/* Direction D — "Foliosole": Console's layout, Folio's editorial skin.
 * Left settings rail + top readout strip + centered words + line-drawn keyboard. */
@import url('https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root { --kbd-unit: 44px; --kbd-gap: 8px; --radius: 6px; }
[data-theme="light"] { --done: oklch(0.79 0.01 254); --upcoming: oklch(0.3 0.02 256); }
[data-theme="dark"]  { --done: oklch(0.46 0.014 262); --upcoming: oklch(0.93 0.012 260); }

html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Schibsted Grotesk', system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  display: grid; grid-template-columns: 272px 1fr; min-height: 100vh;
}
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

/* ---- left rail (Console structure, Folio finish) ---- */
.rail {
  border-right: 1px solid var(--line); background: var(--surface);
  padding: 24px 24px 28px; display: flex; flex-direction: column; gap: 26px; overflow-y: auto;
}
.railbrand { display: flex; align-items: baseline; gap: 10px; padding-bottom: 2px; }
.railbrand b { font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.railbrand .idx { font: 400 10px 'IBM Plex Mono', monospace; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-left: auto; }

.field { display: flex; flex-direction: column; gap: 11px; }
.field.is-disabled { opacity: 0.4; pointer-events: none; }
.field > label { font: 500 10.5px 'IBM Plex Mono', monospace; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.opts { display: flex; flex-wrap: wrap; gap: 7px; }
.opts.stack { flex-direction: column; }
.opts button {
  appearance: none; cursor: pointer; border: 1px solid var(--line-strong); background: var(--bg);
  color: var(--ink-2); font: 500 12.5px 'Schibsted Grotesk', sans-serif; padding: 8px 12px; border-radius: var(--radius); transition: 0.14s; text-align: left;
}
.opts button:hover { border-color: var(--ink-2); color: var(--ink); }
.opts button.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fld { appearance: none; width: 100%; cursor: pointer; border: 1px solid var(--line-strong); background: var(--bg);
  color: var(--ink); font: 500 12.5px 'Schibsted Grotesk', sans-serif; padding: 9px 12px; border-radius: var(--radius); }
.chips { display: flex; gap: 9px; }
.chip { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; background: oklch(0.62 0.13 var(--h)); transition: 0.14s; }
.chip.is-active { border-color: var(--ink); }
.tg { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 5px 0; }
.tg span { font: 500 13px 'Schibsted Grotesk', sans-serif; color: var(--ink-2); }
.sw { width: 36px; height: 21px; border-radius: 100px; background: var(--line-strong); position: relative; transition: 0.16s; flex: none; }
.sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--bg); transition: 0.16s; box-shadow: 0 1px 2px rgba(0,0,0,0.18); }
.tg.is-on .sw { background: var(--accent); }
.tg.is-on .sw::after { left: 17px; }
.railspace { flex: 1; min-height: 8px; }

/* ---- main work area ---- */
.work { display: flex; flex-direction: column; min-width: 0; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 50px; padding: 44px clamp(24px, 5vw, 72px); }
.stage { width: 100%; max-width: 900px; }

/* stats sit directly above where you type */
.statbar { display: flex; align-items: flex-end; gap: 34px; margin-bottom: 22px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .v { font: 600 26px/1 'Schibsted Grotesk', sans-serif; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat.accent .v { color: var(--accent); }
.stat .k { font: 400 10px 'IBM Plex Mono', monospace; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.statbar .now { margin-left: auto; align-self: center; display: flex; flex-direction: column; gap: 4px; text-align: right; }
.statbar .now .lvtag { font: 500 12.5px 'Schibsted Grotesk', sans-serif; color: var(--ink-2); white-space: nowrap; }
.statbar .now .lvtag b { color: var(--accent); font-weight: 600; }
.statbar .now .layo { font: 400 10.5px 'IBM Plex Mono', monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

.tt-wordsview { width: 100%; height: calc(2.1rem * 1.8 * 3); font-size: 2.1rem; line-height: 1.8; }
.tt-words { font-weight: 500; letter-spacing: -0.005em; }
.tt-sp { padding: 0 0.15em; }
.is-finished .tt-wordsview { opacity: 0.55; }

.kbdwrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
/* line-drawn keys, Folio idiom */
.tt-key { border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2); font-family: 'IBM Plex Mono', monospace; font-weight: 500; }
.tt-key.is-inactive { opacity: 0.26; border-color: var(--line); }
.tt-key.is-next { border-color: var(--fzc, var(--fz-th)); color: var(--fzc, var(--fz-th)); box-shadow: inset 0 0 0 1px var(--fzc, var(--fz-th)); background: color-mix(in oklch, var(--fzc, var(--fz-th)) 18%, transparent); }
.tt-space { border-radius: var(--radius); }
.legend { display: flex; gap: 18px; font: 400 10.5px 'IBM Plex Mono', monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.legend .ls { display: flex; align-items: center; gap: 7px; }
.legend i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.legend i.next { border: 1px solid var(--accent); background: var(--accent-soft); }
.legend i.act { border: 1px solid var(--line-strong); }
.legend i.off { border: 1px solid var(--line); opacity: 0.5; }

.focusnote { position: fixed; left: 272px; right: 0; bottom: 26px; display: flex; justify-content: center; pointer-events: none; opacity: 0; transition: 0.2s; }
.focusnote span { font: 400 11px 'IBM Plex Mono', monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 7px 14px; border-radius: 100px; }
.is-blurred .focusnote { opacity: 1; }

.sitefooter {
  padding: 14px clamp(24px, 5vw, 72px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font: 400 10.5px 'IBM Plex Mono', monospace; letter-spacing: 0.06em;
  color: var(--muted);
}
.sitefooter a { color: var(--muted); text-decoration: none; }
.sitefooter a:hover { color: var(--ink-2); }
.sf-dot { opacity: 0.4; }

@media (max-width: 820px) {
  body { grid-template-columns: 1fr; }
  .rail { display: none; }
  .focusnote { left: 0; }
  .tt-wordsview { font-size: 1.6rem; }
}
