/* WinShaders — Windows 11 Fluent Design Landing Page */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #F3F3F3;
  --text: #202020;
  --text-muted: #605E5C;
  --accent: #0078D4;
  --accent-hover: #106EBE;
  --accent-subtle: rgba(0, 120, 212, 0.08);
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #FFFFFF;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 32px rgba(0, 0, 0, 0.06);
  --overlay: rgba(0, 0, 0, 0.32);
  --toggle-bg: rgba(0, 0, 0, 0.04);
  --input-bg: #F3F3F3;
  --hover-bg: rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --header-h: 56px;
  --footer-h: 48px;
  --header-shadow: 0 4px 16px rgba(14, 18, 32, 0.1), 0 2px 5px rgba(14, 18, 32, 0.06);
  --footer-shadow: 0 -4px 16px rgba(14, 18, 32, 0.1), 0 -2px 5px rgba(14, 18, 32, 0.06);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hero-text: #202020;
  --hero-text-muted: #605E5C;
  --hero-accent: #0078D4;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #202020;
  --text: #FFFFFF;
  --text-muted: #ADADAD;
  --accent: #60CDFF;
  --accent-hover: #98D8FF;
  --accent-subtle: rgba(96, 205, 255, 0.12);
  --surface: rgba(32, 32, 32, 0.78);
  --surface-solid: #2D2D30;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3);
  --overlay: rgba(0, 0, 0, 0.6);
  --toggle-bg: rgba(255, 255, 255, 0.06);
  --input-bg: #1E1E1E;
  --hover-bg: rgba(255, 255, 255, 0.06);
  /* Hero: shader siempre claro → textos oscuros también en tema UI oscuro */
  --hero-text: #14101C;
  --hero-text-muted: #3F3B52;
  --hero-accent: #5B52E8;
  --header-shadow: 0 4px 20px rgba(8, 10, 22, 0.26), 0 2px 6px rgba(8, 10, 22, 0.14);
  --footer-shadow: 0 -4px 20px rgba(8, 10, 22, 0.26), 0 -2px 6px rgba(8, 10, 22, 0.14);
}

html[data-theme="light"] {
  color-scheme: light;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background-color: #D4D9E8;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-user-select: none;
  user-select: none;
}

body.devtools-open #bgCanvas {
  visibility: hidden;
}

input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
}

/* Canvas background — full viewport, beneath header & footer */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--header-shadow);
}

.header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header__logo img,
.header__logo-img {
  height: 28px;
  width: auto;
}

.header__logo-img--dark {
  display: none;
}

html[data-theme="dark"] .header__logo-img--light {
  display: none;
}

html[data-theme="dark"] .header__logo-img--dark {
  display: block;
}

.header__controls {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

/* Theme toggle — Windows 11 segmented style */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--toggle-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.theme-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.theme-toggle__btn:hover {
  color: var(--text);
  background: var(--hover-bg);
}

.theme-toggle__btn.is-active {
  color: var(--text);
  background: var(--surface-solid);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.lang-selector__select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  background-color: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem 1.75rem 0.375rem 0.75rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23605E5C' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  transition: border-color 0.15s;
}

.lang-selector__select:hover,
.lang-selector__select:focus {
  border-color: var(--accent);
  outline: none;
}

html[data-theme="dark"] .lang-selector__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ADADAD' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
}

/* SEO — texto indexable sin impacto visual */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hero — transparente para que el shader se vea detrás del texto */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 1rem) 1.5rem calc(var(--footer-h) + 1rem);
  text-align: center;
  background: transparent;
  pointer-events: none;
}

.hero__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(640px, 92vw);
  margin: 0 auto;
  animation: fadeIn 0.8s ease-out;
  background: transparent;
  pointer-events: auto;
}

