/* Hallmark · macrostructure: Feature Stack (a sticky stage beside the length-grouped list) · round 5 pick B "Stage", 2026-10-28
 * stage paper var(--color-bone) beside the dark list · accent copper · wordmark Archivo 800 wdth 125 · UI Switzer
 * motion: M1 wordmark swap + price roll · M2 the email types itself · M3 copper dot follows the list · M4 phone sheet
 * reduced motion: no slides, no typing, no roll (the script checks prefers-reduced-motion)
 */

/* desktop: the brand sits on the stage, so the page header only shows on phones */
.home > .top { display: none; }

.frame { display: grid; grid-template-columns: minmax(0, 44fr) minmax(0, 56fr); grid-template-areas: "stage list"; }
.list { --list-pad: clamp(1.5rem, 3.4vw, 3.6rem); grid-area: list; position: relative; min-width: 0; display: flex; flex-direction: column; padding: 0 var(--list-pad) var(--space-2xl); }
.list .index { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); z-index: 4; border-block: 0; border-bottom: 1px solid var(--color-rule); }
.list .intro { padding-block: clamp(2.25rem, 5vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem); }
.list .intro h1 { font-size: clamp(2.6rem, 1.4rem + 3vw, 4.6rem); }

/* the rows: one name per line */
.home .names { display: block; }
.home .nm { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem 8.8rem; grid-template-areas: "n x p" "n x s"; align-items: center; gap: 0.12rem var(--space-lg); padding: 0.85rem 0.6rem 0.85rem 1.7rem; }
.home .nm__x { justify-self: end; }
.home .nm__n { grid-area: n; font-size: clamp(1.4rem, 1.05rem + 0.85vw, 1.85rem); }
.home .nm__x { grid-area: x; display: block; margin: 0; font-size: 0.8rem; color: var(--color-faint); white-space: nowrap; }
.home .nm__x b { margin: 0; font-weight: 500; color: var(--color-muted); }
.home .nm__p { grid-area: p; justify-self: end; font-weight: 600; font-size: 1.12rem; }
.home .nm__p.is-offer { font-weight: 500; color: var(--color-muted); }
.home .nm__s { grid-area: s; justify-self: end; font-size: 0.8rem; color: var(--color-faint); white-space: nowrap; }
.home .nm__s .m { color: var(--color-accent); font-weight: 500; }
.home .nm.is-on { background: linear-gradient(90deg, var(--color-paper-2), transparent 92%); }
.home .nm .tld { transition: color var(--dur) var(--ease-out); }
.home .nm.is-on .nm__n .tld { color: var(--color-accent); }

/* M3: one copper dot travels to the name on stage */
.list__dot { position: absolute; left: 0; top: 0; z-index: 2; width: 0.55rem; height: 0.55rem; margin: -0.275rem 0 0 0.55rem; border-radius: 50%; background: var(--color-accent); opacity: 0; pointer-events: none; transition: transform var(--dur-long) var(--ease-out), opacity 200ms var(--ease-out); }
.list__dot.is-on { opacity: 1; }
.list__dot.is-instant { transition: opacity 200ms var(--ease-out); }

/* the stage */
.stage { grid-area: stage; position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; overflow: hidden; background: var(--color-bone); color: var(--color-ink-light); padding: clamp(1.4rem, 2.2vw, 2rem) clamp(1.75rem, 3.6vw, 3.6rem) clamp(1.5rem, 2.4vw, 2.4rem); }
.stage .brand__mark { color: var(--color-ink-light); }
.stage .brand__tld { color: var(--color-faint-light); }
.stage :focus-visible { outline-color: var(--color-accent-ink); }
.stage__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md); }
.stage__meta { font-size: 0.85rem; color: var(--color-faint-light); white-space: nowrap; }
.stage__close { display: none; }
.stage__body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; padding-block: var(--space-lg); }

/* M1: the wordmark sits in a fixed window so a swap never moves the text below it */
.stage__wm { --wm-max: min(10.4rem, 17.5vh); position: relative; margin: 0; height: calc(var(--wm-max) * 1.1); overflow: hidden; container-type: inline-size; }
.wm { position: absolute; left: 0; bottom: 0; font-family: var(--font-mark); font-weight: 800; font-stretch: 125%; font-size: min(var(--wm-max), calc(100cqi / (var(--len) * 0.82))); line-height: 1.1; letter-spacing: -0.05em; white-space: nowrap; transition: transform var(--dur-long) var(--ease-out), opacity var(--dur-long) var(--ease-out); }
.wm.is-in-up { transform: translateY(75%); opacity: 0; }
.wm.is-in-down { transform: translateY(-75%); opacity: 0; }
.wm.is-out-up, .wm.is-out-down { opacity: 0; transition-duration: 300ms; transition-timing-function: var(--ease-in); }
.wm.is-out-up { transform: translateY(-75%); }
.wm.is-out-down { transform: translateY(75%); }

.stage__uses { margin: var(--space-lg) 0 0; display: grid; gap: 0.35rem; font-weight: 500; font-size: clamp(1.1rem, 0.85rem + 0.7vw, 1.45rem); line-height: 1.25; letter-spacing: -0.01em; }
.stage__uses div { display: flex; align-items: baseline; }
.stage__uses dt { flex: none; width: 5rem; font-size: 0.8rem; font-weight: 500; letter-spacing: 0.01em; color: var(--color-faint-light); }
.stage__uses dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.stage__uses .tld { color: var(--color-accent-ink); }
.stage__uses .caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -0.16em; background: var(--color-accent-ink); }
.stage__uses .is-done .caret { opacity: 0; transition: opacity 600ms var(--ease-out); }
.stage__note, .stage__proof { margin: var(--space-md) 0 0; max-width: 46ch; font-size: 1rem; line-height: 1.5; color: var(--color-muted-light); }
.stage__proof { margin-top: var(--space-xs); }
.stage__proof b { font-weight: 600; color: var(--color-ink-light); }

