/* Just Pick: calm and certain. See .impeccable.md for the design context. */

@font-face {
  font-family: "Young Serif";
  src: url("/fonts/young-serif-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Young Serif";
  src: url("/fonts/young-serif-latin-ext-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk-latin-wght.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk-latin-ext-wght.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Brygada 1918";
  src: url("/fonts/brygada-1918-cyrillic-wght.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  src: url("/fonts/golos-text-cyrillic-wght.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  color-scheme: light dark;

  --font-display: "Young Serif", "Brygada 1918", "Iowan Old Style", Georgia, serif;
  --font-ui: "Hanken Grotesk", "Golos Text", ui-sans-serif, system-ui, sans-serif;

  /* Warm paper, ink, and one vermilion pen. Neutrals lean toward the pen hue. */
  --paper: oklch(0.972 0.009 70);
  --paper-2: oklch(0.944 0.012 65);
  --ink: oklch(0.255 0.02 45);
  --ink-2: oklch(0.45 0.02 50);
  --ink-3: oklch(0.6 0.016 55);
  --rule: oklch(0.885 0.012 60);
  --rule-strong: oklch(0.8 0.014 58);
  --pen: oklch(0.555 0.17 36);
  --pen-hover: oklch(0.505 0.165 36);
  --on-pen: oklch(0.985 0.006 70);
  --grain-opacity: 0.045;

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);

  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* CJK falls back to system faces; the Latin fonts never carry these scripts. */
:root:lang(zh) {
  --font-display: "Young Serif", "Brygada 1918", "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --font-ui: "Hanken Grotesk", "Golos Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}
:root:lang(ja) {
  --font-display: "Young Serif", "Brygada 1918", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", Georgia, serif;
  --font-ui: "Hanken Grotesk", "Golos Text", "Hiragino Sans", "Noto Sans CJK JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(0.205 0.012 50);
    --paper-2: oklch(0.25 0.014 50);
    --ink: oklch(0.935 0.012 72);
    --ink-2: oklch(0.77 0.016 66);
    --ink-3: oklch(0.6 0.016 60);
    --rule: oklch(0.32 0.014 52);
    --rule-strong: oklch(0.42 0.016 54);
    --pen: oklch(0.73 0.145 42);
    --pen-hover: oklch(0.78 0.13 44);
    --on-pen: oklch(0.2 0.02 40);
    --grain-opacity: 0.07;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--font-ui);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Paper grain: a fixed, very quiet noise layer. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.4  0 0 0 0 0.3  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) {
  body::before {
    mix-blend-mode: screen;
  }
}

::selection {
  background: color-mix(in oklch, var(--pen) 22%, transparent);
}

:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-color: var(--pen);
}

/* Language picker: a quiet pill matching .chip. */
.lang {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.lang select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 2.25rem;
  padding: 0 2rem 0 0.875rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  color: var(--ink-2);
  font: 500 0.875rem/1 var(--font-ui);
  cursor: pointer;
  transition: color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.lang::after {
  content: "";
  position: absolute;
  right: 0.95rem;
  top: 50%;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  color: var(--ink-2);
  pointer-events: none;
}
.lang:hover select {
  color: var(--ink);
  background: var(--paper-2);
}
.lang select:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ page */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: [full-start] var(--gutter) [main-start] minmax(0, 1fr) [main-end] var(--gutter) [full-end];
  grid-template-rows: auto 1fr auto auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.masthead,
main,
.margin-note,
.colophon {
  grid-column: main;
}

.masthead {
  padding-block: var(--space-lg) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

main {
  padding-block: clamp(2.5rem, 9vh, 6.5rem) var(--space-2xl);
  max-width: 38rem;
  width: 100%;
}

.colophon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--space-lg);
  padding-block: var(--space-lg) var(--space-xl);
  color: var(--ink-3);
  font-size: 0.875rem;
}
.colophon p {
  margin: 0;
}

.margin-note {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34ch;
  padding-block: var(--space-md) var(--space-sm);
  border-top: 1px solid var(--rule);
}
.margin-note h2 {
  margin: 0 0 var(--space-xs);
  font: 400 1.125rem/1.3 var(--font-display);
  color: var(--ink);
}
.margin-note p {
  margin: 0 0 var(--space-xs);
}
.margin-note .cite {
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.margin-note cite {
  font-style: italic;
}

/* The study note belongs with the question on phones; elsewhere it's noise. */
.page:not([data-screen="ask"]) .margin-note {
  display: none;
}

@media (min-width: 64rem) {
  .page {
    grid-template-columns:
      [full-start] minmax(var(--gutter), 1fr)
      [main-start] minmax(0, 38rem)
      [main-end] minmax(3rem, 7rem)
      [note-start] 15rem
      [note-end] minmax(var(--gutter), 1fr)
      [full-end];
    grid-template-rows: auto 1fr auto;
  }
  .masthead {
    grid-column: main-start / note-end;
    padding-top: var(--space-xl);
  }
  main {
    grid-column: main;
    grid-row: 2;
    padding-top: clamp(4rem, 14vh, 9rem);
  }
  .margin-note {
    grid-column: note;
    grid-row: 2;
    align-self: end;
    margin-bottom: var(--space-3xl);
  }
  .page:not([data-screen="ask"]):not([data-screen="care"]) .margin-note {
    display: block;
    opacity: 0.7;
  }
  .colophon {
    grid-column: main-start / note-end;
  }
}

/* ------------------------------------------------------------------ wordmark */

.wordmark {
  font: 400 1.375rem/1 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  padding: var(--space-xs) var(--space-2xs);
  margin-left: calc(var(--space-2xs) * -1);
}
.wordmark-pick {
  position: relative;
  display: inline-block;
  margin-left: 0.45em;
}

/* ------------------------------------------------------------------ type */

.prompt {
  margin: 0;
  font: 400 clamp(2.25rem, 1.55rem + 3.2vw, 3.5rem) / 1.06 var(--font-display);
  letter-spacing: -0.015em;
  text-wrap: balance;
  outline: none;
}

.verdict {
  margin: var(--space-xs) 0 0;
  font: 400 clamp(2.75rem, 1.6rem + 5vw, 4.75rem) / 1.02 var(--font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  outline: none;
}

/* Cyrillic and CJK display text: a sturdier weight, with no faux bold on Young Serif. */
:root:lang(ru) .prompt,
:root:lang(ru) .verdict,
:root:lang(ru) .echo,
:root:lang(ru) .answer,
:root:lang(ru) .gut-title,
:root:lang(ru) .settled-title,
:root:lang(ru) .margin-note h2,
:root:lang(zh) .prompt,
:root:lang(zh) .verdict,
:root:lang(zh) .echo,
:root:lang(zh) .answer,
:root:lang(zh) .gut-title,
:root:lang(zh) .settled-title,
:root:lang(zh) .margin-note h2,
:root:lang(ja) .prompt,
:root:lang(ja) .verdict,
:root:lang(ja) .echo,
:root:lang(ja) .answer,
:root:lang(ja) .gut-title,
:root:lang(ja) .settled-title,
:root:lang(ja) .margin-note h2 {
  font-weight: 600;
  font-synthesis: none;
}

/* CJK: no tracking, tighter leading. Japanese also keeps phrases together. */
:root:lang(zh) .prompt,
:root:lang(zh) .verdict,
:root:lang(ja) .prompt,
:root:lang(ja) .verdict {
  letter-spacing: 0;
  line-height: 1.25;
}
:root:lang(ja) {
  word-break: keep-all;
  line-break: strict;
}

.eyebrow + .prompt,
.eyebrow + .verdict {
  margin-top: var(--space-sm);
}

/* Translation is applied before first paint; hide the page until the text is in place. */
.translating .page {
  visibility: hidden;
}

.eyebrow {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--ink-2);
  outline: none;
}

.lede {
  margin: var(--space-md) 0 0;
  font-size: 1.125rem;
  color: var(--ink-2);
  max-width: 40ch;
}

/* ------------------------------------------------------------------ controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 3.25rem;
  padding: 0 1.75rem;
  border: 0;
  border-radius: 999px;
  font: 600 1.0625rem/1 var(--font-ui);
  letter-spacing: -0.005em;
  transition:
    transform 160ms var(--ease-out),
    background-color 200ms var(--ease-out),
    color 200ms var(--ease-out),
    border-color 200ms var(--ease-out),
    box-shadow 200ms var(--ease-out);
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-pen {
  background: var(--pen);
  color: var(--on-pen);
  box-shadow:
    inset 0 -1px 0 color-mix(in oklch, var(--pen), black 18%),
    0 10px 24px -14px color-mix(in oklch, var(--pen), transparent 20%);
}
.btn-pen:hover:not(:disabled) {
  background: var(--pen-hover);
}
.btn-pen:disabled {
  background: var(--paper-2);
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--rule);
  cursor: default;
}

.btn-quiet {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  font-weight: 500;
}
.btn-quiet:hover {
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--ink-3);
}

.btn-text {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: color 160ms var(--ease-out), text-decoration-color 160ms var(--ease-out);
}
.btn-text:hover {
  color: var(--ink);
  text-decoration-color: var(--pen);
}
.btn-small {
  font-size: 0.9375rem;
}
.btn-compact {
  min-height: 2.75rem;
  padding: 0 1.25rem;
  font-size: 1rem;
}
/* A text button inside a sentence: no line-box growth, a generous hit area. */
.btn-inline {
  display: inline;
  min-height: 0;
  padding: 0.6rem 0.2rem;
  margin: -0.6rem 0;
  color: var(--ink);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-xl);
}

.hint {
  color: var(--ink-3);
  font-size: 0.875rem;
}
@media (hover: none) {
  .hint {
    display: none;
  }
}

.notice {
  margin: var(--space-lg) 0 0;
  padding: var(--space-sm) var(--space-md);
  border-radius: 12px;
  background: color-mix(in oklch, var(--pen) 9%, var(--paper));
  color: var(--ink);
  font-size: 0.9375rem;
  max-width: 44ch;
}

/* ------------------------------------------------------------------ ask */

.ask {
  margin-top: var(--space-xl);
}

.ask textarea,
.option-fields input {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--pen);
  outline: none;
  box-shadow: inset 0 -1px 0 var(--rule-strong);
  transition: box-shadow 200ms var(--ease-out);
}
.ask textarea {
  font: 400 1.375rem/1.45 var(--font-ui);
  letter-spacing: -0.005em;
  padding: var(--space-xs) 0 var(--space-md);
  min-height: calc(1.45em * 3 + 1.5rem);
  max-height: 55vh;
  resize: none;
  overflow-y: auto;
}
.ask textarea::placeholder,
.option-fields input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}
.ask textarea:focus,
.option-fields input:focus {
  box-shadow: inset 0 -2px 0 var(--pen);
}

