/* Section compositions. Every value resolves to a token in site.css. */

/* Floating nav */
.nav {
  position: fixed; top: var(--s-200); left: 50%; z-index: 30; transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--s-300);
  padding: var(--s-50) var(--s-75) var(--s-50) var(--s-400);
  background: rgb(31 31 31 / 0.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: var(--r-full);
  width: max-content; max-width: calc(100% - 2 * var(--s-200));
}
.brand { display: inline-flex; align-items: center; gap: var(--s-50); min-height: 44px; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 500; }
.nav-links { display: flex; gap: var(--s-50); list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: var(--s-75) var(--s-100); border-radius: var(--r-full);
  font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none;
  transition: color 300ms var(--ease), background-color 300ms var(--ease), transform 300ms var(--ease);
}
.nav-links a[aria-current="true"] { color: var(--text); background: var(--surface-2); }
@media (hover: hover) { .nav-links a:hover { color: var(--text); background: var(--surface-2); } }
.nav .btn { min-height: 36px; padding: var(--s-75) var(--s-200); border-radius: var(--r-full); font-size: 14px; }
.menu-toggle {
  display: none; width: 44px; height: 44px; border-radius: var(--r-full); border: 0;
  background: transparent; color: var(--text); cursor: pointer; position: relative;
}
.menu-toggle span {
  position: absolute; left: 13px; right: 13px; height: 2px; border-radius: var(--r-full);
  background: currentColor; transition: transform 500ms var(--ease);
}
.menu-toggle span:first-child { transform: translateY(-4px); }
.menu-toggle span:last-child { transform: translateY(4px); }
.menu-open .menu-toggle span:first-child { transform: rotate(45deg); }
.menu-open .menu-toggle span:last-child { transform: rotate(-45deg); }
.mobile-menu {
  position: fixed; inset: 0; z-index: 20; display: none; flex-direction: column; justify-content: center;
  gap: var(--s-200); padding: var(--s-900) var(--s-300) var(--s-600);
  background: rgb(19 18 9 / 0.94); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.mobile-menu a { font-size: 30px; line-height: 1.25; font-weight: 600; text-decoration: none; padding-block: var(--s-75); }
.mobile-menu a[aria-current="true"] { text-decoration: underline wavy var(--err) 1px; text-underline-offset: 8px; }
.menu-open .mobile-menu { display: flex; }
.menu-open .mobile-menu a { animation: menu-in 500ms var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes menu-in { from { opacity: 0; transform: translateY(24px); } }

/* Hero */
/* The fixed nav ends at 68px; 96px of padding leaves a 28px gap above the h1. */
.hero { padding-top: var(--s-900); padding-bottom: var(--s-800); text-align: center; }
.hero-copy { max-width: var(--measure); margin-inline: auto; display: grid; justify-items: center; gap: var(--s-300); }
.hero h1 {
  font-size: 72px; line-height: 1.2; padding-block: var(--s-50);
  background: linear-gradient(90deg, #ffffff, #9b9b9b); -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* Red pen: a wavy underline (the --err colour) under the phrase the validator flags. It is a background
   on the span, so it paints over the clipped gradient of the h1 and follows the phrase across line breaks. */
.redpen {
  padding-bottom: 0.1em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 6'%3E%3Cpath d='M0 3Q3 0 6 3T12 3' fill='none' stroke='%23ff6b5e' stroke-width='1.8'/%3E%3C/svg%3E") repeat-x 0 100% / 0.22em 0.11em;
}
.hero .lede { max-width: var(--measure); }
.proof-line { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-75) var(--s-200); color: var(--muted); font-size: 14px; }
.proof-line .ph { color: var(--ok); margin-right: var(--s-50); vertical-align: -2px; }

/* Graded draft demo */
.demo {
  margin: var(--s-300) auto 0; max-width: 1120px; text-align: left;
  background: var(--surface); border-radius: var(--r-2xl); padding: var(--s-75);
}
.demo-bar { border-radius: var(--r-lg); display: flex; align-items: center; justify-content: space-between; gap: var(--s-200); padding: var(--s-75) var(--s-100) var(--s-100); flex-wrap: wrap; }
.demo-file { font: 500 14px/1.5 var(--mono); color: var(--muted); }
.seg { display: inline-flex; padding: var(--s-50); gap: var(--s-50); background: var(--bg); border-radius: var(--r-full); }
.seg button {
  min-height: 44px; padding: var(--s-75) var(--s-200); border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--muted); font: 600 14px/1.5 var(--sans); cursor: pointer;
  transition: background-color 300ms var(--ease), color 300ms var(--ease), transform 300ms var(--ease);
}
@media (hover: hover) { .seg button:hover { color: var(--text); } }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.demo-body { border-radius: var(--r-lg); display: grid; grid-template-columns: 1fr 1.15fr; gap: var(--s-75); }
.sheet, .term { border-radius: var(--r-lg); padding: var(--s-300); }
.sheet { background: var(--bg); }
.term { background: #000000; font: 400 14px/1.6 var(--mono); color: var(--muted); overflow-x: auto; }
.sheet ol { margin: 0; padding: 0; list-style: none; counter-reset: ln; display: grid; gap: var(--s-200); }
.sheet li { counter-increment: ln; display: grid; grid-template-columns: var(--s-300) 1fr; gap: var(--s-100); font-size: 18px; line-height: 1.55; }
.sheet li::before { content: counter(ln); font: 400 14px/2 var(--mono); color: var(--muted); }
.mark { text-decoration: underline wavy; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.mark.err { text-decoration-color: var(--err); }
.mark.warn { text-decoration-color: var(--warn); }
.sheet .chips { display: flex; flex-wrap: wrap; gap: var(--s-50); margin-top: var(--s-75); }
.term p { white-space: pre-wrap; }
.term .cmd { color: var(--text); margin-bottom: var(--s-200); }
/* A finding that wraps keeps its continuation indented, so each finding still reads as one block. */
.term [data-state="draft"] p:not(.sum) { padding-left: 2ch; text-indent: -2ch; }
.term .e { color: var(--err); } .term .w { color: var(--warn); } .term .g { color: var(--ok); }
.term .sum { margin-top: var(--s-200); color: var(--text); }
.demo [data-state][hidden] { display: none; }

/* Problems opener: oversized heading across the full width, lede in the right half */
.section-head-wide { max-width: none; grid-template-columns: 1fr 1fr; gap: var(--s-300) var(--s-500); }
.section-head-wide .h2 { grid-column: 1 / -1; max-width: 920px; }
.section-head-wide .lede { grid-column: 2; }

/* Problems: diff rows */
.diff { display: grid; border-top: 1px solid var(--line); }
.diff-row { display: grid; grid-template-columns: 240px 1fr 1fr; gap: var(--s-400); padding-block: var(--s-500); border-bottom: 1px solid var(--line); align-items: start; }
.diff-row h3 { font-size: 24px; line-height: 1.3; margin-bottom: var(--s-100); }
.diff-row .why { color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: var(--s-100); }
.say { display: grid; gap: var(--s-75); }
.say small { font-size: 12px; line-height: 1.5; color: var(--muted); letter-spacing: 0.03em; }
.say p { font-size: 18px; line-height: 1.55; }
.say.bad p { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--err); text-decoration-thickness: 1px; }
.glyph { justify-self: start; font-weight: 600; font-size: 48px; padding-inline: var(--s-75); border: 1px dashed var(--line); border-radius: var(--r-md); }
.glyph.clip { line-height: 1; height: 48px; overflow: hidden; }
.glyph.safe { line-height: 1.2; }

/* Tagline reveal */
.tagline { padding-block: var(--s-900); }
.tagline p { max-width: var(--measure); font-size: 60px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.js .tagline .w { color: var(--faint); transition: color 500ms var(--ease); }
.js .tagline .w.on { color: var(--text); }

/* FAQ: sticky split (heading left, list right) */
.split { display: grid; grid-template-columns: 360px 1fr; gap: var(--s-700); align-items: start; }
.split .section-head { position: sticky; top: var(--s-900); margin-bottom: 0; }

/* Skills: 16 entries in two columns under a full-width head. Rows share a height, so the hairlines line up. */
.skill-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, 1fr); column-gap: var(--s-700); }
.skill-list li { padding-block: var(--s-300); border-bottom: 1px solid var(--line); display: grid; gap: var(--s-50); align-content: start; }
.skill-list h3 { font: 500 18px/1.55 var(--mono); overflow-wrap: anywhere; }
.skill-list h3 a { display: inline-block; padding-block: var(--s-100); text-decoration: none; transition: transform 300ms var(--ease); }
@media (hover: hover) { .skill-list h3 a:hover { text-decoration: underline; } }
.skill-list p { color: var(--muted); max-width: 60ch; }
.skill-list p b { display: block; margin-bottom: var(--s-50); color: var(--text); font-weight: 600; }
.skill-list .chips { display: flex; flex-wrap: wrap; gap: var(--s-50); }

/* Steps: cell grid */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-75); padding: var(--s-75); background: var(--surface); border-radius: var(--r-2xl); }
.step { background: var(--bg); border-radius: var(--r-lg); padding: var(--s-400); display: grid; gap: var(--s-200); align-content: start; }
.step .n { font: 500 14px/1.5 var(--mono); color: var(--muted); }
.step h3 { font-size: 24px; line-height: 1.3; }
.step p { color: var(--muted); }
.step pre { margin: 0; padding: var(--s-200); background: #000000; border-radius: var(--r-md); overflow-x: auto; font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Proof ledger */
.ledger { background: #000000; border: 1px solid var(--line); border-radius: var(--r-2xl); padding: var(--s-400) var(--s-300) var(--s-200); font-family: var(--mono); }
/* Proof opener: the heading sits inside the ledger as its header row */
.ledger-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s-200) var(--s-500); align-items: end; padding-bottom: var(--s-400); border-bottom: 1px solid var(--line); font-family: var(--sans); }
.ledger-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s-75) var(--s-400); padding-block: var(--s-200); border-bottom: 1px solid var(--line); align-items: baseline; }
.ledger-row:last-child { border-bottom: 0; }
.ledger code { font-size: 14px; color: var(--muted); word-break: break-word; }
.ledger code::before { content: "$ "; color: var(--muted); }
.ledger .res { color: var(--ok); font-size: 14px; text-align: right; }
.ledger .note { grid-column: 1 / -1; max-width: 60ch; font: 400 14px/1.55 var(--sans); color: var(--muted); }

