/* ============================================================
   fsiMetrics landing — light editorial storytelling
   (Vectr / Neko / Climanova direction)
   Light paper foundation, brand teal #1CA59D as the single
   accent, ONE dark film-nod chapter + dark finale/footer.
   ============================================================ */

:root {
  --paper: #fafcfc;
  --paper-2: #eef5f4;
  --ink: #0b1d1b;
  --ink-soft: rgba(11, 29, 27, 0.62);
  --ink-faint: rgba(11, 29, 27, 0.40);
  --hairline: rgba(11, 29, 27, 0.10);
  --teal: #1CA59D;
  --teal-deep: #136b65;
  --dark: #030f0d;
  --neon: #3cd7e8;

  --t-hero: clamp(2.6rem, 5.2vw + 1rem, 5.75rem);
  --t-h2: clamp(1.9rem, 2.4vw + 1rem, 3.25rem);
  --t-lead: clamp(1.02rem, 0.9vw + 0.85rem, 1.25rem);
}

html { background: var(--paper); }

body {
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}

::selection { background: rgba(28, 165, 157, 0.22); }

main { position: relative; }

/* ============ Typography ============ */
.t-hero {
  font-size: var(--t-hero);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.028em;
  color: var(--ink);
}
.t-h2 {
  font-size: var(--t-h2);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.t-lead {
  font-size: var(--t-lead);
  line-height: 1.7;
  color: var(--ink-soft);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--teal);
}
.eyebrow::before {
  content: '';
  width: 1.6rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}
.teal-text { color: var(--teal); }

/* Dark-section variants */
.on-dark { color: rgba(255, 255, 255, 0.92); }
.on-dark-soft { color: rgba(255, 255, 255, 0.58); }
.neon-text {
  background: linear-gradient(100deg, #7ee7f2 0%, var(--neon) 45%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.neon-glow-text { text-shadow: 0 0 24px rgba(60, 215, 232, 0.30); }

/* ============ Split-word reveal ============ */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.w > .wi { display: inline-block; }
/* opacity-only pre-state: GSAP owns the transform */
.anim .w > .wi { opacity: 0; }

/* ============ Nav ============ */
#nav { transition: transform 0.3s ease; }
#nav .nav-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(250, 252, 252, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  padding: 0.5rem 0.625rem 0.5rem 1.25rem;
  box-shadow: 0 10px 30px -18px rgba(11, 29, 27, 0.35);
}
#nav a.nav-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
#nav a.nav-link:hover { color: var(--ink); }
.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.15rem;
  border-radius: 9999px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn-nav:hover { background: #1c3a37; transform: translateY(-1px); }

#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  z-index: 60;
  background: linear-gradient(90deg, var(--teal), #35c1b8);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ============ Buttons ============ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-width: 200px;
  padding: 1rem 2rem;
  border-radius: 9999px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 14px 30px -12px rgba(28, 165, 157, 0.55);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}
.btn-primary:hover {
  background: #17948d;
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -12px rgba(28, 165, 157, 0.6);
}
.btn-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-width: 200px;
  padding: 1rem 2rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 10px 24px -16px rgba(11, 29, 27, 0.25);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.btn-soft:hover {
  transform: translateY(-2px);
  border-color: rgba(28, 165, 157, 0.45);
  box-shadow: 0 14px 30px -16px rgba(11, 29, 27, 0.3);
}
/* Download dropdown (nav) */
.dl-wrap { position: relative; }
.dl-menu {
  position: absolute;
  top: calc(100% + 14px);
  right: -0.5rem;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 0.9rem;
  box-shadow: 0 22px 44px -18px rgba(11, 29, 27, 0.35);
  padding: 6px;
  z-index: 70;
}
.dl-menu.hidden { display: none; }
.dl-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.15s ease;
}
.dl-item:hover { background: var(--paper-2); }
.dl-item .ver { margin-left: auto; font-size: 0.72rem; font-weight: 500; color: var(--ink-faint); }

/* ============ Hero (light) ============ */
#hero {
  position: relative;
  background:
    radial-gradient(900px 480px at 50% -8%, rgba(28, 165, 157, 0.10), transparent 65%),
    linear-gradient(180deg, #f2f8f7 0%, var(--paper) 55%);
}
.scroll-cue { animation: cue-bounce 2s ease-in-out infinite; color: var(--teal); }
@keyframes cue-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(7px); opacity: 1; }
}
.anim #hero-eyebrow,
.anim #hero-sub,
.anim #hero-ctas,
.anim #hero-cue { opacity: 0; }

