:root {
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --maxw: 1180px;
}

/* Theme tokens */
[data-theme="dark"] {
  --bg: #0e0f12;
  --surface: #14161b;
  --text: #edf0f4;
  --muted: #b9c2cf;
  --brand: #ff7a1a;
  --brand-ink: #0b1a2f;
  --brand-soft: #ffefdf;
}
[data-theme="light"] {
  --bg: #e1e1e1;
  --surface: #f7f8fb;
  --text: #0b0f17;
  --muted: #566173;
  --brand: #ff7a1a;
  --brand-ink: #10233e;
  --brand-soft: #fff3e8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
  scroll-behavior: smooth;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==== PAGE SHELL / MODO CINE ==== */

.page-shell {
  min-height: 100vh;
  transition: opacity 0.6s ease, filter 0.6s ease;
}

/* Fades globales */
header,
main > *,
footer,
.hero-inner {
  opacity: 1;
  transition: opacity 0.6s ease;
}

/* Modo cine: UI oculta, solo video */
body.is-cinema {
  overflow: hidden;
}

body.is-cinema .page-shell {
  padding-right: 15px;
}

body.is-cinema header,
body.is-cinema main > *,
body.is-cinema footer,
body.is-cinema .hero-inner {
  opacity: 0;
  pointer-events: none;
}

/* En modo cine, el layer de video ocupa toda la pantalla */
body.is-cinema .hero-video-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
}

/* Fade SOLO del video al final */
.hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
}

.hero-video.fade-out {
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* HEADER (tu version: fixed, full width) */

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(16px, 4vw, 22px);
}

header.sticky {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 40;
  backdrop-filter: saturate(140%) blur(8px);
  background: color-mix(in oklab, var(--bg) 100%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
}

header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  background: url("../../media/images/logo.svg") no-repeat center/contain;
  width: 190px;
  height: 60px;
}

.logo.footer {
  filter: grayscale(1);
  width: 150px;
}

nav a {
  opacity: 0.86;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
}
nav a:hover {
  background: color-mix(in oklab, var(--brand) 20%, transparent);
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.actions .lang-switch {
  display: flex;
  align-items: center;
  gap: 12px;
}

.actions .lang-switch button {
  border: transparent !important;
  filter: grayscale(1);
  opacity: 0.5;
}

.actions .lang-switch button[aria-pressed="true"] {
  filter: none;
  opacity: 1;
  pointer-events: none;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #8a3f05;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.segmented {
  display: inline-flex;
  border: 1px solid color-mix(in oklab, var(--text) 18%, transparent);
  border-radius: 999px;
  padding: 3px;
  background: color-mix(in oklab, var(--surface) 60%, transparent);
}

.segmented button {
  border: 0;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}
.segmented button.active {
  background: var(--brand);
  color: #0b0f17;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--text) 18%, transparent);
  background: color-mix(in oklab, var(--surface) 60%, transparent);
  cursor: pointer;
}
.icon-btn:hover {
  background: color-mix(in oklab, var(--brand) 18%, transparent);
}

/* ==== HERO con video de fondo ==== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin: 0;
}

.hero-video-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* overlay de gradiente sobre el video */
.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(5, 10, 30, 0.9) 0%,
    rgba(5, 10, 30, 0.75) 45%,
    rgba(5, 10, 30, 0.4) 100%
  );
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero .content {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3.4vw, 36px);
  padding-block: clamp(40px, 7vw, 90px);
  color: #f7f8ff;
}

.hero h1 {
  font-size: clamp(28px, 4.6vw, 56px);
  line-height: 1.02;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-right: 37%;
}

.hero p {
  font-size: clamp(16px, 1.2vw, 20px);
  opacity: 0.9;
  margin: 12px 0 22px 0;
  max-width: 40rem;
}

/* CTA Hero (ocultar al 50% de scroll) */
[data-hero-cta] {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

body.hero-cta-faded [data-hero-cta] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
}

