/* Hello World. — system font stack throughout: a hundred languages in their
   own scripts need the OS's font fallback chain, which no webfont replaces. */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #16151a;
  --ink-soft: #55525e;
  --ink-faint: #8e8a98;
  --line: #e6e1da;
  --accent: #1f6f5c;
  --accent-ink: #ffffff;
  --locked: #b9b4ae;
  --radius: 14px;
  --maxw: 760px;
  --chrome-h: 56px;
  --np-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          "Noto Sans", "Noto Sans CJK SC", "Noto Sans Devanagari",
          "Noto Sans Arabic", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111013;
    --surface: #1a181d;
    --ink: #f3f0ea;
    --ink-soft: #b4afbb;
    --ink-faint: #7d7887;
    --line: #2c2931;
    --accent: #4fd1a5;
    --accent-ink: #0d2b22;
    --locked: #45414c;
  }
}
:root[data-theme="dark"] {
  --bg: #111013; --surface: #1a181d; --ink: #f3f0ea; --ink-soft: #b4afbb;
  --ink-faint: #7d7887; --line: #2c2931; --accent: #4fd1a5;
  --accent-ink: #0d2b22; --locked: #45414c;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--np-h) + env(safe-area-inset-bottom, 0px));
}

a { color: inherit; }

/* ---------- chrome ---------- */

.chrome {
  position: sticky; top: 0; z-index: 40;
  height: var(--chrome-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-weight: 700; font-size: 20px; letter-spacing: 0;
  text-decoration: none; white-space: nowrap;
}
/* ōWō is a face exactly as the name is spelled: the lowercase o's are eyes,
   the macrons are brows, the capital W is the mouth. Colour is the only thing
   doing any work. Do not resize, shift or respace these letters. */
.face { color: var(--accent); }

.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;
}

.chrome-nav { display: flex; align-items: center; gap: 4px; }
.chrome-nav a, .ghost {
  font: inherit; font-size: 15px;
  color: var(--ink-soft); text-decoration: none;
  padding: 7px 11px; border-radius: 9px;
  background: none; border: 0; cursor: pointer;
}
.chrome-nav a:hover, .ghost:hover { background: var(--line); color: var(--ink); }

/* ---------- layout ---------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 21px; letter-spacing: -0.01em; margin: 32px 0 12px; }
.lede { color: var(--ink-soft); margin: 0 0 28px; font-size: 18px; }

.primary {
  font: inherit; font-weight: 560;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 11px; padding: 12px 20px; cursor: pointer;
}
.primary:disabled { opacity: .5; cursor: default; }

.secondary {
  font: inherit; background: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 19px; cursor: pointer;
}

/* ---------- the profile screen: shown while someone speaks ---------- */

.stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: min(68vh, 560px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 28px;
  color: #fff;
  background: #333;
  margin-bottom: 8px;
}
.stage::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.12) 55%, rgba(0,0,0,.28));
}
.stage > * { position: relative; z-index: 1; }
.stage-portrait {
  width: 76px; height: 76px; border-radius: 50%;
  object-fit: cover; border: 2px solid rgba(255,255,255,.75);
  margin-bottom: 14px;
}
.stage-name { font-size: 30px; font-weight: 620; letter-spacing: -0.02em; }
.stage-native { font-size: 23px; opacity: .95; margin-top: 2px; }
.stage-where { font-size: 15px; opacity: .8; margin-top: 8px; }
.stage-line { font-size: 16px; opacity: .92; margin-top: 12px; max-width: 46ch; }

/* ---------- replies ---------- */

.replies { margin-top: 20px; }

.replies-head {
  display: flex; align-items: baseline; gap: 10px;
  color: var(--ink-faint); font-size: 14px;
  margin-bottom: 10px;
}

.reply-list { border-left: 2px solid var(--line); margin-left: 10px; padding-left: 16px; }

.reply {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font: inherit; color: var(--ink);
  cursor: pointer;
}
.reply:disabled { cursor: default; }

/* Locked replies are visibly present and deliberately unexplained.
   Finishing the recording is what opens them. */
.reply[data-locked="true"] {
  color: var(--locked);
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  filter: saturate(.25);
}
.reply[data-locked="true"] .reply-av { opacity: .35; }

.reply-av {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto; background: var(--line);
}
.reply-who { flex: 1 1 auto; min-width: 0; }
.reply-name { font-size: 15px; font-weight: 520; }
.reply-sub { font-size: 13px; color: var(--ink-faint); }
.reply[data-locked="true"] .reply-sub { color: inherit; }
.reply-len { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink-faint); flex: 0 0 auto; }
.reply[data-locked="true"] .reply-len { color: inherit; }

