/* data.hub.xyz on Hub Liquid Glass Night. Redesign spec sections 5 and 6. All styles live here:
   the page CSP is style-src 'self'. Default styles are the still end states; every movement sits in
   the prefers-reduced-motion: no-preference block at the end. */

@font-face {
  font-family: Inter;
  src: url(/fonts/inter-latin.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url(/fonts/jetbrains-mono-500.woff2) format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Hub Liquid Glass tokens, Night values only (the page always renders data-theme="night"). Copied
   from tokens.css (:root plus the [data-theme="night"] block), only the ones this page uses. */
:root {
  color-scheme: dark;
  --page: #0b0d0c;
  --ink: #f3f4f3;
  --ink-soft: #d4d7d5;
  --gray-11: #9ba09d;
  --gray-9: #7b807d;
  --gray-6: #ffffff24;
  --gray-4: #ffffff14;
  --gray-2: #ffffff0a;
  --green: #1ec872;
  --green-light: #5be39b;
  --green-tint: #1ec87233;
  --call-positive: #1ec8721a;
  --green-text: #5be39b;
  --on-green: #06310f;
  --vermilion: #e34234;
  --vermilion-text: #f39184;
  --glass-top: #202422f2;
  --glass-bottom: #141715e6;
  --glass-strong-top: #282d2af7;
  --glass-strong-bottom: #1a1e1cf0;
  --glass-border: #ffffff14;
  --glass-edge: #ffffff33;
  --icon-glass-top: #1ec87242;
  --icon-glass-bottom: #1ec8721f;
  --focus: #1ec87247;
  --shadow-glass: inset 0 1px 0 #ffffff12, 0 12px 32px -14px #000000b3;
  --shadow-icon: inset 0 1px 0 #ffffff14;
  --shadow-primary: 0 6px 14px -6px #0e8a4d73;
  --shadow-primary-hover: 0 8px 18px -6px #0e8a4d8c;
  --r-small: 14px;
  --r-card: 18px;
  --r-pill: 999px;
  --blur-glass: 28px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gl: max(20px, env(safe-area-inset-left));
  --gr: max(20px, env(safe-area-inset-right));
  --dock-h: calc(80px + env(safe-area-inset-bottom));
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Keyboard focus and find-in-page never land behind the fixed dock. */
  scroll-padding-bottom: calc(var(--dock-h) + 16px);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink-soft);
  font: 400 16px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* The dark dot grid (Background), light at rest at 50% across and 30% down. Fixed and static, so
   touch devices never repaint it; it is the only decoration on the page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url(/dot-grid-dark.svg) 50% 0 / 1440px 900px no-repeat;
}
h1, h2, p, dl, dd, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; }
button, input, textarea { font: inherit; color: inherit; }

a {
  color: var(--green-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
/* Headings take focus on each step change (tabindex -1); the move itself is the cue. */
[tabindex="-1"]:focus { outline: none; }

.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  line-height: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- Frame and header ---------- */

.page { padding: 0 var(--gr) 0 var(--gl); }
.page > * { max-width: 560px; margin-inline: auto; }

/* Logo left, step count right. */
.top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px 12px;
  padding-top: max(16px, env(safe-area-inset-top));
}
.logo svg { width: auto; height: 28px; }
#step-of {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--gray-6);
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  letter-spacing: .12em;
}
/* ---------- Steps ---------- */

/* Every step but Done has a fixed dock; the padding keeps the last line above it. */
.step {
  position: relative;
  padding-top: 22px;
  padding-bottom: calc(var(--dock-h) + 28px);
}
.step[data-step="done"] { padding-bottom: max(48px, env(safe-area-inset-bottom)); }

h1 {
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(32px, 9.2vw, 46px);
  line-height: 1.06;
  letter-spacing: -.035em;
  text-wrap: balance;
}
/* The one gradient word on the page (.gt in the system). */
.grad {
  display: inline-block;
  padding: .1em .04em .14em;
  margin: -.1em -.04em -.14em;
  background: linear-gradient(90deg, var(--green-light), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.5;
  text-wrap: pretty;
}
.h2 {
  color: var(--ink);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.hint { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--gray-11); }
.err { margin-top: 8px; font-weight: 500; font-size: 15px; line-height: 1.45; color: var(--vermilion-text); }
.form-err:empty, .ts-slot:empty { display: none; }
.noscript { margin-top: 16px; color: var(--gray-11); }

/* Glass surfaces: smoked glass with the bright edge from GlassSurfaces. */
.opt, .summary, .paused {
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  background: linear-gradient(135deg, var(--glass-top), var(--glass-bottom));
  box-shadow: var(--shadow-glass);
}
.opt::before, .dock::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.2px;
  pointer-events: none;
  background: linear-gradient(135deg, var(--glass-edge), transparent 32%, transparent 55%, var(--glass-edge));
  opacity: .5;
  -webkit-mask: linear-gradient(var(--ink) 0 0) content-box, linear-gradient(var(--ink) 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* ---------- Enter: title, description, pills, button ---------- */

/* The hero block sits centred in the space above the dock, a little above true centre, so a tall
   phone shows no dead band between the pills and the button. */
.step[data-step="enter"] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100svh - 60px);
  padding-top: 24px;
  padding-bottom: calc(var(--dock-h) + 72px);
}
.step[data-step="enter"] h1 { font-size: clamp(38px, 11vw, 58px); }
.step[data-step="enter"] .sub { margin-top: 18px; max-width: 34em; color: var(--ink-soft); }
/* EyebrowPill-style chips: smoked glass, a green dot, the fact in mono. */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
/* Tabular figures only where digits sit: Inter's tnum also widens the hyphen, which spaced out
   every hyphenated word when it was set on body. */