.ask-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-md);
  min-height: 2.25rem;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
  color: var(--ink-3);
  font-size: 0.875rem;
}
.examples > span {
  margin-right: var(--space-2xs);
}

.chip {
  position: relative;
  min-height: 2.25rem;
  padding: 0 0.875rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.chip::after {
  content: "";
  position: absolute;
  inset: -4px;
}
.chip:hover {
  color: var(--ink);
  background: var(--paper-2);
}

.counter {
  flex: none;
  font-size: 0.875rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.counter[data-low] {
  color: var(--pen);
}

/* ------------------------------------------------------------------ thinking */

.echo {
  margin: var(--space-lg) 0 0;
  font: 400 clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem) / 1.35 var(--font-display);
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.scribble {
  display: block;
  width: min(100%, 20rem);
  height: 28px;
  margin-top: var(--space-lg);
  overflow: visible;
}
.scribble path {
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: scribble 1.8s var(--ease-out) infinite;
}
@keyframes scribble {
  0% {
    stroke-dashoffset: 1;
    opacity: 1;
  }
  70% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}

/* ------------------------------------------------------------------ options */

.option-fields {
  list-style: none;
  margin: var(--space-xl) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-md);
}
.option-fields li {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  align-items: baseline;
}
.option-fields .num {
  font: 400 1.125rem/1 var(--font-display);
  color: var(--ink-3);
}
.option-fields input {
  font: 500 1.25rem/1.4 var(--font-ui);
  padding: var(--space-xs) 0 var(--space-sm);
}

/* ------------------------------------------------------------------ clarify */

.answers {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}
.answer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: 100%;
  min-height: 4rem;
  padding: var(--space-sm) var(--space-lg);
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  color: var(--ink);
  text-align: left;
  font: 400 1.375rem/1.2 var(--font-display);
  transition: background-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out), transform 160ms var(--ease-out);
}
.answer::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-top: 1.5px solid var(--ink-3);
  border-right: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
  transition: border-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.answer:hover {
  background: var(--paper-2);
  box-shadow: inset 0 0 0 1px var(--ink-3);
}
.answer:hover::after {
  border-color: var(--pen);
  transform: translateX(3px) rotate(45deg);
}
.answer:active {
  transform: scale(0.99);
}