/* ============ Dark chapter — the film nod ============ */
#story {
  background:
    radial-gradient(1000px 500px at 50% 108%, rgba(28, 165, 157, 0.22), transparent 65%),
    var(--dark);
}
#story-stage { position: relative; height: 100svh; display: flex; flex-direction: column; padding-top: 5.5rem; }
#plot-svg { width: min(920px, 94vw); max-height: calc(100svh - 16rem); margin: auto; display: block; }
#plot-svg .stroke {
  fill: none;
  stroke: url(#tealStroke);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(60, 215, 232, 0.55));
}
#plot-svg .stroke-faint { fill: none; stroke: rgba(60, 215, 232, 0.45); stroke-width: 1; }
#plot-svg .top { fill: rgba(60, 215, 232, 0.05); }
#plot-setback { opacity: 0.55; }
#plot-svg .pin-chip-rect { fill: rgba(3, 17, 15, 0.85); stroke: rgba(60, 215, 232, 0.35); }
#plot-svg .pin-chip-text {
  fill: #bfeef5;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2.5px;
}
#plot-svg .pin-dot { fill: var(--neon); filter: drop-shadow(0 0 6px rgba(60, 215, 232, 0.9)); }
#plot-svg [pathLength] { stroke-dasharray: 1; }
.anim #plot-svg [pathLength] { stroke-dashoffset: 1; }
.anim #plot-svg .pin-g,
.anim #plot-svg .pin-dot,
.anim #plot-svg #layer-ground,
.anim #story-copy { opacity: 0; }
html:not(.anim) #story-stage { height: auto; padding: 5rem 0; }

/* ============ Process — pinned diorama + step list ============ */
#how-it-works { background: var(--paper); }
#process-stage {
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 4.5rem;
}
#process-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 2rem;
  align-items: center;
  max-width: 76rem;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem;
}
.step {
  border-top: 1px solid var(--hairline);
  padding: 0.85rem 0.25rem;
  transition: padding 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.step:last-child { border-bottom: 1px solid var(--hairline); }
.step .step-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.step .step-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-faint);
  width: 1.6rem;
  flex: 0 0 auto;
  transition: color 0.3s ease;
}
.step .step-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink-faint);
  transition: color 0.3s ease, font-size 0.3s ease;
}
.step .step-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.65;
  padding-left: 2.6rem;
}
/* Steps are click-to-jump wherever the pinned timeline runs */
@media (min-width: 900px) {
  .step { cursor: pointer; }
  .step:hover .step-title { color: var(--ink); }
  .step:focus-visible {
    outline: 2px solid rgba(28, 165, 157, 0.55);
    outline-offset: 3px;
    border-radius: 0.5rem;
  }
}
.step.active { padding: 1.15rem 0.25rem; }
.step.active .step-num {
  color: #fff;
  background: var(--teal);
  border-radius: 0.5rem;
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.step.active .step-title { color: var(--ink); font-size: 1.15rem; }
.step.active .step-body { max-height: 8rem; opacity: 1; padding-top: 0.5rem; }

#diorama-wrap { position: relative; }
#diorama { width: 100%; height: auto; max-height: calc(100svh - 12rem); display: block; }

/* Clay diorama styles */
#diorama .plate-top { fill: #ffffff; stroke: #c8ddda; stroke-width: 1; }
#diorama .plate-side { fill: #dcebe8; stroke: #c8ddda; stroke-width: 1; }
#diorama .ground-line { stroke: #e3edec; stroke-width: 1; fill: none; }
#diorama .road { fill: #dbe4e7; stroke: #c3d2d6; stroke-width: 1; }
#diorama .road-dash { stroke: #ffffff; stroke-width: 3; stroke-dasharray: 16 13; fill: none; }
#diorama .setback { fill: none; stroke: var(--teal); stroke-width: 1.5; stroke-dasharray: 7 7; opacity: 0.65; }
#diorama .common { fill: #c9f2df; stroke: #43c68f; stroke-width: 1.2; }
#diorama .foot { fill: rgba(96, 165, 250, 0.25); stroke: #3b82f6; stroke-width: 1.2; }
#diorama .tw-top { fill: #ffffff; stroke: #b9d5d2; stroke-width: 1; }
#diorama .tw-left { fill: #cfe3e0; stroke: #b9d5d2; stroke-width: 1; }
#diorama .tw-right { fill: #e6f1ef; stroke: #b9d5d2; stroke-width: 1; }
#diorama .tw-win { stroke: rgba(28, 165, 157, 0.35); stroke-width: 1.5; fill: none; }
#diorama .pin-line { stroke: var(--teal); stroke-width: 1.5; fill: none; }
#diorama .pin-dot-l { fill: var(--teal); }
#diorama .chip-rect { fill: #ffffff; stroke: var(--hairline); }
#diorama .chip-rect-hl { fill: var(--ink); }
#diorama .chip-text {
  fill: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
}
#diorama .chip-text-hl { fill: #ffffff; }
#diorama .chip-text-teal { fill: var(--teal); }
#diorama .shadow { fill: rgba(11, 29, 27, 0.07); }

