/* The Ultimate Calculator — v2 */
@view-transition { navigation: auto; }
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --paper: #f3f4fb;
  --paper-2: #e9ebf8;
  --surface: #ffffff;
  --glass: rgba(255, 255, 255, .72);
  --ink: #14153a;
  --ink-2: #51537e;
  --line: #d9dbef;
  --blue: #3330d9;
  --blue-deep: #211fa6;
  --violet: #7a5cff;
  --link: #3330d9;
  --on-blue-2: #cdccff;
  --gold: #ffb224;
  --mint: #0fa67a;
  --coral: #f2545b;
  --sky: #1c9bd6;
  --key: #ffffff;
  --key-fn: #eceefb;
  --depth: #c9cce8;
  --err: #b3261e;
  --shadow: none;
  --shadow-lg: none;
  --display-font: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body-font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1200px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b0c26; --paper-2: #10113a; --surface: #15173d; --glass: rgba(21, 23, 61, .7); --ink: #f0f1ff; --ink-2: #a7a9d4; --line: #282a5e;
    --blue: #3c39ea; --blue-deep: #2623b5; --link: #a9a7ff; --mint: #37d6a6; --coral: #ff7b81; --sky: #5cc4f2;
    --key: #1c1e4c; --key-fn: #25275c; --depth: #060717; --err: #ff8a80;
    --shadow: none;
    --shadow-lg: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b0c26; --paper-2: #10113a; --surface: #15173d; --glass: rgba(21, 23, 61, .7); --ink: #f0f1ff; --ink-2: #a7a9d4; --line: #282a5e;
  --blue: #3c39ea; --blue-deep: #2623b5; --link: #a9a7ff; --mint: #37d6a6; --coral: #ff7b81; --sky: #5cc4f2;
  --key: #1c1e4c; --key-fn: #25275c; --depth: #060717; --err: #ff8a80;
  --shadow: none;
  --shadow-lg: none; color-scheme: dark;
}
[data-cat="Math"] { --hue: var(--blue); --hue-t: #6f6cff; }
[data-cat="Geometry"] { --hue: var(--violet); --hue-t: var(--violet); }
[data-cat="Science"] { --hue: var(--mint); --hue-t: var(--mint); }
[data-cat="Finance"] { --hue: #e2930a; --hue-t: var(--gold); }
[data-cat="Health"] { --hue: var(--coral); --hue-t: var(--coral); }
[data-cat="Everyday"] { --hue: var(--sky); --hue-t: var(--sky); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--body-font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3 { font-family: var(--display-font); line-height: 1.08; letter-spacing: -0.02em; margin: 0; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--link) 60%, transparent); text-underline-offset: 0.18em; text-decoration-thickness: 0.09em; }
a:hover { text-decoration-color: currentColor; }
button, input, select, textarea { font: inherit; color: inherit; }
kbd { font: 600 .78rem/1 var(--body-font); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; background: var(--surface); color: var(--ink-2); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--gold) 55%, transparent); }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── header ── */
.top-bar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 78%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s; }
.top-bar.is-stuck { border-color: var(--line); box-shadow: 0 10px 30px -22px rgba(20, 21, 58, .5); }
.top { display: flex; align-items: center; gap: 18px; padding: 12px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.35rem/1 var(--display-font); letter-spacing: -0.03em; text-decoration: none; }
.brand svg { width: 32px; height: 32px; flex: none; transition: transform .5s var(--spring); }
.brand:hover svg { transform: rotate(180deg); }
.kbtn { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: 0 1 300px; min-width: 0; border: 1px solid var(--line); background: var(--glass); border-radius: 999px; padding: 8px 10px 8px 14px; color: var(--ink-2); font-size: .94rem; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.kbtn:hover { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent); }
.kbtn svg { width: 16px; height: 16px; flex: none; }
.kbtn span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top nav { display: flex; align-items: center; gap: clamp(8px, 2vw, 22px); font-weight: 600; font-size: .97rem; }
.top nav a { text-decoration: none; padding: 6px 2px; position: relative; }
.top nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.top nav a:hover::after, .top nav a[aria-current]::after { transform: scaleX(1); }
.theme { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); cursor: pointer; display: grid; place-items: center; transition: transform .4s var(--spring); }
.theme:hover { transform: rotate(40deg); }
.theme svg { width: 18px; height: 18px; }

