/* Formhouse Connected: shared stage, phone frame and app components.
   Every prototype uses these; an option only adds what is unique to it. */

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--ink-0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100svh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Stage (desktop) */

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 32rem) auto;
  justify-content: center;
  align-items: start;
  gap: clamp(2rem, 1rem + 4vw, 6rem);
  padding: var(--space-page-2) var(--page-gutter);
  max-width: var(--page-max);
  margin: 0 auto;
  isolation: isolate;
}

.stage-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vw 60vh at 85% 40%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(50vw 50vh at 5% 100%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%),
    var(--ink-0);
}

.stage-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.brief {
  position: sticky; top: 0;
  max-height: 100svh; overflow-y: auto; scrollbar-width: none;
  display: grid; gap: var(--space-page-2); align-content: safe center;
  min-height: 100svh; padding-block: var(--space-page-2);
}
.brief::-webkit-scrollbar { display: none; }

.brief__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-page-2); }

.brief__back {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-size: var(--fs-page-xs); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-3);
  transition: color var(--t-fast);
}
.brief__back:hover { color: var(--text); }
.brief__back img { height: 0.95rem; width: auto; opacity: 0.9; }

.brief__index { font-family: var(--font-mono); font-size: var(--fs-page-xs); color: var(--text-3); }
.brief__index b { color: var(--accent-hi); font-weight: 500; }

.brief__title {
  font-size: clamp(2.6rem, 1.2rem + 3.5vw, 4.5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
}
.brief__title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent-hi), var(--accent) 60%, var(--text) 140%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.brief__lede { font-size: var(--fs-page-md); line-height: 1.6; color: var(--text-2); max-width: 30rem; }
/* Steps come before the summary box on every option, whatever the markup order */
.brief__centre { order: 2; }
.brief__nav { order: 3; }
.brief__quote { font-size: var(--fs-page-lg); font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }

.brief__centre {
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-page-1) var(--space-page-2);
  padding: var(--space-page-2); border: 1px solid var(--line); border-radius: 18px; background: var(--glass);
  font-size: var(--fs-page-sm);
}
.brief__centre dt { color: var(--text-3); font-family: var(--font-mono); font-size: var(--fs-page-xs); text-transform: uppercase; letter-spacing: 0.1em; padding-top: 0.2em; }
.brief__centre dd { color: var(--text); font-weight: 500; }

.brief__steps { list-style: none; display: grid; gap: 0.25rem; counter-reset: step; }
.brief__steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.2rem 1fr; align-items: baseline;
  padding: 0.7rem 0; border-top: 1px solid var(--line);
  font-size: var(--fs-page-sm); color: var(--text-2); line-height: 1.5;
  transition: color var(--t-med);
}
.brief__steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: var(--fs-page-xs); color: var(--text-3); }
.brief__steps li.is-done { color: var(--text-3); }
.brief__steps li.is-done::before { content: '\2713'; color: var(--success); }
.brief__steps li.is-now { color: var(--text); }
.brief__steps li.is-now::before { color: var(--accent-hi); }