.pill, #step-of { font-variant-numeric: tabular-nums; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px 0 11px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--glass-strong-top), var(--glass-strong-bottom));
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-tint);
}

/* ---------- Select: option cards ---------- */

.opts { display: grid; gap: 10px; margin-top: 20px; }
.opt { scroll-margin: 16px 0 calc(var(--dock-h) + 16px); }
/* The radio only carries the posted value; the head button is the control. */
.opt-radio { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.opt-head {
  display: grid;
  grid-template-columns: 1fr 24px;
  gap: 4px 12px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 16px;
  border: 0;
  border-radius: inherit;
  background: none;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.opt-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.3;
  letter-spacing: -.01em;
}
/* Radio mark: a ring, filled green when selected, so the state never rests on tint alone. */
.opt-label::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--gray-9);
  border-radius: 50%;
}
.opt-blurb { grid-column: 1; padding-left: 26px; font-size: 15px; line-height: 1.45; color: var(--gray-11); }
.opt-chev {
  grid-column: 2;
  grid-row: 1 / 3;
  justify-self: center;
  width: 9px;
  height: 9px;
  border: solid var(--gray-11);
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}
.opt-head[aria-expanded="true"] .opt-chev { border-color: var(--green-text); transform: translateY(2px) rotate(225deg); }
@media (hover: hover) {
  .opt-head:hover .opt-chev { border-color: var(--ink); }
  .opt:hover { border-color: var(--gray-6); }
}

/* Selected (set by the client): Hub green edge and a 10% green wash (call-positive), which keeps
   gray-11 text on it at 5:1. Open is aria-expanded alone. */
.opt.is-selected {
  border-color: var(--green);
  background: linear-gradient(135deg, var(--call-positive), transparent 70%), linear-gradient(135deg, var(--glass-top), var(--glass-bottom));
}
.opt.is-selected::before { opacity: 0; }
.opt.is-selected .opt-label::before {
  border-color: var(--green);
  background: radial-gradient(circle, var(--green) 0 3.5px, transparent 4px);
}

/* Reveal: grid rows 0fr to 1fr. Visibility keeps a closed body out of the tab order and the
   accessibility tree. */
.opt-body { display: grid; grid-template-rows: 0fr; visibility: hidden; }
.opt-head[aria-expanded="true"] + .opt-body { grid-template-rows: 1fr; visibility: visible; }
.opt-inner { min-height: 0; overflow: hidden; opacity: 0; }
.opt-head[aria-expanded="true"] + .opt-body .opt-inner { opacity: 1; }
.opt-inner > * { margin-inline: 16px; }
.opt-inner > :last-child { margin-bottom: 16px; }

.spec { border-top: 1px solid var(--gray-4); }
.spec > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--gray-4);
}
.spec dt { padding-top: 2px; font-size: 11px; color: var(--gray-11); }
.spec dd { font-size: 15px; line-height: 1.45; color: var(--ink-soft); }

/* Preview slot: an instrument frame until real media lands in it (img or video, added later). */
.preview {
  position: relative;
  display: grid;
  place-items: center;
  margin-top: 14px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px dashed var(--gray-6);
  border-radius: 12px;
  background: radial-gradient(var(--gray-6) 1px, transparent 1.5px) 0 0 / 11px 11px, var(--page);
}
.preview-label { position: absolute; top: 9px; left: 11px; z-index: 1; color: var(--gray-11); font-size: 11px; }
/* Sound toggle, bottom right of a preview with audio: a 44 px glass pill with a speaker dot. */
.preview-sound {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--glass-strong-top), var(--glass-strong-bottom));
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.preview-sound::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gray-9); }
.preview-sound[aria-pressed="true"] { border-color: var(--green); color: var(--ink); }
.preview-sound[aria-pressed="true"]::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.preview-empty { padding: 0 16px; font-size: 14px; color: var(--gray-11); text-align: center; }
.preview > img, .preview > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Fields (Custom collection and Details) ---------- */

.field { margin-top: 18px; }
.field label { display: block; margin-bottom: 8px; font: 500 11px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gray-11); }
.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--gray-6);
  border-radius: 12px;
  background: var(--glass-strong-top);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 104px; padding: 12px 14px; resize: vertical; }
.field ::placeholder { color: var(--gray-11); opacity: 1; }
.field input:focus,
.field textarea:focus { outline: 2px solid transparent; outline-offset: 2px; border-color: var(--green); box-shadow: 0 0 0 3px var(--focus); }
/* The transparent outline is invisible normally and becomes the focus ring in forced-colors mode,
   where box-shadow and border colours are dropped. */