/* report card overlay (step 05) */
#report-card {
  position: absolute;
  right: 2%;
  top: 6%;
  width: min(240px, 40%);
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  box-shadow: 0 24px 50px -20px rgba(11, 29, 27, 0.28);
  padding: 1rem 1.15rem;
}
#report-card .rc-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding: 0.3rem 0;
}
#report-card .rc-row strong { color: var(--ink); }
#report-card .rc-badge {
  margin-top: 0.5rem;
  background: #e7f8ef;
  color: #0c7a4d;
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  border-radius: 0.6rem;
  text-align: center;
  padding: 0.55rem;
}
/* pre-animation states (the scrubbed timeline reveals these on all viewports) */
.anim #diorama .g-plate,
.anim #diorama .g-roads,
.anim #diorama .g-setback,
.anim #diorama .g-common,
.anim #diorama .g-foot,
.anim #diorama .g-towers,
.anim #diorama .g-pins,
.anim #report-card { opacity: 0; }

/* no-JS / reduced-motion: everything visible, steps expanded, footprints tucked under towers */
html:not(.anim) #diorama .g-foot { opacity: 0; }
html:not(.anim) #process-stage { height: auto; padding: 4rem 0; }
html:not(.anim) .step .step-body { max-height: none; opacity: 1; padding-top: 0.5rem; }
html:not(.anim) .step .step-num { color: var(--teal); }
html:not(.anim) .step .step-title { color: var(--ink); }

/* Mobile: no pin — the diorama sticks above the step list (native scrolling),
   the timeline scrubs against the list, and the active step highlights.
   Bodies stay expanded so activating a step never shifts the layout mid-scrub. */
@media (max-width: 899px) {
  #process-stage { height: auto; padding: 4.5rem 0 2.5rem; }
  #process-grid {
    display: flex;
    flex-direction: column-reverse;
    gap: 1.25rem;
  }
  #diorama-wrap {
    position: sticky;
    top: 3.9rem;
    z-index: 5;
    background: var(--paper);
    /* full-bleed: the panel always spans the entire viewport width */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 0.5rem 1.5rem 0.75rem;
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 16px 18px -16px rgba(11, 29, 27, 0.14);
    overflow: hidden;
  }
  /* crop the diorama's empty side margins so the scene reads larger */
  #diorama { width: 118%; max-width: none; margin-left: -9%; max-height: none; }

  /* report card: compact strip below the diorama, inside the sticky panel —
     space is always reserved so its arrival never shifts the layout */
  #report-card {
    position: static;
    width: 100%;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 24px -16px rgba(11, 29, 27, 0.25);
  }
  #report-card .rc-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 0;
    font-size: 0.62rem;
    white-space: nowrap;
  }
  #report-card .rc-row strong { font-size: 0.8rem; }
  #report-card .rc-badge {
    margin-top: 0;
    padding: 0.45rem 0.6rem;
    font-size: 0.66rem;
    border-radius: 0.55rem;
    white-space: nowrap;
  }

  /* inactive steps recede; the active one leads */
  .step { opacity: 0.42; transition: opacity 0.3s ease, padding 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
  .step.active { opacity: 1; padding: 0.85rem 0.25rem; }
  .step .step-body { max-height: none; opacity: 1; padding-top: 0.5rem; }
  .step.active .step-title { font-size: 1.02rem; } /* avoid layout shift mid-scrub */
  html:not(.anim) .step { opacity: 1; } /* static render: all readable */
}