.brief__nav { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.pill-link {
  display: inline-flex; align-items: center; gap: 0.5em;
  min-height: var(--tap-min);
  padding: 0.65em 1.15em; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  font-size: var(--fs-page-sm); font-weight: 600; color: var(--text-2);
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.pill-link:hover { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }
.pill-link[aria-current='page'] { color: var(--ink-0); background: var(--text); border-color: var(--text); }

/* ---------------------------------------------------------------- Phone frame */

.phone {
  position: sticky;
  top: var(--space-page-2);
  height: min(calc(var(--phone-h) * 1px), calc(100svh - 2 * var(--space-page-2)));
  aspect-ratio: var(--phone-w) / var(--phone-h);
  padding: var(--phone-bezel);
  border-radius: var(--phone-radius);
  background: linear-gradient(145deg, #3a3c41 0%, #141518 30%, #0b0b0d 70%, #2b2d31 100%);
  box-shadow: var(--shadow-phone), inset 0 0 0 1.5px rgba(255, 255, 255, 0.08), 0 0 120px -40px var(--accent);
}

.phone::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: calc(var(--phone-radius) - 3px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.screen-root {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--phone-radius) - var(--phone-bezel));
  background: var(--ink-1);
  container-type: size;
  isolation: isolate;
  overflow: clip;
  --safe-top: calc(6.6cqh + var(--sp-2));
  --safe-bottom: 3.4cqh;
  --tabbar-h: calc(9cqh + var(--safe-bottom) * 0.4);
}

/* Keeps scrolled content from colliding with the clock and the island */
.status-scrim {
  position: absolute; top: 0; left: 0; right: 0; z-index: 55; height: var(--safe-top);
  background: linear-gradient(180deg, var(--ink-1) 62%, rgba(10, 10, 10, 0.6));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent);
  pointer-events: none;
}

.island {
  position: absolute; top: 1.35cqh; left: 50%; transform: translateX(-50%);
  width: 31cqw; height: 4.2cqh; border-radius: 99px; background: #000; z-index: 90;
  pointer-events: none;
}

.statusbar {
  position: absolute; top: 0; left: 0; right: 0; height: 6.4cqh;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2cqh 8cqw 0 9.5cqw;
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: -0.01em;
  z-index: 85; pointer-events: none;
  color: var(--text);
}
.statusbar__icons { display: flex; gap: 1.4cqw; align-items: center; }
.statusbar__icons svg { width: 4.6cqw; height: auto; }

.home-indicator {
  position: absolute; bottom: 1cqh; left: 50%; transform: translateX(-50%);
  width: 35cqw; height: 0.6cqh; min-height: 4px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.85); z-index: 95; pointer-events: none;
}

/* Layout mode change: on a phone the prototype IS the phone */
@media (max-width: 860px) {
  .stage { display: block; padding: 0; min-height: 0; }
  .brief { display: none; }
  .phone { position: relative; top: 0; height: 100svh; width: 100vw; aspect-ratio: auto; padding: 0; border-radius: 0; background: var(--ink-1); box-shadow: none; }
  .phone::before { display: none; }
  .screen-root {
    border-radius: 0;
    --safe-top: calc(env(safe-area-inset-top, 0px) + var(--sp-4));
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --tabbar-h: calc(64px + var(--safe-bottom));
  }
  .island, .statusbar, .home-indicator { display: none; }
  .status-scrim { height: env(safe-area-inset-top, 0px); }
  body .info-fab { display: grid; }
}

/* ---------------------------------------------------------------- Screens */

.screen {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: var(--safe-top) var(--sp-5) calc(var(--tabbar-h) + var(--sp-6));
  opacity: 0;
  visibility: hidden;
  transform: translateX(8%);
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out), visibility 0s linear var(--t-med);
  z-index: 1;
}
.screen::-webkit-scrollbar { display: none; }
.screen.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; z-index: 2; }
.screen.is-behind { transform: translateX(-6%); }
.screen.is-fade { transform: scale(0.985); }
.screen--bleed { padding: 0; }
.screen--notabs { padding-bottom: calc(var(--safe-bottom) + var(--sp-6)); }

.screen [data-reveal] { opacity: 0; transform: translateY(14px); }
.screen.is-active [data-reveal] {
  animation: reveal var(--t-slow) var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 70ms + 80ms);
}
@keyframes reveal { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .screen [data-reveal] { opacity: 1; transform: none; }
  .screen.is-active [data-reveal] { animation: none; }
}

.appbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.appbar__brand { display: flex; align-items: center; gap: var(--sp-2); }
.appbar__brand img { height: var(--fs-md); width: auto; }
.appbar__title { font-size: var(--fs-md); font-weight: 700; letter-spacing: -0.01em; }
.appbar__back {
  display: grid; place-items: center;
  width: max(var(--tap-min), 11cqw); height: max(var(--tap-min), 11cqw);
  margin-left: calc(var(--sp-3) * -1);
  border-radius: 50%;
}
.appbar__back svg { width: 6cqw; height: 6cqw; }