.clarify-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* ------------------------------------------------------------------ verdict */

.choices {
  list-style: none;
  margin: var(--space-xl) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-lg);
  justify-items: start;
}
.choices li {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 500;
  color: var(--ink-3);
  padding-left: 0.9rem;
  transition: color 300ms var(--ease-out);
}
.choices li[data-picked] {
  color: var(--ink);
  font-weight: 650;
}
.choice {
  position: relative;
  display: inline-block;
}
.pen-mark {
  position: absolute;
  pointer-events: none;
  overflow: visible;
}
.shared-said {
  margin-top: var(--space-2xl);
}

.pen-mark path {
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wordmark .pen-mark path {
  stroke-width: 1.6;
}

.why {
  margin: var(--space-xl) 0 0;
  font-size: 1.125rem;
  line-height: 1.55;
  max-width: 40ch;
}

.aside {
  margin: var(--space-sm) 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  max-width: 44ch;
}

.gut,
.settled {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--rule);
}
.gut-title,
.settled-title {
  margin: 0;
  font: 400 1.5rem/1.2 var(--font-display);
  letter-spacing: -0.01em;
}
.gut-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}
.gut-buttons .btn {
  min-width: 9.5rem;
}
.settled .actions {
  margin-top: var(--space-lg);
}

.edit {
  margin: var(--space-xl) 0 0;
}

