/* Do The Math — site styles. Brand: ink #0B0B10, green #2BD67B, cream #F2EFE6, mist #9CA3AF. */
@font-face { font-family: 'IS'; src: url(/static/InstrumentSerif-Italic.ttf) format('truetype'); font-style: italic; font-display: swap; }
@font-face { font-family: 'GM'; src: url(/static/GeistMono-Medium.woff2) format('woff2'); font-display: swap; }
:root {
  --ink: #0B0B10; --card: #14151C; --line: rgba(242,239,230,.10); --text: #F2EFE6; --mist: #9CA3AF;
  --green: #2BD67B; --green-d: #1FA85F; --max: 1120px; --read: 720px;
  /* theme-dependent helpers */
  --accent: #2BD67B; --body: #E3E0D7; --soft: rgba(242,239,230,.04); --top-bg: rgba(11,11,16,.92);
  --ink-rgb: 11,11,16; --glow: rgba(43,214,123,.18); --stat-a: rgba(43,214,123,.14); --stat-b: rgba(43,214,123,.03); --stat-line: rgba(43,214,123,.35);
  color-scheme: dark;
}
/* Light theme: warm paper, ink text; green darkened where it is text so it stays readable. */
:root[data-theme="light"] {
  --ink: #F7F5EF; --card: #FFFFFF; --line: rgba(11,11,16,.12); --text: #0B0B10; --mist: #545B66;
  --accent: #12804A; --body: #23252B; --soft: rgba(11,11,16,.04); --top-bg: rgba(247,245,239,.92);
  --ink-rgb: 247,245,239; --glow: rgba(43,214,123,.22); --stat-a: rgba(43,214,123,.16); --stat-b: rgba(43,214,123,.05); --stat-line: rgba(18,128,74,.35);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font: 17px/1.65 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.read { max-width: var(--read); margin: 0 auto; padding: 0 20px; }
.mono { font-family: 'GM', ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; color: var(--mist); }
.serif { font-family: 'IS', Georgia, serif; font-style: italic; font-weight: 400; }
.g { color: var(--accent); }

/* header / footer */
.top { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--top-bg); backdrop-filter: blur(8px); z-index: 10; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 900; font-size: 20px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.mark { position: relative; width: 30px; height: 22px; flex: none; }
.mark i { position: absolute; left: 0; height: 7px; border-radius: 9px; display: block; }
.mark i:first-child { top: 2px; width: 18px; background: var(--text); }
.mark i:last-child { top: 13px; width: 30px; background: var(--green); }
nav a { color: var(--text); margin-left: 22px; font-weight: 600; font-size: 15px; }
nav a:hover { color: var(--accent); text-decoration: none; }
.foot { border-top: 1px solid var(--line); margin-top: 80px; padding: 40px 0 60px; color: var(--mist); font-size: 14px; }
.foot .cols { display: flex; flex-wrap: wrap; gap: 28px 60px; justify-content: space-between; }
.foot a { color: var(--mist); display: block; margin: 4px 0; }
.foot a:hover { color: var(--text); }
.disclaimer { margin-top: 28px; font-size: 13px; line-height: 1.6; max-width: 820px; }

/* hero */
.hero { padding: 80px 0 56px; background: radial-gradient(900px 500px at 70% -10%, var(--glow), transparent 70%); }
.hero h1 { font-size: clamp(42px, 7vw, 86px); line-height: .95; letter-spacing: -.045em; font-weight: 900; margin: 14px 0 18px; }
.hero p { font-size: 20px; color: var(--mist); max-width: 620px; margin: 0 0 28px; }
.btn { display: inline-block; background: var(--green); color: #0B0B10; font-weight: 800; padding: 13px 22px; border-radius: 999px; }
.btn:hover { background: #3be38a; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); margin-left: 10px; }

/* sections & cards */
section.block { padding: 40px 0; }
h2.sec { font-size: 30px; letter-spacing: -.03em; font-weight: 900; margin: 0 0 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; color: var(--text); transition: border-color .15s, transform .15s; }
.card:hover { border-color: rgba(43,214,123,.5); transform: translateY(-2px); text-decoration: none; }
.card h3 { margin: 8px 0 6px; font-size: 20px; letter-spacing: -.02em; line-height: 1.25; }
.card p { margin: 0; color: var(--mist); font-size: 15px; line-height: 1.5; }
.card .num { font-weight: 900; font-size: 30px; color: var(--accent); letter-spacing: -.03em; }

/* article */
.crumbs { font-size: 14px; color: var(--mist); padding-top: 28px; }
.crumbs a { color: var(--mist); }
article h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: -.035em; font-weight: 900; margin: 14px 0 12px; }
article .lede { font-size: 21px; color: var(--mist); margin: 0 0 18px; }
article .meta { font-size: 14px; color: var(--mist); margin-bottom: 30px; }
article h2 { font-size: 28px; letter-spacing: -.025em; margin: 44px 0 10px; line-height: 1.2; }
article h3 { font-size: 21px; margin: 30px 0 8px; }
article p, article li { color: var(--body); }
article ul, article ol { padding-left: 22px; }
article li { margin: 6px 0; }
article strong { color: var(--text); }
.stat { margin: 28px 0; padding: 22px 24px; border-radius: 16px; background: linear-gradient(135deg, var(--stat-a), var(--stat-b)); border: 1px solid var(--stat-line); }
.stat .v { font-size: clamp(36px, 6vw, 54px); font-weight: 900; letter-spacing: -.04em; color: var(--accent); line-height: 1; }
.stat .l { margin-top: 8px; color: var(--mist); font-size: 15px; }
.note { margin: 28px 0; padding: 16px 18px; border-left: 3px solid var(--mist); background: var(--soft); color: var(--mist); font-size: 15px; border-radius: 0 10px 10px 0; }
.tw { overflow-x: auto; margin: 20px 0; }
.tw table { margin: 0; }
table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--mist); font-weight: 600; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.video { position: relative; aspect-ratio: 16 / 9; margin: 28px 0; border-radius: 14px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cta { margin: 40px 0; padding: 24px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.cta h3 { margin: 0 0 6px; }
.cta p { margin: 0 0 14px; color: var(--mist); }

/* calculator */
.calc { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px; margin: 26px 0 34px; }
.calc .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.calc label { display: block; font-size: 14px; color: var(--mist); margin-bottom: 6px; font-weight: 600; }
.calc input, .calc select { width: 100%; background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: 600 18px Inter, system-ui, sans-serif; }
.calc input:focus, .calc select:focus { outline: none; border-color: var(--green); }
.calc .out { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.calc .o .k { font-size: 13px; color: var(--mist); }
.calc .o .val { font-size: 30px; font-weight: 900; letter-spacing: -.03em; line-height: 1.15; }
.calc .o.big .val { color: var(--accent); font-size: 40px; }
.calc .msg { margin-top: 14px; color: var(--mist); font-size: 15px; }
.calc svg { width: 100%; height: auto; margin-top: 18px; }
.faq h3 { margin-top: 26px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  nav a { margin-left: 14px; font-size: 14px; }
  nav a.hide-s { display: none; }
  .hero { padding: 54px 0 36px; }
  .btn.ghost { margin: 10px 0 0; }
  th, td { padding: 9px 8px; font-size: 14px; }
  .calc { padding: 20px; }
  .calc .o.big .val { font-size: 34px; }
}

/* images */
.card { overflow: hidden; }
.card .thumb { margin: -22px -22px 16px; width: calc(100% + 44px); max-width: none; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--line); }
.hero-img { margin: 0 0 30px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.hero-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero.has-img { position: relative; overflow: hidden; }
.hero.has-img::before { content: ""; position: absolute; inset: 0; background: var(--hero) right center / auto 100% no-repeat; opacity: .9; -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000 70%); mask-image: linear-gradient(90deg, transparent 35%, #000 70%); }
.hero.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--ink) 30%, rgba(var(--ink-rgb),.75) 55%, rgba(var(--ink-rgb),.1) 100%); }
.hero.has-img .wrap { position: relative; z-index: 1; }
@media (max-width: 640px) { .hero.has-img::before { background-size: cover; opacity: .35; } }
.sources { margin: 34px 0 0; padding: 18px 20px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 15px; }
.sources ul { margin: 8px 0; padding-left: 20px; }
.sources p { margin: 6px 0 0; color: var(--mist); font-size: 14px; }
h2.sec a { vertical-align: middle; }
.foot a.brand { display: flex; color: var(--text); margin-bottom: 6px; }

/* theme toggle */
.top .right { display: flex; align-items: center; gap: 6px; }
.theme { background: none; border: 1px solid var(--line); color: var(--text); width: 38px; height: 38px; border-radius: 999px; display: inline-grid; place-items: center; cursor: pointer; margin-left: 14px; padding: 0; flex: none; }
.theme:hover { border-color: var(--accent); color: var(--accent); }
.theme svg { width: 18px; height: 18px; }
.theme .sun { display: none; }
:root[data-theme="light"] .theme .sun { display: block; }
:root[data-theme="light"] .theme .moon { display: none; }
:root[data-theme="light"] .card:hover { box-shadow: 0 8px 24px rgba(11,11,16,.08); }
@media (max-width: 640px) {
  .top .wrap { gap: 10px; }
  .brand { white-space: nowrap; }
  nav a { margin-left: 14px; font-size: 14px; }
  .theme { margin-left: 10px; width: 34px; height: 34px; }
}
@media (max-width: 430px) {
  .top .brand { font-size: 0; gap: 0; }   /* keep the logo mark, drop the wordmark so nav + toggle fit */
}
/* Spreadsheet pack box (our own product) */
.pack { display: flex; gap: 22px; align-items: center; margin: 32px 0; padding: 22px; border: 1px solid var(--stat-line); border-radius: 16px; background: linear-gradient(135deg, var(--stat-a), var(--stat-b)); }
.pack img { width: 120px; height: 120px; border-radius: 12px; flex: none; }
.pack h3 { margin: 6px 0 6px; font-size: 21px; letter-spacing: -.02em; line-height: 1.25; }
.pack p { margin: 0 0 14px; color: var(--body); font-size: 15px; line-height: 1.5; }
.pack .btn { padding: 11px 20px; font-size: 15px; }
@media (max-width: 560px) { .pack { flex-direction: column; align-items: flex-start; } .pack img { width: 96px; height: 96px; } }
