:root {
  --bg: #f4f2ed;
  --bg-2: #ebe8e1;
  --surface: #ffffff;
  --ink: #16171a;
  --ink-2: #3b3e45;
  --muted: #6b6f78;
  --line: #dcd8ce;
  --line-strong: #c4bfb3;
  --accent: #ff5a1f;
  --accent-hover: #ff7442;
  --accent-text: #c2410c;
  --accent-soft: rgba(255, 90, 31, 0.12);
  --dark: #141518;
  --dark-2: #1c1e22;
  --dark-line: #2c2f35;
  --radius: 14px;
  --maxw: 1160px;
  --header-h: 68px;
  --font-head: "Archivo", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-head);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}
.skip:focus { left: 16px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn .store-mark { width: 18px; height: 18px; flex: none; }

.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2a2c31; }

.btn-ghost,
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover,
.btn-outline:hover { border-color: var(--ink); }

.btn-on-dark { background: transparent; border-color: rgba(255, 255, 255, 0.28); color: #fff; }
.btn-on-dark:hover { border-color: #fff; }

.btn-small { padding: 9px 16px; font-size: 14px; }
.btn-large { padding: 18px 28px; font-size: 17px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-link span { transition: transform 0.15s; }
.text-link:hover span { transform: translateX(3px); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 242, 237, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand img { width: 34px; height: 34px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav .btn { margin-left: 10px; }

.nav-link {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.nav-link:hover { background: var(--bg-2); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--bg-2); color: var(--ink); }

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle:hover { background: var(--bg-2); }
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, top 0.2s ease;
}
.nav-toggle-icon::before { top: 17px; }
.nav-toggle-icon::after { top: 25px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { top: 21px; transform: rotate(-45deg); }

/* Eyebrow label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current="page"] { color: var(--ink); }

/* Hero */
.hero {
  position: relative;
  padding: 80px 0 104px;
  overflow: hidden;
}
.hero::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.6;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 75% 45%, #000 15%, transparent 70%);
  mask-image: radial-gradient(ellipse 75% 70% at 75% 45%, #000 15%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 64px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hl {
  padding: 0 0.04em;
  background: linear-gradient(transparent 62%, rgba(255, 90, 31, 0.5) 62%, rgba(255, 90, 31, 0.5) 90%, transparent 90%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.lead {
  max-width: 34em;
  margin-top: 24px;
  color: var(--ink-2);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.page-hero .cta-row { margin-top: 28px; }
.page-hero .cta-row + .jump { margin-top: 24px; }

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.hero-facts li::before {
  content: "";
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
}

/* Inner page header */
.page-hero {
  position: relative;
  padding: 88px 0 80px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.page-hero::before {
  -webkit-mask-image: radial-gradient(ellipse 60% 100% at 90% 20%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 100% at 90% 20%, #000 10%, transparent 70%);
}
.page-hero .container { position: relative; }
.page-hero h1 {
  max-width: 15em;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.035em;
}
.page-hero .lead { max-width: 38em; }
.page-hero-compact { padding: 64px 0 56px; }
.page-hero-compact h1 { font-size: clamp(2.2rem, 4.2vw, 3.2rem); }

.updated {
  margin-top: 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Jump links */
.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.jump a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s;
}
.jump a:hover { border-color: var(--ink); }
.jump a[aria-current="page"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.jump a[aria-current="page"] span { color: var(--accent); }
.jump a span {
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Calculation card */
.calc-card {
  margin: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 28px 60px -28px rgba(22, 23, 26, 0.3);
}

.calc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.calc-app {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
}

.xsection { width: 100%; height: auto; padding: 18px 12px 6px; }

.xsection .soil { fill: url(#hatch); }
.xsection .hatch-bg { fill: #faf9f6; }
.xsection .hatch-line { stroke: #d3cec2; stroke-width: 1; }
.xsection .void { fill: rgba(255, 90, 31, 0.08); }
.xsection .cut {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.6s cubic-bezier(0.6, 0, 0.2, 1) 0.2s forwards;
}
.xsection .dim line { stroke: var(--accent-text); stroke-width: 1.1; }
.xsection .dim .ext { stroke-opacity: 0.45; stroke-dasharray: 3 3; }
.xsection .dim .tick { stroke-width: 1.6; }
.xsection .dim-text {
  fill: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
}
.xsection .dim-muted { fill: var(--muted); }
.xsection .dim,
.xsection .dim-text {
  opacity: 0;
  animation: fade 0.5s ease 1.4s forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .xsection .cut { animation: none; stroke-dashoffset: 0; }
  .xsection .dim,
  .xsection .dim-text { animation: none; opacity: 1; }
  .btn:hover { transform: none; }
}

.calc-readout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}
.calc-readout div { padding: 14px 20px; border-right: 1px solid var(--line); }
.calc-readout div:last-child { border-right: 0; }
.calc-readout dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.calc-readout dd {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
}

.calc-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: var(--ink);
  color: #fff;
}
.calc-total span {
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.calc-total strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
}

/* Worked-example rows (tools page) */
.spec-rows { margin: 0; }
.spec-rows div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.spec-rows div:last-child { border-bottom: 0; }
.spec-rows dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.spec-rows dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  text-align: right;
}
.spec-rows .spec-working { background: #faf9f6; }
.spec-rows .spec-working dd { color: var(--accent-text); }

/* Sections */
.section { padding: 112px 0; }
.section-white { background: var(--surface); border-top: 1px solid var(--line); }
.page-hero + .section-white { border-top: 0; }

.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head h2 {
  font-size: clamp(2.1rem, 3.8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.section-head p:not(.eyebrow) {
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 1.1rem;
}
.section-head .text-link { margin-top: 20px; }

.section-foot { margin-top: 40px; }

/* Split: heading left, copy right */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px 64px;
  align-items: start;
}
.split h2 {
  font-size: clamp(2.1rem, 3.8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.split-body p { color: var(--ink-2); font-size: 1.1rem; }
.split-body p + p { margin-top: 18px; }

/* Modules */
.modules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.modules-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.module {
  display: block;
  height: 100%;
  padding: 20px 0 36px;
  border-top: 1px solid var(--line-strong);
  text-decoration: none;
  transition: border-color 0.2s;
}
a.module:hover { border-top-color: var(--ink); }
.module-no {
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}
.module h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 1.2rem;
  font-weight: 700;
}
.module p { margin-top: 8px; color: var(--muted); font-size: 0.95rem; }
.module-more {
  display: inline-flex;
  gap: 6px;
  margin-top: 16px;
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
}
.module-more span { transition: transform 0.15s; }
.section-follow { margin-top: 28px; }

.explain { display: grid; gap: 88px; }
.explain-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 32px 56px;
  align-items: center;
}
.explain-copy h3 {
  margin-top: 12px;
  font-size: clamp(1.7rem, 2.6vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.explain-copy p { margin-top: 16px; color: var(--ink-2); font-size: 1.05rem; }
.explain-copy .eyebrow { margin-top: 0; }
.explain-shot { margin: 0; }
.explain-shot img {
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.shot { margin: 0; display: flex; flex-direction: column; height: 100%; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.shot figcaption {
  margin-top: auto;
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}
.prose .shot {
  float: right;
  width: 240px;
  margin: 6px 0 16px 28px;
}
.prose .shot-stack {
  float: none;
  clear: both;
  width: min(280px, 100%);
  margin: 18px 0 0;
}
.prose h2 { clear: both; }
.prose::after {
  content: "";
  display: block;
  clear: both;
}
a.module:hover .module-more span { transform: translateX(3px); }
.app-group-title {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.app-group-title + .modules { margin-top: 8px; }
.modules + .app-group-title { margin-top: 48px; }
.modules-apps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.modules-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }
.app-hold {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Dark section */
.section-dark { background: var(--dark); color: #fff; }
.section-dark .eyebrow { color: rgba(255, 255, 255, 0.7); }
.section-dark .text-link { color: var(--accent); }

.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature {
  padding: 28px;
  background: var(--dark-2);
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 90, 31, 0.14);
}
.feature-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature h3 { margin-top: 22px; font-size: 1.15rem; font-weight: 700; }
.feature p { margin-top: 10px; color: rgba(255, 255, 255, 0.66); font-size: 0.95rem; }

.step-no {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.step-no + h3 { margin-top: 18px; }

/* Tools page */
.tool { padding: 104px 0; }
.tool + .tool { border-top: 1px solid var(--line); }
.tool.section-white { border-top: 1px solid var(--line); }

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
}
.tool-flip .tool-copy { order: 2; }

.tool h2 {
  margin-top: 14px;
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.tool-lead {
  max-width: 30em;
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 1.1rem;
}

.checklist {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.checklist a,
.module p a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}
.checklist li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 0.6em;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
}

.calc-card .calc-head .calc-example { color: var(--accent-text); }

/* About page: principles */
.principles {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--dark-line);
}
.principle {
  display: grid;
  grid-template-columns: 72px minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 16px 40px;
  align-items: baseline;
  padding: 36px 0;
  border-bottom: 1px solid var(--dark-line);
}
.principle .step-no { font-size: 13px; }
.principle h3 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 800; letter-spacing: -0.025em; }
.principle p { color: rgba(255, 255, 255, 0.7); font-size: 1.05rem; }

/* Contact page */
.email-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  padding: 36px 40px;
  background: var(--ink);
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 28px 60px -32px rgba(22, 23, 26, 0.5);
}
.email-card-label {
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.email-card-address {
  display: inline-block;
  margin-top: 8px;
  color: #fff;
  font-family: var(--font-head);
  font-size: clamp(1.45rem, 3.6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.email-card-address:hover { color: var(--accent); }
.email-card-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.email-card + .section-head { margin: 96px 0 40px; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.section-white .card { background: var(--bg); }
.card .feature-icon { background: var(--accent-soft); }
.card .feature-icon svg { stroke: var(--accent-text); }
.card h3 { margin-top: 20px; font-size: 1.2rem; font-weight: 700; }
.card p { flex: 1; margin-top: 10px; color: var(--muted); font-size: 0.95rem; }
.card .text-link { margin-top: 22px; font-size: 15px; }

/* Legal pages */
.legal { padding: 64px 0 112px; background: var(--surface); }
.legal-doc { max-width: 800px; }
.legal-back { margin-top: 20px; font-size: 15px; }
.legal-back .text-link span { transition: transform 0.15s; }
.legal-back .text-link:hover span { transform: translateX(-3px); }

.prose { color: var(--ink-2); font-size: 1.02rem; line-height: 1.7; overflow-wrap: anywhere; }
.prose h2 {
  margin: 48px 0 0;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 700;
}
.prose > :first-child { margin-top: 0; }
.prose h3 { margin: 28px 0 0; color: var(--ink); font-size: 1.1rem; font-weight: 700; }
.prose p,
.prose ul,
.prose ol { margin: 14px 0 0; }
.prose ul,
.prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 6px; }
.prose li > ul,
.prose li > ol { margin-top: 8px; }
.prose li::marker { color: var(--accent-text); }
.prose a { color: var(--accent-text); text-underline-offset: 3px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose .effective-date {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}
.prose .section-number { color: var(--accent-text); }
.prose .toc-list {
  padding: 18px 22px;
  list-style: none;
  background: var(--bg);
  border-radius: 12px;
  columns: 2;
  column-gap: 32px;
}
.prose .toc-list li { margin: 0; padding: 3px 0; break-inside: avoid; }

.callout {
  margin-top: 20px;
  padding: 20px 22px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: var(--ink);
}
.callout p { margin: 0; }
.callout p + p { margin-top: 10px; }
.callout-warning { background: rgba(220, 38, 38, 0.07); border-left-color: #dc2626; }

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.prose table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-wrap: normal;
}
.prose th,
.prose td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th { background: var(--bg); color: var(--ink); font-weight: 600; }
.prose tbody tr:last-child td { border-bottom: 0; }

/* Legal index */
.doc-group {
  margin: 56px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.doc-group:first-child { margin-top: 0; }
.doc-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.doc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.doc-row h3 { font-size: 1.2rem; font-weight: 700; }
.doc-meta { margin-top: 4px; color: var(--muted); font-size: 0.95rem; }
.doc-links { display: flex; flex-wrap: wrap; gap: 10px; }
.doc-contact { margin-top: 48px; color: var(--ink-2); }
.doc-contact a { color: var(--accent-text); text-underline-offset: 3px; }

/* 404 */
.notfound { padding: 112px 0 136px; border-bottom: 0; }
.notfound-dim { width: 260px; margin-bottom: 36px; }
.notfound-dim line { stroke: var(--accent-text); stroke-width: 1.4; }
.notfound-dim .ext { stroke-opacity: 0.45; stroke-dasharray: 3 3; }
.notfound-dim text {
  fill: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
}

/* Contact band */
.contact { padding: 96px 0; background: var(--accent); color: var(--ink); }
.contact-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px 48px;
}
.contact h2 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.contact p { max-width: 32em; margin-top: 12px; color: rgba(22, 23, 26, 0.82); font-size: 1.1rem; }

/* Footer */
.site-footer { padding: 64px 0 32px; background: var(--dark); color: rgba(255, 255, 255, 0.65); }
.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px 64px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--dark-line);
}
.site-footer .brand { color: #fff; font-size: 17px; }
.site-footer .brand img { width: 28px; height: 28px; }
.footer-tagline { max-width: 22em; margin-top: 14px; font-size: 14px; }
.social-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.social-links a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--dark-line);
  border-radius: 8px;
}
.social-links a:hover { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.social-links svg { width: 16px; height: 16px; display: block; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 32px 72px; }
.footer-title {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer-cols ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.footer-cols a,
.footer-bottom a { font-size: 14px; text-decoration: none; }
.footer-cols a:hover,
.footer-bottom a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 28px;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 980px) {
  .hero { padding: 48px 0 80px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .modules,
  .modules-apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .tool-flip .tool-copy { order: 0; }
  .tool .calc-card { max-width: 560px; }
  .split,
  .explain-row { grid-template-columns: minmax(0, 1fr); }
  .explain { gap: 64px; }
  .principle { grid-template-columns: 56px minmax(0, 1fr); }
  .principle p { grid-column: 2; }
}

@media (max-width: 760px) {
  .section { padding: 80px 0; }
  .tool { padding: 80px 0; }
  .page-hero { padding: 64px 0 56px; }
  .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
  .modules-2 { grid-template-columns: minmax(0, 1fr); max-width: none; }
  .prose .shot {
    float: none;
    width: min(280px, 100%);
    margin: 16px 0 0;
  }
  .cards { grid-template-columns: minmax(0, 1fr); }

  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 32px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(22, 23, 26, 0.28);
  }
  .site-header.is-open .nav { display: flex; }
  .nav-link { padding: 13px 12px; font-size: 17px; }
  .nav .btn { margin: 12px 0 0; padding: 14px; font-size: 16px; }
}

@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .nav { padding: 8px 16px 20px; }
  .section { padding: 64px 0; }
  .tool { padding: 64px 0; }
  .section-head { margin-bottom: 40px; }
  .modules,
  .modules-3,
  .features { grid-template-columns: minmax(0, 1fr); }
  .module { padding-bottom: 24px; }
  .xsection .dim-text { font-size: 19px; }
  .calc-readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-readout div:nth-child(2) { border-right: 0; }
  .calc-readout div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .calc-total strong { font-size: 22px; }
  .spec-rows div { padding: 12px 16px; }
  .spec-rows dd { font-size: 15px; }
  .principle { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 28px 0; }
  .principle p { grid-column: auto; }
  .email-card { padding: 28px 22px; }
  .email-card-actions,
  .email-card-actions .btn { width: 100%; }
  .legal { padding: 48px 0 80px; }
  .prose .toc-list { columns: 1; }
  .contact { padding: 72px 0; }
  .notfound { padding: 72px 0 96px; }
}