.avatar {
  display: grid; place-items: center;
  width: 11cqw; height: 11cqw; min-width: var(--tap-min); min-height: var(--tap-min);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  font-size: var(--fs-xs); font-weight: 800; color: var(--ink-0);
  box-shadow: 0 0 0 2px var(--ink-1), 0 0 0 3px var(--line-strong);
}

/* ---------------------------------------------------------------- Type */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow--accent { color: var(--accent-hi); }

.h-hero { font-size: var(--fs-hero); font-weight: 800; letter-spacing: -0.05em; line-height: 0.9; }
.h-3xl { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; }
.h-2xl { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.h-xl { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.h-lg { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.h-md { font-size: var(--fs-md); font-weight: 700; letter-spacing: -0.01em; }
.body { font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }
.small { font-size: var(--fs-xs); line-height: 1.45; color: var(--text-3); }
.accent { color: var(--accent-hi); }

.gradient-text {
  background: linear-gradient(100deg, var(--text) 10%, var(--accent-hi) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.stack { display: grid; gap: var(--gap, var(--sp-4)); }
.row { display: flex; align-items: center; gap: var(--gap, var(--sp-3)); }
.row--between { justify-content: space-between; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: var(--sp-6) 0 var(--sp-3); }
.section-head .link { display: inline-flex; align-items: center; min-height: var(--tap-min); padding-inline: var(--sp-2); margin-right: calc(var(--sp-2) * -1); font-size: var(--fs-xs); font-weight: 600; color: var(--accent-hi); }

/* ---------------------------------------------------------------- Buttons */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: max(var(--tap-min), 13cqw);
  padding: 0 var(--sp-5);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: -0.005em;
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  color: var(--text);
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast), box-shadow var(--t-med);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 1.25em; height: 1.25em; flex: none; }
.btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: #00131f;
  box-shadow: 0 10px 30px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn--primary:hover { box-shadow: 0 14px 40px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn--light { background: var(--text); color: var(--ink-0); border-color: transparent; }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }
.btn--sm { min-height: max(36px, 9.5cqw); padding: 0 var(--sp-4); font-size: var(--fs-xs); }
.btn--icon { padding: 0; width: max(var(--tap-min), 13cqw); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
/* A finished action: full strength, clearly done, not greyed out like an unavailable one */
.btn.btn--done, .btn.btn--done[disabled] { opacity: 1; background: color-mix(in srgb, var(--success) 10%, transparent); border-color: color-mix(in srgb, var(--success) 45%, transparent); color: var(--success); box-shadow: none; pointer-events: none; }
.btn.btn--done::after { display: none; }

/* The main action of a long screen stays docked at the bottom over a fade */
.dock {
  position: sticky; bottom: 0; z-index: 3;
  margin: 0 calc(var(--sp-5) * -1);
  padding: var(--sp-6) var(--sp-5) calc(var(--safe-bottom) + var(--sp-5));
  background: linear-gradient(180deg, transparent, var(--ink-1) 40%);
}
.screen:has(.dock) { padding-bottom: 0; }

.btn--shine { overflow: hidden; }
.btn--shine::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: shine 3.6s var(--ease-in-out) infinite 1.2s;
}
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .btn--shine::after { display: none; } }

/* ---------------------------------------------------------------- Cards */

.card {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--line);
  padding: var(--sp-5);
  overflow: hidden;
}
.card--tight { padding: var(--sp-4); }
.card--accent { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%), var(--glass); border-color: var(--blue-line); }
.card--tap { transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast); text-align: left; width: 100%; display: block; }
.card--tap:active { transform: scale(0.985); }
.card--tap:hover { border-color: var(--line-strong); }

.media {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  isolation: isolate;
  background: var(--ink-3);
}
.media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.media::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0) 20%, rgba(5, 5, 5, 0.55) 60%, rgba(5, 5, 5, 0.94) 100%);
}
.media__body { position: relative; padding: var(--sp-5); display: grid; gap: var(--sp-2); align-content: end; height: 100%; }

.kenburns { animation: kenburns 24s ease-in-out infinite alternate; transform-origin: 60% 40%; }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.12) translate(-1%, -1%); } }
@media (prefers-reduced-motion: reduce) { .kenburns { animation: none; } }

