/* hero section: the F2 flow scene runs full-bleed behind the header. Scene styles are generated (hero-scene.css). */
@import url('./hero-scene.css');

/* the header stays at the top while the page scrolls; once scrolled it gets a frosted background (site.js) */
body > header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
}

body > header.is-stuck {
  background: color-mix(in srgb, var(--canvas) 84%, transparent);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(14px) saturate(1.2);
}

body > header.is-stuck .header-inner {
  padding-block: 12px;
}

/* anchors land below the header */
html {
  scroll-padding-top: 80px;
}

.hero {
  position: relative;
  /* clip, not hidden: a hidden box can still be scrolled sideways by focus */
  overflow: clip;
  padding: 0;
  background: var(--mist);
  /* the scene starts below the copy block (44px), and drops a little more below 1440px, where the copy keeps its
     size while the scene scales with the width */
  --scene-drop: clamp(44px, 44px + (1440px - 100vw) * 0.3, 116px);
  min-height: calc(max(100vw, 1180px) * 0.5625 + var(--scene-drop));
}

.f2-scene {
  top: var(--scene-drop) !important;
}

/* tablet: the scene sits below the copy instead of behind it */
@media (min-width: 760.02px) and (max-width: 1199.98px) {
  .hero {
    min-height: 0;
  }

  .f2-scene {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 116% !important;
    margin: -19% 0 0 -8% !important;
  }

  .hero-motion {
    bottom: 10px;
  }
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
}

.hero-blob--1 {
  left: -12%;
  top: -25%;
  width: 62%;
  height: 95%;
  background: radial-gradient(closest-side, var(--glow1), transparent);
}

.hero-blob--2 {
  right: -12%;
  top: 5%;
  width: 58%;
  height: 85%;
  background: radial-gradient(closest-side, var(--glow2), transparent);
}

/* F2 sizes these boxes as content-box, so its gutters and pill are wider than border-box would give
   (the header's container gets F2's width from base.css) */
.hero-copy,
.f2-pill {
  box-sizing: content-box;
}

.nav-dot {
  box-sizing: content-box;
}

/* the header is out of flow here, so the copy clears it (header is about 90px tall) */
.hero-copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 56px;
  max-width: 1360px;
  margin: 0 auto;
  padding: calc(90px + clamp(24px, 4vw, 56px)) clamp(16px, 3vw, 40px) 0;
  pointer-events: none;
}

/* one block: eyebrow, a two-line headline, then the supporting line (no button: Applications follows the proof strip) */
.hero-head {
  flex: 1 1 560px;
  max-width: 1120px;
}

.hero .eyebrow {
  margin: 0 0 16px;
  font-size: 15px;
}

.hero h1 {
  max-width: none;
  line-height: 1.06;
  text-wrap: balance;
}

.hero .lead {
  max-width: 880px;
  margin: 18px 0 0;
  line-height: 1.6;
}

.hero-motion {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line2);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--ink2);
  cursor: pointer;
}

.hero-motion:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}

/* one icon shows at a time: pause while playing, play once paused */
.hero-motion[aria-pressed="false"] .hero-motion__play,
.hero-motion[aria-pressed="true"] .hero-motion__pause {
  display: none;
}

/* a lit item is one the live question is reading or has produced */
.f2-hot {
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color 0.3s;
}

.f2-hot[data-lit] {
  outline-color: var(--accent);
}

/* keyboard focus: thicker ring with a light gap, so it reads differently from the lit ring */
.f2-hot:focus-visible,
.f2-hot[data-lit]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--surface);
}

.f2-tip {
  position: absolute;
  z-index: 6;
  width: 280px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 20px 44px -22px rgba(20, 33, 61, 0.5);
  pointer-events: none;
}

.f2-tip p {
  max-width: none;
  margin: 0;
}

.f2-tip-kind {
  font-size: 12px;
  color: var(--muted);
}

.f2-tip-title {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.f2-tip-body {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink2);
}

.f2-tip-acl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 3px 10px;
  border: 1px solid var(--seal-line);
  border-radius: 999px;
  background: var(--seal-soft);
  color: var(--seal);
  font-size: 12px;
  font-weight: 500;
}

/* the body's anywhere-wrapping would split words inside the layers */
.f2-scene {
  overflow-wrap: normal;
}

/* the platform: four capability cards in a stack; hero.js brings each to the front in turn (data-pos 0 is the front).
   The front card shows its job and what it does for the current question; the cards behind show their titles. */
.f2-caps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.f2-cap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-sizing: border-box;
  padding: 12px 16px 14px;
  overflow: hidden;
  border: 1px solid var(--accent-line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: 0 22px 44px -30px color-mix(in srgb, var(--navy) 65%, transparent);
  backdrop-filter: blur(10px);
}

