/* stonks site. Layout: one centred column; the drawing area and the verdict are the two big moments. */
:root {
  --bg: #f4f6fa; --surface: #ffffff; --ink: #111722; --muted: #576173; --rule: #dce1e9; --chip: #eaeef5;
  --you: #2747c9; --culprit: #c2410c; --ok: #15803d; --focus: #2747c9;
  --display: "Avenir Next", "Segoe UI Variable Display", "Helvetica Neue", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1118; --surface: #151b25; --ink: #e8ecf3; --muted: #9aa4b5; --rule: #283040; --chip: #1f2734;
    --you: #8ea4ff; --culprit: #fb8a4c; --ok: #4ade80; --focus: #8ea4ff; color-scheme: dark; }
}
* { box-sizing: border-box }
[hidden] { display: none !important }
html, body { margin: 0 }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 920px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0) }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums }
a { color: inherit }
button, select, input, textarea { font: inherit; color: inherit }
button { cursor: pointer; border: 1px solid var(--rule); background: var(--surface); border-radius: 8px; padding: 8px 14px; font-weight: 500 }
button:hover { border-color: var(--muted) }
button:disabled { opacity: .45; cursor: default }
button.go { background: var(--ink); color: var(--bg); border-color: var(--ink) }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px }

.top { display: flex; align-items: center; justify-content: space-between; padding-block: 18px }
.brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; font: 700 1.3rem var(--display); letter-spacing: -0.02em }
nav { display: flex; gap: 18px; font-size: .92rem } nav a { text-decoration: none; color: var(--muted) } nav a:hover { color: var(--ink) }
.mark { width: 30px; height: 30px; flex: none } .mark.big { width: 46px; height: 46px }
.mark .lens { fill: var(--surface); stroke: var(--ink); stroke-width: 3 }
.mark .l-you, .mark .l-culprit { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round }
.mark .l-you { stroke: var(--you) } .mark .l-culprit { stroke: var(--culprit) }
.mark .handle { stroke: var(--ink); stroke-width: 4.5; stroke-linecap: round }

main { display: grid; gap: 22px; padding-bottom: 40px }
.intro h1 { font: 700 clamp(2rem, 5.4vw, 3.4rem)/1.04 var(--display); letter-spacing: -0.03em; margin: 18px 0 10px; text-wrap: balance; max-width: 16ch }
.lede { color: var(--muted); max-width: 60ch; margin: 0; font-size: 1.06rem }

.input { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden }
.tabs { display: flex; border-bottom: 1px solid var(--rule); overflow-x: auto }
.tabs button { flex: 1 0 auto; border: 0; border-radius: 0; background: none; padding: 13px 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink) }
.panel { padding: 16px; display: grid; gap: 14px }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center } .row.end { justify-content: flex-end }
.chips { display: flex; gap: 8px; flex-wrap: wrap }
.chips button { background: var(--chip); border-color: transparent; padding: 6px 12px; font-size: .9rem; border-radius: 999px }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg) }
.canvas-wrap { position: relative; border: 1px dashed var(--rule); border-radius: 10px; background: linear-gradient(var(--bg), var(--bg)) }
#draw { display: block; width: 100%; height: clamp(220px, 36vw, 340px); touch-action: none; cursor: crosshair }
.axis { display: flex; justify-content: space-between; padding: 4px 10px 8px; font: .78rem var(--mono); color: var(--muted) }
.hint { color: var(--muted); font-size: .88rem; margin: 0 }
.canvas-wrap .hint { position: absolute; left: 0; right: 0; top: 42%; text-align: center; pointer-events: none }
.words { display: flex; gap: 8px; flex: 1 1 320px; min-width: 0 }
.words input, .handle input, .handle select, textarea { border: 1px solid var(--rule); background: var(--bg); border-radius: 8px; padding: 9px 12px; min-width: 0 }
.words input { flex: 1 }
textarea { width: 100%; font: .92rem/1.45 var(--mono); resize: vertical }
.file input { display: none } .file { border: 1px solid var(--rule); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 500 }
.handle { display: flex; gap: 8px; flex-wrap: wrap } .handle input { flex: 1 1 200px }

.understood { margin: 0; font-size: .95rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.understood .fix { background: var(--chip); border: 0; padding: 3px 10px; border-radius: 999px; font-size: .85rem }

.result { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: clamp(16px, 3vw, 28px); display: grid; gap: 14px; min-width: 0 }
.verdict { display: flex; gap: 14px; align-items: flex-start }
.verdict h2 { font: 700 clamp(1.3rem, 3.2vw, 2rem)/1.2 var(--display); letter-spacing: -0.02em; margin: 0; text-wrap: balance }
.chart svg { width: 100%; height: auto; display: block }
.legend { display: flex; gap: 8px 22px; flex-wrap: wrap; font-size: .92rem }
.legend span { display: inline-flex; gap: 8px; align-items: center; min-width: 0 }
.legend i { width: 22px; height: 4px; border-radius: 2px; flex: none } .legend i.you { background: var(--you) } .legend i.culprit { background: var(--culprit) }
#name-you { font-weight: 600; outline-offset: 3px; border-bottom: 1px dashed var(--rule) }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 18px; margin: 0; padding-top: 12px; border-top: 1px solid var(--rule) }
.facts div { min-width: 0 } .facts dt { font: .72rem var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted) }
.facts dd { margin: 2px 0 0; font: 500 1rem var(--mono); font-variant-numeric: tabular-nums }
.confess { margin: 0; color: var(--muted); font-size: .92rem; max-width: 75ch }
.credit { margin: 0; color: var(--muted); font-size: .8rem }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center } .spacer { flex: 1 }
.foot { color: var(--muted); font-size: .85rem; padding-block: 28px 48px; border-top: 1px solid var(--rule) }
.foot p { max-width: 75ch }
.dropping::after { content: "Drop to read it"; position: fixed; inset: 12px; border: 3px dashed var(--you); border-radius: 18px; display: grid; place-items: center; font: 700 1.6rem var(--display); background: color-mix(in srgb, var(--bg) 85%, transparent); z-index: 20 }
@media (max-width: 560px) { .actions .spacer { display: none } nav a:first-child { display: none } }
@media (prefers-reduced-motion: no-preference) { .result { animation: rise .25s ease-out } @keyframes rise { from { transform: translateY(6px); opacity: .6 } } }
