/* Pre-launch hero · variant A2 "Stage first, form as caption".
   One screen, three rows, all centred:
     .a2-head     the logo, large, with a mono kicker under it
     .a2-slot     the bracket arc + laptop (css/home-hero.css), sized by prelaunch-a2.js to the height left over
     .a2-caption  under the laptop, like a product caption: a two-tone line, the waitlist capsule,
                  the consent line and a quiet "50% off at launch · macOS 14 or later"
   Green only on the button; amber only for the error state. */

.a2 {
  --a2-warn: #f2a65a;
  --a2-quiet: #7b837f;                       /* small print: lighter than --faint so 12px still reads */
  --a2-pad-t: clamp(28px, 6svh, 72px);
  --a2-pad-b: clamp(24px, 5svh, 60px);
  --a2-logo-h: clamp(44px, min(6.8vw, 10.4svh), 112px);
  --a2-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  display: flex; flex-direction: column; align-items: center;
  height: 100vh; height: 100svh;
  min-height: 560px;
  overflow: clip;                            /* the floor light is wider and taller than the page: never a scrollbar */
  margin: 0;
  padding: var(--a2-pad-t) 0 var(--a2-pad-b);
  padding-top: max(var(--a2-pad-t), env(safe-area-inset-top));
}
/* The shipping hero's floor light is placed for its own layout; this one lights the slot instead. */
.a2::before { content: none; }

/* ---------- Head: logo + kicker ---------- */

.a2-head {
  display: grid; justify-items: center;
  padding: 0 var(--gutter);
  position: relative; z-index: 3;
}
.a2-head > *, .a2-caption > * { animation: a2-rise 0.9s var(--a2-ease) backwards; }
.a2-head > :nth-child(2) { animation-delay: 0.08s; }
.a2-caption > :nth-child(1) { animation-delay: 0.22s; }
.a2-caption > :nth-child(2) { animation-delay: 0.3s; }
.a2-caption > :nth-child(3) { animation-delay: 0.38s; }
@keyframes a2-rise { from { opacity: 0; transform: translateY(10px); } }

.a2-logo { margin: 0; line-height: 0; }
.a2-logo img {
  display: block;
  height: var(--a2-logo-h); width: auto;
  max-width: min(100%, 82vw);
  object-fit: contain;
}

/* A precise, instrument-like label: tracked mono caps between two hairlines. */
.a2-kicker {
  display: flex; align-items: center; gap: 14px;
  margin-top: clamp(14px, 2.4svh, 26px);
  font-family: var(--mono);
  font-size: clamp(10.5px, 0.8vw, 12px);
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--muted);
  /* tracking adds space after the last letter: pull it back so the label sits optically centred */
  margin-right: -0.26em;
}
.a2-kicker::before,
.a2-kicker::after {
  content: "";
  width: clamp(18px, 2.4vw, 36px); height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong));
}
.a2-kicker::after { transform: scaleX(-1); margin-left: -0.26em; }

/* ---------- Stage ---------- */

.a2-slot {
  position: relative;
  flex: 1 1 0; min-height: 0;
  width: 100%;
  display: grid; place-items: center;
  margin: clamp(24px, 5svh, 64px) 0 0;
}
/* Low, wide light the laptop sits in. */
.a2-slot::before {
  content: ""; position: absolute; z-index: -2;
  left: 50%; top: 62%;
  width: min(1500px, 150vw); aspect-ratio: 2.2 / 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(120, 150, 60, 0.11), rgba(120, 150, 60, 0.03) 60%, transparent);
  pointer-events: none;
}
.a2-stage { margin: 0 auto; }
.a2 .ha-device { margin: 0; }

/* ---------- Caption ---------- */

.a2-caption {
  position: relative; z-index: 3;
  display: grid; justify-items: center;
  width: 100%;
  padding: 0 var(--gutter);
  margin-top: clamp(24px, 4.6svh, 56px);
}

