/* graphyt voice collection — ink on paper, matching graphyt.in
 *
 * Humant: brand, chrome, buttons, labels.
 * Source Serif 4: the sentences you read aloud (and free-dictation prompts).
 */

:root {
  --paper: #FFFFFF;
  --ink: #111111;
  --ink-muted: #5C5955;
  --statement: #8C8883;
  --hairline: #E4E2DD;
  --rec: #111111;
  --ease: cubic-bezier(.65, 0, .35, 1);
  --display: 'Humant', ui-sans-serif, system-ui, sans-serif;
  --read: 'Source Serif 4', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  background: var(--paper);
}
.screen-read {
  height: 100vh;
  height: 100dvh;
  grid-template-rows: auto 1fr auto;
}
.screen[hidden] { display: none; }
[hidden] { display: none !important; }

/* ── brand ───────────────────────────────────────────────────────────── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 28px;
}
.brand__mark { height: 28px; width: auto; display: block; }
.brand__word {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.035em;
  line-height: 1;
}

/* ── join & done sheets ──────────────────────────────────────────────── */
.sheet {
  place-self: center;
  width: min(440px, calc(100vw - 40px));
  padding: 28px 0 40px;
  margin: 24px 0;
}
h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 8vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 14px;
  text-wrap: balance;
}
.lede {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--ink-muted);
  margin: 0 0 18px;
}
.lede.muted { color: var(--ink-muted); font-size: 0.95rem; }

.how {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 16px 0;
}
.how li {
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
  padding-left: 1.6em;
  position: relative;
}
.how li::before {
  content: counter(how);
  counter-increment: how;
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--ink-muted);
}
.how { counter-reset: how; }
.how b { font-weight: 700; }

.field {
  display: block;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-muted);
  margin-bottom: 14px;
}
.field .opt { font-weight: 500; color: var(--ink-muted); }
.field input, .field select {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px;
  appearance: none;
}
.field select { min-height: 48px; background-image:
  linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
  linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--ink);
}

.inapp-note {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
}
.inapp-note strong { font-weight: 700; }

.consent {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 6px 0 22px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 14px 16px;
}
.consent-head {
  margin: 0;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}
.consent-foot { margin: 0; font-size: 0.78rem; color: var(--ink-muted); }
.tick {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.45;
  cursor: pointer;
}
.tick input {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--ink);
}
.tick b { color: var(--ink); font-weight: 700; }
.hint {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: 14px 0 0;
  text-align: center;
}

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  cursor: pointer;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0 26px;
  min-height: 52px;
  color: var(--ink);
  background: var(--paper);
  transition: background 160ms var(--ease), color 160ms var(--ease), transform 60ms ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn.primary:hover { background: var(--paper); color: var(--ink); }
.btn.primary.big { width: 100%; }
.btn.ghost {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--hairline);
}
.btn.ghost:hover { border-color: var(--ink); }
.btn.record {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1 1 auto;
}
.btn.record .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
}
.btn.stop {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1 1 auto;
  animation: breathe 1.8s var(--ease) infinite;
}
.btn.stop .square {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--ink);
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(17,17,17,.18); }
  50% { box-shadow: 0 0 0 10px rgba(17,17,17,0); }
}
.btn.slim { min-height: 44px; font-size: 0.95rem; padding: 0 20px; justify-self: start; }

.ctrl {
  /* retired — icon-btn replaces the old side arrows */
  display: none;
}

.linkbtn {
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-muted);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px 4px;
}