.chip {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: 0.02em;
  background: var(--glass-strong); border: 1px solid var(--line);
  color: var(--text-2);
  white-space: nowrap;
}
.chip svg { width: 1.2em; height: 1.2em; }
.chip--accent { background: var(--accent-dim); border-color: var(--blue-line); color: var(--accent-hi); }
.chip--gold { background: rgba(233, 196, 106, 0.12); border-color: rgba(233, 196, 106, 0.35); color: var(--gold); }
.chip--live::before {
  content: ''; width: 0.5em; height: 0.5em; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 0 currentColor; animation: live 1.8s ease-out infinite;
}
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 100% { box-shadow: 0 0 0 0.6em transparent; } }

.example-tag {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold);
  padding: 0.3em 0.7em; border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(233, 196, 106, 0.35);
  white-space: nowrap;
}
.example-tag::before { content: ''; width: 0.45em; height: 0.45em; border: 1px solid currentColor; transform: rotate(45deg); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(22cqw, 1fr)); gap: var(--sp-3); }
.stat { display: grid; gap: var(--sp-1); }
.stat__value { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__label { font-size: var(--fs-2xs); color: var(--text-3); font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }

.list { display: grid; }
.list-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
  text-align: left; width: 100%;
}
.list-row:last-child { border-bottom: 0; }
.list-row__icon {
  display: grid; place-items: center;
  width: 10cqw; height: 10cqw; border-radius: var(--r-sm);
  background: var(--glass-strong); color: var(--accent-hi);
}
.list-row__icon svg { width: 50%; height: 50%; }
.list-row__title { font-weight: 600; }
.list-row__meta { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.list-row__end { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }

.bar { height: 1.1cqw; min-height: 4px; border-radius: 99px; background: var(--glass-strong); overflow: hidden; }
.bar > span {
  display: block; height: 100%; width: calc(var(--p, 0) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  box-shadow: 0 0 12px var(--accent);
  transition: width var(--t-xslow) var(--ease-out);
}

.hscroll {
  display: flex; gap: var(--sp-3);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 calc(var(--sp-5) * -1); padding: 0 var(--sp-5);
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }

.divider { height: 1px; background: var(--line); margin: var(--sp-5) 0; }

/* ---------------------------------------------------------------- Tab bar */

.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 60;
  height: var(--tabbar-h);
  padding: 0 var(--sp-3) var(--safe-bottom);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-top: 1px solid var(--line);
  transition: transform var(--t-med) var(--ease-out), opacity var(--t-med);
}
.tabbar.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
.tab {
  display: grid; place-items: center; align-content: center; gap: 0.6cqh;
  font-size: var(--fs-2xs); font-weight: 600; color: var(--text-3);
  transition: color var(--t-fast);
  min-height: var(--tap-min);
}
.tab svg { width: 6.4cqw; height: 6.4cqw; transition: transform var(--t-med) var(--ease-spring); }
.tab[aria-selected='true'] { color: var(--text); }
.tab[aria-selected='true'] svg { color: var(--accent-hi); transform: translateY(-1px) scale(1.06); filter: drop-shadow(0 0 8px var(--accent)); }

/* ---------------------------------------------------------------- Sheet, toast, overlay */

.sheet-backdrop {
  position: absolute; inset: 0; z-index: 70;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-med);
}
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 75;
  max-height: 88%;
  overflow-y: auto; scrollbar-width: none;
  padding: var(--sp-3) var(--sp-5) calc(var(--safe-bottom) + var(--sp-6));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--ink-2);
  border-top: 1px solid var(--line-strong);
  transform: translateY(105%);
  visibility: hidden;
  transition: transform var(--t-slow) var(--ease-out), visibility 0s linear var(--t-slow);
}
.sheet.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.sheet::before { content: ''; display: block; width: 11cqw; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 0 auto var(--sp-4); }
.sheet--full { top: 0; max-height: none; border-radius: 0; padding: 0; }
.sheet--full::before { display: none; }