/* ============ Product showcase (light) ============ */
.shot-frame {
  border-radius: 1.1rem;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: #fff;
  box-shadow: 0 30px 60px -30px rgba(11, 29, 27, 0.35);
}
.shot-chrome {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.9rem;
  background: #f4f8f7;
  border-bottom: 1px solid var(--hairline);
}
.shot-chrome i { width: 0.6rem; height: 0.6rem; border-radius: 9999px; background: rgba(11, 29, 27, 0.12); }
.shot-chrome i:first-child { background: rgba(28, 165, 157, 0.6); }
.shot-frame img { display: block; width: 100%; height: auto; }
.shot-frame figcaption {
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--hairline);
}
.shot-frame figcaption .num { color: var(--teal); font-weight: 800; }

/* ============ Features — hairline editorial grid ============ */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-left: 1px solid var(--hairline);
  border-top: 1px solid var(--hairline);
}
@media (max-width: 1023px) { .feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 639px) { .feat-grid { grid-template-columns: 1fr; } }
.feat-cell {
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 2rem 1.6rem 2.2rem;
  transition: background 0.25s ease;
}
.feat-cell:hover { background: #f2f8f7; }
.feat-cell .feat-icon {
  color: var(--teal);
  margin-bottom: 1.1rem;
}
.feat-cell h3 { font-weight: 700; font-size: 1.02rem; color: var(--ink); margin-bottom: 0.5rem; }
.feat-cell p { font-size: 0.86rem; line-height: 1.65; color: var(--ink-soft); }

/* ============ Chips (why-choose) ============ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.05rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid var(--hairline);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  box-shadow: 0 6px 16px -12px rgba(11, 29, 27, 0.25);
}
.chip svg { color: var(--teal); }

/* ============ Stats band ============ */
#stats-band { background: var(--paper-2); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.stat-num { font-size: clamp(2.2rem, 3.4vw, 3.4rem); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.stat-num .accent { color: var(--teal); }

/* ============ Plan strip ============ */
.plan-strip {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 1.25rem;
  box-shadow: 0 24px 50px -30px rgba(11, 29, 27, 0.3);
}
.plan-num {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
}

/* ============ FAQ (light) ============ */
.faq-item {
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.faq-item:hover { border-color: rgba(28, 165, 157, 0.4); }
.faq-answer { border-top: 1px solid var(--hairline); }

/* ============ Footer (dark, clean columns) ============ */
footer {
  background:
    radial-gradient(800px 380px at 50% 115%, rgba(28, 165, 157, 0.14), transparent 65%),
    var(--dark);
}
.footer-heading {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 1.1rem;
}
.footer-link {
  color: rgba(255, 255, 255, 0.62);
  transition: color 0.2s ease;
}
.footer-link:hover { color: #fff; }

/* ============ Road spine ============
   Dashed road centerline segments (echoing the diorama's roads) that draw
   in as you scroll — starting under the hero's "scroll to see how it works"
   cue and reappearing as connectors between sections. Drawn via clip-path
   in story.js; fully visible when GSAP/motion is unavailable. */
.road-seg {
  display: block;
  width: 2px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg,
    rgba(28, 165, 157, 0.5) 0 9px,
    transparent 9px 17px);
}

/* ============ Reveals (IO) ============ */
.anim .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.anim .reveal.visible { opacity: 1; transform: translateY(0); }
.anim .stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.anim .stagger > .reveal:nth-child(2) { transition-delay: 80ms; }
.anim .stagger > .reveal:nth-child(3) { transition-delay: 160ms; }
.anim .stagger > .reveal:nth-child(4) { transition-delay: 240ms; }
.anim .stagger > .reveal:nth-child(5) { transition-delay: 320ms; }
.anim .stagger > .reveal:nth-child(6) { transition-delay: 400ms; }
.anim .stagger > .reveal:nth-child(7) { transition-delay: 480ms; }
.anim .stagger > .reveal:nth-child(8) { transition-delay: 560ms; }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .scroll-cue { animation: none !important; }
}
