/* ==========================================================================
   sections.css — per-section composition.
   ========================================================================== */

/* --- Hero ----------------------------------------------------------------- */
.hero {
  padding-top: calc(var(--nav-h) + clamp(2.5rem, 5vw, 5rem));
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 4vw, 4rem);
  align-items: center;
}

.hero__copy,
.hero__media {
  min-width: 0;
}

@media (min-width: 1024px) {
  .hero__grid {
    grid-template-columns: 1.05fr 1fr;
  }
}

.hero__title {
  font-size: var(--t-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.hero__title .grad {
  background: linear-gradient(120deg, var(--accent-text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin-top: var(--s-24);
  font-size: var(--t-lead);
  color: var(--text-secondary);
  max-width: 36rem;
}

.hero__cta {
  margin-top: var(--s-32);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-12);
}

.hero__meta {
  margin-top: var(--s-24);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-16);
  font-size: var(--t-small);
  color: var(--text-tertiary);
}
.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero__meta .icon {
  width: 15px;
  height: 15px;
  color: var(--accent-text);
}

/* ambient glow behind hero devices */
.hero__media {
  position: relative;
}
.hero__media::before {
  content: "";
  position: absolute;
  inset: -10% -5%;
  background: radial-gradient(
    60% 50% at 60% 40%,
    var(--accent-glow),
    transparent 70%
  );
  filter: blur(20px);
  opacity: 0.6;
  z-index: -1;
  animation: float-soft 8s var(--ease-std) infinite;
}

@media (min-width: 1024px) {
  .device--phone.hero-phone {
    transform: rotate(-4deg);
  }
  .device--window.hero-window {
    transform: rotate(2deg) translateY(18px);
  }
}

/* --- Trust strip ---------------------------------------------------------- */
.trust {
  padding-block: clamp(2rem, 1.5rem + 3vw, 3.5rem);
  border-block: 1px solid var(--hairline);
}

.trust__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-16);
}

@media (min-width: 768px) {
  .trust__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.trust__cell {
  text-align: center;
  padding: var(--s-12);
  min-width: 0;
}
.trust__label {
  overflow-wrap: break-word;
}
.trust__cell + .trust__cell {
  border-left: 1px solid var(--hairline);
}
@media (max-width: 767px) {
  .trust__cell:nth-child(odd) {
    border-left: none;
  }
}

.trust__num {
  font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.trust__num .unit {
  color: var(--accent-text);
}
.trust__label {
  margin-top: var(--s-4);
  font-size: var(--t-small);
  color: var(--text-secondary);
}

/* --- Feature copy bullets ------------------------------------------------- */
.feat-list {
  margin-top: var(--s-24);
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
}
.feat-list li {
  display: flex;
  gap: var(--s-12);
  align-items: flex-start;
  color: var(--text-secondary);
}
.feat-list .icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--accent-text);
  margin-top: 2px;
}
.feat-list strong {
  color: var(--text);
  font-weight: 600;
}

/* --- Bento tiles ---------------------------------------------------------- */
.tile {
  padding: var(--s-24);
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
  transition: transform var(--dur-med) var(--ease),
    border-color var(--dur-med) var(--ease-std);
}
.tile:hover {
  transform: translateY(-4px);
  border-color: var(--hairline-strong);
}
.tile__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--accent-muted);
  color: var(--accent-text);
}
.tile__icon .icon {
  width: 22px;
  height: 22px;
}
.tile h3 {
  font-size: var(--t-h3);
}
.tile p {
  color: var(--text-secondary);
  font-size: var(--t-small);
}

/* Transport-ladder feature tile */
.tile--ladder {
  justify-content: space-between;
}
.ladder {
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
  margin-top: var(--s-8);
}
.ladder-step {
  display: flex;
  align-items: center;
  gap: var(--s-12);
  padding: var(--s-12);
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: var(--card);
  color: var(--text-secondary);
  font-size: var(--t-small);
  font-weight: 500;
}
.ladder-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex: none;
  transition: background-color var(--dur-med) var(--ease-std);
}
.ladder-step .speed {
  margin-left: auto;
  font-size: var(--t-caption);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* --- How it works / stepper ----------------------------------------------- */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-32);
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-24);
  }
  .stepline {
    position: absolute;
    top: 26px;
    left: 16%;
    right: 16%;
    height: 2px;
    background: var(--hairline);
    border-radius: 2px;
    overflow: hidden;
  }
  .stepline__fill {
    height: 100%;
    background: var(--accent);
  }
}

