/* ==========================================================
   nawa home — page sections (dark, left-aligned, hairlines)
   ========================================================== */

/* ---------- 1. Hero ---------- */
.hero {
  position: relative;
  padding-block: var(--section-space);
  overflow: clip;
}
/* Heroes sit closer to the nav than other sections: the full section space (up to
   112px) left a large empty band above every headline */
.hero { padding-top: clamp(var(--space-4), 3.4vw, var(--space-6)); }
.hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}
.hero__title {
  font-size: var(--text-hero);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--text);
}
.hero__line { display: block; }
.hero__line + .hero__line { margin-top: 0.04em; }
.hero__sub {
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-2);
  text-wrap: pretty;
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Hero copy settles in on load */
.rise { animation: rise var(--dur-slow) var(--ease) both; }
.hero__inner > .rise:nth-child(2) { animation-delay: 60ms; }
.hero__inner > .rise:nth-child(3) { animation-delay: 140ms; }
.hero__inner > .rise:nth-child(4) { animation-delay: 220ms; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* Animated workspace (WorkspaceDemo): centred under the headline, max 1200px.
   It scales itself to this container's width. */
.hero__stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(1200px + var(--gutter) * 2);
  margin: var(--head-gap) auto 0;
  padding-inline: var(--gutter);
}
.hero__stage .nawa-demo { max-width: 1200px; margin-inline: auto; }
/* The one soft glow on the page, beneath the product */
.hero__glow {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 8%;
  width: min(1100px, 110%);
  height: 70%;
  transform: translateX(-50%);
  background:
    radial-gradient(34% 46% at 50% 62%, rgba(209, 238, 43, 0.2) 0%, rgba(209, 238, 43, 0.07) 42%, rgba(209, 238, 43, 0) 72%),
    radial-gradient(50% 50% at 50% 50%, rgba(196, 190, 255, 0.14) 0%, rgba(196, 190, 255, 0.04) 45%, rgba(196, 190, 255, 0) 70%);
  pointer-events: none;
}

/* ---------- 2. Proof / logos ---------- */
.proof { padding: var(--section-space) 0; }
.proof__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--head-stack);
  margin-bottom: var(--head-gap);
}
.proof__head .section-title { max-width: 18em; }
.proof__controls { display: flex; margin-top: var(--space-5); }
.marquee__pause {
  --btn-h: 30px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.marquee__pause .icon-pause,
.marquee__pause .icon-play { width: 12px; height: 12px; }
.marquee__pause .icon-play { display: none; }
.marquee__pause[aria-pressed="true"] .icon-pause { display: none; }
.marquee__pause[aria-pressed="true"] .icon-play { display: block; }

.marquee {
  display: grid;
  gap: var(--space-3);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__row {
  display: flex;
  width: max-content;
  animation: marquee var(--marquee-dur, 50s) linear infinite;
}
.marquee__row[data-direction="right"] { animation-direction: reverse; }
.marquee.is-paused .marquee__row,
.marquee.is-offscreen .marquee__row,
.marquee:hover .marquee__row { animation-play-state: paused; }   /* hovering stops the logos to read one */
.marquee__set {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding-right: var(--space-6);
}
/* Wide screens: the logos keep their wide spread */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .marquee__set { gap: var(--space-12); padding-right: var(--space-12); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-1 * var(--set-w, 0px))); }
}

/* Partner logos: white on transparent, each at a height that balances it with the others
   (tall marks larger, wide wordmarks smaller); phones scale them all down a little */
.logo-tile { display: flex; align-items: center; flex: none; }
.logo-tile img { display: block; width: auto; height: calc(var(--logo-h, 36px) * var(--logo-scale, 1)); opacity: 0.92; }
@media (max-width: 767px) { .marquee { --logo-scale: 0.8; } }
.logo--texas-instruments { --logo-h: 40px; }
.logo--goldman-sachs { --logo-h: 42px; }
.logo--foodify { --logo-h: 36px; }
.logo--beam-venture { --logo-h: 64px; }
.logo--linedanceai { --logo-h: 28px; }
.logo--hexa-innovation { --logo-h: 38px; }
.logo--mayer-solar { --logo-h: 28px; }
.logo--beam-academy { --logo-h: 64px; }
.logo--launch-texas { --logo-h: 34px; }

@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee__row { animation: none; width: auto; padding-inline: var(--gutter); }
  .marquee__row[data-direction="right"] { display: none; }
  .marquee__set { flex-wrap: wrap; gap: var(--space-3) var(--space-6); padding-right: 0; max-width: var(--container); margin-inline: auto; }
  .marquee__set[aria-hidden="true"] { display: none; }
  .proof__controls { display: none; }
}