.hero__headline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.15rem, 1.2vw, 0.45rem);
  margin: 0 0 clamp(1.25rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.hero__line {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.hero__line--1 {
  font-size: clamp(1.5rem, 4.8vw, 2.5rem);
  color: var(--hero-text);
}

.hero__line--2 {
  font-size: clamp(1.65rem, 5.4vw, 2.85rem);
  color: var(--hero-text);
}

.hero__tagline {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(640px, 92vw);
  margin: 0 auto;
  font-size: clamp(1.05rem, 3.2vw, 1.45rem);
  font-weight: 500;
  color: var(--hero-accent);
  pointer-events: auto;
  animation: fadeIn 0.8s ease-out 0.15s both;
}

.hero__carousel {
  font-size: clamp(0.875rem, 2vw, 1.0625rem);
  font-weight: 500;
  color: var(--hero-text-muted);
  min-height: 1.75em;
  transition: opacity 0.4s ease;
}

html[data-theme="dark"] .hero__line,
html[data-theme="dark"] .hero__carousel,
html[data-theme="dark"] .hero__tagline {
  text-shadow:
    0 0 18px rgba(212, 217, 232, 0.95),
    0 0 36px rgba(212, 217, 232, 0.65),
    0 1px 2px rgba(255, 255, 255, 0.85);
}

.hero__carousel.is-fading {
  opacity: 0;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--border);
  box-shadow: var(--footer-shadow);
  font-size: 0.8125rem;
}

.footer__copy {
  color: var(--text-muted);
}

.footer__nav {
  display: flex;
  gap: 0.5rem;
}

.footer__link {
  font-family: var(--font);
  font-size: 0.8125rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.footer__link:hover {
  background: var(--accent-subtle);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 2rem);
  background: var(--surface-solid);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal__title {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.modal__close:hover {
  background: var(--hover-bg);
  color: var(--text);
}

.modal__body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.modal__body p {
  margin-bottom: 0.875rem;
}

.modal__body p:last-child {
  margin-bottom: 0;
}

/* Legal page — privacy (indexable, no shader) */
.legal-page {
  position: relative;
  z-index: 1;
  max-width: 42rem;
  margin: 0 auto;
  padding: calc(var(--header-h) + 2rem) 1.5rem calc(var(--footer-h) + 2rem);
}

.legal-page__title {
  font-size: clamp(1.375rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.legal-page__body {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.legal-page__body p {
  margin-bottom: 0.875rem;
}

.legal-page__body p:last-child {
  margin-bottom: 0;
}

.legal-page__body a {
  color: var(--accent);
  text-decoration: none;
}

.legal-page__body a:hover {
  text-decoration: underline;
}

.legal-page__back {
  margin-top: 1.75rem;
  font-size: 0.875rem;
}

.legal-page__back a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.legal-page__back a:hover {
  text-decoration: underline;
}

.footer__link--anchor {
  font-family: var(--font);
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.footer__link--anchor:hover {
  background: var(--accent-subtle);
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.form-feedback {
  font-size: 0.875rem;
  min-height: 1.25em;
}

.form-feedback.is-success {
  color: #107C10;
}

.form-feedback.is-error {
  color: #D13438;
}

.btn {
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn--primary {
  color: #fff;
  background: var(--accent);
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile */
@media (max-width: 480px) {
  .header {
    padding: 0 0.75rem;
  }

  .header__controls {
    gap: 0.375rem;
  }

  .theme-toggle__btn {
    width: 28px;
    height: 26px;
  }

  .footer {
    padding: 0 1rem;
    flex-wrap: wrap;
    height: auto;
    min-height: var(--footer-h);
    gap: 0.25rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 12px 12px 0 0;
  }

  .hero {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero__headline {
    gap: 0.2rem;
  }

  .hero__line--1 {
    font-size: clamp(1.35rem, 6.5vw, 2rem);
  }

  .hero__line--2 {
    font-size: clamp(1.5rem, 7vw, 2.25rem);
  }

  .hero__tagline {
    font-size: clamp(0.95rem, 4.5vw, 1.25rem);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