.stage__buy { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0.35rem var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--color-rule-light); }
.stage__price { margin: 0; font-weight: 600; font-size: clamp(2.1rem, 1.3rem + 1.8vw, 3.1rem); line-height: 1; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stage__terms { grid-column: 1; margin: 0; font-size: 0.95rem; color: var(--color-muted-light); }
.stage__terms b { font-weight: 600; color: var(--color-ink-light); }
.stage__act { grid-column: 2; grid-row: 1 / span 2; display: grid; justify-items: end; gap: 0.55rem; }
.stage .btn { display: inline-flex; align-items: center; gap: 0.6rem; padding: 1rem 1.45rem; border-radius: 999px; background: var(--color-ink-light); color: var(--color-bone); font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap; transition: transform var(--dur) var(--ease-out); }
.stage .btn .ico { width: 1rem; height: 1rem; flex: none; color: var(--color-accent); }
.stage .btn:active { transform: translateY(0); }
@media (hover: hover) { .stage .btn:hover { transform: translateY(-1px); } }
.stage .alt { font-size: 0.9rem; font-weight: 500; color: var(--color-ink-light); text-decoration: none; white-space: nowrap; border-bottom: 1px solid var(--color-rule-light); padding-bottom: 1px; }
@media (hover: hover) { .stage .alt:hover { border-color: var(--color-ink-light); } }
.stage__micro { grid-column: 1 / -1; margin: var(--space-xs) 0 0; font-size: 0.82rem; color: var(--color-faint-light); }

/* narrower desktops: price, then the button under it */
@media (min-width: 60rem) and (max-width: 74.99rem) {
  .stage__buy { grid-template-columns: minmax(0, 1fr); }
  .stage__act { grid-column: 1; grid-row: auto; justify-items: start; margin-top: var(--space-sm); }
  .home .nm__x { display: none; }
  .home .nm { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n p" "n s"; }
}

.scrim { display: none; }

/* phones and tablets: one column, and a tap opens the stage as a sheet (M4) */
@media (max-width: 59.99rem) {
  .home > .top { display: flex; }
  .frame { display: block; }
  .list { --list-pad: clamp(1.25rem, 4vw, 3rem); padding-bottom: var(--space-xl); }
  .list .intro { order: -1; padding-block: clamp(1.25rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem); }
  .list .index { margin-inline: calc(-1 * var(--list-pad)); padding-inline: var(--list-pad); border-top: 1px solid var(--color-rule); }
  .home .nm { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n p" "x s"; padding: 0.95rem 0.4rem 0.9rem 0.4rem; }
  .home .nm__x { justify-self: start; }
  .list__dot { display: none; }

  .stage { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 40; height: auto; max-height: 92svh; overflow-y: auto; overscroll-behavior: contain; border-radius: 18px 18px 0 0; padding: 0.7rem clamp(1.25rem, 4vw, 2rem) calc(1.25rem + env(safe-area-inset-bottom)); box-shadow: 0 -18px 50px oklch(5% 0 0 / 0.45); transform: translateY(104%); visibility: hidden; transition: transform 300ms var(--ease-in), visibility 0s linear 300ms; }
  .stage.is-open { transform: none; visibility: visible; transition: transform var(--dur-long) var(--ease-out), visibility 0s; }
  .stage::before { content: ""; display: block; flex: none; width: 2.6rem; height: 0.3rem; margin: 0 auto 0.5rem; border-radius: 9px; background: var(--color-rule-light); }
  .stage .brand { display: none; }
  .stage__top { align-items: center; }
  .stage__close { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin: -0.3rem -0.5rem 0 0; padding: 0; border: 0; border-radius: 50%; background: var(--color-bone-2); color: var(--color-ink-light); cursor: pointer; }
  .stage__close svg { width: 1rem; height: 1rem; }
  .stage__body { flex: none; padding-block: var(--space-sm) var(--space-md); }
  .stage__wm { --wm-max: min(6.4rem, 23vw); }
  .stage__uses dt { width: 4.2rem; }
  .stage__note, .stage__proof { font-size: 0.95rem; }
  .stage__buy { grid-template-columns: minmax(0, 1fr); }
  .stage__act { grid-column: 1; grid-row: auto; justify-items: stretch; margin-top: var(--space-sm); }
  .stage .btn { justify-content: center; }
  .stage .alt { justify-self: center; }

  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: var(--color-scrim); opacity: 0; visibility: hidden; transition: opacity 300ms var(--ease-in), visibility 0s linear 300ms; }
  .scrim.is-on { opacity: 1; visibility: visible; transition: opacity var(--dur-long) var(--ease-out), visibility 0s; }
  .is-sheet, .is-sheet body { overflow: hidden; }
}
@media (max-width: 22.49rem) { .home .nm__x { display: block; } }

/* 11/28: six length groups now (r11.si added a 3-character group), so the desktop index runs a little tighter
   and still fits whole from 1280px, as the five-group index did */
@media (min-width: 60rem) {
  .list .index ol { gap: clamp(0.875rem, 1.25vw, 2.25rem); }
  .list .index ol a { font-size: 0.875rem; }
}