/* ---------- 3. Features ---------- */
.features { padding: var(--section-space) 0; border-top: 1px solid var(--line); }
.features__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--head-stack);
  margin-bottom: var(--head-gap);
}
.features__grid { display: grid; gap: var(--space-8); }
@media (min-width: 1024px) {
  .features__grid { grid-template-columns: 1fr 1fr; gap: var(--grid-gap); }
}
.feature { display: flex; flex-direction: column; gap: var(--space-4); }
.feature__copy { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); max-width: 32rem; }
.feature__title {
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.feature__text { color: var(--text-2); margin-bottom: var(--space-1); }
/* Home's two features: the product name is the heading, the line under it a step smaller */
.feature__label { font-size: var(--text-h3); font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; color: var(--text); }
.feature__label span { margin-right: 0.3em; color: var(--lime); font-variant-numeric: tabular-nums; }
.features__grid .feature__title { font-size: 1.125rem; font-weight: 500; color: #dcdaea; letter-spacing: -0.01em; }

/* Product panel: navy → indigo gradient, a soft indigo glow behind the card,
   and the white card centred with equal padding on every side */
.visual {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--panel-pad);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(closest-side, rgba(43, 29, 143, 0.6), rgba(43, 29, 143, 0) 100%) center / 90% 85% no-repeat,
    linear-gradient(160deg, #070030 0%, #120c45 55%, #1a1257 100%);
  perspective: 1200px;
}
.visual .tile { width: 100%; max-width: none; } /* fill the panel so the padding is equal on every side */
/* 1px border: a hint of lime in the top-left corner that fades out along the edges */
.visual::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(70% 70% at 0% 0%, rgba(209, 238, 43, 0.85), rgba(209, 238, 43, 0.12) 45%, rgba(209, 238, 43, 0) 75%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* The two cards face inward like the pages of an open book (side by side only) */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .features__grid .tile {
    transition: transform 450ms var(--ease);
  }
  /* The extra shadow on the far edge lives on a pseudo-element, so it can fade
     (opacity) when the card goes flat on hover. The card keeps its own soft
     shadow and faint white rim from product.css. */
  .features__grid .tile::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    transition: opacity 450ms var(--ease);
  }
  /* Left card: outer (left) edge closer, inner edge away; shadow heavier on the far (right) edge */
  .features__grid .feature:first-child .tile { transform: rotateY(6deg); }
  .features__grid .feature:first-child .tile::after {
    box-shadow: 14px 24px 48px -18px rgba(0, 0, 0, 0.6), 4px 8px 16px -8px rgba(0, 0, 0, 0.35);
  }
  /* Right card: outer (right) edge closer, inner edge away */
  .features__grid .feature:last-child .tile { transform: rotateY(-6deg); }
  .features__grid .feature:last-child .tile::after {
    box-shadow: -14px 24px 48px -18px rgba(0, 0, 0, 0.6), -4px 8px 16px -8px rgba(0, 0, 0, 0.35);
  }
}
/* Hover (real pointers only): ease back to flat, lift slightly, drop the one-sided shadow.
   The :is() raises specificity so this never depends on rule order. */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) and (hover: hover) {
  .features__grid .feature:is(:first-child, :last-child) .visual:hover .tile { transform: translateY(-6px); }
  .features__grid .feature:is(:first-child, :last-child) .visual:hover .tile::after { opacity: 0; }
}

/* ---------- 4. How nawa works ---------- */
.how { padding: var(--section-space) 0; border-top: 1px solid var(--line); }
.how__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--head-stack);
  margin-bottom: var(--head-gap);
}
.how__head .statement { max-width: 24em; }

.how__grid { display: grid; gap: var(--space-5); }
.how__steps { display: grid; gap: var(--space-8); }
.how-step { display: grid; gap: var(--space-2); align-content: start; }
.how-step__num {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
  transition: color var(--dur) var(--ease);
}
.how-step__title {
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  transition: color var(--dur) var(--ease);
}
.how-step__text { color: var(--text-2); max-width: 28rem; }
.how-step__slot:empty { display: none; }
.how-step__slot { margin-top: var(--space-3); }
.how__stage { display: none; }