/* The pick's share of the weighing: two slim segments, no numbers. */
.split {
  display: flex;
  gap: 3px;
  width: min(100%, 11rem);
  height: 4px;
  margin-top: var(--space-sm);
}
.split-pick {
  width: calc(var(--share, 0.5) * 100%);
  border-radius: 2px;
  background: var(--pen);
  transform-origin: left center;
}
.split-rest {
  flex: 1;
  border-radius: 2px;
  background: var(--rule-strong);
}
.screen[data-entering] .split-pick {
  animation: split-in 900ms var(--ease-out-expo) 320ms both;
}
@keyframes split-in {
  from {
    transform: scaleX(0);
  }
}

.enjoy {
  margin: var(--space-lg) 0 0;
  font: 400 1.5rem/1.2 var(--font-display);
  color: var(--ink-2);
}
.enjoy + .why {
  margin-top: var(--space-sm);
}

.assume {
  margin: var(--space-lg) 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  max-width: 44ch;
}

.gut-sub {
  margin: var(--space-xs) 0 0;
  color: var(--ink-2);
  max-width: 40ch;
}
.lean-note {
  margin: 0 0 var(--space-md);
  color: var(--ink-2);
  font-size: 0.9375rem;
  max-width: 44ch;
}
.gut-both {
  flex-basis: 100%;
}
.gut .answers {
  margin-top: var(--space-lg);
}