.toast {
  position: absolute; left: 50%; top: calc(var(--safe-top) - var(--sp-2)); z-index: 88;
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4) var(--sp-2) var(--sp-2);
  border-radius: var(--r-pill);
  background: rgba(24, 25, 28, 0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.8);
  font-size: var(--fs-xs); font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -60%);
  transition: transform var(--t-slow) var(--ease-spring), opacity var(--t-med), visibility 0s linear var(--t-slow);
}
.toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.toast__icon { display: grid; place-items: center; width: 7.5cqw; height: 7.5cqw; border-radius: 50%; background: var(--accent); color: #00131f; }
.toast__icon svg { width: 60%; height: 60%; }

.info-fab {
  display: none; place-items: center;
  position: fixed; left: 0; top: 50%; z-index: 200;
  width: 30px; height: 64px; border-radius: 0 16px 16px 0; border-left: 0;
  translate: -60% -50%;
  transition: translate var(--t-med) var(--ease-out);
}
.info-fab:hover, .info-fab:focus-visible { translate: 0 -50%; }
.info-fab svg { margin-left: 10px; }
.info-fab {
  background: rgba(24, 25, 28, 0.85); border: 1px solid var(--line-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.info-fab svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- Scan intro (shared moment) */

.scan {
  position: absolute; inset: 0; z-index: 80;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: calc(var(--safe-top) + 3cqh) var(--sp-5) calc(var(--safe-bottom) + var(--sp-6));
  background: radial-gradient(120% 60% at 50% 105%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%), #030405;
  overflow: hidden;
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out), visibility 0s linear var(--t-slow);
}
.scan.is-done { opacity: 0; transform: scale(1.06); visibility: hidden; pointer-events: none; }
.scan__photo { position: absolute; inset: 0; z-index: -1; opacity: 0.28; }
.scan__photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9); }
.scan__photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #030405 0%, rgba(3, 4, 5, 0.3) 45%, #030405 100%); }

.scan__clock { text-align: center; }
.scan__date { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.scan__time { font-size: clamp(56px, 22cqw, 96px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin-top: var(--sp-1); }

.scan__target { display: grid; place-items: center; position: relative; }
.scan__label {
  position: relative; z-index: 2;
  width: 38cqw; aspect-ratio: 1 / 1.25;
  border-radius: var(--r-sm);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, #1c1d21, #0b0b0d);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), inset 0 0 0 4px rgba(0, 0, 0, 0.4), inset 0 0 0 5px rgba(255, 255, 255, 0.06);
  display: grid; place-items: center; align-content: center; gap: 3cqw;
  transform: rotate(-4deg);
  transition: transform var(--t-slow) var(--ease-spring);
}
.scan__label img { width: 70%; opacity: 0.92; }
.scan__label .mono { font-size: var(--fs-2xs); color: var(--text-3); }
.scan__chip { width: 11cqw; height: 11cqw; color: var(--accent-hi); filter: drop-shadow(0 0 10px var(--accent)); }
.scan.is-tapped .scan__label { transform: rotate(0deg) scale(1.05); }

.scan__rings { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scan__rings span {
  position: absolute; width: 44cqw; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: ring 3s var(--ease-out) infinite;
}
.scan__rings span:nth-child(2) { animation-delay: 1s; }
.scan__rings span:nth-child(3) { animation-delay: 2s; }
@keyframes ring { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(2.1); opacity: 0; } }
.scan.is-tapped .scan__rings span { animation: burst 900ms var(--ease-out) forwards; }
.scan.is-tapped .scan__rings span:nth-child(2) { animation-delay: 120ms; }
.scan.is-tapped .scan__rings span:nth-child(3) { animation-delay: 240ms; }
@keyframes burst { 0% { transform: scale(0.8); opacity: 1; border-width: 3px; } 100% { transform: scale(3.2); opacity: 0; border-width: 1px; } }

.scan__cta { display: grid; gap: var(--sp-3); justify-items: center; text-align: center; transition: opacity var(--t-med); }
.scan__hint { font-size: var(--fs-sm); color: var(--text-2); max-width: 70cqw; line-height: 1.5; }
.scan.is-tapped .scan__cta button { opacity: 0; pointer-events: none; }
.scan.is-tapped .scan__hint { color: var(--accent-hi); font-weight: 600; }

.nfc-banner {
  position: absolute; left: var(--sp-3); right: var(--sp-3); top: calc(var(--safe-top) - var(--sp-2)); z-index: 5;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-3);
  border-radius: var(--r-lg);
  background: rgba(40, 41, 46, 0.78);
  backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.9);
  text-align: left;
  opacity: 0; visibility: hidden;
  transform: translateY(-40%) scale(0.96);
  transition: transform var(--t-slow) var(--ease-spring), opacity var(--t-med), visibility 0s linear var(--t-slow);
}
.scan.is-tapped .nfc-banner { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--blue-line), 0 0 40px -8px var(--accent); }
.scan__clock { transition: transform var(--t-slow) var(--ease-out); }
.scan.is-tapped .scan__clock { transform: translateY(5cqh); }
/* The app icon: the Formhouse wordmark on a black tile, never a lone letter that reads as another brand */
.nfc-banner__app {
  display: grid; place-items: center;
  width: 11cqw; height: 11cqw; border-radius: 26%;
  background: radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%), #050505;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.nfc-banner__app img { width: 80%; height: auto; }
