/* Rubric Agents. Warm cream, brown-grey ink, two typefaces, colour only for pass and fail.
   Always light: the site never follows the system dark mode. */

:root {
  color-scheme: light only;
  --bg: #F7F3EC;
  --raised: #FBF9F5;
  --sunk: #EFEAE0;
  --ink: #2B2A26;
  --body: #3A372F;
  --soft: #6B665B;
  --muted: #8A8578;
  --line: #E2DCCF;
  --line-strong: #CFC8B8;
  --pass: #2E7D4F;
  --fail: #B4553A;
  --logo-top: #B4AD9E;

  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(16px, 5vw, 72px);
  --measure: 1180px;
  --section: clamp(88px, 13vw, 168px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img, svg, canvas { display: block; max-width: 100%; }
::selection { background: #E6DCC8; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -40px; z-index: 50; padding: 8px 12px; background: var(--ink); color: var(--bg); font-size: 14px; }
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--measure) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* Type */
.label { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.title { font-weight: 400; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.22; letter-spacing: -0.015em; color: var(--ink); }
.lede { font-size: 15px; line-height: 1.6; color: var(--soft); }
.prose { font-size: 17px; line-height: 1.7; color: var(--body); }
.prose p + p { margin-top: 1em; }
.link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; transition: text-decoration-color .2s; }
.link:hover { text-decoration-color: var(--ink); }
.arrow-link { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.arrow-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Header */
.site-header { position: absolute; inset: 0 0 auto; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 92px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.28em; }
.brand svg { width: 20px; height: 20px; }
.site-nav { display: flex; align-items: center; gap: 30px; font-size: 14px; }
.site-nav ul { display: flex; gap: 30px; }
.site-nav a { text-decoration: none; color: var(--body); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 6px; }
.btn-dark { display: inline-block; background: var(--ink); color: var(--bg) !important; padding: 9px 15px; border-radius: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none !important; transition: background .2s; }
.btn-dark:hover { background: #45423A; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; margin-right: -8px; cursor: pointer; color: var(--ink); font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; }

/* Page structure */
main { display: block; }
.section { padding: var(--section) 0; }
.section + .section { padding-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 40px; }
.page-head { padding: calc(92px + clamp(56px, 10vw, 128px)) 0 clamp(48px, 7vw, 88px); }
.page-head .title { max-width: 18em; margin-top: 18px; }
.page-head .lede { max-width: 34em; margin-top: 16px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Hero */
.hero { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; }
.hero canvas { position: absolute; top: 10%; right: -2%; width: 50%; height: 80%; }
.hero-copy { position: absolute; left: clamp(16px, 9vw, 140px); bottom: clamp(64px, 15vh, 160px); z-index: 1; }
.hero-copy .title { max-width: 15em; }
.hero-copy .lede { max-width: 400px; margin-top: 16px; }
.hero-foot { position: absolute; left: var(--gutter); bottom: 26px; }

/* Manifesto */
.manifesto { max-width: 34em; margin: 0 auto; font-size: clamp(19px, 1.7vw, 23px); line-height: 1.6; color: var(--ink); letter-spacing: -0.005em; }

/* Findings ledger */
.ledger { border-top: 1px solid var(--line); }
.ledger a { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(0, 2.4fr) minmax(120px, 1fr); gap: 28px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .25s; }
.ledger a:hover { background: rgba(255, 255, 255, 0.35); }
.ledger .name { color: var(--ink); font-size: 16px; }
.ledger .name small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.ledger .bar { position: relative; height: 2px; background: var(--line-strong); }
.ledger .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--fail); width: 0; transition: width 1.4s var(--ease); }
.ledger.is-in .bar i { width: var(--w); }
.ledger .what { font-size: 13px; color: var(--soft); line-height: 1.4; }
.ledger .what b { display: block; font-family: var(--mono); font-weight: 400; font-size: 13px; color: var(--ink); letter-spacing: 0.02em; }
.ledger-note { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* Evaluation cards: shared */
.card { display: block; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 14px 14px 16px; text-decoration: none; color: var(--body); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.card .thumb { height: 108px; border-radius: 6px; background: var(--sunk); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.squares { display: grid; gap: 3px; }
.squares i { display: block; width: 8px; height: 8px; border-radius: 1.5px; background: var(--line-strong); }
.squares i.x { background: var(--fail); }
.card .meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.card h3 { font-weight: 400; font-size: 17px; color: var(--ink); margin: 6px 0 2px; }
.card p { font-size: 13.5px; line-height: 1.5; color: var(--soft); margin-top: 10px; }

/* Homepage stack */
.stack { display: flex; justify-content: center; padding-top: 24px; }
.stack .card { flex: 0 0 230px; margin-left: -64px; box-shadow: -10px 0 24px -20px rgba(58, 55, 47, 0.4); }
.stack .card:first-child { margin-left: 0; }
.stack .card:hover, .stack .card:focus-visible { transform: translateY(-22px) rotate(-1deg); box-shadow: 0 28px 40px -26px rgba(58, 55, 47, 0.45); position: relative; z-index: 5; }

/* Evaluations grid */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid .card:hover { transform: translateY(-4px); box-shadow: 0 18px 30px -24px rgba(58, 55, 47, 0.45); }

/* Anatomy */
.anatomy-lead { color: var(--ink); font-size: clamp(19px, 1.7vw, 23px); line-height: 1.45; max-width: 26em; }
.anatomy { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: relative; margin-top: 56px; }
.anatomy::before { content: ""; position: absolute; left: 5px; right: 0; top: 5px; height: 1px; background: var(--line-strong); }
.part { position: relative; padding: 0 24px 0 0; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: default; }
.part .dot { display: block; width: 11px; height: 11px; border-radius: 50%; background: var(--body); margin-bottom: 22px; transition: transform .3s var(--ease), background .3s; }
.part:hover .dot, .part:focus-visible .dot, .part.is-on .dot { transform: scale(1.4); background: var(--fail); }
.part .name { display: block; font-size: 17px; color: var(--ink); }
.part .check { display: block; font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.finding { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); min-height: 64px; font-size: 15px; color: var(--soft); }
.finding .label { color: var(--fail); margin-right: 10px; }

/* Closing contact band */
.closing .title { margin-bottom: 14px; }

/* Lines list (contact, about proof) */
.lines { border-top: 1px solid var(--line); max-width: 560px; }
.lines > * { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 17px; }
.lines a:hover span:first-child { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 5px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.steps h3 { font-weight: 400; font-size: 17px; color: var(--ink); margin: 10px 0 6px; }
.steps p { font-size: 15px; color: var(--soft); line-height: 1.55; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(40px, 8vw, 120px); }
.proof { border-top: 1px solid var(--line); margin-top: 22px; }
.proof li { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--soft); line-height: 1.45; }
.proof b { font-weight: 400; font-size: 19px; color: var(--ink); line-height: 1.2; }

/* Method */
.method-part { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; padding: 36px 0; border-top: 1px solid var(--line); }
.method-part:last-child { border-bottom: 1px solid var(--line); }
.method-part h3 { font-weight: 400; font-size: 20px; color: var(--ink); }
.method-part .label { display: block; margin-bottom: 8px; }
.method-part p { color: var(--body); line-height: 1.7; }
.method-part p + p { margin-top: 0.8em; }
.method-part .eg { font-size: 14.5px; color: var(--soft); }
.method-part .eg b { font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.12em; color: var(--fail); margin-right: 8px; }

/* Footer */
.site-footer { padding: 56px 0 36px; border-top: 1px solid var(--line); }
.page-head + .site-footer, main > .page-head:only-child { margin-bottom: var(--section); }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.footer-links { display: grid; grid-template-columns: repeat(2, auto); gap: 12px 48px; font-size: 14px; }
.footer-links a { text-decoration: none; color: var(--soft); }
.footer-links a:hover { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 56px; flex-wrap: wrap; }
.footer-bottom a { color: inherit; text-decoration: none; }
.footer-bottom a[href^="mailto:"] { text-transform: none; letter-spacing: 0.04em; }
.footer-bottom a:hover { color: var(--ink); }
.footer-bottom .legal { display: flex; gap: 22px; }

/* Consent notice (driven by js/site.js) */
.consent { position: fixed; right: 16px; bottom: 16px; z-index: 40; max-width: 340px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-size: 13.5px; color: var(--soft); box-shadow: 0 18px 40px -24px rgba(58, 55, 47, 0.45); transition: opacity .25s, transform .25s; }
.consent.is-leaving { opacity: 0; transform: translateY(8px); }
.consent a { color: var(--ink); }
.consent-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.consent button { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; padding: 8px 12px; border-radius: 6px; cursor: pointer; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); }
.consent button[data-consent="granted"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Reveal: content fades up once as it enters the viewport. Only when JS is running. */
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .card, .part .dot, .ledger .bar i { transition: none; }
}

/* Tablet */
@media (max-width: 1020px) {
  .stack { justify-content: flex-start; overflow-x: auto; padding: 24px 4px 28px; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); scroll-snap-type: x mandatory; }
  .stack .card { flex-basis: 220px; margin-left: 14px; scroll-snap-align: start; box-shadow: none; }
  .stack .card:hover { transform: translateY(-6px); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phone */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header .wrap { height: 72px; }
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 64px; left: var(--gutter); right: var(--gutter); flex-direction: column; align-items: flex-start; gap: 18px; padding: 22px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 14px; font-size: 16px; }
  .hero canvas { top: 11%; right: auto; left: 0; width: 100%; height: 50%; }
  .hero-copy { left: var(--gutter); right: var(--gutter); bottom: 72px; }
  .hero-foot { display: none; }
  .ledger a { grid-template-columns: 1fr auto; gap: 10px 16px; }
  .ledger .bar { grid-column: 1 / -1; order: 3; }
  .ledger .what { text-align: right; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .anatomy { grid-template-columns: minmax(0, 1fr); gap: 26px; margin-top: 36px; }
  .anatomy::before { left: 5px; right: auto; top: 5px; bottom: 5px; width: 1px; height: auto; }
  .part { display: grid; grid-template-columns: 11px 1fr; gap: 0 18px; padding: 0; }
  .part .dot { margin: 6px 0 0; grid-row: 1 / span 3; }
  .part .name, .part .check, .part .eg { grid-column: 2; }
  .finding { display: none; }
  .part .eg { display: block; grid-column: 2; margin-top: 8px; font-size: 13.5px; color: var(--soft); }
  .steps, .about-grid, .method-part { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .footer-top { flex-direction: column; }
  .section-head { flex-direction: column; gap: 10px; }
}
@media (min-width: 761px) { .part .eg { display: none; } }