/* Two-tone line, Apple caption style: the promise in white, the news in grey. */
.a2-lede {
  max-width: 34em;
  font-family: "SF Pro Display", "SF Pro", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(19px, min(2.05vw, 3.4svh), 30px);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.16;
  text-wrap: balance;
  font-feature-settings: "kern", "ss01";
}
.a2-lede { color: var(--text); }

/* The reason to tap: the launch price. White figure on a muted line, not green (green is the button). */
.a2-offer {
  margin: clamp(10px, 1.8svh, 16px) 0 0;
  color: var(--muted);
  font-size: clamp(14px, min(1.15vw, 2svh), 16px);
  line-height: 1.4; letter-spacing: -0.005em;
  text-wrap: balance;
}
.a2-offer b { color: var(--text); font-weight: 600; }

/* ---------- Form ---------- */

.a2-form {
  --a2-cap: 52px;
  /* the idle form's height (capsule + gap + consent), kept on "done" so the note below never moves */
  --a2-h: calc(var(--a2-cap) + 14px + 12.5px * 1.4);
  width: min(100%, 460px);
  margin-top: clamp(20px, 3.6svh, 36px);
  display: grid; justify-items: stretch;
}

.a2-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.a2-capsule {
  display: flex; align-items: center; gap: 6px;
  min-height: var(--a2-cap);
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 12px 32px rgba(0, 0, 0, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.a2-capsule:focus-within {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 0 0 4px rgba(255, 255, 255, 0.05),
    0 12px 32px rgba(0, 0, 0, 0.35);
}

.a2-input {
  flex: 1; min-width: 0;
  height: 42px;
  padding: 0 8px 0 18px;
  border: 0; outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit; font-size: 16px; letter-spacing: -0.01em;
  caret-color: var(--text);
}
.a2-input::placeholder { color: var(--faint); opacity: 1; }
.a2-input:disabled { opacity: 0.6; }
.a2-input:focus-visible { outline: none; }

/* The one action on the page: the only accent on the screen. */
.a2-submit {
  flex: none;
  display: inline-grid; place-items: center;
  height: 42px;
  padding: 0 20px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(89, 214, 160, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.a2-submit:hover { background: var(--accent-soft); box-shadow: 0 10px 30px rgba(89, 214, 160, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.a2-submit:active { transform: scale(0.97); }
.a2-submit > * { grid-area: 1 / 1; }
.a2-submit__label { display: inline-flex; align-items: center; gap: 9px; }
/* The offer rides on the button itself: a hairline, then "50% off" in a lighter weight of the same ink. */
.a2-submit__sep { width: 1px; height: 16px; background: currentColor; opacity: 0.28; }
.a2-submit__more { display: none; }
.a2-submit__offer {
  margin-right: -10px;                       /* the pill sits closer to the button's rounded end */
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff; color: var(--accent-ink);
  font-size: 13px; font-weight: 650; letter-spacing: 0;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.a2-submit__spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(6, 43, 32, 0.25); border-top-color: var(--accent-ink);
  opacity: 0;
}

/* Consent and status share one row, so swapping them never moves the page. */
.a2-foot { display: grid; margin-top: 14px; min-height: calc(12.5px * 1.4); }
.a2-foot > p {
  grid-area: 1 / 1; margin: 0;
  font-size: 12.5px; line-height: 1.4; letter-spacing: 0.005em;
  transition: opacity 0.2s;
}
.a2-consent { color: var(--a2-quiet); }
.a2-consent a {
  color: inherit;
  text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.18);
  text-underline-offset: 2px;
  margin-left: 2px;
}
.a2-consent a:hover { color: var(--muted); text-decoration-color: currentColor; }
.a2-consent, .a2-status { text-wrap: balance; }
/* Shares the consent line's cell: while invisible it must not swallow clicks on the Privacy link. */
.a2-status { color: var(--muted); opacity: 0; pointer-events: none; }

/* Availability and the launch offer: small print, not a headline. */
.a2-note {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: clamp(12px, 2.2svh, 22px);
  color: var(--faint);
  font-size: 12px; line-height: 1.4; letter-spacing: 0.01em;
}
.a2-note__dot { width: 2px; height: 2px; border-radius: 50%; background: currentColor; }

/* ---------- States ---------- */

.a2-form[data-state="sending"] .a2-submit { cursor: progress; }
.a2-form[data-state="sending"] .a2-submit__label { opacity: 0; }
.a2-form[data-state="sending"] .a2-submit__spinner { opacity: 1; animation: a2-spin 0.8s linear infinite; }
.a2-form[data-state="sending"] .a2-consent,
.a2-form[data-state="error"] .a2-consent { opacity: 0; visibility: hidden; }
.a2-form[data-state="sending"] .a2-status,
.a2-form[data-state="error"] .a2-status { opacity: 1; }
@keyframes a2-spin { to { transform: rotate(360deg); } }

/* Error: a warning, so amber, never red or green. */
.a2-form[data-state="error"] .a2-capsule { border-color: color-mix(in srgb, var(--a2-warn) 55%, transparent); }
.a2-form[data-state="error"] .a2-status { color: var(--a2-warn); }

/* Done: the capsule gives way to a quiet glass confirmation in the same place. */
.a2-form[data-state="done"] .a2-capsule,
.a2-form[data-state="done"] .a2-consent { display: none; }
.a2-form[data-state="done"] { min-height: var(--a2-h); align-content: center; }
.a2-form[data-state="done"] .a2-foot { margin-top: 0; }
.a2-form[data-state="done"] .a2-status {
  opacity: 1;
  display: flex; align-items: center; gap: 14px;
  min-height: var(--a2-cap);
  padding: 10px 22px 10px 11px;
  border-radius: 26px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 12px 32px rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 13.5px; line-height: 1.4; letter-spacing: -0.003em;
  text-align: left; text-wrap: pretty;
  animation: a2-done-in 0.5s var(--a2-ease) both;
}
/* A neutral check badge (green is for actions only). */
.a2-form[data-state="done"] .a2-status::before {
  content: "";
  flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4 6.6 11.4 12.5 4.8' fill='none' stroke='%23f1f4f2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat,
    rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
@keyframes a2-done-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

/* ---------- Tablets and phones: natural flow, the bracket fans above the lid ---------- */

@media (max-width: 900px) {
  .a2 {
    --a2-logo-h: clamp(40px, 12.5vw, 84px);
    height: auto; min-height: 100svh;
    padding-bottom: max(var(--a2-pad-b), env(safe-area-inset-bottom));
  }
  /* leftover height on tall phones goes above the stage and below the caption: the logo stays on top,
     the caption stays tight under the laptop */
  .a2-slot { flex: none; display: block; margin: auto 0 0; }
  .a2-slot::before { top: 70%; }
  .a2-stage { margin-top: calc(var(--dw) * 0.2 + 28px); }
  .a2-caption { margin: clamp(32px, 5svh, 48px) 0 auto; }
  .a2-lede { font-size: clamp(20px, 5.4vw, 28px); }
}

@media (max-width: 520px) {
  .a2-kicker { font-size: 10px; letter-spacing: 0.22em; margin-right: -0.22em; gap: 10px; }
  .a2-form { --a2-h: calc(48px + 8px + 48px + 14px + 12.5px * 1.4); width: min(100%, 360px); }
  .a2-capsule {
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 0;
    background: none; border: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .a2-capsule:focus-within { box-shadow: none; }
  .a2-input {
    flex: none;
    height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-edge);
    box-shadow: inset 0 1px 0 var(--glass-highlight), 0 10px 26px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition: border-color 0.2s;
  }
  .a2-input:focus { border-color: rgba(255, 255, 255, 0.24); }
  .a2-submit { height: 48px; font-size: 16px; }
  /* Full-width button: the white pill floated mid-button. Words only, in the button's ink:
     "Notify me · 50% off at launch", the offer half lighter. */
  .a2-submit__label { gap: 10px; }
  .a2-submit__sep { width: 3px; height: 3px; border-radius: 50%; opacity: 0.55; }
  .a2-submit__offer {
    margin: 0; padding: 0;
    background: none; box-shadow: none;
    color: inherit;
    font-size: inherit; font-weight: 500; letter-spacing: -0.01em; line-height: inherit;
    opacity: 0.78;
  }
  .a2-submit__more { display: inline; }
  .a2-form[data-state="error"] .a2-capsule { border-color: transparent; }
  .a2-form[data-state="error"] .a2-input { border-color: color-mix(in srgb, var(--a2-warn) 55%, transparent); }
  .a2-form[data-state="done"] .a2-status { min-height: 56px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .a2-head > *, .a2-caption > * { animation: none; }
  .a2-form[data-state="done"] .a2-status { animation: none; }
  .a2-form[data-state="sending"] .a2-submit__spinner { animation-duration: 2s; }
}

/* Once signed up, the pitch has done its job; keep its space so nothing moves. */
.a2-caption:has(.a2-form[data-state="done"]) .a2-offer { visibility: hidden; }

/* Mushroom bracket (Design/HeroMushroom): its own ambient light instead of the ladybird's. */
.a2 .ha-glow { background-image: url("../assets/mushroom-glow.webp"); }
/* Cool, faintly green floor light to match the forest bokeh. */
.a2-slot::before { background: radial-gradient(closest-side, rgba(90, 160, 90, 0.12), rgba(90, 160, 90, 0.03) 60%, transparent); }

/* Proportions from Design/HeroMushroom/mac_cards.mjs (1400 1.4 1.3 0.24 0.14): prints 0.5014 × device and the arc
   pulled in towards the lid. One screen: js/prelaunch.js gives the laptop all the height the rest leaves,
   and the rows below are tightened so that is as close as possible to 1.4 × the earlier laptop. */
.a2 {
  height: auto; min-height: 0;
  --a2-pad-t: clamp(16px, 3.6svh, 44px);
  --a2-pad-b: clamp(14px, 3svh, 36px);
  --a2-logo-h: clamp(40px, min(6.8vw, 8.4svh), 104px);
}
.a2-slot { flex: none; margin-top: clamp(14px, 3svh, 40px); }
.a2-kicker { margin-top: clamp(10px, 1.8svh, 20px); }
.a2-caption { margin-top: clamp(14px, 2.6svh, 34px); }
.a2-lede { font-size: clamp(19px, min(1.9vw, 3.1svh), 28px); }
.a2-offer { margin-top: clamp(6px, 1.2svh, 12px); }
.a2-form { margin-top: clamp(14px, 2.4svh, 26px); }
.a2-note { margin-top: clamp(8px, 1.4svh, 16px); }
.a2 .ha-card { --w: 0.5014; --x: calc(var(--s) * var(--dw) * (0.24 + 0.14 * var(--d))); }
@media (max-width: 900px) {
  .a2 { --a2-logo-h: clamp(40px, 12.5vw, 84px); --a2-pad-t: clamp(28px, 6svh, 72px); }   /* phones scroll: keep their larger logo */
  .a2 .ha-card { --w: 0.62; }              /* the fanned phone layout: as big as fits inside the screen edges */
}

/* App icon beside the wordmark: a touch taller than the letters, centred on them. */
.a2-logo { display: flex; align-items: center; justify-content: center; gap: calc(var(--a2-logo-h) * 0.3); }
.a2-logo .a2-logo__icon {
  height: calc(var(--a2-logo-h) * 1.25); width: auto;
  max-width: none;
  flex: none;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}
.a2-logo .a2-logo__word { max-width: min(100%, 64vw); }
