/* ==========================================================================
   BLANKWORK — Design System
   Tokens per 03-design/02-design-system.md
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink:        #0B0F14;
  --graphite:   #2A333D;
  --slate:      #5B6773;
  --mist:       #A8B2BC;
  --hairline:   #E3E1DC;
  --bone:       #F5F4F1;
  --paper:      #FFFFFF;
  --recovered:  #00A868;
  --waste:      #E8A33D;
  --critical:   #C2410C;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --r-sm: 2px; --r-md: 4px; --r-lg: 6px; --r-xl: 10px;

  --max-w: 1120px;
  --max-w-prose: 680px;

  --ease: cubic-bezier(0.2, 0, 0.1, 1);
  --dur: 170ms;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { margin: 0 0 var(--s4); font-weight: 700; }
h1 { font-size: 44px; letter-spacing: -0.025em; line-height: 1.12; }
h2 { font-size: 32px; letter-spacing: -0.02em; line-height: 1.2; font-weight: 600; }
h3 { font-size: 23px; letter-spacing: -0.01em; line-height: 1.3; font-weight: 600; }
p  { margin: 0 0 var(--s4); }
a  { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }

strong { font-weight: 600; }

.lead { font-size: 19px; line-height: 1.6; color: var(--slate); }
.small { font-size: 15px; }
.caption {
  font-size: 13px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--slate);
}
.disclaimer { font-size: 13px; color: var(--slate); line-height: 1.5; max-width: 720px; }
.muted { color: var(--slate); }
.prose { max-width: var(--max-w-prose); }

/* ---------- Layout ---------- */

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--s5); }
.section { padding: var(--s10) 0; }
.section--tight { padding: var(--s8) 0; }
.section--ink { background: var(--ink); color: var(--bone); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: var(--paper); }
.section--ink .lead, .section--ink .muted { color: #B9C2CB; }
.section--paper { background: var(--paper); }

.grid { display: grid; gap: var(--s5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.stack > * + * { margin-top: var(--s4); }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--slate); margin-bottom: var(--s3);
}
.rule { height: 1px; background: var(--hairline); border: 0; margin: var(--s7) 0; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,244,241,0.94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav-links { display: flex; gap: var(--s6); align-items: center; }
.nav-links a { text-decoration: none; font-size: 16px; font-weight: 500; color: var(--graphite); }
.nav-links a:hover { color: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; }
.brand-word {
  font-weight: 700; font-size: 20px; letter-spacing: -0.03em; color: var(--ink);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 28px;
  font-family: var(--font); font-size: 17px; font-weight: 600;
  border-radius: var(--r-md); border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #000; }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--secondary:hover { background: rgba(11,15,20,0.05); }
.btn--onink { background: var(--paper); color: var(--ink); }
.btn--onink-secondary { background: transparent; color: var(--paper); border-color: rgba(255,255,255,0.4); }
.btn--sm { height: 42px; padding: 0 18px; font-size: 15px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
.btn-row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Cards ---------- */

.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s6);
}
.card--ink { background: var(--graphite); border-color: #3A444F; color: var(--bone); }
.card h3 { margin-bottom: var(--s2); }
.card p:last-child { margin-bottom: 0; }
.assistant-match { border-left: 4px solid var(--recovered); }
.assistant-tasks { list-style: none; padding: 0; margin: var(--s3) 0 0; }
.assistant-tasks li {
  position: relative;
  padding: var(--s3) 0 var(--s3) 28px;
  border-top: 1px solid var(--hairline);
  color: var(--graphite);
}
.assistant-tasks li::before {
  position: absolute;
  left: 0;
  color: var(--recovered);
  content: '✓';
}

/* ---------- Hero ---------- */

.hero { padding: var(--s9) 0 var(--s8); }
.hero h1 {
  font-size: 64px; letter-spacing: -0.03em; line-height: 1.05;
  max-width: 15ch; margin-bottom: var(--s5);
}
.hero .lead { max-width: 56ch; margin-bottom: var(--s6); }

/* ---------- Outcome strip ---------- */

.outcomes {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.outcome { padding: var(--s5) var(--s4); border-right: 1px solid var(--hairline); }
.outcome:last-child { border-right: 0; }
.outcome strong { display: block; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.outcome span { font-size: 15px; color: var(--slate); }

/* ---------- Metric tiles ---------- */

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s5); }
.metric { }
.metric-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--slate); margin-bottom: var(--s2);
}
.metric-value {
  font-size: 56px; font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  margin-bottom: var(--s2);
}
.metric-unit { font-size: 15px; color: var(--slate); line-height: 1.4; }
.section--ink .metric-label, .section--ink .metric-unit { color: #96A2AD; }

/* ---------- Steps ---------- */

.steps { counter-reset: step; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: var(--s5); padding: var(--s6) 0; border-top: 1px solid var(--hairline); }
.step:last-child { border-bottom: 1px solid var(--hairline); }
.step-num {
  font-size: 32px; font-weight: 700; letter-spacing: -0.03em; color: var(--mist); line-height: 1.1;
}
.step h3 { margin-bottom: var(--s2); }
.step p { margin: 0; color: var(--slate); }

/* ---------- Tags ---------- */

.tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 8px; border-radius: var(--r-sm);
}
.tag--now    { background: rgba(0,168,104,0.12); color: #00784B; }
.tag--next   { background: rgba(232,163,61,0.16); color: #8A5D12; }
.tag--later  { background: rgba(168,178,188,0.22); color: var(--slate); }
.tag--dont   { background: rgba(11,15,20,0.08); color: var(--graphite); }

/* ---------- Price cards ---------- */

.price-card { display: flex; flex-direction: column; }
.price-card .price {
  font-size: 40px; font-weight: 700; letter-spacing: -0.03em; margin: var(--s2) 0 var(--s1);
}
.price-card .price-note { font-size: 15px; color: var(--slate); margin-bottom: var(--s5); }
.price-card ul { list-style: none; padding: 0; margin: 0 0 var(--s6); }
.price-card li {
  padding: var(--s3) 0; border-top: 1px solid var(--hairline);
  font-size: 16px; line-height: 1.5;
}
.price-card .btn { margin-top: auto; }
.price-card--featured { border-color: var(--ink); border-width: 2px; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--paper); background: var(--ink);
  padding: 4px 9px; border-radius: var(--r-sm); margin-bottom: var(--s3);
}

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: var(--s3) var(--s4) var(--s3) 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th { font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--slate); }

/* ---------- FAQ ---------- */

.faq details {
  border-top: 1px solid var(--hairline); padding: var(--s5) 0;
}
.faq details:last-of-type { border-bottom: 1px solid var(--hairline); }
.faq summary {
  cursor: pointer; font-size: 19px; font-weight: 600; letter-spacing: -0.01em;
  list-style: none; display: flex; justify-content: space-between; gap: var(--s4);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--mist); font-weight: 400; font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: var(--s4) 0 0; color: var(--slate); max-width: var(--max-w-prose); }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: #96A2AD; padding: var(--s8) 0 var(--s6); font-size: 15px; }