/* Words that stay on the device: the friend prompt. */
.note-field {
  display: block;
  width: 100%;
  min-height: calc(1.5em * 3 + 1.25rem);
  margin-top: var(--space-lg);
  padding: var(--space-xs) 0 var(--space-sm);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--pen);
  font: 400 1.125rem/1.5 var(--font-ui);
  resize: vertical;
  outline: none;
  box-shadow: inset 0 -1px 0 var(--rule-strong);
  transition: box-shadow 200ms var(--ease-out);
}
.note-field::placeholder {
  color: var(--ink-3);
  opacity: 1;
}
.note-field:focus {
  box-shadow: inset 0 -2px 0 var(--pen);
}
.private {
  margin: var(--space-xs) 0 0;
  color: var(--ink-3);
  font-size: 0.875rem;
}

/* High stakes: the options side by side, nothing circled until the user chooses. */
.screen[data-mode="high"] .verdict {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  line-height: 1.08;
}
.choices.weigh li {
  color: var(--ink);
  font-weight: 600;
}
.better {
  display: block;
  margin-top: var(--space-2xs);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
}
.people {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  border-radius: 18px;
  background: var(--paper-2);
  max-width: 34rem;
}
.people-title {
  margin: 0;
  font: 400 1.25rem/1.25 var(--font-display);
}
.people ul {
  display: grid;
  gap: var(--space-sm);
  margin: var(--space-sm) 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
}
.people li {
  position: relative;
  padding-left: 1.1rem;
}
.people li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--ink-3);
}

/* ------------------------------------------------------------------ closing */

.choices-solo {
  margin-top: var(--space-xl);
}
.choices-solo li,
.choices-solo li[data-picked] {
  font: 400 clamp(1.75rem, 1.35rem + 1.8vw, 2.375rem) / 1.15 var(--font-display);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.slips {
  display: grid;
  gap: var(--space-sm);
  max-width: 26rem;
  margin: var(--space-2xl) 0 0;
  padding: 0;
  list-style: none;
}
/* Paper slips, set down slightly askew. */
.slip {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 3.5rem;
  padding: var(--space-sm) var(--space-lg);
  border-radius: 14px;
  background: var(--paper-2);
  box-shadow:
    inset 0 0 0 1px var(--rule),
    0 12px 24px -20px color-mix(in oklch, var(--ink), transparent 30%);
  color: var(--ink-2);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: 50% 0;
  rotate: -0.6deg;
}
.slip:nth-child(even) {
  rotate: 0.5deg;
}
.slip.is-dragging {
  cursor: grabbing;
}
.slip-label {
  position: relative;
}
.pen-strike,
.pen-under {
  position: absolute;
  pointer-events: none;
  overflow: visible;
}
.pen-strike path,
.pen-under path {
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.25;
  stroke-linecap: round;
}
.closing .actions {
  margin-top: var(--space-lg);
}
.swipe-hint {
  color: var(--ink-3);
  font-size: 0.875rem;
}
@media (hover: hover) and (pointer: fine) {
  .swipe-hint {
    display: none;
  }
}

/* ------------------------------------------------------------------ first step */

.commit {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--rule);
}
.step-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-lg);
}
.step-chip {
  min-height: 2.75rem;
  padding: var(--space-xs) var(--space-md);
  border-radius: 1.375rem;
  color: var(--ink);
  font-size: 1rem;
  text-align: left;
}
.step-chip[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1.5px var(--pen);
}
.inline-field {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.inline-field input[type="text"],
.when-input {
  display: block;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--pen);
  outline: none;
  box-shadow: inset 0 -1px 0 var(--rule-strong);
  transition: box-shadow 200ms var(--ease-out);
}
.inline-field input[type="text"] {
  flex: 1;
  padding: var(--space-xs) 0 var(--space-sm);
  font: 500 1.125rem/1.4 var(--font-ui);
}
.inline-field input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}
.inline-field input:focus,
.when-input:focus {
  box-shadow: inset 0 -2px 0 var(--pen);
}
.commit .btn-text {
  margin-top: var(--space-sm);
}

