/* =========================================================
   NOCTILIO — Design System
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

:root {
  --c-bg:           #121212;
  --c-surface:      #3D3A37;
  --c-surface-2:    #1a1a1a;
  --c-surface-3:    #232120;
  --c-accent:       #D92E36;
  --c-accent-soft:  rgba(217, 46, 54, 0.14);
  --c-text:         #F5F2ED;
  --c-text-muted:   rgba(245, 242, 237, 0.66);
  --c-text-dim:     rgba(245, 242, 237, 0.42);
  --c-border:       rgba(245, 242, 237, 0.08);
  --c-border-strong:rgba(245, 242, 237, 0.18);

  --font-sans:  'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;

  --s-1: .5rem;  --s-2: 1rem;  --s-3: 1.5rem;  --s-4: 2rem;
  --s-5: 3rem;   --s-6: 4.5rem; --s-7: 6rem;   --s-8: 8rem;

  --container: 1180px;
  --container-narrow: 760px;
  --radius: 4px;
  --radius-lg: 10px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur: .7s;

  --header-h: 68px;
}

/* ---------- Base ---------- */

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  color: var(--c-text);
  background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-image:
    radial-gradient(1100px 620px at 82% -10%, rgba(217, 46, 54, .05), transparent 60%),
    radial-gradient(900px 540px at 8% 42%, rgba(61, 58, 55, .38), transparent 65%);
  background-attachment: fixed;
}

h1, h2, h3, h4 { font-weight: 600; line-height: 1.18; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 6vw, 3.75rem); font-weight: 500; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.35rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }
p  { color: var(--c-text-muted); max-width: 68ch; }

::selection { background: var(--c-accent); color: var(--c-text); }

:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--c-accent); color: var(--c-text); padding: .75rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Layout helpers ---------- */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.section { position: relative; padding-block: clamp(3.5rem, 9vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4rem); }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--c-text-dim); font-weight: 500; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--c-accent); opacity: .8; }
.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; letter-spacing: 0; }
.accent { color: var(--c-accent); }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.15rem); color: var(--c-text-muted); max-width: 62ch; }

/* ---------- Buttons / CTA ---------- */

.btn { display: inline-flex; align-items: center; gap: .55rem; padding: .85rem 1.35rem; font-size: .9rem; font-weight: 500; letter-spacing: .01em; border-radius: var(--radius); transition: transform .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease); white-space: nowrap; }
.btn--primary { background: var(--c-accent); color: var(--c-text); box-shadow: 0 0 0 0 rgba(217, 46, 54, 0); }
.btn--primary:hover { transform: translateY(-1px); background: #e53840; box-shadow: 0 8px 30px -12px rgba(217, 46, 54, .55); }
.btn--ghost { border: 1px solid var(--c-border-strong); color: var(--c-text); background: rgba(245, 242, 237, 0.02); }
.btn--ghost:hover { border-color: var(--c-text); background: rgba(245, 242, 237, 0.05); }
.btn .arrow { transition: transform .35s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Header ---------- */

.header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h); background: rgba(18, 18, 18, 0.55); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid transparent; transition: border-color .4s var(--ease), background-color .4s var(--ease); }
.header.is-scrolled { background: rgba(18, 18, 18, 0.78); border-bottom-color: var(--c-border); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 600; letter-spacing: .04em; font-size: .95rem; }
.brand svg { width: 26px; height: 26px; color: var(--c-text); }
.brand svg .accent { color: var(--c-accent); }

.nav { display: none; }
.nav__list { display: flex; gap: 2rem; list-style: none; padding: 0; }
.nav__link { font-size: .88rem; color: var(--c-text-muted); position: relative; padding: .35rem 0; transition: color .3s var(--ease); }
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--c-text); }
.nav__link[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--c-accent); }
.header__cta { display: none; }

.burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; padding: 8px; border: 1px solid var(--c-border); border-radius: var(--radius); }
.burger span { display: block; height: 1.5px; background: var(--c-text); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav { position: fixed; inset: var(--header-h) 0 auto 0; z-index: 49; background: rgba(18, 18, 18, 0.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--c-border); padding: 1rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem; display: grid; gap: .25rem; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: transform .35s var(--ease), opacity .35s var(--ease); }
.mobile-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mobile-nav a { padding: .85rem .25rem; font-size: 1rem; color: var(--c-text); border-bottom: 1px solid var(--c-border); }
.mobile-nav .btn { margin-top: 1rem; justify-content: center; }

@media (min-width: 820px) {
  .nav { display: block; }
  .header__cta { display: inline-flex; }
  .burger, .mobile-nav { display: none; }
}

/* ---------- Hero ---------- */

.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding-top: calc(var(--header-h) + 3rem); padding-bottom: 4rem; overflow: hidden; }
.hero__grid { display: grid; gap: clamp(2.5rem, 6vw, 4rem); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.15fr 1fr; } }
.hero__title { max-width: 16ch; }
.hero__title .serif { font-style: italic; color: var(--c-text); }
.hero__sub { margin-top: 1.5rem; max-width: 46ch; }
.hero__cta { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.hero__visual { position: relative; aspect-ratio: 1 / 1; max-width: 460px; margin-inline: auto; width: 100%; }

.signal { width: 100%; height: 100%; overflow: visible; }
.signal__arc { fill: none; stroke: var(--c-text); stroke-width: .6; opacity: .18; transform-origin: center; animation: pulse 6s var(--ease) infinite; }
.signal__arc:nth-child(2) { animation-delay: .6s; opacity: .14; }
.signal__arc:nth-child(3) { animation-delay: 1.2s; opacity: .10; }
.signal__arc:nth-child(4) { animation-delay: 1.8s; opacity: .07; }
.signal__core { fill: var(--c-accent); }
.signal__wing { fill: none; stroke: var(--c-text); stroke-width: .8; opacity: .35; }

@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: inherit; }
  50%      { transform: scale(1.04); opacity: .05; }
}
@media (prefers-reduced-motion: reduce) { .signal__arc { animation: none; } }

/* ---------- Hero compacto (páginas internas) ---------- */

.hero--compact { min-height: auto; padding-top: calc(var(--header-h) + clamp(4rem, 9vw, 7rem)); padding-bottom: clamp(2rem, 6vw, 4rem); display: block; }
.hero--compact h1 { max-width: 22ch; margin-top: 1rem; }
.hero--compact .lede { margin-top: 1.5rem; max-width: 60ch; }

/* ---------- Section headings ---------- */