/* FAQ */
.faq { max-width: 800px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--s-300);
  padding-block: var(--s-300); font-size: 18px; line-height: 1.32; font-weight: 600; min-height: 44px;
  transition: transform 300ms var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ph { flex: none; font-size: 18px; color: var(--muted); transition: transform 500ms var(--ease); }
.faq details[open] summary .ph { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: var(--s-300); max-width: 680px; }

/* Install CTA */
.cta { text-align: center; }
.cta .section-head { margin-inline: auto; justify-items: center; }
/* Outer 16px, gap 8px, so the inner command well and button take 16 - 8 = 8px. */
.install {
  max-width: 920px; margin: 0 auto var(--s-400); display: flex; align-items: flex-start; gap: var(--s-75);
  background: var(--surface); border-radius: var(--r-2xl); padding: var(--s-75);
  text-align: left;
}
.install pre { flex: 1; margin: 0; padding: var(--s-200) var(--s-300); background: #000000; border-radius: var(--r-lg); font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.install .btn { flex: none; border-radius: var(--r-lg); min-height: 44px; }
.copy-status { min-height: 24px; color: var(--muted); font-size: 14px; margin-bottom: var(--s-100); }
.install-alt { max-width: 760px; margin: 0 auto var(--s-400); color: var(--muted); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.install-alt code { color: var(--text); font-size: 14px; }
.copy-status.ok { color: var(--ok); } .copy-status.err { color: var(--err); }
.cta-links { display: flex; gap: var(--s-100); justify-content: center; flex-wrap: wrap; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding-block: var(--s-600); color: var(--muted); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-200); }
.footer ul { display: flex; flex-wrap: wrap; gap: var(--s-75) var(--s-300); list-style: none; margin: 0; padding: 0; }
.footer a { text-decoration: none; display: inline-block; padding: var(--s-100) var(--s-50); transition: transform 300ms var(--ease); }
@media (hover: hover) { .footer a:hover { color: var(--text); text-decoration: underline; } }

@media (max-width: 1024px) {
  .nav-links, .nav .btn-nav { display: none; }
  .menu-toggle { display: block; }
  .nav { gap: var(--s-200); }
  .demo-body { grid-template-columns: 1fr; }
  .diff-row { grid-template-columns: 1fr 1fr; }
  .diff-row > div:first-child { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; gap: var(--s-400); }
  .split .section-head { position: static; }
  .skill-list { column-gap: var(--s-500); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .hero h1 { font-size: 36px; line-height: 1.25; }
  .ledger-head { grid-template-columns: 1fr; }
  .section-head-wide { grid-template-columns: 1fr; }
  .section-head-wide .lede { grid-column: 1; }
  .diff-row { grid-template-columns: 1fr; gap: var(--s-200); }
  .tagline p { font-size: 30px; line-height: 1.25; }
  .ledger-row { grid-template-columns: 1fr; }
  .ledger .res { text-align: left; }
  .install { flex-direction: column; align-items: stretch; }
  .install .btn { justify-content: center; }
  .sheet, .term { padding: var(--s-200); }
  .sheet li { font-size: 16px; }
  .skill-list { grid-template-columns: 1fr; }
  .skill-list h3 { font-size: 16px; }
}

/* Plain document pages (privacy) */
.doc-body { max-width: var(--measure); padding-block: var(--s-900); display: grid; gap: var(--s-300); }
.doc-body h1 { font-size: 48px; line-height: 1.2; }
.doc-body h2 { font-size: 24px; line-height: 1.3; margin-top: var(--s-300); }
.doc-body p, .doc-body li { color: var(--muted); }
.doc-body ul { margin: 0; padding-left: var(--s-300); display: grid; gap: var(--s-75); }
.doc-body a:not(.btn) { color: var(--text); }
.doc-body .updated { font-size: 14px; }
.footer a[aria-current="page"] { color: var(--text); }
@media (max-width: 767px) { .doc-body h1 { font-size: 36px; line-height: 1.25; } }
.nav-solo { padding-inline: var(--s-400); }