.site-footer a { color: #C7CFD7; text-decoration: none; }
.site-footer a:hover { color: var(--paper); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s6); margin-bottom: var(--s7); }
.footer-grid h4 { font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--mist); margin-bottom: var(--s3); font-weight: 600; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { padding: 5px 0; }
.footer-bottom { border-top: 1px solid #1E262F; padding-top: var(--s5); font-size: 13px; line-height: 1.6; }

/* ==========================================================================
   BLANKWORK CHECK
   ========================================================================== */

.check-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: var(--hairline); z-index: 100;
}
.check-progress-bar { height: 100%; width: 0; background: var(--ink); transition: width 250ms var(--ease); }

.check-shell { max-width: 720px; margin: 0 auto; padding: var(--s8) var(--s5) var(--s9); }

.check-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--s5); font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: var(--slate);
}

.q-card { }
.q-number { font-size: 12px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--slate); margin-bottom: var(--s3); }
.q-text { font-size: 27px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.28; margin-bottom: var(--s3); }
.q-help { font-size: 16px; color: var(--slate); margin-bottom: var(--s5); }

.options { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s6); }
.option {
  display: flex; align-items: center; gap: var(--s4);
  min-height: 60px; padding: var(--s4) var(--s5);
  background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-md);
  font-family: var(--font); font-size: 17px; text-align: left; color: var(--ink);
  cursor: pointer; width: 100%;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.option:hover { border-color: var(--slate); }