.section__head { max-width: 780px; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section__head h2 { margin-top: 1rem; }
.section__head .lede { margin-top: 1.25rem; }

/* ---------- Listas de señales ---------- */

.signals-list { list-style: none; padding: 0; display: grid; gap: .55rem; margin-top: 1.25rem; max-width: 62ch; }
.signals-list li { position: relative; padding-left: 1.15rem; color: var(--c-text-muted); font-size: .98rem; line-height: 1.55; }
.signals-list li::before { content: ""; position: absolute; left: 0; top: .72em; width: 7px; height: 1px; background: var(--c-accent); }

/* ---------- Steps (H3 grid) ---------- */

.steps { display: grid; gap: 2rem 2.5rem; grid-template-columns: 1fr; margin-top: 2.25rem; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps > article { border-top: 1px solid var(--c-border); padding-top: 1.25rem; }
.steps > article h3 { font-family: var(--font-serif); font-weight: 500; font-style: italic; letter-spacing: 0; font-size: 1.35rem; margin-bottom: .65rem; color: var(--c-text); }
.steps > article p { font-size: .95rem; }
.steps--four { grid-template-columns: 1fr; }
@media (min-width: 720px)  { .steps--four { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .steps--four { grid-template-columns: repeat(4, 1fr); } }
.steps--five { grid-template-columns: 1fr; }
@media (min-width: 720px)  { .steps--five { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .steps--five { grid-template-columns: repeat(5, 1fr); } }

/* ---------- Q/A ---------- */

.qa { display: grid; gap: 1.75rem; grid-template-columns: 1fr; margin-top: 2rem; }
@media (min-width: 720px) { .qa { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .qa { grid-template-columns: repeat(4, 1fr); } }
.qa > div { border-left: 1px solid var(--c-border); padding-left: 1.25rem; }
.qa strong { display: block; font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 1.15rem; color: var(--c-text); margin-bottom: .35rem; }
.qa span { color: var(--c-text-muted); font-size: .92rem; }

/* ---------- Flow ---------- */

.flow { display: flex; flex-wrap: wrap; gap: .5rem .35rem; align-items: center; margin-top: 1.5rem; font-family: var(--font-serif); font-style: italic; font-size: 1.15rem; color: var(--c-text); }
.flow span[aria-hidden] { color: var(--c-accent); }

/* ---------- Signal Network ---------- */

.network { position: relative; display: grid; gap: 2.5rem; grid-template-columns: 1fr; margin-top: 2.5rem; }
@media (min-width: 960px) { .network { grid-template-columns: 1.35fr 1fr; align-items: start; gap: 3.5rem; } }
.network__svg { width: 100%; aspect-ratio: 1 / 1; background: radial-gradient(60% 60% at 50% 50%, rgba(61,58,55,.35), transparent 70%); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 1rem; }
.network__edge { stroke: var(--c-text); stroke-width: .4; opacity: .12; transition: opacity .5s var(--ease), stroke .5s var(--ease); }
.network__edge.is-active { stroke: var(--c-accent); opacity: .55; }
.network__node { cursor: pointer; }
.network__node circle { fill: var(--c-bg); stroke: var(--c-border-strong); stroke-width: .8; transition: stroke .4s var(--ease), fill .4s var(--ease), r .4s var(--ease); }
.network__node text { fill: var(--c-text-dim); font-family: var(--font-sans); font-size: 3.4px; font-weight: 500; letter-spacing: .02em; transition: fill .4s var(--ease); pointer-events: none; }
.network__node:hover circle, .network__node:focus-visible circle, .network__node.is-active circle { stroke: var(--c-accent); fill: var(--c-accent-soft); r: 6; }
.network__node:hover text, .network__node.is-active text { fill: var(--c-text); }
.network__pulse { fill: none; stroke: var(--c-accent); stroke-width: .6; opacity: 0; pointer-events: none; }
.network__node.is-active .network__pulse { animation: nodePulse 1.6s var(--ease) infinite; opacity: .9; }
@keyframes nodePulse { 0% { r: 6; opacity: .9; } 100% { r: 14; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .network__node.is-active .network__pulse { animation: none; opacity: .3; } }

.network__panel { border-left: 1px solid var(--c-border); padding-left: 1.5rem; min-height: 200px; }
.network__panel h3 { margin-bottom: .75rem; font-size: 1.15rem; }
.network__panel p  { margin-bottom: 1rem; font-size: .95rem; }
.network__panel .hint { color: var(--c-text-dim); font-size: .85rem; display: none; }
.js .network__panel .hint { display: block; }

.network__panel__items > * { padding-block: 1rem; border-top: 1px solid var(--c-border); }
.network__panel__items > *:first-child { border-top: 0; padding-top: 0; }
.network__panel__items > * h3 { font-family: var(--font-serif); font-style: italic; font-weight: 500; }

.js .network__panel__items > * { display: none; border-top: 0; padding-block: 0; }
.js .network__panel__items > .is-visible { display: block; animation: fadeUp .5s var(--ease) both; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Flight path ---------- */

.path { position: relative; margin-block: clamp(2rem, 5vw, 4rem); padding-inline: 0; }
.path__svg { width: 100%; height: auto; }
.path__line { fill: none; stroke: url(#pathGrad); stroke-width: 1.2; stroke-linecap: round; stroke-dasharray: var(--len, 2400); stroke-dashoffset: var(--len, 2400); transition: stroke-dashoffset 1.6s var(--ease); }
.path.is-inview .path__line { stroke-dashoffset: 0; }
.path__stage circle { fill: var(--c-bg); stroke: var(--c-text-dim); stroke-width: 1; transition: stroke .5s var(--ease), fill .5s var(--ease); }
.path__stage.is-active circle { stroke: var(--c-accent); fill: var(--c-accent-soft); }
.path__stage text { fill: var(--c-text-dim); font-family: var(--font-sans); font-size: 9px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; transition: fill .5s var(--ease); }
.path__stage.is-active text { fill: var(--c-text); }

/* ---------- FAQ ---------- */

.faq { max-width: var(--container-narrow); margin-inline: auto; }
.faq details { border-top: 1px solid var(--c-border); padding: 1.35rem 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--c-border); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; font-size: 1.05rem; font-weight: 500; color: var(--c-text); transition: color .3s var(--ease); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--c-accent); }
.faq summary::after { content: "+"; font-family: var(--font-serif); font-size: 1.4rem; line-height: 1; color: var(--c-accent); transition: transform .35s var(--ease); flex-shrink: 0; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 1rem; max-width: 60ch; font-size: .95rem; animation: fadeUp .4s var(--ease) both; }

/* ---------- CTA band ---------- */

.cta { position: relative; border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3.5rem); background: radial-gradient(120% 140% at 100% 0%, rgba(217,46,54,.10), transparent 55%), linear-gradient(180deg, rgba(61,58,55,.28), rgba(61,58,55,.06)); overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 79px, rgba(245,242,237,.03) 79px 80px); pointer-events: none; mask-image: linear-gradient(180deg, transparent, #000 40%, #000 60%, transparent); }
.cta__grid { display: grid; gap: 1.75rem; position: relative; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 820px) { .cta__grid { grid-template-columns: 1.4fr 1fr; } }
.cta__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.cta__title { max-width: 20ch; margin-top: 1rem; }
.cta__title .serif { font-style: italic; color: var(--c-text); }

/* ---------- Reveal ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-inview { opacity: 1; transform: none; }
.reveal--d1 { transition-delay: .08s; }
.reveal--d2 { transition-delay: .16s; }
.reveal--d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--c-border); padding-block: 3rem 2rem; margin-top: var(--s-7); }
.footer__grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h4 { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--c-text-dim); margin-bottom: 1rem; font-weight: 500; }
.footer ul { list-style: none; padding: 0; display: grid; gap: .55rem; }
.footer a { color: var(--c-text-muted); font-size: .9rem; }
.footer a:hover { color: var(--c-text); }
.footer__base { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--c-border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .8rem; color: var(--c-text-dim); }