@media (min-width: 960px) {
  .how__grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--split-gap); }
  .how__stage { display: block; }
  .how__steps { gap: 0; }
  .how-step {
    min-height: min(64vh, 600px);
    align-content: center;
  }
  .how__sticky {
    position: sticky;
    top: calc(var(--header-h) + max(24px, (100vh - var(--header-h) - 560px) / 2));
    display: grid;
  }
  .how__sticky > .screen { grid-area: 1 / 1; align-self: start; }
  .js .how__sticky > .screen {
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur);
  }
  .js .how__sticky > .screen.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}

/* ---------- 5. Choose your path ---------- */
.path { padding: var(--section-space) 0; border-top: 1px solid var(--line); }
.path__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--head-gap);
}
.path__head > div { display: flex; flex-direction: column; align-items: flex-start; gap: var(--head-stack); }
@media (min-width: 768px) {
  .path__head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}


/* ---------- Wider layouts where there was empty space (≥1024px) ---------- */
@media (min-width: 1024px) {
  /* Hero: headline across the full width; subtext left and buttons right underneath */
  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-6);
    row-gap: var(--space-3);
    align-items: end;
  }
  .hero__inner > .status-tag { grid-column: 1 / -1; justify-self: start; }
  .hero__title { grid-column: 1 / -1; }
  .hero__sub { grid-column: 1; }
  .hero__ctas { grid-column: 2; justify-content: flex-end; }

  /* Logo section: heading on the left, its subtext on the right */
  .proof__head {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    column-gap: var(--space-8);
    row-gap: var(--head-stack);
    align-items: end;
  }
  .proof__head > .status-tag { grid-column: 1 / -1; justify-self: start; }
  .proof__head .section-sub { justify-self: end; }
}

/* How steps fade in like everything else, but keep their colour change when they become active */
.js .how-step .reveal {
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease), color var(--dur) var(--ease);
}

/* ---------- How nawa works: scroll-linked progress rail ----------
   A faint track runs from the first step's dot to the last; a lime fill grows
   over it with scroll (transform: scaleY, set by js/stories.js). Dots sit level
   with each step number: an empty ring until the fill reaches them, then lime. */
.how__rail-wrap { position: relative; padding-left: 36px; }
.how__rail {
  position: absolute;
  left: 7px;
  top: var(--rail-top, 0);
  width: 2px;
  height: var(--rail-height, 0);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}
.how__rail-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--lime);
  transform: scaleY(0);
  transform-origin: 50% 0;
  will-change: transform;
}
html:not(.js) .how__rail { display: none; }

.how-step { position: relative; }
/* The dot (empty ring until reached) */
.how-step::before,
.how-step::after {
  content: "";
  position: absolute;
  left: -35px;
  top: calc(var(--dot-y, 0.6em) - 7px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  pointer-events: none;
}
.how-step::before {
  z-index: 1;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35);
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.how-step.is-reached::before { background: var(--lime); box-shadow: 0 0 0 4px rgba(209, 238, 43, 0.14); }
/* A brief soft pulse when the fill reaches the dot (opacity + transform only) */
.how-step::after { z-index: 0; background: rgba(209, 238, 43, 0.35); opacity: 0; }
.how-step.is-pulsing::after { animation: dot-pulse 700ms var(--ease) 1; }
@keyframes dot-pulse {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(2.6); }
}
html:not(.js) .how-step::before,
html:not(.js) .how-step::after { display: none; }

/* Steps the fill hasn't reached stay muted; reached steps brighten to white */
.how__rail-wrap.is-ready .how-step:not(.is-reached) .how-step__title { color: var(--text-2); }  /* ≈7.6:1 on navy */
.how__rail-wrap.is-ready .how-step:not(.is-reached) .how-step__text { color: var(--text-3); }   /* ≈6.2:1 on navy, ≈4.8:1 over the brightest glow */
.how-step.is-reached .how-step__num,
.how-step.is-reached .how-step__title,
.how-step.is-reached .how-step__text { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .how__rail-fill { transform: none !important; }
  .how-step::after { display: none; }
}

/* Extra scroll room after the last step (desktop, pinned layout): step 04 keeps
   rising while the card stays pinned, its dot fills, and only then does the card
   release. Measured: without this the release came 16–80px after the 04 dot at
   720–1080px tall windows, i.e. too early in shorter frames. The rail itself still
   ends exactly at the 04 dot (it's sized from the dots, not from this padding). */
@media (min-width: 960px) {
  /* floor for short windows (the card is a fixed ~560px), cap for very tall ones */
  .how__rail-wrap { padding-bottom: clamp(180px, 24vh, 300px); }
}
