/* Calcwright's site. The colors are the engineering pad's: its green ink and grid on pale paper,
   and the red of the crosshair, kept for small marks only. Light and dark follow the visitor's system. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter-700.woff2') format('woff2'); }
/* The math font the app sets math in, cut to Latin, Greek and the math signs. */
@font-face { font-family: 'STIX Two Math'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/stix-two-math.woff2') format('woff2'); }

:root {
  color-scheme: light dark;
  --bg: #F6F8F1;
  --bg-2: #EDF2E6;
  --surface: #FFFFFF;
  --ink: #17261C;
  --muted: #536257;
  --line: rgba(31, 81, 51, 0.16);
  --grid: rgba(31, 81, 51, 0.07);
  --green: #1F5133;
  --green-2: #2C6B45;
  --on-green: #F4F1E6;
  --accent: #2C6B45;
  --red: #C8372D;
  --ok: #2E7D3E;
  --violet: #7A4CC2;
  --code-bg: #E8EEE0;
  --shadow: 0 1px 2px rgba(23, 38, 28, 0.06), 0 12px 32px rgba(23, 38, 28, 0.10);
  --radius: 12px;
  --max: 1160px;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --math: 'STIX Two Math', 'Cambria Math', 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1611;
    --bg-2: #131E17;
    --surface: #18251D;
    --ink: #E5ECE3;
    --muted: #9BAE9F;
    --line: rgba(200, 230, 205, 0.14);
    --grid: rgba(200, 230, 205, 0.05);
    --green: #8FD3A0;
    --green-2: #A9E2B7;
    --on-green: #0E1611;
    --accent: #8FD3A0;
    --red: #F07A6F;
    --ok: #7FCF8E;
    --violet: #B79AF0;
    --code-bg: #1E2D24;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, kbd { font-family: var(--mono); font-size: 0.88em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 5px; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface); }
pre { font-family: var(--mono); font-size: 14px; line-height: 1.55; background: var(--code-bg); padding: 14px 16px; border-radius: 10px; overflow-x: auto; margin: 12px 0 20px; }
pre code { background: none; padding: 0; font-size: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.math { font-family: var(--math); font-size: 1.12em; letter-spacing: 0.01em; white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 20px; border-radius: 10px; font: 600 15px/1.2 var(--sans); text-decoration: none; transition: transform .15s ease, background .15s ease; border: 1px solid transparent; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--green); color: var(--on-green); }
.btn-primary:hover { background: var(--green-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); }
.btn.soon { opacity: 0.6; cursor: default; }

/* Header */
header.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; }
nav.links { display: flex; align-items: center; gap: 4px; }
nav.links a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 8px; }
nav.links a:hover { background: var(--bg-2); }
nav.links a[aria-current="page"] { color: var(--accent); }
nav.links a.btn { margin-left: 8px; padding: 0 16px; min-height: 40px; color: var(--on-green); }
nav.links a.btn:hover { background: var(--green-2); }
/* On a phone the web app is a button in the hero and on the Download page, so the header keeps Download in view. */
@media (max-width: 520px) { nav.links a.nav-web { display: none; } }
@media (max-width: 720px) {
  header.top .wrap { flex-wrap: wrap; gap: 0; padding-top: 8px; padding-bottom: 6px; }
  nav.links { width: 100%; overflow-x: auto; margin: 0 -8px; padding-bottom: 2px; scrollbar-width: none; }
  nav.links::-webkit-scrollbar { display: none; }
  nav.links a { padding: 8px 10px; white-space: nowrap; font-size: 14px; }
  nav.links a.btn { margin-left: auto; min-height: 36px; padding: 0 14px; }
}

/* Draft and placeholder notes: what is not settled yet, plainly marked. */
.placeholder { display: inline-block; font: 600 12px/1.4 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--red); border: 1px dashed var(--red); border-radius: 6px; padding: 1px 6px; vertical-align: 0.1em; }
.draft { border: 1px dashed var(--red); background: color-mix(in srgb, var(--red) 6%, var(--surface)); border-radius: var(--radius); padding: 14px 18px; margin: 20px 0; }
.draft strong:first-child { color: var(--red); }