/* offsets are 36 scene units across a 300 x 170 card */
.f2-cap[data-pos="0"] { z-index: 4; transform: translate(-12%, 21%); opacity: 1; }
.f2-cap[data-pos="1"] { z-index: 3; transform: translate(-4%, 7%) scale(0.95); opacity: 0.88; }
.f2-cap[data-pos="2"] { z-index: 2; transform: translate(4%, -7%) scale(0.9); opacity: 0.72; }
.f2-cap[data-pos="3"] { z-index: 1; transform: translate(12%, -21%) scale(0.85); opacity: 0.55; }

.f2-cap[data-pos="0"] {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 26px 50px -28px color-mix(in srgb, var(--accent) 55%, transparent);
}

/* permissions keep the amber reserved for them */
.f2-cap[data-cap="policy"][data-pos="0"] {
  border-color: var(--seal);
  box-shadow: 0 0 0 3px var(--seal-soft), 0 26px 50px -28px color-mix(in srgb, var(--seal) 45%, transparent);
}

.f2-cap-icon {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
}

.f2-cap-icon svg {
  width: auto;
  height: 16px;
}

.f2-cap p {
  max-width: none;
  margin: 0;
}

.f2-cap-step {
  color: var(--muted);
  font-size: clamp(10.5px, 0.8vw, 11.5px);
  font-weight: 500;
}

.f2-cap-title {
  padding-right: 22px;
  color: var(--ink);
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 600;
  line-height: 1.25;
}

.f2-cap-body {
  color: var(--ink2);
  font-size: clamp(11px, 0.86vw, 12.5px);
  line-height: 1.4;
}

.f2-cap-detail {
  margin-top: auto !important;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: clamp(11px, 0.86vw, 12.5px);
  font-weight: 500;
  line-height: 1.35;
}

.f2-cap[data-cap="policy"] .f2-cap-detail {
  background: var(--seal-soft);
  color: var(--seal);
}

/* the cards behind read as a stack of edges; only the front card's text shows */
.f2-cap:not([data-pos="0"]) > * {
  opacity: 0;
}

/* the live status under the question (detail level "full") */
.f2-status {
  position: absolute;
  top: calc(100% + 6px);
  left: 18px;
  display: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

[data-detail-level="full"] .f2-status {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .f2-cap {
    transition: transform 0.6s cubic-bezier(0.6, 0, 0.3, 1), opacity 0.6s, border-color 0.4s, background-color 0.4s, box-shadow 0.4s;
  }

  .f2-cap > * {
    transition: opacity 0.3s;
  }
}

/* narrower scenes keep the step, title and detail; the job line returns at desktop widths */
@media (max-width: 1199.98px) {
  .f2-cap-body {
    display: none;
  }
}

@media (max-width: 760px) {
  /* phone: the header wraps tall, so it stays in flow above the hero instead of over the scene */
  body > header {
    position: sticky;
    top: 0;
    background: var(--mist);
  }

  .hero-copy {
    padding-top: clamp(24px, 4vw, 56px);
  }

  .hero {
    min-height: 0;
  }

  .f2-scene {
    position: relative !important;
    left: auto !important;
    transform: none !important;
    top: auto !important; /* the desktop drop would push the scene's bottom out of the clipped hero */
    width: 180% !important;
    /* the scene's top fifth is near-empty sky, so it tucks under the call to action */
    margin: -20% 0 0 -40% !important;
  }

  /* the pill keeps its size as the scene shrinks, so it sits higher, clear of the cards */
  .f2-pill {
    transform: translateY(-75%);
  }

  .f2-cap {
    justify-content: center;
    padding: 6px 10px;
    border-radius: 12px;
  }

  .f2-cap-icon,
  .f2-cap-detail,
  .f2-status {
    display: none !important;
  }

  .f2-cap-step {
    font-size: min(2.4vw, 10px);
  }

  .f2-cap-title {
    padding-right: 0;
    font-size: min(2.9vw, 12px);
  }

  .hero-motion {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    margin: 12px auto 20px;
  }
}

/* one orchestrated moment on load: the copy fades up in a short stagger, then the scene settles in (once; never under
   reduced motion). Hero tips fade and scale in from 0.97. */
@media (prefers-reduced-motion: no-preference) {
  .hero .eyebrow,
  .hero h1,
  .hero .lead {
    animation: heroIn 640ms var(--ease-out) both;
  }

  .hero h1 {
    animation-delay: 60ms;
  }

  .hero .lead {
    animation-delay: 120ms;
  }

  .f2-scene {
    animation: heroFade 900ms var(--ease-out) 180ms both;
  }

  .f2-tip {
    transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
  }

  @starting-style {
    .f2-tip {
      opacity: 0;
      transform: scale(0.97);
    }
  }
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes heroFade {
  from {
    opacity: 0;
  }
}
