/* Everything in One Account (pinned) — Figma 2331:511 / 2347:1749
   ScrollStep 2313:28 (On/Off), Phone/* 2318:14 · 2318:51 · 2318:93 · 2318:149.
   Default styles = un-pinned / open layout (mobile, ≤1060px, reduced motion).
   The pinned scrub lives under `.js` at ≥1061px — see js/sections/12-platform.js. */
.platform {
  --platform-mute: #a8c6c0;
  position: relative;
  background: var(--ink-deep);
  color: #fff;
}

.platform__pin {
  position: relative;
  overflow: hidden;
  padding-block: var(--sec-pad);
}

/* ---------- Background wash: dashboard at .16, masked + veiled ---------- */
.platform__wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.platform__wash-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .16;
  filter: saturate(.6);
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 62% 45%, #000 45%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 90% at 62% 45%, #000 45%, transparent 100%);
}
/* pin2-veil (2331:513): keeps the copy column legible over the wash */
.platform__wash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(33.33% 37.04% at 61.33% 50.37%,
    rgba(6, 33, 31, .97) 0%, rgba(6, 33, 31, .72) 55%, rgba(6, 33, 31, .18) 100%);
}

/* ---------- Layout ---------- */
.platform__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 459fr) minmax(0, 661fr);
  gap: 40px;
  align-items: center;
}

/* ---------- SectionHead (on dark) ---------- */
.platform__head { gap: 14px; margin-bottom: 22px; }
.platform__eyebrow { color: var(--accent); }
.platform__title { font-size: 40px; color: #fff; }
.platform__lede { margin-top: -4px; font-size: 14.5px; color: var(--platform-mute); }

/* ---------- ScrollStep rows (open = State On) ---------- */
.platform__steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.platform__step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 17px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .055);
}
.platform__num {
  display: grid;
  place-items: center;
  flex: none;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--ink-deep);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.platform__content {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
}
.platform__step-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: #fff;
}
.platform__body,
.platform__tags { overflow: hidden; }
.platform__body p {
  padding-top: 5px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--platform-mute);
}
.platform__tags ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 5px;
}
.platform__tags li {
  padding: 4px 9px;
  border-radius: 99px;
  background: rgba(49, 226, 154, .14);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

/* ---------- PlatformVisual: browser + dashboard + ring + phone ---------- */
.platform__visual {
  position: relative;
  justify-self: end;
  width: 100%;
  aspect-ratio: 661 / 620;
}
.platform__browser {
  position: absolute;
  top: 4.84%;
  left: 0;
  width: 93.8%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: #0e2b29;
  box-shadow: var(--el-lg);
}
.platform__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: #12332f;
}
.platform__bar img { flex: none; width: 8px; height: 8px; }
.platform__url {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  height: 17px;
  padding-inline: 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .5);
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.platform__shot {
  position: relative;
  aspect-ratio: 620 / 522;
  overflow: hidden;
}
.platform__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tracking ring — hidden in the open layout */
.platform__ring { display: none; }