/* ── hero ── */
.hero { position: relative; padding: clamp(28px, 5vw, 64px) 0 8px; }
.aurora { position: absolute; inset: -140px 0 auto; height: 760px; z-index: -1; overflow: hidden; pointer-events: none; mask-image: linear-gradient(#000 55%, transparent); -webkit-mask-image: linear-gradient(#000 55%, transparent); }
.aurora i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; animation: drift 22s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 560px; height: 560px; left: -8%; top: 0; background: var(--violet); }
.aurora i:nth-child(2) { width: 520px; height: 520px; right: -6%; top: 40px; background: var(--blue); animation-delay: -8s; animation-duration: 28s; }
.aurora i:nth-child(3) { width: 380px; height: 380px; left: 42%; top: 180px; background: var(--gold); opacity: .28; animation-delay: -14s; }
.aurora::after { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 44px 44px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 44px 44px; opacity: .55; mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000, transparent); -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000, transparent); }
:root[data-theme="dark"] .aurora i { opacity: .34; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .aurora i { opacity: .34; } }
@keyframes drift { to { transform: translate3d(70px, 50px, 0) scale(1.18); } }
.hero-in > * { animation: enter .9s var(--ease) both; }
.hero-in > :nth-child(2) { animation-delay: .08s; } .hero-in > :nth-child(3) { animation-delay: .16s; } .hero-in > :nth-child(4) { animation-delay: .24s; } .hero-in > :nth-child(5) { animation-delay: .34s; }
@keyframes enter { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(8px); border-radius: 999px; padding: 6px 14px 6px 8px; font-size: .9rem; font-weight: 500; color: var(--ink-2); }
.pill b { background: var(--ink); color: var(--paper); border-radius: 999px; padding: 2px 9px; font: 700 .78rem/1.5 var(--display-font); }
.hero h1 { margin-top: 20px; font-size: clamp(2.7rem, 7.6vw, 5.9rem); font-weight: 800; letter-spacing: -0.05em; line-height: .94; max-width: 12.5ch; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, var(--blue), var(--violet) 55%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
:root[data-theme="dark"] .hero h1 em { background-image: linear-gradient(100deg, #8f8dff, #b79cff 55%, var(--gold)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero h1 em { background-image: linear-gradient(100deg, #8f8dff, #b79cff 55%, var(--gold)); } }
.hero .lede { margin-top: 20px; max-width: 52ch; color: var(--ink-2); font-size: 1.17rem; }

.ask-wrap { position: relative; margin-top: 32px; z-index: 5; }
.ask { position: relative; display: flex; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); }
.ask::before { content: ""; position: absolute; inset: -2px; z-index: -1; border-radius: 26px; background: conic-gradient(from var(--spin), var(--blue), var(--violet), var(--gold), var(--mint), var(--blue)); opacity: .35; transition: opacity .3s; animation: spin 6s linear infinite; }
.ask:focus-within::before { opacity: 1; }
.ask::after { content: ""; position: absolute; inset: -14px; z-index: -2; border-radius: 36px; background: conic-gradient(from var(--spin), var(--blue), var(--violet), var(--gold), var(--mint), var(--blue)); filter: blur(26px); opacity: 0; transition: opacity .4s; animation: spin 6s linear infinite; }
.ask:focus-within::after { opacity: .38; }
@keyframes spin { to { --spin: 360deg; } }
.ask > svg { flex: none; width: 24px; height: 24px; margin: auto 0 auto 22px; color: var(--ink-2); }
.ask input { flex: 1; min-width: 0; border: 0; background: none; padding: 24px 8px 24px 14px; font: 500 clamp(1.15rem, 2.6vw, 1.6rem)/1.2 var(--display-font); letter-spacing: -0.01em; outline: none; }
.ask input::placeholder { color: color-mix(in srgb, var(--ink-2) 70%, transparent); }
.ask .go { flex: none; margin: 9px; min-width: 64px; padding: 0 20px; border-radius: 16px; border: 0; background: linear-gradient(160deg, #4744f0, var(--blue-deep)); color: #fff; font: 700 1.05rem/1 var(--display-font); cursor: pointer; display: flex; align-items: center; gap: 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 16px -6px var(--blue); transition: transform .15s var(--spring), filter .2s; }
.ask .go b { font-size: 1.5rem; font-weight: 700; }
.ask .go:hover { filter: brightness(1.12); transform: translateY(-1px); }
.ask .go:active { transform: scale(.95); }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 10px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 6px; display: none; animation: pop .22s var(--ease); }
.sugg.is-open { display: block; }
.sugg a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 500; }
.sugg a small { margin-left: auto; color: var(--ink-2); font-weight: 400; }
.sugg a:hover, .sugg a.is-on { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.dot { width: 9px; height: 9px; border-radius: 3px; background: var(--hue-t, var(--blue)); flex: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
.tries { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; align-items: center; }
.tries span { color: var(--ink-2); font-size: .95rem; margin-right: 2px; }
.chip { border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(6px); border-radius: 999px; padding: 6px 14px; font-size: .95rem; cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--spring), box-shadow .2s; text-decoration: none; display: inline-block; }
.chip:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 8px 18px -10px var(--blue); }
.chip:active { transform: scale(.96); }

/* ── bench: display + keypad ── */
.bench { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: 22px; margin-top: 30px; align-items: start; }
.display {
  position: relative; overflow: hidden; border-radius: 30px; color: #fff; min-height: 320px; padding: clamp(22px, 3.4vw, 36px); isolation: isolate;
  background: radial-gradient(120% 90% at 0% 0%, #5b4cf5 0%, transparent 55%), radial-gradient(90% 80% at 100% 100%, #1a1787 0%, transparent 60%), linear-gradient(160deg, var(--blue), var(--blue-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 0 0 1px rgba(255, 255, 255, .08), var(--shadow-lg);
}
.display::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(transparent 31px, rgba(255, 255, 255, .06) 32px) 0 0 / 32px 32px, linear-gradient(90deg, transparent 31px, rgba(255, 255, 255, .06) 32px) 0 0 / 32px 32px; mask-image: radial-gradient(120% 100% at 100% 0%, #000 20%, transparent 85%); -webkit-mask-image: radial-gradient(120% 100% at 100% 0%, #000 20%, transparent 85%); }
.display::after { content: ""; position: absolute; width: 340px; height: 340px; right: -110px; top: -150px; z-index: -1; border-radius: 50%; background: var(--gold); filter: blur(90px); opacity: .22; }
.dbar { position: absolute; right: 16px; top: 16px; display: flex; gap: 6px; z-index: 2; }
.dbar button { border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #fff; border-radius: 999px; height: 32px; padding: 0 12px; font-size: .84rem; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; backdrop-filter: blur(6px); transition: background .2s, transform .2s var(--spring); }
.dbar button:hover { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.dbar svg { width: 14px; height: 14px; }
.dbar[hidden] { display: none; }
.display .cap { color: var(--gold); font-weight: 600; font-size: 1rem; min-height: 1.6em; padding-right: 170px; }
.display .echo { color: var(--on-blue-2); font-size: 1rem; margin-top: 2px; overflow-wrap: anywhere; }
.display .ans { font: 700 clamp(2.5rem, 6.6vw, 4.8rem)/1.04 var(--display-font); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; margin-top: 10px; overflow-wrap: anywhere; text-shadow: 0 2px 30px rgba(255, 255, 255, .18); }
.display .ans.md { font-size: clamp(1.8rem, 4.2vw, 3rem); }
.display .ans.sm { font-size: clamp(1.3rem, 2.8vw, 1.9rem); letter-spacing: -0.02em; line-height: 1.2; }
.display .ans .unit { font-size: .42em; font-weight: 500; letter-spacing: 0; color: var(--on-blue-2); margin-left: .35em; }
.display .idle { color: var(--on-blue-2); font: 500 clamp(1.3rem, 2.6vw, 1.8rem)/1.25 var(--display-font); max-width: 22ch; margin-top: 8px; }
.display .msg { color: #fff; font: 500 1.25rem/1.35 var(--display-font); max-width: 34ch; margin-top: 8px; }
.display.is-live .ans { opacity: .86; }
.ch { display: inline-block; white-space: pre; animation: roll .55s var(--ease) both; animation-delay: calc(var(--i) * 22ms); }
@keyframes roll { from { opacity: 0; transform: translateY(.6em) rotateX(-80deg) scale(.9); filter: blur(6px); } }

.rows { margin: 22px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0 28px; }
.rows div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .16); font-size: .98rem; }
.rows dt { color: var(--on-blue-2); flex: 1 1 auto; min-width: 0; }
.rows dd { margin: 0; flex: 0 1 auto; max-width: 68%; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: break-word; min-width: 0; }
.steps { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 1rem; line-height: 1.45; overflow-wrap: anywhere; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 .78rem/1 var(--display-font); background: rgba(255, 255, 255, .16); margin-top: 1px; }
.reveal > * { animation: rise .5s var(--ease) both; animation-delay: calc(120ms + var(--n, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.display .more { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.display .chip { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); color: #fff; }
.display .chip:hover { background: rgba(255, 255, 255, .18); border-color: #fff; box-shadow: none; }

.plot { margin-top: 22px; position: relative; border-radius: 20px; overflow: hidden; background: rgba(8, 8, 60, .4); border: 1px solid rgba(255, 255, 255, .16); box-shadow: inset 0 0 40px rgba(0, 0, 40, .4); }
.plot canvas { display: block; width: 100%; height: 320px; touch-action: none; cursor: grab; }
.plot canvas:active { cursor: grabbing; }
.plot .legend { position: absolute; left: 12px; top: 10px; display: grid; gap: 4px; font-size: .86rem; pointer-events: none; }
.plot .legend span::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--c); margin-right: 7px; vertical-align: middle; }
.plot .zoom { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.plot button { border: 1px solid rgba(255, 255, 255, .3); background: rgba(10, 10, 60, .55); color: #fff; border-radius: 999px; min-width: 32px; height: 30px; padding: 0 11px; font-size: .9rem; cursor: pointer; }
.plot button:hover { background: rgba(255, 255, 255, .18); }
.plot .read { position: absolute; right: 12px; bottom: 9px; font-size: .84rem; font-variant-numeric: tabular-nums; color: #fff; pointer-events: none; white-space: pre; }

/* keypad */
.pad { background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 30px; padding: 16px; box-shadow: var(--shadow); }
.pad-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.seg { position: relative; display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper); }
.seg button { border: 0; background: none; border-radius: 999px; padding: 5px 13px; font-size: .9rem; font-weight: 600; cursor: pointer; color: var(--ink-2); transition: background .25s var(--ease), color .2s; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pad-top small { color: var(--ink-2); font-size: .86rem; }
.keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.key { position: relative; overflow: hidden; height: 52px; border-radius: 15px; border: 1px solid var(--line); background: var(--key); box-shadow: 0 3px 0 var(--depth), inset 0 1px 0 rgba(255, 255, 255, .5); font: 600 1.14rem/1 var(--display-font); cursor: pointer; transition: transform .08s, box-shadow .08s, background .15s; -webkit-tap-highlight-color: transparent; }
:root[data-theme="dark"] .key { box-shadow: 0 3px 0 var(--depth), inset 0 1px 0 rgba(255, 255, 255, .07); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .key { box-shadow: 0 3px 0 var(--depth), inset 0 1px 0 rgba(255, 255, 255, .07); } }
.key.fn { background: var(--key-fn); font-size: .98rem; font-weight: 500; }
.key.op { color: var(--link); font-size: 1.3rem; }
.key.eq { background: linear-gradient(160deg, #4744f0, var(--blue-deep)); border-color: var(--blue-deep); box-shadow: 0 3px 0 #17157a, inset 0 1px 0 rgba(255, 255, 255, .3); color: #fff; font-size: 1.4rem; }
.key:hover { background: color-mix(in srgb, var(--blue) 10%, var(--key)); }
.key.eq:hover { filter: brightness(1.12); background: linear-gradient(160deg, #4744f0, var(--blue-deep)); }
.key:active, .key.is-down { transform: translateY(3px); box-shadow: 0 0 0 var(--depth); }
.key i { position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: currentColor; opacity: .25; animation: ink .5s ease-out forwards; pointer-events: none; }
@keyframes ink { to { transform: scale(18); opacity: 0; } }

/* tape */
.tape { margin-top: 22px; }
.tape-head { display: flex; align-items: baseline; justify-content: space-between; }
.tape-head h2 { font-size: 1.05rem; letter-spacing: -0.01em; }
.linkbtn { border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink-2); text-decoration: underline; text-underline-offset: .18em; font-size: .92rem; }
.tape ol { list-style: none; margin: 10px 0 0; padding: 0; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.tape li { border-top: 1px dashed var(--line); }
.tape li:first-child { border-top: 0; }
.tape li.new { animation: feed .45s var(--ease); }
@keyframes feed { from { opacity: 0; transform: translateY(-14px); } }
.tape li button { width: 100%; display: flex; justify-content: space-between; gap: 18px; border: 0; background: none; padding: 12px 18px; cursor: pointer; text-align: left; font-variant-numeric: tabular-nums; transition: background .15s, padding .2s var(--ease); }
.tape li button:hover { background: color-mix(in srgb, var(--blue) 7%, transparent); padding-left: 24px; }
.tape .q { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tape .a { font-weight: 700; font-family: var(--display-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.tape .empty { padding: 14px 18px; color: var(--ink-2); font-size: .98rem; }

/* ── sections ── */
.band { padding: clamp(56px, 9vw, 112px) 0 0; }
.band-head h2, .band > .wrap > h2 { font-size: clamp(1.9rem, 4.4vw, 3.2rem); font-weight: 800; letter-spacing: -0.04em; }
.band-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 28px; }
.band-head p { color: var(--ink-2); max-width: 52ch; margin-top: 12px; font-size: 1.08rem; }
.find { position: relative; flex: 0 1 340px; }
.find input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 13px 16px; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.find input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 16%, transparent); }
.io { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * 70ms); }
.io.is-in { opacity: 1; transform: none; }

/* what you can type */
.caps { margin-top: 30px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cap-tile { position: relative; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 22px; padding: 18px 18px 16px; cursor: pointer; overflow: hidden; box-shadow: var(--shadow); transition: transform .3s var(--spring), border-color .2s; display: grid; gap: 10px; align-content: start; }
.cap-tile:hover { transform: translateY(-4px); border-color: var(--hue-t, var(--blue)); }
.cap-tile small { color: var(--hue-t, var(--blue)); font-weight: 700; font-size: .84rem; display: flex; align-items: center; gap: 7px; }
.cap-tile .in { font: 500 1.02rem/1.3 var(--display-font); color: var(--ink-2); }
.cap-tile .in::before { content: "› "; color: var(--hue-t, var(--blue)); font-weight: 700; }
.cap-tile .outv { font: 700 1.3rem/1.2 var(--display-font); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.cap-tile::after { content: "Run it ↵"; position: absolute; right: 14px; top: 14px; font-size: .76rem; font-weight: 600; color: var(--ink-2); opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .2s var(--ease); }
.cap-tile:hover::after { opacity: 1; transform: none; }

/* bento categories */
.bento { margin-top: 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cat { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 24px; overflow: hidden; box-shadow: var(--shadow); transition: border-color .25s, transform .35s var(--ease); }
.cat::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -20%), color-mix(in srgb, var(--hue-t) 20%, transparent), transparent 62%); opacity: 0; transition: opacity .35s; pointer-events: none; }
.cat:hover { border-color: color-mix(in srgb, var(--hue-t) 60%, var(--line)); }
.cat:hover::before { opacity: 1; }
.cat-head { display: flex; align-items: center; gap: 14px; position: relative; }
.ico { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(150deg, color-mix(in srgb, var(--hue-t) 80%, #fff), var(--hue)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 10px 20px -10px var(--hue); transition: transform .45s var(--spring); }
.cat:hover .ico { transform: rotate(-8deg) scale(1.08); }
.ico svg { width: 24px; height: 24px; }
.cat h3 { font-size: 1.45rem; }
.cat-head small { display: block; color: var(--ink-2); font-size: .88rem; margin-top: 2px; }
.cat > p { color: var(--ink-2); font-size: .96rem; margin-top: 14px; position: relative; }
.cat ul { list-style: none; margin: 14px 0 0; padding: 0; position: relative; }
.cat li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; text-decoration: none; font-weight: 500; font-size: .98rem; transition: background .15s, padding .2s var(--ease); }
.cat li a::after { content: "→"; color: var(--hue-t); opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s var(--ease); }
.cat li a:hover { background: color-mix(in srgb, var(--hue-t) 12%, transparent); padding-left: 14px; }
.cat li a:hover::after { opacity: 1; transform: none; }
.cat [hidden], .bento [hidden] { display: none; }
.none { padding: 28px 0; color: var(--ink-2); }

/* guides */
.guides { margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.guides a { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; box-shadow: var(--shadow); transition: transform .3s var(--spring), border-color .2s; overflow: hidden; }
.guides a::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--hue-t); transform: scaleY(0); transform-origin: top; transition: transform .35s var(--ease); }
.guides a:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--hue-t) 55%, var(--line)); }
.guides a:hover::before { transform: scaleY(1); }
.guides small { color: var(--hue-t); font-weight: 700; font-size: .84rem; display: flex; align-items: center; gap: 7px; }
.guides small span { color: var(--ink-2); font-weight: 500; margin-left: auto; }
.guides h3 { font-size: 1.24rem; letter-spacing: -0.015em; line-height: 1.18; }
.guides p { color: var(--ink-2); font-size: .95rem; line-height: 1.5; }
.allink { display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); background: var(--surface); padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow); transition: transform .2s var(--spring), border-color .2s; }
.allink:hover { transform: translateY(-2px); border-color: var(--blue); }
.cat-title { margin-top: 48px; font-size: 1.6rem; display: flex; align-items: center; gap: 10px; }

/* stats strip */
.facts { margin-top: clamp(40px, 6vw, 72px); display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 26px; background: var(--glass); backdrop-filter: blur(10px); box-shadow: var(--shadow); overflow: hidden; }
.facts div { padding: 22px 24px; border-left: 1px solid var(--line); }
.facts div:first-child { border-left: 0; }
.facts b { display: block; font: 800 clamp(1.7rem, 3.4vw, 2.5rem)/1 var(--display-font); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.facts span { color: var(--ink-2); font-size: .93rem; }

/* ── calculator page ── */
.crumbs { font-size: .92rem; color: var(--ink-2); padding-top: 22px; }
.crumbs a { color: var(--link); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.page-head { position: relative; padding: 18px 0 0; }
.page-head .tag { display: inline-flex; align-items: center; gap: 8px; color: var(--hue-t); font-weight: 700; font-size: .9rem; margin-bottom: 12px; text-decoration: none; }
.page-head h1 { font-size: clamp(2.2rem, 5.6vw, 4rem); font-weight: 800; letter-spacing: -0.045em; max-width: 18ch; }
.page-head > p { margin-top: 14px; color: var(--ink-2); font-size: 1.16rem; max-width: 58ch; }
.tool { display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 24px; margin-top: 32px; align-items: start; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: 30px; padding: clamp(18px, 3vw, 28px); display: grid; gap: 18px; box-shadow: var(--shadow); }
.form .hint { color: var(--ink-2); font-size: .95rem; background: color-mix(in srgb, var(--gold) 16%, transparent); border-radius: 12px; padding: 10px 14px; }
.field { display: grid; gap: 7px; }
.field[hidden] { display: none; }
.field label { font-weight: 600; font-size: .97rem; }
.control { position: relative; display: flex; align-items: center; }
.control input, .control select, .control textarea { width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 14px; padding: 13px 15px; font-size: 1.08rem; font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s, background .15s; }
.control textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.control select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
.control :is(input, select, textarea):focus { outline: none; border-color: var(--blue); background-color: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 16%, transparent); }
.control .u { position: absolute; right: 14px; color: var(--ink-2); font-size: .95rem; pointer-events: none; }
.control.has-u input { padding-right: 68px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--blue) var(--fill, 50%), var(--line) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--blue) var(--fill, 50%), var(--line) var(--fill, 50%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); box-shadow: 0 3px 8px rgba(51, 48, 217, .35); transition: transform .15s var(--spring); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); box-shadow: 0 3px 8px rgba(51, 48, 217, .35); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); }
.form-foot { display: flex; gap: 14px; align-items: center; padding-top: 2px; flex-wrap: wrap; }
.btn { border: 1px solid var(--blue-deep); background: linear-gradient(160deg, #4744f0, var(--blue-deep)); color: #fff; border-radius: 14px; padding: 12px 20px; font-weight: 600; cursor: pointer; box-shadow: 0 3px 0 #17157a, inset 0 1px 0 rgba(255, 255, 255, .3); transition: transform .08s, box-shadow .08s, filter .2s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(3px); box-shadow: none; }
.result { position: sticky; top: 84px; }
.result .display { min-height: 280px; }
.result .display.pulse { animation: pulse .5s var(--ease); }
@keyframes pulse { 30% { transform: scale(.99); } }

.split { display: flex; height: 16px; border-radius: 999px; overflow: hidden; margin-top: 24px; background: rgba(255, 255, 255, .14); }
.split span { flex-grow: var(--v); flex-basis: 0; min-width: 2px; }
.split .s0, .key-list .s0::before { background: var(--gold); }
.split .s1, .key-list .s1::before { background: #fff; }
.split .s2, .key-list .s2::before { background: #7de3c3; }
.key-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 12px 0 0; padding: 0; font-size: .94rem; }
.key-list li::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; }
.key-list b { font-weight: 600; }
.gauge { margin-top: 26px; }
.gauge .track { position: relative; height: 12px; border-radius: 999px; background: linear-gradient(90deg, #7de3c3, var(--gold), #ff8a6b); }
.gauge .pin { position: absolute; top: -7px; left: var(--p); width: 4px; height: 26px; margin-left: -2px; border-radius: 3px; background: #fff; box-shadow: 0 0 0 3px var(--blue-deep); }
.gauge .marks { position: relative; height: 1.5em; margin-top: 8px; font-size: .85rem; color: var(--on-blue-2); }
.gauge .marks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.gauge .marks.even { display: flex; justify-content: space-between; }
.gauge .marks.even span { position: static; transform: none; }
.fresh .split span { animation: grow .8s var(--ease) both; }
@keyframes grow { from { flex-grow: 0; } }
.fresh .gauge .pin { animation: slide .8s var(--spring) both; }
@keyframes slide { from { left: 0; } }

/* charts */
.chart { margin-top: 24px; position: relative; border-radius: 20px; background: rgba(8, 8, 60, .36); border: 1px solid rgba(255, 255, 255, .14); padding: 14px 14px 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: rgba(255, 255, 255, .12); stroke-width: 1; }
.chart text { fill: rgba(255, 255, 255, .72); font: 11px var(--body-font); }
.chart .ln { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chart .c0 { stroke: var(--gold); } .chart .c1 { stroke: #7de3c3; } .chart .c2 { stroke: #fff; }
.chart .a0 { fill: url(#g0); stroke: none; }
.fresh .chart .ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.fresh .chart .a0 { animation: fadein .9s .3s both; }
@keyframes fadein { from { opacity: 0; } }
.chart .cur { stroke: rgba(255, 255, 255, .55); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart .pt { stroke: var(--blue-deep); stroke-width: 2; opacity: 0; }
.chart.is-hover .cur, .chart.is-hover .pt { opacity: 1; }
.chart .tip { position: absolute; top: 10px; pointer-events: none; background: rgba(10, 10, 50, .88); border: 1px solid rgba(255, 255, 255, .2); border-radius: 10px; padding: 7px 10px; font-size: .82rem; line-height: 1.5; white-space: nowrap; opacity: 0; transition: opacity .15s; font-variant-numeric: tabular-nums; backdrop-filter: blur(6px); }
.chart.is-hover .tip { opacity: 1; }
.chart .tip b { display: block; color: var(--gold); }
.chart .leg { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .86rem; margin: 0 0 8px 4px; }
.chart .leg span::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 7px; vertical-align: middle; background: var(--c); }

/* ── prose ── */
.doc { display: grid; grid-template-columns: minmax(0, 68ch) 1fr; gap: 40px 64px; padding-top: clamp(40px, 6vw, 72px); align-items: start; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.03em; margin-top: 1.9em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.22rem; margin-top: 1.6em; letter-spacing: -0.015em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose a { color: var(--link); font-weight: 500; }
.formula { position: relative; font: 600 clamp(1.1rem, 2.4vw, 1.4rem)/1.5 var(--display-font); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px 18px 26px; overflow-x: auto; letter-spacing: -0.01em; box-shadow: var(--shadow); }
.formula::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: linear-gradient(var(--blue), var(--violet)); }
.prose table { width: 100%; border-collapse: collapse; font-size: .97rem; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--display-font); border-bottom: 2px solid var(--ink); white-space: nowrap; }
.prose tbody tr:hover { background: color-mix(in srgb, var(--blue) 5%, transparent); }
.worked { counter-reset: s; list-style: none; padding: 0 !important; }
.worked li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.worked li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 .8rem/1 var(--display-font); background: var(--blue); color: #fff; }
.faq { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: 4px 20px; box-shadow: var(--shadow); }
.faq details { border-top: 1px solid var(--line); margin: 0; }
.faq details:first-child { border-top: 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font: 600 1.1rem/1.3 var(--display-font); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem; line-height: 1; color: var(--link); background: color-mix(in srgb, var(--blue) 10%, transparent); transition: transform .3s var(--spring); }
.faq details[open] summary::after { transform: rotate(135deg); }
.faq details p { padding: 0 0 16px; color: var(--ink-2); max-width: 62ch; animation: rise .35s var(--ease); }
.aside { position: sticky; top: 88px; display: grid; gap: 22px; }
.aside > div { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: 18px 20px; box-shadow: var(--shadow); }
.aside h2 { font-size: 1rem; letter-spacing: -0.01em; padding-bottom: 6px; }
.aside ul { list-style: none; margin: 0; padding: 0; }
.aside li a { display: block; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; font-weight: 500; font-size: .96rem; transition: color .15s, padding .2s var(--ease); }
.aside li a:hover { color: var(--link); padding-left: 6px; }
.toc li a { border: 0; border-left: 2px solid var(--line); padding: 6px 0 6px 12px; color: var(--ink-2); font-size: .93rem; }
.toc li a.is-on { border-color: var(--blue); color: var(--ink); font-weight: 600; }
.article-head h1 { max-width: 22ch; }
.byline { margin-top: 14px; color: var(--ink-2); font-size: .94rem; }
.progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 60; transform-origin: left; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--blue), var(--violet), var(--gold)); }
.trycalc { margin-top: 2em; background: radial-gradient(120% 120% at 0 0, #5b4cf5, transparent 60%), linear-gradient(160deg, var(--blue), var(--blue-deep)); color: #fff; border-radius: 24px; padding: 26px 28px; box-shadow: var(--shadow-lg); }
.trycalc h2 { margin: 0; font-size: 1.35rem; }
.trycalc div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.trycalc .chip { border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); color: #fff; font-weight: 500; }
.trycalc .chip:hover { background: rgba(255, 255, 255, .2); border-color: #fff; }

/* ── command palette ── */
.pal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 0; background: rgba(10, 10, 40, .5); backdrop-filter: blur(6px); }
.pal.is-open { display: flex; animation: fadein .2s; }
.pal-box { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 40px 100px -20px rgba(0, 0, 30, .6); overflow: hidden; animation: palin .28s var(--spring); }
@keyframes palin { from { opacity: 0; transform: translateY(-14px) scale(.97); } }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.pal-in svg { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.pal-in input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: 500 1.15rem var(--display-font); }
.pal-list { max-height: min(52vh, 440px); overflow-y: auto; padding: 8px; }
.pal-list h4 { margin: 8px 10px 4px; font: 600 .8rem var(--body-font); color: var(--ink-2); }
.pal-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 500; }
.pal-list a small { margin-left: auto; color: var(--ink-2); font-weight: 400; white-space: nowrap; }
.pal-list a.is-on { background: color-mix(in srgb, var(--blue) 12%, transparent); }
.pal-list .nil { padding: 22px 12px; color: var(--ink-2); }
.pal-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .82rem; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 120; transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: .94rem; box-shadow: var(--shadow-lg); transition: transform .35s var(--spring), opacity .25s; pointer-events: none; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ── footer ── */
footer { margin-top: clamp(72px, 10vw, 130px); border-top: 1px solid var(--line); background: var(--paper-2); padding: 48px 0 40px; }
.foot { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; }
.foot p { color: var(--ink-2); font-size: .95rem; max-width: 34ch; margin-top: 12px; }
.foot h2 { font-size: .98rem; letter-spacing: 0; margin-bottom: 8px; }
.foot ul { list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.foot li a { display: inline-block; padding: 3px 0; text-decoration: none; color: var(--ink-2); transition: color .15s, transform .2s var(--ease); }
.foot li a:hover { color: var(--ink); transform: translateX(3px); }
.legal { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; }

.hero-in.settled > * { animation: none !important; }
.settled :is(.ch, .reveal > *, .split span, .pin, .ln, .a0) { animation: none !important; stroke-dashoffset: 0 !important; }

/* ── responsive ── */
@media (max-width: 1020px) {
  .bench, .tool, .doc { grid-template-columns: 1fr; }
  .result, .aside { position: static; }
  .guides, .bento { grid-template-columns: repeat(2, 1fr); }
  .caps { grid-template-columns: repeat(2, 1fr); }
  .foot { grid-template-columns: 1fr 1fr; }
  .toc-box { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 1rem; }
  .top nav a.hide-s, .kbtn span, .kbtn kbd { display: none; }
  .kbtn { flex: none; padding: 9px; }
  .top { gap: 8px; } .top nav { gap: 10px; font-size: .92rem; } .brand { font-size: 1.2rem; gap: 7px; } .brand svg { width: 28px; height: 28px; } .theme { width: 34px; height: 34px; }
  .ask > svg { display: none; }
  .ask input { padding: 19px 4px 19px 18px; }
  .ask .go { min-width: 52px; padding: 0 14px; } .ask .go span { display: none; }
  .guides, .bento, .caps { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; } .facts div:nth-child(3) { border-left: 0; } .facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .key { height: 48px; } .keys { gap: 6px; }
  .plot canvas { height: 250px; }
  .display { border-radius: 24px; } .display .cap { padding-right: 0; margin-top: 34px; }
  .dbar { right: 12px; top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .io { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}

/* ── calm pass ── flat, quiet, fewer things on screen */
.io { opacity: 1; transform: none; transition: none; }
.hero-in > * { animation: none; }
.top-bar { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; }
.top-bar.is-stuck { box-shadow: none; }
.kbtn { flex: none; border: 0; background: none; padding: 8px; color: var(--ink); }
.kbtn:hover { box-shadow: none; color: var(--link); }
.kbtn span, .kbtn kbd { display: none; }
.kbtn svg { width: 19px; height: 19px; }
.brand:hover svg, .theme:hover { transform: none; }
.theme { border: 0; background: none; }
.top nav { font-weight: 500; }

.hero { padding: clamp(48px, 9vw, 120px) 0 0; }
.hero h1 { margin-top: 0; font-size: clamp(2.2rem, 5.4vw, 4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; max-width: 16ch; }
.hero .lede { margin-top: 16px; font-size: 1.1rem; max-width: 46ch; }
.ask-wrap { margin-top: 36px; max-width: 820px; }
.ask { border: 1.5px solid var(--line); border-radius: 16px; transition: border-color .2s; }
.ask::before, .ask::after { display: none; }
.ask:focus-within { border-color: var(--blue); }
.ask > svg { display: none; }
.ask input { padding: 20px 8px 20px 20px; font-size: clamp(1.1rem, 2.2vw, 1.35rem); }
.ask .go { margin: 7px; min-width: 52px; padding: 0 16px; border-radius: 11px; background: var(--blue); box-shadow: none; }
.ask .go span { display: none; }
.ask .go:hover { transform: none; filter: none; background: var(--blue-deep); }
.tries { margin-top: 16px; gap: 6px 18px; }
.tries span { display: none; }
.chip { border: 0; background: none; backdrop-filter: none; padding: 2px 0; border-radius: 0; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .25em; }
.chip:hover { transform: none; box-shadow: none; color: var(--ink); text-decoration-color: currentColor; }
.padlink { margin-left: auto; }

.bench { grid-template-columns: 1fr; max-width: 820px; margin-top: 28px; }
.bench:has(.pad:not([hidden])) { grid-template-columns: minmax(0, 1fr) 320px; max-width: none; }
.display { background: var(--blue); box-shadow: none; border-radius: 18px; min-height: 0; padding: clamp(20px, 3vw, 30px); }
.display[hidden], .pad[hidden], .tape[hidden] { display: none; }
.display::before, .display::after { display: none; }
.display .cap { color: var(--on-blue-2); font-weight: 500; font-size: .95rem; }
.display .ans { text-shadow: none; font-size: clamp(2.2rem, 5.4vw, 3.8rem); margin-top: 6px; }
.display .chip { color: #fff; text-decoration-color: rgba(255, 255, 255, .5); }
.display .chip:hover { background: none; }
.dbar button { border: 0; background: rgba(255, 255, 255, .12); backdrop-filter: none; }
.dbar button:hover { transform: none; }
.dbar svg { display: none; }
.rows div { border-top-color: rgba(255, 255, 255, .14); }
.steps li::before { background: none; border: 1px solid rgba(255, 255, 255, .35); }
.plot { box-shadow: none; background: rgba(0, 0, 40, .25); border: 0; border-radius: 12px; }
.chart { background: rgba(0, 0, 40, .22); border: 0; border-radius: 12px; }
.pad { background: none; backdrop-filter: none; border: 0; border-radius: 0; padding: 0; }
.pad-top small { display: none; }
.keys { gap: 6px; }
.key { height: 46px; border-radius: 10px; box-shadow: none !important; background: var(--surface); }
.key.fn { background: var(--paper-2); }
.key.eq { background: var(--blue); border-color: var(--blue); }
.key:active, .key.is-down { transform: scale(.95); }
.key i { display: none; }
.tape ol { background: none; backdrop-filter: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.tape li { border-top: 1px solid var(--line); }
.tape li button { padding: 11px 0; }
.tape li button:hover { background: none; padding-left: 0; }
.tape li button:hover .q { color: var(--ink); }
.tape-head h2 { font-size: .95rem; font-weight: 600; color: var(--ink-2); }

.band { padding-top: clamp(64px, 9vw, 110px); }
.band-head h2, .band > .wrap > h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 700; letter-spacing: -0.02em; }
.band-head p { font-size: 1rem; margin-top: 6px; }
.find input { border-radius: 10px; padding: 10px 14px; }
.find input:focus { box-shadow: none; }
.caps { display: block; margin-top: 20px; border-top: 1px solid var(--line); max-width: 820px; }
.cap-tile { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 13px 0; }
.cap-tile small, .cap-tile::after { display: none; }
.cap-tile:hover { transform: none; }
.cap-tile:hover .in { color: var(--ink); }
.cap-tile .in { font: 400 1rem var(--body-font); }
.cap-tile .in::before { content: none; }
.cap-tile .outv { font: 600 1rem var(--body-font); letter-spacing: 0; text-align: right; }
.bento { gap: 36px 48px; margin-top: 28px; }
.cat { background: none; border: 0; border-radius: 0; padding: 0; overflow: visible; }
.cat::before, .ico, .cat > p, .cat-head small { display: none; }
.cat h3 { font-size: 1rem; font-weight: 700; letter-spacing: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cat-head { display: block; }
.cat ul { margin-top: 8px; }
.cat li a { padding: 4px 0; margin: 0; font-weight: 400; font-size: .97rem; color: var(--ink-2); border-radius: 0; }
.cat li a::after { content: none; }
.cat li a:hover { background: none; padding-left: 0; color: var(--ink); text-decoration: underline; }
.guides { gap: 0 48px; margin-top: 20px; }
.guides a { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 16px 0; gap: 4px; }
.guides a::before, .guides p, .guides .dot { display: none; }
.guides a:hover { transform: none; }
.guides a:hover h3 { text-decoration: underline; }
.guides small { color: var(--ink-2); font-weight: 500; }
.guides h3 { font: 600 1.05rem/1.3 var(--body-font); letter-spacing: 0; }
.allink { border: 0; background: none; padding: 0; border-radius: 0; text-decoration: underline; margin-top: 20px; font-weight: 500; }
.allink:hover { transform: none; }
.cat-title { font-size: 1.2rem; margin-top: 44px; }

.page-head h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; }
.page-head > p { font-size: 1.08rem; }
.page-head .tag { color: var(--ink-2); font-weight: 500; }
.form { border-radius: 18px; gap: 16px; }
.form .hint { background: none; padding: 0; }
.control input, .control select, .control textarea { border-radius: 10px; }
.control :is(input, select, textarea):focus { box-shadow: none; }
input[type="range"]::-webkit-slider-thumb { box-shadow: none; }
.btn { background: var(--blue); box-shadow: none; border-radius: 10px; }
.btn:hover { filter: none; background: var(--blue-deep); }
.btn:active { transform: none; }
.formula { border: 0; border-radius: 0; background: none; padding: 4px 0 4px 18px; }
.formula::before { top: 0; bottom: 0; width: 3px; background: var(--blue); }
.faq { border: 0; background: none; padding: 0; border-radius: 0; }
.faq summary { font: 600 1.02rem/1.4 var(--body-font); }
.faq summary::after { background: none; }
.aside > div { border: 0; background: none; padding: 0; border-radius: 0; }
.aside li a:hover { padding-left: 0; text-decoration: underline; }
.trycalc { background: none; color: inherit; border-radius: 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.trycalc h2 { font-size: 1.1rem; }
.trycalc .chip { color: var(--link); }
.progress { background: var(--blue); height: 2px; }
.pal { backdrop-filter: none; background: rgba(10, 10, 40, .35); }
.pal-box { border-radius: 14px; box-shadow: 0 20px 60px -20px rgba(0, 0, 30, .5); }
footer { background: none; padding-top: 36px; }
.foot li a:hover { transform: none; }
.ch { animation-name: rollcalm; animation-duration: .35s; }
@keyframes rollcalm { from { opacity: 0; transform: translateY(.25em); } }
@media (max-width: 1020px) { .bench:has(.pad:not([hidden])) { grid-template-columns: 1fr; } .pad { max-width: 420px; } }
@media (max-width: 680px) { .display .cap { margin-top: 0; padding-right: 130px; } .bento { gap: 28px; } }
.tries { max-width: 820px; }

/* ── friendly pass ── colourful picture tiles for calculators */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; margin-top: 20px; }
.tile { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 20px; text-decoration: none; background: color-mix(in srgb, var(--hue-t) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--hue-t) 24%, transparent); transition: transform .25s var(--spring), background .2s; }
.tile:hover { transform: translateY(-4px) rotate(-.6deg); background: color-mix(in srgb, var(--hue-t) 22%, var(--surface)); }
.tile:hover .emo { transform: scale(1.12) rotate(6deg); }
.tile[hidden], .grp[hidden] { display: none; }
.emo { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 1.55rem; line-height: 1; background: var(--surface); transition: transform .3s var(--spring); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.tn { font-weight: 600; font-size: .97rem; line-height: 1.25; }
.tiles.mini { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tiles.mini .tile { flex-direction: row; align-items: center; gap: 10px; padding: 9px; border-radius: 14px; }
.tiles.mini .emo { width: 34px; height: 34px; border-radius: 10px; font-size: 1.15rem; flex: none; }
.tiles.mini .tn { font-size: .88rem; font-weight: 500; }
.emo.big { display: inline-grid; width: 1.25em; height: 1.25em; font-size: .8em; border-radius: .32em; margin-right: .3em; vertical-align: -.12em; background: color-mix(in srgb, var(--hue-t) 16%, var(--surface)); }
.sub { margin-top: 44px; font-size: clamp(1.4rem, 2.6vw, 1.8rem); letter-spacing: -0.02em; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.ccard { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; padding: 20px; border-radius: 22px; text-decoration: none; background: color-mix(in srgb, var(--hue-t) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--hue-t) 26%, transparent); transition: transform .25s var(--spring), background .2s; }
.ccard:hover { transform: translateY(-4px); background: color-mix(in srgb, var(--hue-t) 24%, var(--surface)); }
.ccard .ico, .grp-h .ico, .cat-title .ico { display: grid; }
.ccard .ico { grid-row: span 2; }
.ccard b { font: 700 1.2rem/1.2 var(--display-font); letter-spacing: -0.01em; }
.ccard small { color: var(--ink-2); font-size: .9rem; }
.ccard .peek { grid-column: 1 / -1; margin-top: 14px; display: flex; gap: 8px; }
.ccard .peek i { font-style: normal; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: var(--surface); }
.grp { margin-top: 48px; }
.grp-h { display: flex; align-items: center; gap: 12px; font-size: 1.4rem; flex-wrap: wrap; }
.grp-h .ico, .cat-title .ico { width: 40px; height: 40px; border-radius: 13px; }
.grp-h small { font: 400 .95rem var(--body-font); color: var(--ink-2); letter-spacing: 0; }
.guides .dot { display: inline-block; }
.guides small { color: var(--hue-t); font-weight: 600; }
.guides small span { color: var(--ink-2); font-weight: 400; }
.page-head .tag { color: var(--hue-t); font-weight: 600; }
.band-head { align-items: center; }
@media (max-width: 1020px) { .cats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .cats { grid-template-columns: 1fr; } .tiles { grid-template-columns: repeat(2, 1fr); } .ccard .peek { display: none; } }

/* ── plain pass ── one colour, system type, real photos, plain links */
:root { --display-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --body-font: var(--display-font); --paper: #ffffff; --paper-2: #f4f5f7; --ink: #1b1d27; --ink-2: #5b5f6e; --line: #dfe1e7; --blue: #1f4fd8; --blue-deep: #173ba6; --link: #1f4fd8; --go: #1a8a4a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --paper: #14151a; --paper-2: #1b1d24; --surface: #1e2028; --ink: #f1f2f5; --ink-2: #a6aab8; --line: #32353f; --blue: #2c5be0; --link: #9db8ff; --go: #2aa35e; } }
:root[data-theme="dark"] { --paper: #14151a; --paper-2: #1b1d24; --surface: #1e2028; --ink: #f1f2f5; --ink-2: #a6aab8; --line: #32353f; --blue: #2c5be0; --link: #9db8ff; --go: #2aa35e; }
[data-cat] { --hue: var(--blue); --hue-t: var(--link); }
body { font-size: 1.0625rem; }
h1, h2, h3 { letter-spacing: -0.01em; line-height: 1.2; }
.hero h1 { font-size: clamp(1.9rem, 4.4vw, 2.75rem); font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; max-width: none; }
.hero .lede { margin-top: 10px; font-size: 1.08rem; }
.ask input { font-family: var(--body-font); font-weight: 400; letter-spacing: 0; }
.ask .go { background: var(--go); min-width: 0; padding: 0 22px; font-weight: 600; font-size: 1.05rem; }
.ask .go span { display: inline; }
.band { padding-top: clamp(44px, 6vw, 72px); }
.band h2, .grp-h { font-size: 1.45rem; font-weight: 700; }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tile, .tiles.mini .tile { display: inline-block; flex: none; padding: 9px 15px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--link); font-weight: 500; font-size: 1rem; text-decoration: none; transition: none; }
.tile:hover { transform: none; background: var(--paper-2); border-color: var(--link); text-decoration: underline; }
.tiles.mini { display: flex; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; margin-top: 20px; }
.ccard, .ccard:hover { display: block; padding: 0; background: none; border: 0; border-radius: 0; transform: none; }
.ccard .ph { display: block; border-radius: 10px; overflow: hidden; background: var(--paper-2); }
.ccard img, .grp-ph img { display: block; width: 100%; height: auto; aspect-ratio: 40 / 21; object-fit: cover; }
.ccard h3 { margin-top: 12px; font-size: 1.2rem; }
.ccard h3 a { color: var(--ink); text-decoration: none; }
.ccard ul, .glinks { list-style: none; margin: 8px 0 0; padding: 0; }
.ccard li, .glinks li { padding: 3px 0; }
.ccard li a, .glinks a { color: var(--link); text-decoration: none; }
.ccard li a:hover, .glinks a:hover, .ccard h3 a:hover, .ccard .more:hover { text-decoration: underline; }
.ccard .more { display: inline-block; margin-top: 6px; color: var(--ink-2); font-size: .95rem; }
.grp { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.grp-ph { border-radius: 10px; overflow: hidden; background: var(--paper-2); }
.grp-ph img { aspect-ratio: 28 / 19; }
.grp-d { margin: 4px 0 0; color: var(--ink-2); }
.page-head .tag, .guides small { color: var(--ink-2); }
.dot { display: none !important; }
@media (max-width: 860px) { .cats { grid-template-columns: repeat(2, 1fr); gap: 22px 16px; } .grp { grid-template-columns: 1fr; } .grp-ph { max-width: 280px; } }
@media (max-width: 480px) { .ask .go { padding: 0 14px; } }

/* ── phone pass ── answer always in view, bigger tap targets, header fits */
.btn { background: var(--go); border-color: var(--go); }
.btn:hover { background: var(--go); filter: brightness(.93); }
.peek { display: none; }
@media (max-width: 860px) {
  .peek { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font: inherit; text-align: left; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); cursor: pointer; }
  .peek[hidden], .peek.is-off { display: none; }
  .peek span { font-size: .9rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .peek b { font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%; }
  .hero { padding-top: 28px; }
  .tries .chip { padding: 11px 0; }
  .tries { gap: 0 18px; margin-top: 8px; }
  .page-head .tag { display: none; }
  .page-head h1 { font-size: 1.7rem; }
  .page-head p { margin-top: 6px; }
}
@media (max-width: 480px) { .brand { font-size: 1rem; gap: 8px; } .brand span { max-width: 5.6em; line-height: 1.05; } }

/* ── evidence pass ── contrast, 48px touch targets, most-used list in the first phone screen */
:root, :root[data-theme="dark"] { --go: #157a40; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --go: #157a40; } }
.band-first { padding-top: clamp(28px, 4vw, 48px); }
@media (max-width: 860px) {
  .tile, .tiles.mini .tile { padding: 13px 16px; min-height: 48px; }
  .tiles { gap: 8px; }
  .ccard li a, .glinks a, .ccard .more { display: block; padding: 10px 0; }
  .ccard li, .glinks li { padding: 0; }
  .top-bar nav a, .top-bar button { min-height: 48px; display: inline-flex; align-items: center; }
  .tries .chip { padding: 13px 0; }
}