.nfc-banner__title { font-size: var(--fs-sm); font-weight: 700; }
.nfc-banner__meta { font-size: var(--fs-xs); color: var(--text-2); margin-top: 1px; }
.nfc-banner__open { font-size: var(--fs-xs); font-weight: 700; color: var(--accent-hi); }
.nfc-banner:not([disabled]) { animation: nudge 2.4s ease-in-out infinite 1.6s; }
@keyframes nudge { 0%, 85%, 100% { transform: none; } 90% { transform: translateY(3px); } 95% { transform: translateY(-1px); } }

.splash {
  position: absolute; inset: 0; z-index: 84;
  display: grid; place-items: center; align-content: center; gap: var(--sp-5);
  background: var(--ink-1);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-med), visibility 0s linear var(--t-med);
}
.splash.is-on { opacity: 1; visibility: visible; transition-delay: 0s; }
.splash__mark { width: 15cqw; height: 15cqw; color: var(--text); }
.splash__mark path { stroke: var(--text); stroke-width: 10; fill: transparent; stroke-dasharray: 2600; stroke-dashoffset: 2600; }
.splash.is-on .splash__mark path { animation: draw 1.1s var(--ease-in-out) forwards, fillin 0.4s ease forwards 0.9s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fillin { to { fill: var(--text); } }
.splash__line { width: 30cqw; height: 2px; border-radius: 2px; background: var(--glass-strong); overflow: hidden; }
.splash__line span { display: block; height: 100%; width: 0; background: var(--accent-hi); box-shadow: 0 0 10px var(--accent); }
.splash.is-on .splash__line span { animation: load 1.3s var(--ease-in-out) forwards; }
@keyframes load { to { width: 100%; } }
.splash__meta { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------------------------------------------------------------- Calm player (shared) */

.calm { position: relative; min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; isolation: isolate; padding: var(--safe-top) var(--sp-5) calc(var(--safe-bottom) + var(--sp-6)); }
.calm__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.calm__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.calm__bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 6, 12, 0.9) 0%, rgba(4, 6, 12, 0.35) 35%, rgba(4, 6, 12, 0.92) 72%, #04060c 100%); }
.calm__top { display: flex; align-items: center; justify-content: space-between; }
.calm__close { display: grid; place-items: center; width: max(var(--tap-min), 11cqw); height: max(var(--tap-min), 11cqw); border-radius: 50%; background: rgba(255, 255, 255, 0.08); }
.calm__close svg { width: 45%; height: 45%; }

.calm__centre { display: grid; place-items: center; align-content: center; gap: var(--sp-5); text-align: center; }
.orb { position: relative; width: 52cqw; aspect-ratio: 1; display: grid; place-items: center; }
.orb__core {
  position: absolute; inset: 18%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9), var(--accent-hi) 22%, var(--accent) 48%, rgba(0, 60, 140, 0.4) 72%, transparent 74%);
  filter: blur(0.5px);
  box-shadow: 0 0 60px -10px var(--accent), 0 0 140px -30px var(--accent-hi);
  transform: scale(0.72);
  transition: transform 4s ease-in-out;
}
.orb__halo { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(0, 212, 255, 0.25); transform: scale(0.8); transition: transform 4s ease-in-out, opacity 4s; opacity: 0.4; }
.orb__halo + .orb__halo { inset: -10%; border-color: rgba(0, 212, 255, 0.12); }
.calm.is-in .orb__core { transform: scale(1); }
.calm.is-in .orb__halo { transform: scale(1); opacity: 1; }
.orb__wave { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; opacity: 0.9; mix-blend-mode: screen; }
.calm__breath { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.01em; min-height: 1.4em; transition: opacity 0.6s; }
.calm__track { font-size: var(--fs-xs); color: var(--text-3); }