/* Phone: one visible at a time, stacked in one cell */
.platform__phones {
  position: absolute;
  top: 46.08%;
  left: 76.06%;
  width: 26.36%;
  display: grid;
}
.platform__phone {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  border-radius: 14.05% / 6.72%;
  box-shadow: 0 18.72px 25.2px rgba(6, 33, 31, .22);
  opacity: 0;
  transform: translateY(24px) scale(.95);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.platform__phone.is-on { opacity: 1; transform: none; }

/* ======================================================================
   Pinned scrub (≥1061px, motion allowed). Spec 2343:731:
   runway 420svh; .platform__pin sticky, 100svh, padding-top 64px.
   ====================================================================== */
@media (min-width: 1061px) {
  .js .platform { height: 420vh; height: 420svh; }
  .js .platform__pin {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    padding: 64px 0 0;
    display: flex;
    align-items: center;
  }
  /* keep browser + phone inside the viewport on short screens */
  .js .platform__visual { width: min(100%, calc((100vh - 140px) * 1.017)); }
  @supports (height: 100svh) {
    .js .platform__visual { width: min(100%, calc((100svh - 140px) * 1.017)); }
  }

  /* ScrollStep Off → On */
  .js .platform__step {
    transition:
      opacity var(--t-state) var(--ease),
      background-color var(--t-state) var(--ease),
      border-color var(--t-state) var(--ease);
  }
  .js .platform__num { transition: background-color var(--t-state) var(--ease), color var(--t-state) var(--ease); }
  .js .platform__body { max-height: 100px; transition: max-height .5s var(--ease); }
  .js .platform__tags { max-height: 60px; transition: max-height .55s var(--ease); }

  .js .platform__step:not(.is-on) {
    opacity: .42;
    background-color: transparent;
    border-color: transparent;
  }
  .js .platform__step:not(.is-on) .platform__num {
    background: rgba(255, 255, 255, .12);
    color: var(--platform-mute);
  }
  .js .platform__step:not(.is-on) .platform__body,
  .js .platform__step:not(.is-on) .platform__tags { max-height: 0; }

  /* Tracking ring over the dashboard (regions in % of the screenshot) */
  .js .platform__ring {
    display: block;
    position: absolute;
    left: 19.1%;
    top: 10.7%;
    width: 80.3%;
    height: 8.2%;
    border: 2px solid var(--accent);
    border-radius: 9px;
    box-shadow:
      0 0 22px rgba(49, 226, 154, .5),
      0 0 0 9999px rgba(6, 33, 31, .52);
    pointer-events: none;
    transition: all .6s var(--ease);
  }
  .js .platform[data-step="2"] .platform__ring { left: 19.1%; top: 19.2%; width: 42.4%; height: 28.3%; }
  .js .platform[data-step="3"] .platform__ring { left: 61.3%; top: 19.2%; width: 38%;   height: 28.3%; }
  .js .platform[data-step="4"] .platform__ring { left: 19.1%; top: 50.1%; width: 80.3%; height: 37.5%; }
}

/* ======================================================================
   Un-pinned (≤1060px) — every row open, ring hidden, phone column hidden,
   wash drops to .1 (mobile frame 2347:1749).
   ====================================================================== */
@media (max-width: 1060px) {
  .platform__grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .platform__steps { gap: 10px; }
  .platform__wash-img { opacity: .1; }
  .platform__visual { justify-self: stretch; aspect-ratio: auto; }
  .platform__browser { position: relative; top: auto; width: 100%; }
  .platform__phones { display: none; }
}

@media (min-width: 721px) and (max-width: 1060px) {
  .platform__features { max-width: 640px; }
  .platform__visual { max-width: 720px; }
}

@media (max-width: 720px) {
  .platform__head { gap: 12px; margin-bottom: 22px; }
  .platform__title { font-size: 28px; }
  .platform__br { display: none; }
  .platform__lede { margin-top: 0; font-size: 15.5px; }

  .platform__browser { border-radius: 12px; }
  .platform__bar { padding: 8px 10px; }
  .platform__bar img { width: 7px; height: 7px; }
  .platform__url { height: 15px; padding-inline: 8px; font-size: 8px; line-height: 1.4; }
  .platform__shot { aspect-ratio: 350 / 293; }
}

/* ======================================================================
   Legibility pass — darker overlay, frosted steps, larger type.
   ====================================================================== */
/* darker wash: dimmer dashboard + a left-weighted shade over the copy column */
.platform__wash-img { opacity: .1; filter: saturate(.5) brightness(.85); }
.platform__wash::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(6, 33, 31, .94) 0%, rgba(6, 33, 31, .86) 38%, rgba(6, 33, 31, .6) 62%, rgba(6, 33, 31, .72) 100%),
    linear-gradient(180deg, rgba(6, 33, 31, .5) 0%, transparent 25%, transparent 75%, rgba(6, 33, 31, .6) 100%);
}
.platform__wash::after { z-index: 2; }
/* keep the wash (and its shades) in its own layer, under the copy and the visual */
.platform__wash { z-index: 0; }
.platform__grid { z-index: 1; }

/* larger type */
.platform__title { font-size: 46px; }
.platform__lede { margin-top: 0; font-size: 17px; line-height: 1.6; color: #c4dcd7; }
.platform__head { margin-bottom: 28px; }
.platform__steps { gap: 6px; }
.platform__step { gap: 16px; padding: 18px 20px; border-radius: 16px; }
.platform__num { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.platform__step-title { font-size: 20px; line-height: 1.25; padding-top: 3px; }
.platform__body p { padding-top: 8px; font-size: 15.5px; line-height: 1.6; color: #c4dcd7; }
.platform__tags ul { gap: 8px; padding-top: 12px; }
.platform__tags li { padding: 6px 12px; font-size: 12px; background: rgba(49, 226, 154, .16); }

/* frosted open step: solid-enough glass so the copy never fights the wash */
.platform__step {
  background: rgba(6, 33, 31, .62);
  border-color: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 18px 40px -24px rgba(0, 0, 0, .7);
}
@media (min-width: 1061px) {
  .js .platform__body { max-height: 140px; }
  .js .platform__tags { max-height: 80px; }
  .js .platform__step:not(.is-on) {
    opacity: .55;
    background-color: transparent;
    border-color: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (max-width: 720px) {
  .platform__title { font-size: 30px; }
  .platform__lede { font-size: 16px; }
  .platform__step { padding: 16px; }
  .platform__step-title { font-size: 18px; }
  .platform__body p { font-size: 15px; }
}
