@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;600;700;800&display=swap');

:root { --ink:#182320; --muted:#65716b; --paper:#f5f3ed; --line:rgba(24,35,32,.16); --accent:#e7654e; --deep:#183d2d; --soft:#e8e8dc; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html, body { min-height:100%; }
body { margin:0; background:var(--paper); color:var(--ink); font-family:'Manrope',sans-serif; overflow-x:hidden; cursor:none; }
button, input { font:inherit; }
button { cursor:none; }
.app-shell { width:100%; min-height:100dvh; padding:clamp(18px,3.4vw,48px) clamp(20px,6vw,92px) 18px; display:grid; grid-template-rows:auto auto 1fr auto; position:relative; isolation:isolate; overflow-x:clip; }
.app-shell:before { content:''; position:absolute; z-index:-1; width:36vw; height:36vw; right:-17vw; top:-23vw; border-radius:50%; background:var(--soft); }
.topbar, .bottom-line { display:flex; align-items:center; justify-content:space-between; }
.topbar { animation:rise .7s ease both; }
.brand { color:var(--ink); text-decoration:none; display:flex; align-items:center; gap:10px; font-size:10px; line-height:1.05; letter-spacing:.04em; text-transform:uppercase; }
.brand strong { font-size:15px; letter-spacing:-.05em; text-transform:none; }
.brand-mark { width:35px; height:35px; display:grid; place-items:center; border:1px solid var(--ink); border-radius:50%; font-size:26px; transform:rotate(-25deg); }
.status-pill { display:flex; align-items:center; gap:8px; color:var(--muted); font:10px 'DM Mono',monospace; text-transform:uppercase; letter-spacing:.08em; }
.status-pill i { width:7px; height:7px; display:block; border-radius:50%; background:var(--deep); }
.tabs { justify-self:center; min-width:0; display:flex; gap:4px; margin-top:20px; padding:4px; border:1px solid var(--line); border-radius:4px; }
.tab { border:0; padding:8px 13px; color:var(--muted); background:transparent; font:10px 'DM Mono',monospace; text-transform:uppercase; letter-spacing:.05em; }
.tab.is-active { color:var(--paper); background:var(--deep); }
.workspace { width:min(1120px,100%); min-width:0; margin:auto; display:grid; grid-template-columns:.7fr 1.3fr; gap:clamp(32px,7vw,110px); align-items:center; }
.intro-block { animation:rise .8s .1s ease both; }
.eyebrow, .section-index, .result-label, .keypad-heading { margin:0; color:var(--muted); font:10px 'DM Mono',monospace; letter-spacing:.1em; text-transform:uppercase; }
h1 { margin:16px 0 18px; font-size:clamp(47px,6vw,82px); line-height:.88; letter-spacing:-.085em; font-weight:800; }
h1 em { color:var(--accent); font-style:normal; }
.intro-copy { max-width:320px; margin:0; color:var(--muted); font-size:13px; line-height:1.6; }
.equation-tag { display:inline-flex; align-items:center; gap:10px; margin-top:25px; padding:10px 14px; border:1px solid var(--line); border-radius:100px; font:14px 'DM Mono',monospace; }
.equation-tag b { color:var(--accent); font-weight:500; }
.calculator-panel { min-width:0; padding:clamp(19px,2.8vw,34px); background:var(--deep); color:#f8f4e8; border-radius:4px; box-shadow:15px 17px 0 rgba(24,61,45,.08); animation:rise .8s .16s ease both; }
.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:20px; }
.panel-heading h2 { margin:7px 0 0; font-size:clamp(23px,2.6vw,34px); letter-spacing:-.07em; line-height:1; }
.spark { color:var(--accent); font-size:22px; }
.fields-grid, .complex-fields { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.input-row { min-width:0; min-height:78px; padding:11px 13px; display:grid; grid-template-columns:28px 1fr 116px; gap:9px; align-items:center; border:1px solid rgba(248,244,232,.22); border-radius:5px; color:#f8f4e8; background:rgba(255,255,255,.055); transition:border-color .2s ease,background .2s ease,transform .2s ease; }
.input-row:hover, .input-row:focus-within { border-color:var(--accent); background:rgba(255,255,255,.1); transform:translateY(-2px); }
.field-symbol { color:var(--accent); font:18px 'DM Mono',monospace; }
.input-row strong, .input-row small { display:block; }
.input-row strong { font-size:11px; line-height:1.15; }
.input-row small { margin-top:3px; color:rgba(248,244,232,.55); font-size:9px; }
.input-row input { width:100%; min-width:0; border:1px solid rgba(24,35,32,.12); border-radius:4px; outline:0; padding:10px 9px; color:var(--ink); background:#f8f4e8; text-align:right; font:500 17px 'DM Mono',monospace; box-shadow:inset 0 0 0 2px transparent; transition:box-shadow .2s ease,background .2s ease; }
.input-row input::placeholder { color:var(--muted); font:10px 'Manrope',sans-serif; }
.input-row input:focus { box-shadow:inset 0 0 0 2px var(--accent); background:#fff; }
.calculated-row { border-color:rgba(231,101,78,.45); background:rgba(231,101,78,.1); }
.calculated-row input { color:var(--accent); font-weight:700; }
.input-row input::-webkit-outer-spin-button, .input-row input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.steps { display:flex; flex-wrap:wrap; gap:7px 14px; margin-top:10px; color:rgba(248,244,232,.6); font:9px 'DM Mono',monospace; }
.result-strip { min-height:66px; margin-top:12px; padding:13px 16px; display:flex; align-items:center; justify-content:space-between; background:#f8f4e8; color:var(--ink); border-radius:3px; }
.result-strip p { margin:4px 0 0; color:var(--muted); font-size:11px; }
.result-value { color:var(--accent); font:500 clamp(26px,3.3vw,42px) 'DM Mono',monospace; letter-spacing:-.1em; }
.calculator-panel.is-complex .result-strip { min-height:118px; margin-top:22px; padding:20px 24px; }
.calculator-panel.is-complex .result-value { font-size:clamp(48px,6vw,78px); letter-spacing:-.12em; }
.calculator-panel.is-complex .result-strip p { max-width:560px; }
.keypad-wrap { margin-top:14px; }
.keypad-heading { display:flex; justify-content:space-between; margin-bottom:6px; color:rgba(248,244,232,.7); }
.keypad-heading small { color:var(--accent); font:9px 'DM Mono',monospace; text-transform:none; }
.keypad { display:grid; grid-template-columns:repeat(6,1fr); gap:5px; }
.keypad button { min-height:28px; border:1px solid rgba(248,244,232,.16); border-radius:2px; color:#f8f4e8; background:rgba(255,255,255,.07); font:13px 'DM Mono',monospace; transition:background .15s ease,transform .15s ease; }
.keypad button:hover { color:var(--deep); background:var(--accent); transform:translateY(-2px); }
.keypad-toggle { display:block; margin:12px 0 0 auto; border:0; padding:0; color:var(--accent); background:transparent; font:10px 'DM Mono',monospace; text-transform:uppercase; }
.keypad-toggle span { display:inline-block; width:14px; font-size:15px; vertical-align:-1px; }
.panel-footer { display:flex; align-items:center; justify-content:space-between; gap:18px; padding-top:12px; }
.panel-footer p { margin:0; color:rgba(248,244,232,.55); font:9px 'DM Mono',monospace; }
#reset-button { border:0; padding:0; color:var(--accent); background:transparent; font:10px 'DM Mono',monospace; text-transform:uppercase; white-space:nowrap; }
.bottom-line { color:var(--muted); font:9px 'DM Mono',monospace; letter-spacing:.06em; text-transform:uppercase; }
.bottom-line b { color:var(--accent); font-size:14px; vertical-align:-1px; }
.cursor-dot { position:fixed; z-index:10; top:-6px; left:-6px; width:12px; height:12px; border:1px solid var(--accent); border-radius:50%; pointer-events:none; transform:translate(-20px,-20px); transition:width .2s ease,height .2s ease,background .2s ease; }
@keyframes rise { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@media (max-width:720px) {
  body { cursor:auto; }
  button { cursor:pointer; }
  .app-shell { padding:17px 16px 13px; }
  .tabs { margin-top:14px; }
  .tab { padding:7px 8px; font-size:8px; }
  .workspace { grid-template-columns:1fr; gap:24px; margin:38px 0 28px; }
  h1 { margin:9px 0 10px; font-size:clamp(42px,13vw,65px); }
  .intro-copy { max-width:410px; font-size:11px; line-height:1.35; }
  .equation-tag { margin-top:12px; padding:7px 11px; font-size:12px; }
  .calculator-panel { padding:15px; }
  .fields-grid, .complex-fields { grid-template-columns:1fr; }
  .panel-heading { margin-bottom:12px; }
  .panel-heading h2 { font-size:23px; }
  .input-row { min-height:68px; padding:8px 9px; grid-template-columns:22px 1fr 92px; gap:6px; }
  .input-row strong { font-size:9px; }
  .input-row small { font-size:8px; }
  .input-row input { width:100%; font-size:15px; }
  .calculator-panel.is-complex .result-strip { min-height:100px; padding:16px; }
  .calculator-panel.is-complex .result-value { font-size:clamp(38px,12vw,58px); }
  .steps { font-size:8px; }
  .keypad button { min-height:29px; font-size:11px; }
  .bottom-line { gap:10px; }
  .bottom-line span:last-child { text-align:right; }
}
@media (pointer:coarse) { .cursor-dot { display:none; } }