.field [aria-invalid="true"] { border-color: var(--vermilion); }
.field [aria-invalid="true"]:focus { border-color: var(--vermilion); }
.field-hint { margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--gray-11); }

/* ---------- Details ---------- */

.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  min-height: 56px;
  padding: 4px 6px 4px 16px;
  border-radius: var(--r-small);
}
.summary-option { color: var(--ink); }
#details-change {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-weight: 500;
  font-size: 14px;
}
.consent { margin-top: 20px; font-size: 14px; line-height: 1.5; color: var(--gray-11); }
/* Inline padding grows the tap target to about 45 px without changing the line box. */
.consent a { padding: 14px 0; }
.ts-slot { margin-top: 16px; }
/* Honeypot: off-screen, never display: none. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Done ---------- */

/* Done mark: an icon box with a check drawn in CSS. */
.step[data-step="done"] > .h2 { position: relative; padding-top: 68px; }
.step[data-step="done"] > .h2::before,
.step[data-step="done"] > .h2::after { content: ""; position: absolute; }
.step[data-step="done"] > .h2::before {
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--icon-glass-top), var(--icon-glass-bottom));
  box-shadow: var(--shadow-icon);
}
.step[data-step="done"] > .h2::after {
  top: 13px;
  left: 19px;
  width: 10px;
  height: 18px;
  border: solid var(--green);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.done-line { margin-top: 12px; font-size: 16px; line-height: 1.5; }
.done-links { display: grid; gap: 10px; margin-top: 28px; }
.done-hub {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 1px solid var(--gray-6);
  border-radius: var(--r-small);
  background: linear-gradient(135deg, var(--glass-strong-top), var(--glass-strong-bottom));
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Kill switch ---------- */

.paused { margin-top: 32px; padding: 20px; font-size: 16px; }

/* ---------- Dock and primary button ---------- */

/* One per step; hidden steps take theirs away. Strong glass, full width, the safe area below. */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 12px var(--gr) calc(12px + env(safe-area-inset-bottom)) var(--gl);
  border-top: 1px solid var(--glass-border);
  background: linear-gradient(135deg, var(--glass-strong-top), var(--glass-strong-bottom));
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(175%);
  backdrop-filter: blur(var(--blur-glass)) saturate(175%);
}
.dock::before { border-radius: 0; opacity: .35; }
.dock .btn { max-width: 560px; margin: 0 auto; }

.btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-small);
  background: linear-gradient(90deg, var(--green-light), var(--green));
  color: var(--on-green);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .btn:hover:not(:disabled) { box-shadow: var(--shadow-primary-hover); }
}
/* Disabled: a flat grey slab, not a faded gradient, so the label keeps AA (ink-soft on gray-6). */
.btn:disabled {
  background: var(--gray-6);
  color: var(--ink-soft);
  box-shadow: none;
  cursor: not-allowed;
}
.btn[aria-disabled="true"] { cursor: progress; }

/* ---------- Wider screens ---------- */

@media (min-width: 640px) {
  .top { padding-top: 28px; }
  .step { padding-top: 36px; }
  .h2 { font-size: 32px; }
  .sub { font-size: 17px; }
}

/* ---------- Motion (spec 6). Nothing below runs under reduced motion. ---------- */

@media (prefers-reduced-motion: no-preference) {
  /* Step change: the incoming step fades in and rises 8 px as it loses hidden; the client adds
     .is-leaving to the outgoing step and hides it on animationend. The move uses top, never
     transform, so the fixed dock is not captured by a transformed ancestor. */
  .step { animation: step-in 180ms var(--ease) both; }
  .step.is-leaving { animation: step-out 180ms ease-in both; pointer-events: none; }

  /* Card expand and chevron. Closing waits for the rows before visibility flips. */
  .opt-body { transition: grid-template-rows 220ms var(--ease), visibility 0s 220ms; }
  .opt-head[aria-expanded="true"] + .opt-body { transition-delay: 0s; }
  .opt-inner { transition: opacity 220ms ease-out; }
  .opt-chev { transition: transform 220ms var(--ease), border-color 220ms ease-out; }
  .opt { transition: border-color 180ms ease-out; }
  .opt-label::before { transition: border-color 180ms ease-out; }

  .btn { transition: transform 120ms ease, box-shadow 150ms ease; }
  .btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
  .field input, .field textarea { transition: border-color 150ms ease, box-shadow 150ms ease; }

  /* Busy: a sweep along the bottom edge while the request is in flight. */
  .btn.is-busy::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 24%;
    height: 2px;
    background: var(--on-green);
    animation: busy 1000ms linear infinite;
  }

  @keyframes step-in { from { opacity: 0; top: 8px; } to { opacity: 1; top: 0; } }
  @keyframes step-out { from { opacity: 1; top: 0; } to { opacity: 0; top: -8px; } }
  @keyframes busy { from { transform: translateX(-100%); } to { transform: translateX(420%); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