.when-input {
  width: min(100%, 20rem);
  margin-top: var(--space-xl);
  padding: var(--space-xs) 0 var(--space-sm);
  font: 500 1.375rem/1.4 var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.when-input-small {
  width: auto;
  flex: 1;
  margin-top: 0;
  font-size: 1rem;
}

.plan-line {
  position: relative;
  margin: var(--space-sm) 0 0;
  max-width: 24ch;
  font: 400 clamp(1.875rem, 1.4rem + 2.2vw, 2.625rem) / 1.3 var(--font-display);
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  outline: none;
}

/* ------------------------------------------------------------------ check-in */

.checkin {
  margin: 0 0 var(--space-2xl);
  padding: var(--space-md) var(--space-lg) var(--space-sm);
  border-radius: 18px;
  background: var(--paper-2);
  max-width: 34rem;
}
.checkin-title {
  margin: 0;
  font: 400 1.25rem/1.25 var(--font-display);
}
.checkin-step {
  margin: var(--space-2xs) 0 0;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.checkin-actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-sm);
}
.field-label {
  display: block;
  margin-top: var(--space-sm);
  color: var(--ink-2);
  font-size: 0.875rem;
}
.checkin .inline-field {
  margin: var(--space-2xs) 0 var(--space-xs);
}

/* Display text added with v2 follows the same script rules as the headings above. */
:root:is(:lang(ru), :lang(zh), :lang(ja)) :is(.enjoy, .plan-line, .checkin-title, .people-title, .choices-solo li) {
  font-weight: 600;
  font-synthesis: none;
}
:root:is(:lang(zh), :lang(ja)) :is(.plan-line, .choices-solo li) {
  letter-spacing: 0;
}

/* Keep-all keeps Japanese phrases whole; long sentences may still break where they must. */
:root:lang(ja) main {
  overflow-wrap: anywhere;
}
/* "Go with “…”" carries a whole option label. */
#friend-go {
  padding-block: var(--space-sm);
  line-height: 1.25;
  text-align: center;
}

/* ------------------------------------------------------------------ group pick */

.group-entry {
  margin: var(--space-xl) 0 0;
}

/* Solo screens promise nothing is stored; group screens say what is, and for how long. */
.footer-group,
.page[data-screen^="group"] .footer-solo {
  display: none;
}
.page[data-screen^="group"] .footer-group {
  display: block;
}

.gc-question,
.gv-field {
  display: block;
  width: 100%;
  margin-top: var(--space-lg);
  padding: var(--space-xs) 0 var(--space-sm);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--pen);
  font: 500 1.25rem/1.4 var(--font-ui);
  outline: none;
  box-shadow: inset 0 -1px 0 var(--rule-strong);
  transition: box-shadow 200ms var(--ease-out);
}
.gv-field {
  margin-top: var(--space-2xs);
  font-size: 1.125rem;
}
.gc-question::placeholder,
.gv-field::placeholder {
  color: var(--ink-3);
  opacity: 1;
}
.gc-question:focus,
.gv-field:focus {
  box-shadow: inset 0 -2px 0 var(--pen);
}
#gc-form .lede {
  margin-top: var(--space-xl);
  font-size: 1rem;
}
#gc-form .option-fields {
  margin-top: var(--space-md);
}
#gv-form .field-label {
  margin-top: var(--space-xl);
}

.link-box {
  margin-top: var(--space-xl);
  padding: var(--space-sm) var(--space-md);
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  user-select: all;
}