/* ── recorder chrome ─────────────────────────────────────────────────── */
.top {
  padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 10px;
  border-bottom: 1px solid var(--hairline);
}
.progress-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  gap: 12px;
}
.who {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.count {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.bar {
  height: 2px;
  background: var(--hairline);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width .45s var(--ease);
}
.saving {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-left: auto;
  margin-right: 8px;
}

.stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px var(--gutter) 8px;
  overflow: hidden;
  width: min(100%, 42rem);
  margin: 0 auto;
}
.section-tag {
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 8px;
  flex: 0 0 auto;
  text-align: center;
}

/* ── vertical sentence reel ──────────────────────────────────────────── */
.reel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  position: relative;
}
.reel[hidden] { display: none !important; }
.reel__viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 14%,
    #000 86%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 14%,
    #000 86%,
    transparent 100%
  );
}
.reel__viewport::-webkit-scrollbar { display: none; }
.reel__track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  /* pad so the first/last card can snap to vertical centre */
  padding: 38vh 1.25rem;
  min-height: 100%;
}
.reel__card {
  flex: 0 0 auto;
  width: 100%;
  max-width: 34rem;
  padding: 0.35rem 0.5rem;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  text-align: center;
  transition: opacity 420ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
              filter 420ms cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center center;
}
.reel__card.is-ghost {
  opacity: 0.16;
  transform: scale(0.92);
  filter: blur(0.4px);
  pointer-events: none;
}
.reel__card.is-near {
  opacity: 0.34;
  transform: scale(0.96);
  pointer-events: none;
}
.reel__card.is-current {
  opacity: 1;
  transform: scale(1);
  padding: 0.6rem 0.5rem;
}
.reel__card.is-empty {
  opacity: 0;
  min-height: 3rem;
  pointer-events: none;
}

.reel__lines {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55em;
}
.reel__line {
  font-family: var(--read);
  font-weight: 400;
  font-size: clamp(1.1rem, 3.6vw, 1.45rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: pretty;
  margin: 0;
}
.reel__card.is-current .reel__line {
  font-weight: 600;
  font-size: clamp(1.25rem, 4.2vw, 1.7rem);
  line-height: 1.4;
}
.reel__card.is-near .reel__line,
.reel__card.is-ghost .reel__line {
  font-weight: 400;
}
.reel__meta {
  font-family: var(--display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 8px;
}
.reel__card.is-current .reel__meta { color: var(--ink); }
.reel__card.is-done .reel__meta::after { content: " · done"; }

.wave-wrap {
  display: grid;
  gap: 6px;
  margin: 10px auto 0;
  flex: 0 0 auto;
  width: min(100%, 22rem);
}
.wave {
  width: 100%;
  height: 72px;
  display: block;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}
.timer {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.timer::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: .15; } }

.note {
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  margin: 8px 0 0;
  border-left: 1px solid var(--ink);
  padding-left: 12px;
}

.free-card {
  display: grid;
  gap: 14px;
  flex: 1;
  align-content: center;
  width: min(100%, 34rem);
  margin: 0 auto;
  text-align: center;
}
.free-prompt {
  font-family: var(--read);
  font-weight: 600;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: pretty;
}
.free-note {
  font-family: var(--display);
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 0;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
}
.free-note b { color: var(--ink); font-weight: 700; }

/* ── compact dock (not a full-bleed button bar) ──────────────────────── */
.deck {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 10px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--hairline);
}
.dock {
  width: min(100%, 22rem);
}
.dock__cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.dock__cluster[hidden] { display: none !important; }
.dock__cluster .btn.record,
.dock__cluster .btn.stop {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 11.5rem;
  min-height: 48px;
  font-size: 1rem;
  padding: 0 22px;
}
.dock__cluster--review {
  gap: 12px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--paper);
}

.icon-btn {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; display: block; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn:active { transform: scale(.96); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn--solid {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  width: 56px;
  height: 56px;
}
.icon-btn--solid:hover {
  background: var(--paper);
  color: var(--ink);
}
.icon-btn--solid svg { width: 22px; height: 22px; }

.sub {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  min-height: 20px;
  width: min(100%, 22rem);
}
.keys {
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
@media (max-width: 640px), (pointer: coarse) { .keys { display: none; } }

/* Desktop: a little more air around the reading column */
@media (min-width: 768px) {
  .stage {
    width: min(100%, 38rem);
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .reel__card { max-width: 32rem; }
  .dock { width: min(100%, 20rem); }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn--solid { width: 52px; height: 52px; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 140px;
  transform: translateX(-50%);
  max-width: min(420px, 88vw);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 999px;
  padding: 12px 18px;
  z-index: 40;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reel__track.is-advancing,
  .reel__track.is-retreating { transform: none; }
}
