/* Design language borrowed from gallop-landing: IBM Plex, cool slate / zinc,
   mono uppercase labels, thin edges, light + dark via light-dark(). */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-sans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --surface: light-dark(#f5f7fa, #09090b);
  --surface-raised: light-dark(#eaeef3, #18181b);
  --surface-sunken: light-dark(#dde2ea, #27272a);
  --field: light-dark(#ffffff, #0f0f12);

  --ink: light-dark(#0b1220, #f4f4f5);
  --ink-soft: light-dark(#1e293b, #d4d4d8);
  --ink-muted: light-dark(#4b5563, #a1a1aa);
  --ink-faint: light-dark(#7b8494, #71717a);
  --ink-whisper: light-dark(#94a0b3, #52525b);

  --edge: light-dark(rgba(15, 23, 42, 0.1), rgba(63, 63, 70, 0.6));
  --edge-strong: light-dark(#c2c8d1, #3f3f46);

  --red: light-dark(#b91c1c, #f87171);
  --amber: light-dark(#b45309, #fbbf24);
  --blue: light-dark(#0284c7, #3b9ac9);
  --red-tint: color-mix(in srgb, var(--red) 12%, transparent);
  --amber-tint: color-mix(in srgb, var(--amber) 22%, transparent);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--surface);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}
::selection { background: var(--red); color: #fff; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: .85em; color: var(--red); background: var(--red-tint); padding: .05em .35em; border-radius: 4px; }
a { color: var(--blue); }

/* ---------- compose ---------- */
.page { max-width: 640px; margin: 0 auto; padding: 28px 20px 64px; }
.brand { font: 12px var(--mono); letter-spacing: .12em; color: var(--ink-faint); display: flex; align-items: center; }
.brand .steak { margin-right: 8px; }
.brand .tld { color: var(--red); }
.hero {
  font-weight: 600; font-size: clamp(38px, 7.5vw, 58px); line-height: 1.08; letter-spacing: -.015em;
  margin: 56px 0 18px; animation: rise .8s ease-out both;
}
.hero em, .big em { font-style: normal; color: var(--red); }
.lede { font-size: 18px; color: var(--ink-muted); margin: 0 0 36px; max-width: 34em; animation: rise .8s .15s ease-out both; }
.lede em { font-style: normal; color: var(--ink); font-weight: 600; }

.card {
  background: color-mix(in srgb, var(--surface-raised) 50%, transparent);
  border: 1px solid var(--edge-strong); border-radius: 10px; padding: 24px;
}
.form { display: grid; gap: 22px; animation: rise .8s .3s ease-out both; }
.lbl { display: block; margin-bottom: 8px; font: 11.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.opt { color: var(--ink-whisper); margin-left: 6px; }
textarea, input[type=text] {
  width: 100%; border: 1px solid var(--edge-strong); border-radius: 8px; background: var(--field);
  font: 15px/1.5 var(--sans); color: var(--ink); padding: 10px 12px; resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
textarea::placeholder, input::placeholder { color: var(--ink-whisper); }
#a { font-family: var(--mono); font-size: 13px; }
textarea:focus, input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.hint { display: block; font-size: 13px; color: var(--ink-faint); margin-top: 6px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.seg label {
  display: inline-flex; align-items: center; border: 1px solid var(--edge-strong); border-radius: 999px;
  padding: 6px 14px; font: 12.5px var(--mono); letter-spacing: .04em; color: var(--ink-muted);
  cursor: pointer; transition: all .15s;
}
.seg label:hover { border-color: var(--ink-faint); color: var(--ink); }
.seg label:has(input:checked) { border-color: color-mix(in srgb, var(--red) 60%, transparent); color: var(--red); background: var(--red-tint); }
.seg label:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--red-tint); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

.btn {
  appearance: none; justify-self: start; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--red) 45%, transparent); border-radius: 999px;
  background: var(--red-tint); color: var(--red);
  font: 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 10px 22px;
  transition: all .15s;
}
.btn:hover { background: var(--red); border-color: var(--red); color: var(--surface); }
.btn:active { transform: scale(.98); }
.btn.small { padding: 9px 16px; }
.fine { font-size: 13px; color: var(--ink-faint); margin: 0; }
.result { margin-top: 16px; animation: rise .35s ease-out; }
.linkrow { display: flex; gap: 8px; align-items: center; }
.linkrow input { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); }
.actions { margin-top: 14px; gap: 20px; }
.ghost {
  background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none;
  font: 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted);
  transition: color .15s;
}
.ghost:hover { color: var(--red); }
.foot { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--edge); font-size: 13px; color: var(--ink-faint); }

/* ---------- replay ---------- */
.stage { position: relative; min-height: 100dvh; overflow: hidden; }
.skip {
  position: fixed; top: 16px; right: 16px; z-index: 5; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(6px);
  border: 1px solid var(--edge-strong); border-radius: 999px; padding: 5px 14px;
  font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted);
}
.skip:hover { color: var(--ink); }
.scene {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 20px 40px; opacity: 0; pointer-events: none; transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.scene.on { opacity: 1; pointer-events: auto; transform: none; }
.caption { margin: 0 0 18px; text-align: center; font: 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.caption.sub { margin: 18px 0 0; }
.caption.sub #secs { color: var(--red); }

.bubble.raw, .chat, .human-box {
  width: min(580px, 100%);
  background: var(--field); border: 1px solid var(--edge-strong); border-radius: 10px;
}
.bubble.raw {
  max-height: 58dvh; overflow: hidden; position: relative; padding: 18px 20px;
  font: 13px/1.65 var(--mono); color: var(--ink-soft); white-space: pre-wrap; word-break: break-word;
}
.bubble.raw::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 60px;
  background: linear-gradient(transparent, var(--field)); pointer-events: none;
}
.md { color: var(--red); background: var(--red-tint); border-radius: 3px; }
.tell { background: linear-gradient(transparent 58%, var(--amber-tint) 58%); }
.hl .md { animation: pop .5s ease both; }

.chat { height: min(62dvh, 520px); display: flex; flex-direction: column; overflow: hidden; }
.chat-top { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--edge); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-sunken); }
.chat-title { margin-left: 8px; font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.chat-body { flex: 1; overflow: hidden; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { border-radius: 10px; padding: 9px 14px; font-size: 14px; }
.msg.user { align-self: flex-end; background: var(--surface-raised); color: var(--ink); max-width: 80%; }
.msg.bot { font: 12.5px/1.65 var(--mono); color: var(--ink-soft); white-space: pre-wrap; word-break: break-word; padding: 4px 2px; transition: color .8s; }
.msg.bot.grey { color: var(--ink-whisper); }
.msg.bot.grey .md, .msg.bot.grey .tell { background: none; color: inherit; }
.chat-input {
  margin: 10px; border: 1px solid var(--edge-strong); border-radius: 8px; padding: 10px 12px;
  font-size: 14px; min-height: 42px; display: flex; align-items: center; position: relative;
}
.chat-input .send {
  position: absolute; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: var(--surface); display: grid; place-items: center; font-size: 13px;
}
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--ink); margin-left: 1px; animation: blink 1s steps(1) infinite; vertical-align: text-bottom; }
.caret.dark { background: var(--red); }

.human { width: min(580px, 100%); }
.who { font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.human-box {
  margin-top: 10px; border-color: color-mix(in srgb, var(--red) 55%, transparent);
  box-shadow: 0 0 0 4px var(--red-tint);
  padding: 22px; font-size: clamp(22px, 4vw, 30px); line-height: 1.3; min-height: 92px;
}

.end { text-align: center; }
.big { font-weight: 600; font-size: clamp(34px, 7vw, 64px); line-height: 1.1; letter-spacing: -.015em; margin: 0 0 24px; }
.why { max-width: 32em; font-size: 18px; color: var(--ink-muted); margin: 0 auto; }
.why em { font-style: normal; color: var(--ink); font-weight: 600; }
.sig { font: 13px var(--mono); letter-spacing: .06em; color: var(--ink-faint); margin: 22px 0 0; }
.end-actions { display: flex; gap: 26px; justify-content: center; margin-top: 36px; }
.meta { position: absolute; bottom: 18px; left: 0; right: 0; font: 11px var(--mono); letter-spacing: .06em; color: var(--ink-whisper); }

@keyframes blink { 50% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes pop { 0% { background: transparent; } 40% { background: color-mix(in srgb, var(--red) 30%, transparent); } 100% { background: var(--red-tint); } }

@media (prefers-reduced-motion: reduce) {
  .scene { transition: none; }
  .hero, .lede, .form { animation: none; }
}

/* dictionary entry: printed-dictionary column, set in the site's Plex type */
.entry { margin: 30px 0 26px; animation: rise .8s .1s ease-out both; }
.guide {
  display: flex; justify-content: space-between; padding-bottom: 6px; margin-bottom: 12px;
  border-bottom: 1px solid var(--edge-strong);
  font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
}
.e {
  margin: 0; padding-left: 1.4em; text-indent: -1.4em;   /* hanging indent */
  font-size: 15px; line-height: 1.55; color: var(--ink-soft);
  hyphens: auto; -webkit-hyphens: auto;
}
.hw { font-weight: 600; font-size: 19px; color: var(--ink); letter-spacing: .005em; }
.pron { font: 13px var(--mono); color: var(--ink-faint); margin: 0 2px; }
.pos { font-style: italic; color: var(--red); }
.infl { color: var(--ink-muted); }
.infl b, .run b { font-weight: 600; color: var(--ink); }
.sn { font: 600 13px var(--mono); color: var(--ink); margin: 0 2px 0 4px; }
.e code { background: none; padding: 0; font-size: 13px; }
.run, .ety { display: inline; }
.run { color: var(--ink-muted); }
.ex { color: var(--ink-muted); }
.ety { color: var(--ink-muted); }
.ety::before { content: ""; display: block; height: 6px; }
.sc { font: 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin-right: 4px; }
.entry::after { content: ""; display: block; margin-top: 14px; border-bottom: 1px solid var(--edge); }
@media (min-width: 560px) { .e { text-align: justify; } }
.say {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin: 0 4px 0 -2px; padding: 0;
  vertical-align: -5px; text-indent: 0; cursor: pointer;
  background: none; border: 1px solid var(--edge-strong); border-radius: 50%; color: var(--ink-muted);
  transition: color .15s, border-color .15s, background .15s;
}
.say:hover, .say.playing { color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, transparent); background: var(--red-tint); }
.say.playing .w1 { animation: wave .6s ease-in-out infinite alternate; }
.say.playing .w2 { animation: wave .6s .15s ease-in-out infinite alternate; }
@keyframes wave { from { opacity: .25; } to { opacity: 1; } }
.e code, .e b, .e .ex, .ety i { hyphens: manual; -webkit-hyphens: manual; white-space: nowrap; }
.e .ex { white-space: normal; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }

/* link-length meter */
.meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; font: 11.5px var(--mono); color: var(--ink-faint); }
.meter .bar { flex: 0 0 90px; height: 4px; border-radius: 2px; background: var(--surface-sunken); overflow: hidden; }
.meter .bar i { display: block; height: 100%; width: 0; background: var(--ink-faint); transition: width .2s; }
.meter.over { color: var(--red); }
.meter.over .bar i { background: var(--red); }
.submit-row { display: flex; align-items: center; gap: 20px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: var(--red-tint); color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }

/* "make it personal" disclosure */
.more { border-top: 1px solid var(--edge); padding-top: 16px; }
.more summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.more summary::-webkit-details-marker { display: none; }
.more summary .lbl { margin: 0; color: var(--ink); }
.more summary .lbl::before { content: "+"; display: inline-block; width: 1.1em; color: var(--red); }
.more[open] summary .lbl::before { content: "−"; }
.more .sum { font: 12px var(--mono); color: var(--ink-faint); }
.more[open] .sum { display: none; }
.more-body { display: grid; gap: 22px; margin-top: 18px; }

/* nudge picker */
.nudge {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--edge-strong); border-radius: 8px; background: var(--field); padding: 8px 8px 8px 14px;
}
.nudge-text { font-size: 15px; color: var(--ink); }
.nudge-btn {
  flex: none; cursor: pointer; border: 1px solid var(--edge-strong); border-radius: 999px; background: none;
  padding: 5px 12px; font: 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted);
  transition: all .15s;
}
.nudge-btn:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, transparent); background: var(--red-tint); }