/* Three taps per option: a segmented control, the chosen one inked in. */
.ratings {
  display: grid;
  gap: var(--space-lg);
  margin: var(--space-xl) 0 0;
  padding: 0;
  list-style: none;
}
.rating-label {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.rating-taps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: var(--space-xs);
  padding: 4px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--rule-strong);
  max-width: 24rem;
}
.tap {
  min-height: 2.75rem;
  padding: 0 var(--space-xs);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.tap:hover {
  background: var(--paper-2);
  color: var(--ink);
}
.tap[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}
.tap[data-rating="love"][aria-pressed="true"] {
  background: var(--pen);
  color: var(--on-pen);
}

/* The result: each option with a slim bar and its no/love counts in words. */
/* The group's pick, circled like a solo pick. */
.group-pick {
  margin: var(--space-xl) 0 0;
  padding-left: 0.9rem;
  font: 400 clamp(2rem, 1.5rem + 2.4vw, 2.75rem) / 1.15 var(--font-display);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  outline: none;
}
.group-pick + .aside {
  margin-top: var(--space-xl);
}
:root:is(:lang(ru), :lang(zh), :lang(ja)) .group-pick {
  font-weight: 600;
  font-synthesis: none;
}
.tally {
  display: grid;
  gap: var(--space-md);
  margin: var(--space-xl) 0 0;
  padding: 0;
  list-style: none;
  max-width: 30rem;
}
.tally li {
  display: grid;
  gap: var(--space-2xs);
  color: var(--ink-2);
}
.tally li[data-picked] {
  color: var(--ink);
}
.tally-label {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.tally-bar {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--rule);
  overflow: hidden;
}
.tally-bar::before {
  content: "";
  display: block;
  height: 100%;
  width: calc(var(--w, 0) * 100%);
  border-radius: 2px;
  background: var(--ink-3);
  transform-origin: left center;
}
.tally li[data-picked] .tally-bar::before {
  background: var(--pen);
}
.screen[data-entering] .tally-bar::before {
  animation: split-in 900ms var(--ease-out-expo) 500ms both;
}
.tally-words {
  font-size: 0.875rem;
  color: var(--ink-2);
}
.voices {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--rule);
}
.voices ul {
  display: grid;
  gap: var(--space-sm);
  margin: var(--space-md) 0 0;
  padding: 0;
  list-style: none;
  max-width: 40ch;
  overflow-wrap: anywhere;
}
.voice-name {
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .screen[data-entering] .tally-bar::before {
    animation: none;
  }
  .tap {
    transition: none;
  }
}

/* ------------------------------------------------------------------ care */

.care-list {
  margin: var(--space-xl) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-md);
  max-width: 44ch;
  font-size: 1.125rem;
}
.care-list li {
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule);
}
/* "If this was about something else": quiet, after the resources. */
.care-other {
  margin: var(--space-xl) 0 0;
  max-width: 44ch;
  color: var(--ink-3);
  font-size: 0.875rem;
}

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  z-index: 10;
  translate: -50% 0;
  padding: var(--space-sm) var(--space-lg);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  font-weight: 500;
  animation: toast-in 280ms var(--ease-out) both;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ------------------------------------------------------------------ update bar */

/* The toast's sibling that waits: the new version loads only when the reader asks. */
.update-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  z-index: 10;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: max-content;
  max-width: calc(100vw - var(--gutter) * 2);
  padding: var(--space-2xs) var(--space-2xs) var(--space-2xs) var(--space-lg);
  border-radius: 1.75rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  box-shadow: 0 12px 28px -18px color-mix(in oklch, var(--ink), transparent 20%);
  animation: toast-in 280ms var(--ease-out) both;
}
.update-bar button {
  flex: none;
  min-height: 2.75rem;
  padding: 0 var(--space-md);
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklch, var(--paper) 14%, var(--ink));
  font-weight: 600;
  transition: background-color 200ms var(--ease-out);
}
.update-bar button:hover {
  background: color-mix(in oklch, var(--paper) 24%, var(--ink));
}
/* A toast during a pending update stacks above the bar. */
.update-bar:not([hidden]) ~ .toast {
  bottom: calc(var(--space-xl) + 4rem + env(safe-area-inset-bottom));
}
/* Room to scroll the colophon clear of the bar. */
body:has(> .update-bar:not([hidden])) .page {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------------ motion */

.screen[data-entering] > * {
  animation: rise 520ms var(--ease-out-expo) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.reveal {
  animation: rise 520ms var(--ease-out-expo) both;
}

@media (prefers-reduced-motion: reduce) {
  .screen[data-entering] > *,
  .reveal,
  .toast,
  .update-bar {
    animation: fade 200ms linear both;
  }
  @keyframes fade {
    from {
      opacity: 0;
    }
  }
  .scribble path {
    animation: none;
    stroke-dashoffset: 0;
  }
  .btn,
  .answer {
    transition: none;
  }
  .screen[data-entering] .split-pick {
    animation: none;
  }
}