/* ---------- directory ---------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  font: inherit; font-size: 15px; background: none; border: 0;
  color: var(--ink-faint); padding: 10px 13px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.card {
  display: block; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 15px 16px; margin-bottom: 9px;
  font: inherit; color: var(--ink); cursor: pointer; text-decoration: none;
}
.card:hover { border-color: var(--ink-faint); }
.card-title { font-size: 17px; font-weight: 560; }
.card-sub { font-size: 14px; color: var(--ink-faint); margin-top: 3px; }

.empty {
  border: 1px dashed var(--line); border-radius: 12px;
  padding: 30px 20px; text-align: center; color: var(--ink-faint);
}

/* ---------- now playing ---------- */

/* [hidden] loses to display:flex, so say it explicitly or the bar shows with
   nothing playing. */
.np[hidden] { display: none; }

.np {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--np-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 14px env(safe-area-inset-bottom, 0px);
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.np-toggle {
  width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  position: relative;
}
/* No transport at all until a recording has been heard through. */
.np-toggle[data-locked="true"] { opacity: .35; cursor: default; }
.np-toggle::before {
  content: ""; position: absolute; inset: 0;
  background: currentColor;
  -webkit-mask: var(--icon) center / 15px 15px no-repeat;
  mask: var(--icon) center / 15px 15px no-repeat;
  --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M3 1.8v12.4L14 8z"/></svg>');
}
.np-toggle[data-state="playing"]::before {
  --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M3 1.5h3.6v13H3zM9.4 1.5H13v13H9.4z"/></svg>');
}
.np-meta { flex: 1 1 auto; min-width: 0; }
.np-title { font-size: 14px; font-weight: 540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-progress {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--line);
}
.np-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.np-skip {
  font: inherit; font-size: 14px; background: none; border: 1px solid var(--line);
  color: var(--ink-soft); border-radius: 9px; padding: 7px 12px; cursor: pointer;
  flex: 0 0 auto;
}

/* ---------- age gate ---------- */

.gate { border: 0; border-radius: 16px; padding: 0; max-width: 420px; width: calc(100% - 32px);
        background: var(--surface); color: var(--ink); }
.gate::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.gate-inner { padding: 26px; margin: 0; }
.gate-inner h2 { margin: 0 0 8px; font-size: 22px; }
.gate-inner p { margin: 0 0 18px; color: var(--ink-soft); font-size: 15px; }
.dob { display: flex; gap: 9px; }
.dob label { flex: 1 1 0; font-size: 12px; color: var(--ink-faint); display: flex; flex-direction: column; gap: 5px; }
.dob select {
  font: inherit; font-size: 16px; padding: 11px 9px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink);
}
.gate-err { color: #c0392b; font-size: 14px; margin-top: 14px !important; }
.gate-inner menu { padding: 0; margin: 20px 0 0; display: flex; justify-content: flex-end; }

/* ---------- recorder ---------- */

.rec-wrap { text-align: center; padding: 26px 0; }
.rec-btn {
  width: 92px; height: 92px; border-radius: 50%;
  border: 0; cursor: pointer; background: #c0392b; color: #fff;
  font: inherit; font-size: 15px; font-weight: 560;
}
.rec-btn[data-state="recording"] { background: #16151a; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.rec-time { font-variant-numeric: tabular-nums; font-size: 34px; margin: 18px 0 6px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field label { font-size: 13px; color: var(--ink-faint); }
.field input, .field select, .field textarea {
  font: inherit; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink);
}

.notice { border: 1px solid var(--line); background: var(--surface);
          border-radius: 12px; padding: 16px; font-size: 15px; color: var(--ink-soft); }

@media (min-width: 900px) {
  :root { --maxw: 820px; }
}

/* ---------- threaded replies: branches open in place ---------- */

.stage-actions { display: flex; gap: 9px; margin: 14px 0 6px; flex-wrap: wrap; }
.stage-actions .secondary[disabled] { opacity: .4; cursor: default; }

.node { position: relative; }
.node .reply-list {
  border-left: 2px solid var(--line);
  margin-left: 14px;
  padding-left: 14px;
  margin-top: 2px;
}
.node-actions { margin: -4px 0 10px 50px; }
.mini {
  font: inherit; font-size: 13px;
  background: none; border: 1px solid var(--line); color: var(--ink-soft);
  border-radius: 8px; padding: 4px 10px; cursor: pointer;
}
.mini:hover:not([disabled]) { border-color: var(--ink-faint); color: var(--ink); }
.mini[disabled] { opacity: .35; cursor: default; }

/* A locked branch shows that it exists and stops there. */
.node[data-depth="locked"] .node-actions { display: none; }

/* ---------- the shirt ---------- */
/* A product shot, so the garment panel keeps its own colour in either theme. */
.shirt-art {
  background: #f2efe9;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11% 9%;
  margin-bottom: 24px;
  display: flex; align-items: center; justify-content: center;
}
.shirt-art img { width: 100%; height: auto; display: block; }