/* Boton skip en modo cine */
.hero-skip {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 60;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  background: color-mix(in oklab, #ffffff 88%, var(--brand-soft));
  color: #222;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 0.25s ease, transform 0.15s ease;
}

.hero-skip:hover {
  transform: translateY(-1px);
}

body.is-cinema .hero-skip {
  opacity: 1;
  pointer-events: auto;
}

.icon {
  width: 32px;
  height: 32px;
  display: inline-block;
}

/* BOTONES / CTA GENERALES */

.cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 16px;
  font-family: Manrope, system-ui, Segoe UI, Roboto, Arial, sans-serif;
}

.btn.primary {
  background: var(--brand);
  color: #0b0f17;
}
.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: color-mix(in oklab, var(--text) 40%, transparent);
}

.hero .btn.secondary {
  border-color: rgba(255, 255, 255, 0.4);
  color: #f7f8ff;
}

/* SECCIONES GENERALES */

section {
  margin-top: clamp(40px, 7vw, 88px);
}

h2 {
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.15;
  margin: 0 0 14px 0;
}

.lead {
  margin-top: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.1vw, 18px);
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  background: color-mix(in oklab, var(--surface) 92%, rgba(0, 0, 0, 0.12));
  border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px);
  backdrop-filter: blur(8px);
}

.panel.quote {
  align-items: center;
}

.panel.quote p {
  margin: 0;
}

.panel.quote h2 {
  color: var(--brand);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2.6vw, 28px);
  width: 100%;
}

.check {
  display: flex;
  gap: 10px;
  align-items: center;
  height: 32px;
}

.check svg {
  flex: 0 0 32px;
  color: var(--brand);
  fill: none;
}

.cards {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px);
}

.card {
  background: color-mix(in oklab, var(--surface) 98%, rgba(0, 0, 0, 0.05));
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  border-radius: 16px;
  padding: 18px;
}

/* ABOUT */

.about {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(18px, 3vw, 28px);
}

.about p {
  font-size: 22px;
  opacity: 0.9;
  margin-top: 0;
}

.portrait {
  border-radius: 16px;
  background: linear-gradient(
      180deg,
      color-mix(in oklab, var(--brand) 18%, transparent),
      transparent 40%
    ),
    url("../../media/images/me.jpg") top/cover no-repeat;
  min-height: 540px;
}

/* CONTACT */

form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}
input,
textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  background: color-mix(in oklab, var(--surface) 95%, transparent);
  color: var(--text);
  font-family: inherit;
}

/* FOOTER */

footer {
  margin-top: clamp(40px, 10vw, 120px);
  padding: 32px 0 60px;
  border-top: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
  background: color-mix(in oklab, #000 18%, transparent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
}
.footer-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  display: grid;
  gap: 6px;
}
.footer-copy {
  opacity: 0.6;
  margin-top: 28px;
  font-size: 0.85rem;
}

.social-list {
  display: flex;
  gap: 16px;
  padding: 16px 0;
}

.social-list a svg {
  color: var(--text);
}

.social-list a:hover svg {
  color: var(--brand);
}

/* RESPONSIVE */

@media (max-width: 980px) {
  header .bar {
    gap: 10px;
  }
  nav {
    display: none;
  }

  .grid-2,
  .about,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* MOTION */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.show {
    opacity: 1;
    transform: none;
  }
  .btn.primary {
    transition: transform 0.12s ease;
  }
  .btn.primary:active {
    transform: translateY(1px);
  }
}

/* Mantener visible la sección hero en modo cine (solo se oculta la UI) */
body.is-cinema .hero {
  opacity: 1;
  pointer-events: none; /* la interacción queda en el video / skip */
}

/* Tema claro: mensaje oscuro sobre fondo claro */
[data-theme="light"] .contact-success {
  border-color: color-mix(in oklab, var(--brand-ink) 60%, transparent);
  background: color-mix(in oklab, var(--brand-ink) 85%, var(--bg));
  color: var(--brand-soft);
}

/* Tema oscuro: mensaje claro sobre fondo oscuro */
[data-theme="dark"] .contact-success {
  border-color: color-mix(in oklab, #ffffff 40%, transparent);
  background: color-mix(in oklab, #ffffff 88%, var(--brand-soft));
  color: var(--brand-ink);
}

.contact-success {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  position: fixed;
  bottom: 32px;
  width: 40vw;
  text-align: center;
  left: 30vw;
}

.contact-success.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

p.lead.big {
  font-size: 22px;
  text-align: center;
  opacity: 0.8;
}
