/* still.: the tokens and the plain pieces everything is made of. Two surfaces, paper and forest;
   one family, Archivo, heavy and tight and lowercase; one living mark, the bloom, forest green on
   paper and yellow on forest. Light is paper, dark is forest, and the player is forest in both.
   From docs/design/still-design-system.md; where the app departs from it is in the README. */
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 100%; font-display: swap;
  src: url(/fonts/archivo-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 100%; font-display: swap;
  src: url(/fonts/archivo-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --forest: #12402C; --forest-soft: #2E5A45; --paper: #F1F0EA; --mist: #C9D4C9;
  --yellow: #EDE84A; --grass: #9FD38A; --sky: #8EC9E8;
  /* On paper. --line is the stroke of anything you can press; --border and --border2 divide and
     contain; --grid is the hairline grid behind everything. */
  --bg: #F1F0EA; --fg: #12402C; --fg2: #2E5A45; --muted: #4E7161; --faint: #8AA294;
  --line: #12402C; --border: rgba(18, 64, 44, .2); --border2: rgba(18, 64, 44, .38); --grid: rgba(18, 64, 44, .12);
  --surface: #E8E9E2; --surface2: #DEE1D9;
  --primary: #12402C; --primary-fg: #F1F0EA;
  --accent: #12402C; --accent-soft: rgba(18, 64, 44, .1);
  --bloom: #12402C; --bloom-inv: #EDE84A; --cover: #12402C;
  --danger: #A8321F; --ring: rgba(18, 64, 44, .32);
  --scrim: rgba(18, 64, 44, .42); --shadow-lg: 0 16px 48px rgba(18, 64, 44, .2);
  --r: 20px; --r-sm: 12px; --r-lg: 28px; --pill: 999px; --stroke: 1.5px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --col: 640px; --pad: 1.5rem;
  --breath: 9s; --ease-breath: cubic-bezier(.45, 0, .55, 1);
  --bloom-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='9 10 80 80'%3E%3Cpath d='M83.9 50.0C84.4 53.1 86.4 56.2 87.1 59.9C87.9 63.6 89.3 68.4 88.5 72.2C87.7 75.9 85.4 80.2 82.4 82.4C79.5 84.7 74.5 85.4 70.6 85.7C66.7 85.9 62.5 84.1 59.0 83.8C55.6 83.5 53.1 83.0 50.0 83.7C46.8 84.3 43.7 86.7 39.9 87.7C36.0 88.7 30.9 90.4 27.1 89.6C23.2 88.9 18.9 86.3 16.8 83.1C14.7 79.9 14.5 74.5 14.6 70.4C14.7 66.3 17.1 62.0 17.5 58.6C18.0 55.2 18.3 53.1 17.4 50.0C16.5 46.8 13.6 43.7 12.3 39.9C11.0 36.0 9.0 30.6 9.6 26.7C10.3 22.8 13.0 18.4 16.3 16.3C19.6 14.2 25.2 14.1 29.3 14.2C33.5 14.4 37.7 16.7 41.2 17.2C44.6 17.7 46.8 17.9 50.0 17.2C53.1 16.5 56.1 13.9 59.9 12.8C63.7 11.7 68.7 10.1 72.6 10.8C76.4 11.5 80.7 13.9 82.9 17.0C85.2 20.0 85.8 25.2 86.0 29.1C86.2 33.1 84.5 37.3 84.2 40.8C83.8 44.3 83.4 46.8 83.9 50.0Z'/%3E%3C/svg%3E");
  color-scheme: light;
}
/* On forest: the dark theme, and anything marked .on-forest in either theme (the player). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12402C; --fg: #F1F0EA; --fg2: #C9D4C9; --muted: #9DB3A4; --faint: #6F8C7C;
    --line: #F1F0EA; --border: rgba(241, 240, 234, .2); --border2: rgba(241, 240, 234, .4); --grid: rgba(241, 240, 234, .14);
    --surface: #194734; --surface2: #22503D;
    --primary: #F1F0EA; --primary-fg: #12402C;
    --accent: #EDE84A; --accent-soft: rgba(237, 232, 74, .16);
    --bloom: #EDE84A; --bloom-inv: #12402C; --cover: #0D3323;
    --danger: #FF9C8A; --ring: rgba(241, 240, 234, .42);
    --scrim: rgba(6, 26, 17, .6); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .38);
    color-scheme: dark;
  }
}
:root[data-theme="dark"], .on-forest {
  --bg: #12402C; --fg: #F1F0EA; --fg2: #C9D4C9; --muted: #9DB3A4; --faint: #6F8C7C;
  --line: #F1F0EA; --border: rgba(241, 240, 234, .2); --border2: rgba(241, 240, 234, .4); --grid: rgba(241, 240, 234, .14);
  --surface: #194734; --surface2: #22503D;
  --primary: #F1F0EA; --primary-fg: #12402C;
  --accent: #EDE84A; --accent-soft: rgba(237, 232, 74, .16);
  --bloom: #EDE84A; --bloom-inv: #12402C; --cover: #0D3323;
  --danger: #FF9C8A; --ring: rgba(241, 240, 234, .42);
  --scrim: rgba(6, 26, 17, .6); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .38);
  color-scheme: dark;
}
.on-forest { background: var(--bg); color: var(--fg); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 16px/1.5 var(--font); letter-spacing: -.01em;
  /* The app speaks lowercase. What is read or heard at length, and what people type, keeps its case (below). */
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
/* The grid: hairlines behind everything. One upright and one level line on a phone, quarters on a desk. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(var(--grid), var(--grid)) 50% 0 / 1px 100% no-repeat, linear-gradient(var(--grid), var(--grid)) 0 35% / 100% 1px no-repeat;
}
@media (min-width: 760px) {
  body::before { background: linear-gradient(var(--grid), var(--grid)) 25% 0 / 1px 100% no-repeat, linear-gradient(var(--grid), var(--grid)) 50% 0 / 1px 100% no-repeat, linear-gradient(var(--grid), var(--grid)) 75% 0 / 1px 100% no-repeat, linear-gradient(var(--grid), var(--grid)) 0 35% / 100% 1px no-repeat; }
}
#app { position: relative; z-index: 1; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font-size: clamp(2.25rem, 1.7rem + 3vw, 3.25rem); line-height: .95; font-weight: 800; letter-spacing: -.055em; text-wrap: balance; }
h2 { font-size: 1.25rem; line-height: 1.15; font-weight: 800; letter-spacing: -.04em; }
h3 { font-size: 1.0625rem; line-height: 1.2; font-weight: 700; letter-spacing: -.03em; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; text-transform: inherit; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: var(--r-sm); }
::selection { background: var(--accent-soft); }
strong { font-weight: 700; }

/* Kept as written: prose from the guide, what a person typed, long answers, the lab. */
input, textarea, select, code, q, .as-is, .prose, .lead, .f-pass, .first-text, .fq-own, .ask-note, .fork-note, .known li, .lines li .grow, .lab-panel, .lab-found, .lab-notes, .table, .toast.as-is { text-transform: none; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .875rem; line-height: 1.4; }
.tiny { font-size: .8125rem; line-height: 1.35; font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }
.label { font-size: .75rem; line-height: 1.3; font-weight: 500; color: var(--muted); }
.prose p + p { margin-top: .8em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ─── The bloom and the wordmark ── */
.bloom { flex: none; overflow: visible; color: var(--bloom); }
.bloom path { fill: currentColor; }
.bloom g { transform-origin: 50px 50px; }
.wordmark { display: inline-flex; align-items: baseline; font-weight: 800; letter-spacing: -.07em; line-height: 1; white-space: nowrap; }
.wm-dot { width: .4em; height: .4em; margin: 0 -.02em -.035em .075em; }
.wordmark.big .wm-dot { width: .36em; height: .36em; margin-left: .085em; }
/* Opening the app: the bloom drops into place and settles. */
@keyframes settle { 0% { opacity: 0; transform: translateY(-90px); } 62% { opacity: 1; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }
.settle .wm-dot { animation: settle 3s cubic-bezier(.22, .7, .3, 1) both; }
/* A small mark of something alive: being written, waiting, now. */
.dot { width: 13px; height: 13px; background: var(--accent); -webkit-mask: var(--bloom-mask) center / contain no-repeat; mask: var(--bloom-mask) center / contain no-repeat; flex: none; }
.pulse { animation: pulse 3.6s var(--ease-breath) infinite; }
@keyframes pulse { 0%, 100% { opacity: .45; transform: scale(.8); } 45% { opacity: 1; transform: scale(1.12); } }
/* Small marks on the grid: a crosshair, an outlined square. Two or three to a screen at most. */
.cross, .box-mark { position: absolute; pointer-events: none; }
.cross { width: 29px; height: 29px; margin: -14.5px 0 0 -14.5px; background: linear-gradient(var(--fg), var(--fg)) 50% 0 / 1px 100% no-repeat, linear-gradient(var(--fg), var(--fg)) 0 50% / 100% 1px no-repeat; }
.box-mark { width: 9px; height: 9px; border: 1px solid var(--fg); }

/* ─── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.375rem; border-radius: var(--pill); border: var(--stroke) solid var(--line);
  background: transparent; color: var(--fg); font-size: 1rem; font-weight: 700; letter-spacing: -.02em; white-space: nowrap;
  transition: background .2s, color .2s, opacity .2s;
}
.btn:hover { background: var(--surface2); }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn.primary:hover { opacity: .9; background: var(--primary); }
.btn.danger { color: var(--danger); border-color: currentColor; }
.btn.ghost { border-color: transparent; background: none; color: var(--fg2); font-weight: 600; }
.btn.ghost:hover { background: var(--surface2); }
.btn.ghost.danger { color: var(--danger); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 1rem; font-size: .875rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn svg { flex: none; }
/* The one thing to do on a screen: a tall pill, its label on the left and the bloom on the right. */
.btn.cta { min-height: 60px; width: 100%; justify-content: space-between; padding: 0 .75rem 0 1.625rem; font-size: 1.125rem; }
.btn.cta .bloom { width: 36px; height: 36px; color: var(--bloom-inv); }
.link { color: var(--fg); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-decoration-color: var(--border2); text-underline-offset: 4px; min-height: 44px; display: inline-flex; align-items: center; }
.link:hover { text-decoration-color: currentColor; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--fg); flex: none; transition: background .2s; }
.icon-btn:hover { background: var(--surface2); }
.row { display: flex; align-items: center; gap: .75rem; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: .75rem; }
.grow { flex: 1; min-width: 0; }

/* ─── Fields ── */
.input, .textarea {
  width: 100%; min-height: 52px; padding: .75rem 1.25rem; border-radius: var(--pill); border: var(--stroke) solid var(--line);
  background: transparent; color: var(--fg); font-weight: 500; transition: box-shadow .2s; appearance: none;
}
.textarea { resize: vertical; min-height: 5.75rem; line-height: 1.45; display: block; border-radius: var(--r); padding: .875rem 1.125rem; }
.input::placeholder, .textarea::placeholder { color: var(--faint); font-weight: 400; }
.input:focus, .textarea:focus { box-shadow: 0 0 0 3px var(--ring); outline: none; }
.field { display: grid; gap: .375rem; }
.field > span { font-size: .8125rem; font-weight: 500; padding-left: .25rem; }
.error { color: var(--danger); font-size: .875rem; font-weight: 500; }

/* ─── Small things ── */
.tag {
  display: inline-flex; align-items: center; gap: .3rem; height: 22px; padding: 0 .5rem; border-radius: var(--pill);
  border: 1px solid var(--border2); font-size: .75rem; font-weight: 600; letter-spacing: -.01em; color: var(--fg2); white-space: nowrap;
}
.tag.accent { color: var(--accent); border-color: transparent; background: var(--accent-soft); }
.tag.plain { border: 0; padding: 0; height: auto; background: none; }
.card { border: 1px solid var(--border2); border-radius: var(--r-lg); }
.hr { height: 1px; background: var(--border); border: 0; margin: 0; }
/* A few pills to pick one from: durations, filters, the theme. */
.seg { display: inline-flex; gap: .5rem; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { text-align: center; min-height: 44px; padding: 0 1.125rem; border-radius: var(--pill); border: var(--stroke) solid var(--line); font-size: .9375rem; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
@keyframes rise { from { opacity: 0; } }
.rise { animation: rise .5s ease both; }
.status { display: flex; align-items: center; gap: .625rem; color: var(--fg2); font-size: .9375rem; font-weight: 500; min-height: 44px; }

/* ─── A sheet: a small dialog from the foot of the screen (centred on a desk) ── */
.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: grid; align-items: end; justify-items: center; animation: fade .3s ease; }
.sheet {
  width: min(100%, 460px); background: var(--bg); color: var(--fg); border: var(--stroke) solid var(--line); border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg);
  display: grid; gap: 1rem; animation: fade .4s ease; max-height: min(88dvh, var(--seen, 100dvh) - .75rem); overflow-y: auto;
}
/* With something to write in, it is a card at the top of the screen: a keyboard takes the foot. */
.scrim.typing { align-items: start; }
.scrim.typing .sheet {
  width: min(calc(100% - 1.5rem), 460px); margin-top: calc(.75rem + env(safe-area-inset-top)); padding-bottom: 1.5rem;
  border-radius: var(--r-lg); border-bottom: var(--stroke) solid var(--line); max-height: calc(var(--seen, 100dvh) - 1.5rem - env(safe-area-inset-top));
}
@media (min-width: 600px) {
  .scrim, .scrim.typing { align-items: center; }
  .sheet { border-radius: var(--r-lg); border-bottom: var(--stroke) solid var(--line); }
  .scrim.typing .sheet { margin-top: 0; }
}
@keyframes fade { from { opacity: 0; } }
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80;
  background: var(--primary); color: var(--primary-fg); padding: .75rem 1.125rem; border-radius: var(--r); font-size: .875rem; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: fade .4s ease; max-width: calc(100vw - 2rem);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
p .link, li .link.tiny { display: inline; min-height: 0; }