.calm__sounds { display: grid; gap: var(--sp-2); }
.sound {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3); border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.05); border: 1px solid transparent;
  text-align: left; width: 100%;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.sound[aria-pressed='true'] { background: rgba(0, 168, 255, 0.12); border-color: var(--blue-line); }
.sound__play { display: grid; place-items: center; width: 10cqw; height: 10cqw; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.sound[aria-pressed='true'] .sound__play { background: var(--accent); color: #00131f; }
.sound__play svg { width: 42%; height: 42%; }
.sound__name { font-size: var(--fs-sm); font-weight: 700; }
.sound__detail { font-size: var(--fs-2xs); color: var(--text-3); margin-top: 2px; }
.sound__eq { display: flex; gap: 2px; align-items: end; height: 4cqw; opacity: 0; }
.sound[aria-pressed='true'] .sound__eq { opacity: 1; }
.sound__eq i { width: 3px; border-radius: 2px; background: var(--accent-hi); animation: eq 1s ease-in-out infinite alternate; }
.sound__eq i:nth-child(1) { height: 40%; }
.sound__eq i:nth-child(2) { height: 90%; animation-delay: 0.2s; }
.sound__eq i:nth-child(3) { height: 60%; animation-delay: 0.4s; }
@keyframes eq { to { transform: scaleY(0.3); } }

.calm__timer { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; margin-top: var(--sp-3); }
.calm__timer button { min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: 600; color: var(--text-3); border: 1px solid var(--line); }
.calm__timer button[aria-pressed='true'] { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }

/* ---------------------------------------------------------------- Globe (shared) */

.globe { position: relative; width: 100%; aspect-ratio: 1; touch-action: none; cursor: grab; }
.globe:active { cursor: grabbing; }
.globe canvas { width: 100%; height: 100%; display: block; }
.globe__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: var(--fs-xs); }

/* ---------------------------------------------------------------- Share card (shared) */

.share { display: grid; gap: var(--sp-4); justify-items: center; }
.share > .stack { width: 100%; }
.story {
  position: relative; isolation: isolate; overflow: hidden;
  width: 62cqw; aspect-ratio: 9 / 16;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), 0 0 60px -20px var(--accent);
  display: grid; grid-template-rows: auto 1fr auto;
  padding: var(--sp-4);
  animation: story-in var(--t-slow) var(--ease-spring);
}
@keyframes story-in { from { transform: translateY(20px) rotate(-3deg) scale(0.94); opacity: 0; } }
.story > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.story::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 30%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.92)); }
.story__top { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-2xs); color: var(--text-2); }
.story__top img { height: 2.6cqw; width: auto; }
.story__body { align-self: end; display: grid; gap: var(--sp-1); }
.story__kicker { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-hi); }
.story__big { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.05em; line-height: 0.9; }
.story__big small { font-size: 0.38em; letter-spacing: -0.01em; margin-left: 0.2em; color: var(--text-2); }
.story__line { font-size: var(--fs-xs); color: var(--text-2); line-height: 1.4; }
.story__foot { margin-top: var(--sp-3); padding-top: var(--sp-2); border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: var(--fs-2xs); color: var(--text-2); }
.story__foot span { display: inline-flex; align-items: center; gap: var(--sp-1); }
.story__foot svg { width: 1.3em; height: 1.3em; color: var(--accent-hi); }