/* Hero */
.hero { padding: 72px 0 40px; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; gap: 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--accent); }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.hero h1 { font-size: clamp(38px, 6vw, 64px); line-height: 1.04; letter-spacing: -0.03em; margin: 14px 0 18px; max-width: 16ch; }
.hero .sub { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 60ch; margin: 0 0 28px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-note { margin-top: 14px; font-size: 14px; color: var(--muted); }

/* A screenshot in a window frame */
.shot { margin: 0; }
.frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.frame .bar { display: flex; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.frame .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.shot figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }
@media (prefers-color-scheme: dark) { .frame img { filter: brightness(0.92); } }

/* Sections */
section { padding: 72px 0; }
section.tight { padding: 48px 0; }
section.band { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.kicker { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 8px; }
h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 14px; }
h3 { font-size: 19px; line-height: 1.3; margin: 0 0 8px; letter-spacing: -0.01em; }
.section-head p, .feature .text > p { color: var(--muted); font-size: 17px; margin: 0; }

/* Typed → shown, as the app's start card */
.typed { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.typed th, .typed td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.typed tr:last-child td { border-bottom: 0; }
.typed th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; background: var(--bg-2); }
.typed td:first-child code { font-size: 15px; }
.typed td.math { font-size: 21px; }
.typed td:last-child { color: var(--muted); font-size: 15px; }
.ok { display: inline-block; font: 700 13px/1 var(--sans); color: #fff; background: var(--ok); padding: 4px 6px; border-radius: 4px; vertical-align: 0.15em; margin-left: 6px; }
@media (prefers-color-scheme: dark) { .ok { color: #0E1611; } }
.ratio { font-family: var(--math); font-size: 15px; margin-left: 4px; }

/* Features: text beside a screenshot */
.feature { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; padding: 28px 0; }
.feature .text ul { padding: 0; margin: 18px 0 0; list-style: none; }
.feature .text li { padding-left: 26px; position: relative; margin: 8px 0; }
.feature .text li::before { content: ''; position: absolute; left: 4px; top: 0.55em; width: 10px; height: 10px; border-radius: 2px; border: 2px solid var(--accent); }
@media (min-width: 900px) {
  .feature { grid-template-columns: 5fr 7fr; gap: 56px; padding: 40px 0; }
  .feature.flip { grid-template-columns: 7fr 5fr; }
  .feature.flip .text { order: 2; }
}

.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card p { margin: 0; color: var(--muted); }
.card .n { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--green); color: var(--on-green); font-weight: 700; margin-bottom: 14px; }

.byo { display: grid; gap: 28px; }
@media (min-width: 900px) { .byo { grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; } }
.agents { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.agents li { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 500; }

.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; }
.faq h3 { margin: 0 0 8px; }
.faq p { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .faq { grid-template-columns: minmax(0, 1fr); gap: 26px; } }
.cta-band { text-align: center; }
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { color: var(--muted); margin: 0 auto 24px; max-width: 56ch; }
.cta-band .ctas { justify-content: center; }

/* Tables of facts */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.facts { width: 100%; border-collapse: collapse; font-size: 15px; }
table.facts th, table.facts td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.facts tr:last-child td { border-bottom: 0; }
table.facts th { background: var(--bg-2); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
table.facts td code { white-space: nowrap; }

/* Inner pages */
main.page { padding: 56px 0 80px; }
main.page h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 14px; }
.intro { font-size: 19px; color: var(--muted); max-width: 64ch; margin: 0 0 32px; }
.prose { max-width: 760px; }
.prose h2 { font-size: clamp(24px, 3vw, 30px); margin: 48px 0 12px; scroll-margin-top: 90px; }
.prose h3 { margin: 28px 0 8px; scroll-margin-top: 90px; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose .shot { margin: 24px 0; }
.prose .updated { color: var(--muted); font-size: 15px; margin-top: -4px; }
.doc-layout { display: grid; gap: 32px; }
.toc { font-size: 15px; }
.toc strong { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.toc a { display: block; text-decoration: none; color: var(--ink); padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.toc a:hover { background: var(--bg-2); }
@media (min-width: 1000px) {
  .doc-layout { grid-template-columns: 220px 1fr; gap: 56px; }
  .toc { position: sticky; top: 90px; align-self: start; }
  .toc ol { display: block; }
  .toc a { border: 0; background: none; padding: 5px 10px; }
}

.platforms { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 24px 0 8px; }
.platform { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.platform p { color: var(--muted); margin: 0 0 18px; }

.buckets { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 20px 0; }
.bucket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.bucket h3 { display: flex; justify-content: space-between; gap: 12px; font-size: 17px; margin-bottom: 4px; }
.bucket h3 span { color: var(--muted); font-weight: 500; font-size: 15px; }
.bucket p { margin: 0; color: var(--muted); font-size: 15px; }
.cols { columns: 2 260px; column-gap: 32px; }
.cols li { break-inside: avoid; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer nav a { color: var(--muted); text-decoration: none; }
footer nav a:hover { color: var(--ink); text-decoration: underline; }
footer .brand { font-size: 16px; }
footer .brand img { width: 22px; height: 22px; }

.lead { font-size: 18px; color: var(--muted); margin: 0; }
.more { margin: 24px 0 0; font-weight: 600; }
.cards.stack { grid-template-columns: 1fr; }
.shot.spaced { margin-top: 40px; }

h2.h3 { font-size: 19px; line-height: 1.3; margin: 0 0 8px; letter-spacing: -0.01em; }
.notfound { font-size: 26px; margin: 0 0 28px; }
.ng { display: inline-block; font: 700 14px/1 var(--sans); color: #fff; background: var(--red); padding: 5px 7px; border-radius: 4px; vertical-align: 0.2em; margin-left: 6px; }
@media (prefers-color-scheme: dark) { .ng { color: #0E1611; } }

/* A grid item may shrink below its content (a long code line scrolls inside its own box). */
.doc-layout > * { min-width: 0; }

/* On a phone, each typed row stacks: what you type, what the sheet shows, then what it is. */
@media (max-width: 640px) {
  .typed thead { display: none; }
  .typed, .typed tbody, .typed tr, .typed td { display: block; width: 100%; }
  .typed tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .typed tr:last-child { border-bottom: 0; }
  .typed th, .typed td, .typed td:last-child { display: block; border: 0; padding: 2px 0; }
  .typed td.math { font-size: 19px; white-space: normal; }
  .typed td:last-child { font-size: 14px; }
}

main.page .wrap > h2 { margin-top: 64px; scroll-margin-top: 90px; }
.shot.narrow { max-width: 760px; }

/* The home page's hero: the copy, then the recorded run. */
.hero-copy { max-width: 820px; }
.hero h1 { max-width: 18ch; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 0; font-size: 15px; color: var(--muted); }
/* A license's price: a launch price, the regular one struck through before it. */
.license-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-size: 18px; }
.license-price .pill { align-self: center; }
.license-price .was { color: var(--muted); }
.license-price strong { font-size: 36px; line-height: 1; letter-spacing: -0.02em; }
.license-price .cur { color: var(--muted); font-weight: 600; font-size: 15px; }
.pill { display: inline-block; font: 700 12px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 6px 10px; }
.demo { margin: 8px auto 0; max-width: 980px; width: 100%; scroll-margin-top: 80px; }
.demo video, .demo .demo-still { display: block; width: 100%; height: auto; }
.demo .demo-still { display: none; }
.demo figcaption { font-size: 14px; color: var(--muted); margin-top: 12px; max-width: 80ch; }
@media (prefers-reduced-motion: reduce) {
  .demo video { display: none; }
  .demo .demo-still { display: block; }
}
@media (prefers-color-scheme: dark) { .demo video, .demo .demo-still { filter: brightness(0.92); } }

/* Three runs behind tabs, with no script: a radio button for each, and :has() shows the chosen one's panel.
   Where :has() is not known, the tabs are hidden and the three runs stand one above the other. */
.demo-tabs { display: none; border: 0; padding: 0; margin: 0 0 12px; gap: 6px; flex-wrap: wrap; }
.demo-tabs legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.demo-tabs label { position: relative; cursor: pointer; }
.demo-tabs input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.demo-tabs span { display: block; font: 600 15px/1 var(--sans); padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); }
.demo-tabs label:hover span { color: var(--ink); border-color: var(--muted); }
.demo-tabs input:checked + span { color: var(--surface); background: var(--accent); border-color: var(--accent); }
.demo-tabs input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-panel + .demo-panel { margin-top: 20px; }
@supports selector(:has(*)) {
  .demo-tabs { display: flex; }
  .demo-panel { display: none; }
  .demo-panel + .demo-panel { margin-top: 0; }
  .demo:has([value="beam"]:checked) [data-demo="beam"],
  .demo:has([value="circuit"]:checked) [data-demo="circuit"],
  .demo:has([value="teacher"]:checked) [data-demo="teacher"] { display: block; }
}

/* Engineers and teachers, side by side. */
.audiences { display: grid; gap: 24px; }
@media (min-width: 900px) { .audiences { grid-template-columns: 1fr 1fr; gap: 32px; } }
.audience { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.audience .frame { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; aspect-ratio: 16 / 10; }
.audience .frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.audience-text { padding: 22px 24px 24px; }
.audience-text h3 { font-size: 20px; margin-bottom: 12px; }
.audience-text ul { margin: 0; padding-left: 20px; }
.audience-text li { margin: 6px 0; }
.audience-text .more { margin-top: 16px; }

.assurances { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.assurances li { padding-left: 28px; position: relative; }
.assurances li::before { content: ''; position: absolute; left: 2px; top: 0.35em; width: 14px; height: 8px; border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg); }
.ctas.spaced-top { margin-top: 28px; }
.eyebrow { align-items: flex-start; }
.eyebrow .dot { flex: none; margin-top: 0.42em; }

/* The hero in two columns on a wide screen, so the run is in view without scrolling. */
.byo-note { margin: -10px 0 26px; font-size: 15px; color: var(--muted); padding-left: 12px; border-left: 3px solid var(--violet); max-width: 60ch; }
@media (min-width: 1100px) {
  .hero { padding: 56px 0 48px; }
  .hero .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; gap: 48px; max-width: 1320px; }
  .hero-copy { padding-top: 40px; }
  .hero h1 { font-size: clamp(40px, 3.7vw, 54px); max-width: none; }
  .hero .sub { font-size: 18px; }
  .demo { margin: 0; max-width: none; }
}