@media (max-width: 767px) {
  .stepline {
    display: none;
  }
}

.step {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-12);
}
.step__num {
  position: relative;
  z-index: 2;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent-text);
}
.step h3 {
  font-size: var(--t-h3);
}
.step p {
  color: var(--text-secondary);
  font-size: var(--t-small);
  max-width: 22rem;
}

/* --- Security ------------------------------------------------------------- */
.security__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 3vw, 3.5rem);
  align-items: start;
}
@media (min-width: 900px) {
  .security__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Screenshot showcase under the security copy: centered, with a soft accent
   glow so the phone reads as a deliberate visual rather than an orphan. */
.security__media {
  position: relative;
  margin-top: var(--s-48);
  display: grid;
  place-items: center;
}
.security__media::before {
  content: "";
  position: absolute;
  inset: -6% -14%;
  background: radial-gradient(
    58% 52% at 50% 44%,
    var(--accent-glow),
    transparent 70%
  );
  filter: blur(28px);
  opacity: 0.5;
  z-index: -1;
}
.security__media .device--phone {
  width: clamp(220px, 30vw, 288px);
}

.assure-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-16);
}
@media (min-width: 520px) {
  .assure-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.assure {
  padding: var(--s-24);
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
}
.assure__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--accent-muted);
  color: var(--accent-text);
}
.assure__icon .icon {
  width: 22px;
  height: 22px;
}
.assure h3 {
  font-size: var(--t-body);
  font-weight: 600;
}
.assure p {
  font-size: var(--t-small);
  color: var(--text-secondary);
}

/* --- Platform comparison -------------------------------------------------- */
.compare {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-24);
}
@media (min-width: 768px) {
  .compare {
    grid-template-columns: 1fr 1fr;
  }
}

.plat-card {
  padding: var(--s-24);
}
.plat-card__head {
  display: flex;
  align-items: center;
  gap: var(--s-12);
  margin-bottom: var(--s-16);
  padding-bottom: var(--s-16);
  border-bottom: 1px solid var(--hairline);
}
.plat-card__head .icon {
  width: 28px;
  height: 28px;
  color: var(--accent-text);
}
.plat-card__head h3 {
  font-size: var(--t-h3);
}
.plat-card__head .badge {
  margin-left: auto;
}

.cap-list li {
  display: flex;
  align-items: center;
  gap: var(--s-12);
  padding: var(--s-8) var(--s-4);
  font-size: var(--t-small);
}
.cap-mark {
  width: 18px;
  height: 18px;
  flex: none;
}
.cap-yes {
  color: var(--accent-text);
}
.cap-no {
  color: var(--text-tertiary);
}
.cap-list li.is-no {
  color: var(--text-tertiary);
}

/* --- Download ------------------------------------------------------------- */
.dl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-24);
  max-width: 760px;
  margin-inline: auto;
}
@media (min-width: 720px) {
  .dl-grid {
    grid-template-columns: 1fr 1fr;
  }
}
/* Odd card out (3 cards over 2 columns) spans both instead of sitting
   half-width under column 1 — centers itself as its own row. Upper bound keeps
   this from fighting the 3-column rule below on specificity (it would
   otherwise win: it's the more specific selector). The 3-column band starts at
   1160px — measured, not guessed: each card's min-content is its nowrap
   button label (the Play card's is ~368px), and three of those plus gaps and
   gutters only genuinely fit from ~1150px; below that the grid overflowed and
   the page clipped the third card. */
@media (min-width: 720px) and (max-width: 1159px) {
  .dl-grid:has(.dl-card:nth-child(3)):not(:has(.dl-card:nth-child(4)))
    .dl-card:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 380px;
    margin-inline: auto;
    width: 100%;
  }
}
@media (min-width: 1160px) {
  .dl-grid:has(.dl-card:nth-child(3)) {
    /* minmax(0, …) drops the min-content floor so the three tracks stay EQUAL
       (plain 1fr floors each track at its card's nowrap-label width, which
       rendered lopsided 368/332/332 columns). Cards can't clip: their buttons
       wrap instead (see .dl-card .btn below). */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 1080px;
  }
}