.option[aria-pressed="true"] { border-color: var(--ink); border-width: 2px; background: rgba(11,15,20,0.035); padding: calc(var(--s4) - 1px) calc(var(--s5) - 1px); }
.option-key {
  flex: 0 0 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; color: var(--slate);
}
.option[aria-pressed="true"] .option-key { border-color: var(--ink); color: var(--ink); }

.check-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); }
.link-btn {
  background: none; border: 0; font-family: var(--font); font-size: 16px; font-weight: 500;
  color: var(--slate); cursor: pointer; padding: var(--s2) 0;
}
.link-btn:hover { color: var(--ink); }

/* Gate + results */

.gate { max-width: 520px; }
.field { margin-bottom: var(--s4); }
.field label { display: block; font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: var(--slate); margin-bottom: var(--s2); }
.field input {
  width: 100%; height: 52px; padding: 0 14px;
  font-family: var(--font); font-size: 17px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-md);
}
.field input:focus { border-color: var(--ink); outline: none; }
.field .err { color: var(--critical); font-size: 15px; margin-top: var(--s2); display: none; }
.field.invalid input { border-color: var(--critical); }
.field.invalid .err { display: block; }

.score-hero { text-align: left; margin-bottom: var(--s7); }
.score-number { font-size: 104px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.score-outof { font-size: 40px; color: var(--mist); font-weight: 500; letter-spacing: -0.02em; }
.score-band { font-size: 23px; font-weight: 600; letter-spacing: -0.01em; margin-top: var(--s3); }
.score-band-copy { font-size: 17px; color: var(--slate); max-width: 56ch; margin-top: var(--s2); }

.bars { margin: var(--s6) 0; }
.bar-row { padding: var(--s3) 0; border-top: 1px solid var(--hairline); }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s2); font-size: 16px; }
.bar-head .pts { color: var(--slate); font-size: 15px; }
.bar-track { height: 8px; background: var(--hairline); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; transition: width 500ms var(--ease); }

.callout {
  background: var(--paper); border: 1px solid var(--hairline);
  border-left: 3px solid var(--ink); border-radius: var(--r-md);
  padding: var(--s5); margin: var(--s6) 0;
}
.callout--waste { border-left-color: var(--waste); }
.callout--recovered { border-left-color: var(--recovered); }

.rate-editor { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; font-size: 15px; color: var(--slate); margin-top: var(--s4); }
.rate-editor input {
  width: 84px; height: 40px; padding: 0 10px; font-family: var(--font); font-size: 16px;
  border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--paper); color: var(--ink);
}

.prompt-card { border-color: var(--ink); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .outcomes { grid-template-columns: repeat(2, 1fr); }
  .outcome:nth-child(2) { border-right: 0; }
  .outcome:nth-child(1), .outcome:nth-child(2) { border-bottom: 1px solid var(--hairline); }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .hero { padding: var(--s7) 0 var(--s6); }
  .hero h1 { font-size: 40px; max-width: 100%; }
  .section { padding: var(--s8) 0; }
  .grid-2, .grid-3, .grid-4, .metrics { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.nav-links--cta { display: flex; gap: var(--s3); }
  .metric-value { font-size: 44px; }
  .score-number { font-size: 76px; }
  .score-outof { font-size: 30px; }
  .q-text { font-size: 23px; }
  .btn { width: 100%; }
  .btn-row .btn { width: auto; flex: 1 1 auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .card { padding: var(--s5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .btn { display: none; }
  body { background: #fff; }
}