/* ---------------------------------------------------------------- Proof of authenticity (shared) */

.prov { display: grid; gap: var(--sp-2); }
.prov__seal { width: 26cqw; margin: var(--sp-2) auto var(--sp-2); filter: drop-shadow(0 0 18px var(--accent)); }
.prov__seal svg { width: 100%; height: auto; overflow: visible; }
.prov__ring { fill: rgba(0, 168, 255, 0.08); stroke: var(--accent-hi); stroke-width: 3; stroke-dasharray: 340; stroke-dashoffset: 340; }
.prov__tick { fill: none; stroke: var(--text); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; }
.sheet.is-open .prov__ring { animation: dash 900ms var(--ease-out) forwards 150ms; }
.sheet.is-open .prov__tick { animation: dash 500ms var(--ease-out) forwards 850ms; }
@keyframes dash { to { stroke-dashoffset: 0; } }
.prov__transfer { display: grid; gap: var(--sp-2); justify-items: start; margin-top: var(--sp-3); }
.prov__code { font-size: var(--fs-lg); letter-spacing: 0.12em; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-sm); background: var(--ink-1); border: 1px dashed var(--blue-line); color: var(--accent-hi); }

/* ---------------------------------------------------------------- Tap to trade (shared) */

.trade { display: grid; gap: var(--sp-4); }
.trade__stage { position: relative; height: 44cqw; display: grid; place-items: center; }
.trade__label {
  position: absolute; top: 50%;
  width: 28cqw; aspect-ratio: 1 / 1.25;
  border-radius: var(--r-sm);
  display: grid; place-items: center; align-content: center; gap: var(--sp-2);
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px), linear-gradient(160deg, #1c1d21, #0b0b0d);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.9);
  transition: transform var(--t-slow) var(--ease-spring);
}
.trade__label svg { width: 7cqw; height: auto; fill: var(--text); }
.trade__label .mono { font-size: var(--fs-2xs); color: var(--text-3); }
.trade__label--a { left: 6%; transform: translateY(-50%) rotate(-8deg); }
.trade__label--b { right: 6%; transform: translateY(-50%) rotate(8deg); }
.trade.is-touching .trade__label--a { transform: translate(38%, -50%) rotate(-2deg); }
.trade.is-touching .trade__label--b { transform: translate(-38%, -50%) rotate(2deg); }
.trade__spark { width: 10cqw; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--accent-hi); opacity: 0; z-index: 2; box-shadow: 0 0 30px 6px var(--accent), inset 0 0 20px var(--accent); }
.trade.is-touching .trade__label { box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--accent), 0 0 40px -6px var(--accent); }
.trade.is-touching .trade__spark { animation: spark 900ms var(--ease-out) 450ms; }
@keyframes spark { 0% { opacity: 0; transform: scale(0.2); } 30% { opacity: 1; transform: scale(1.6); } 100% { opacity: 0; transform: scale(4); } }
.trade__result:empty { display: none; }
.trade__card { display: grid; gap: var(--sp-2); justify-items: center; text-align: center; animation: reveal var(--t-slow) var(--ease-out) both; }

/* ---------------------------------------------------------------- Claim capture: Apple Wallet + email (shared) */

.capture { display: grid; gap: var(--sp-3); }
.wallet-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: max(var(--tap-min), 13cqw); border-radius: var(--r-md);
  background: #000; border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: var(--fs-sm); font-weight: 600; color: #fff;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.wallet-btn svg { width: 6.5cqw; height: auto; }
.wallet-btn.is-added { border-color: var(--success); color: var(--success); }
.capture__email { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-4); border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--glass); }
.capture__email input { flex: 1; min-width: 0; min-height: 40px; background: none; border: 0; color: var(--text); font: inherit; font-size: var(--fs-sm); }
.capture__email input:focus { outline: none; }
.capture__email:focus-within { border-color: var(--accent); }
.capture__email button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #00131f; }
.capture__email button svg { width: 18px; height: 18px; }
.capture__ok { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; font-size: var(--fs-sm); color: var(--success); font-weight: 600; }
.capture__ok svg { width: 18px; height: 18px; }