.dl-card {
  padding: var(--s-32);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-16);
  /* Sizing context for the CTA label below. The card's width comes from the
     wheel (a percentage of the deck), not from the viewport, so viewport units
     would mis-size the label on the way down. */
  container-type: inline-size;
  transition: transform var(--dur-med) var(--ease),
    border-color var(--dur-med) var(--ease-std),
    box-shadow var(--dur-med) var(--ease-std);
}
/* Phones: 32px of side padding out of a ~266px card is a third of the width.
   Give it back to the CTA so its label stays on one line. */
@media (max-width: 520px) {
  .dl-card {
    padding-inline: var(--s-16);
  }
}
/* The green neon ring is interactive: it follows whichever card the pointer or
   keyboard last landed on (see platform.js), so it's decoupled from .is-detected
   — which only drives the "Detected — recommended for you" tag. On load the
   detected card starts highlighted. */
.dl-card.is-highlight {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 18px 50px -22px var(--accent-glow);
  transform: scale(1.02);
}
.dl-card__os {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
}
.dl-card__os .icon {
  width: 30px;
  height: 30px;
}
.dl-card h3 {
  font-size: var(--t-h3);
}
.dl-card__badges {
  display: flex;
  gap: var(--s-8);
  justify-content: center;
  flex-wrap: wrap;
}
.dl-card .btn {
  margin-top: var(--s-4);
  /* .btn--lg's 32px side padding does nothing on a full-width button whose
     content is already centered — it only eats label room. Measured, that was
     the whole reason "Download for Windows" broke onto a second line: the
     label needed 225px and the padding left it 222px. */
  padding-inline: var(--s-8);
  /* Below ~400px even the trimmed padding isn't enough, so the label scales
     with the CARD (cqi resolves against the container above — its CONTENT box,
     hence 6.5 rather than the ~5.6 the full width would suggest). 6.5cqi clears
     --t-lead at every card width down to 430px, so the clamp pins to --t-lead
     and the CTA keeps full size; it steps down only on small phones. */
  font-size: clamp(0.95rem, 6.5cqi, var(--t-lead));
  /* Safety net, not the plan: a label that still can't fit — a long localized
     one — wraps rather than clipping or overflowing the grid. */
  white-space: normal;
}
.dl-detected-tag {
  font-size: var(--t-caption);
  font-weight: 600;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-height: 1em;
}
.dl-verify {
  margin-top: var(--s-4);
  font-size: var(--t-caption);
  color: var(--text-tertiary);
}
.dl-verify summary {
  cursor: pointer;
}
.dl-verify code {
  display: block;
  margin-top: var(--s-4);
  word-break: break-all;
  font-size: 10px;
  color: var(--text-secondary);
}

.dl-note {
  margin: 0 auto var(--s-32);
  max-width: 540px;
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--t-small);
}

/* The explicit display below would otherwise defeat the UA's [hidden] rule —
   platform.js hides this banner once every download card is wired. */
.dl-todo[hidden] {
  display: none;
}
.dl-todo {
  display: block;
  margin: var(--s-16) auto 0;
  max-width: 620px;
  padding: var(--s-12) var(--s-16);
  text-align: center;
  font-size: var(--t-small);
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
  border-radius: var(--r-md);
}

.dl-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-12);
  margin-top: var(--s-32);
}
.dl-qr {
  width: 120px;
  height: 120px;
  background: #fff;
  border-radius: var(--r-md);
  padding: 10px;
}

/* --- FAQ ------------------------------------------------------------------ */
.faq {
  max-width: 760px;
  margin-inline: auto;
}
.faq__item {
  border-bottom: 1px solid var(--hairline);
}
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-16);
  padding: var(--s-24) var(--s-4);
  font-weight: 600;
  font-size: var(--t-lead);
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker {
  display: none;
}
.faq__chev {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--text-secondary);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-med) var(--ease);
}
.faq__item[open] .faq__chev {
  transform: rotate(180deg);
}
.faq__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-med) var(--ease);
}
.faq__item[open] .faq__body {
  grid-template-rows: 1fr;
}
.faq__body > div {
  overflow: hidden;
}
.faq__body p {
  padding: 0 var(--s-4) var(--s-24);
  color: var(--text-secondary);
}

/* --- CTA banner inside download head ------------------------------------- */
.dl-head {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto clamp(2rem, 1.5rem + 2vw, 3rem);
}
