/* ============================================================================
   Zach Edwards LLC — redesign design system (Phase 1 prototype)
   Spec: docs/WEBSITE-REDESIGN-SPEC-v1.0-2026-10-22.md §5
   Every colour below is a spec token. Do not introduce new hues — the
   verifier (docs/WEBSITE-REDESIGN-PHASE1-VERIFY.cjs) fails on palette drift.
   No webfonts, no external requests: system stack keeps LCP cheap (§15).
   ========================================================================= */

:root {
  /* --- §5 colour tokens (the only approved palette) ------------------- */
  --bg:            #08090C;  /* main page            */
  --surface:       #12161D;  /* cards and navigation */
  --text:          #F5F5F3;  /* headlines            */
  --muted:         #B2BAC5;  /* descriptions         */
  --accent:        #9FB8D2;  /* restrained highlight */
  --line:          #303842;  /* structural dividers  */
  --btn:           #F5F5F3;  /* primary action       */

  /* derived, same hues only */
  --surface-2:     #161B23;
  --bg-alt:        #0A0C10;  /* between bg and surface; alternating sections */
  --line-soft:     rgba(48, 56, 66, .62);
  --accent-wash:   rgba(159, 184, 210, .09);
  --accent-edge:   rgba(159, 184, 210, .26);
  --shadow:        0 24px 60px rgba(0, 0, 0, .55);

  /* --- 8px spacing system (§5) ---------------------------------------- */
  --s-half: 4px;  --s1: 8px;   --s2: 16px;  --s3: 24px;  --s4: 32px;
  --s5:  40px;    --s6: 48px;  --s7: 64px;  --s8: 80px;  --s9: 96px;
  --s10: 128px;

  /* --- type ------------------------------------------------------------ */
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
          Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;

  /* --- layout ---------------------------------------------------------- */
  --wrap: 1200px;          /* §5 suggests 1160–1240 */
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22, .72, .22, 1);
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;            /* belt-and-braces; layout must not need it */
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.022em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* focus — §15 accessibility: visible focus states everywhere */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--btn); color: var(--bg);
  padding: var(--s2) var(--s3); border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

/* -------------------------------------------------------------- layout */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s3); }
.section { padding-block: var(--s10); }
.section--tight { padding-block: var(--s8); }
.section--line { border-top: 1px solid var(--line); }
.section--surface { background: var(--bg-alt); border-block: 1px solid var(--line); }

.stack > * + * { margin-top: var(--s3); }
.measure { max-width: 62ch; }
.center { text-align: center; margin-inline: auto; }

/* ---------------------------------------------------------------- type */
/* Capped at 60px: above that, the two-line hero headline wraps to four on a
   1366px laptop and the intentional <br> stops reading as a deliberate break.
   Measured in-browser at 1366px before capping. */
.display {
  font-size: clamp(38px, 4.9vw, 60px);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 600;
}
.h2 { font-size: clamp(29px, 3.9vw, 46px); line-height: 1.09; letter-spacing: -.026em; }
.h3 { font-size: clamp(19px, 1.5vw, 22px); line-height: 1.32; }
.lead { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.62; color: var(--muted); }
.body { color: var(--muted); }
.small { font-size: 13px; line-height: 1.6; color: var(--muted); }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: var(--s2);
}
.quote {
  font: 400 clamp(20px, 2.2vw, 27px)/1.45 var(--serif);
  letter-spacing: -.012em; color: var(--text);
}
.quote cite { display: block; margin-top: var(--s2); font: 600 13px/1.6 var(--sans);
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent); font-style: normal; }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  min-height: 48px;                      /* comfortable mobile tap target */
  padding: 0 var(--s4);
  border-radius: 999px; border: 1px solid transparent;
  background: var(--btn); color: var(--bg);
  font: 600 15px/1 var(--sans); letter-spacing: -.005em;
  text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), opacity .18s var(--ease), background .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); opacity: .9; }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--accent-wash); border-color: var(--accent-edge); opacity: 1; }
.btn--quiet { background: transparent; color: var(--muted); border-color: transparent; padding-inline: var(--s2); }
.btn--quiet:hover { color: var(--text); background: var(--accent-wash); }
.btn--sm { min-height: 40px; padding: 0 var(--s3); font-size: 14px; }
.btn--block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }

.textlink {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid var(--accent-edge); padding-bottom: 1px;
  transition: border-color .18s var(--ease);
}
.textlink:hover { border-bottom-color: var(--accent); }

/* --------------------------------------------------------------- chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font: 600 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.chip--accent { color: var(--accent); border-color: var(--accent-edge); background: var(--accent-wash); }
.chip--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* --------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
a.card, .card--hover { text-decoration: none; display: block; }
a.card:hover, .card--hover:hover {
  transform: translateY(-2px);
  border-color: var(--accent-edge);
  background: var(--surface-2);
}
.card__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.card__top > :first-child { min-width: 0; }

/* Media card: image/evidence flush to the card edge.
   Done with overflow:hidden + an inner padded body — NOT negative margins,
   which overflowed the grid gutters and merged the three cards into one
   continuous band (seen in-browser at 1366px before this fix). */
.card--media { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card--media .evidence {
  border-width: 0 0 1px 0; border-style: solid; border-radius: 0;
  min-height: 0; aspect-ratio: 16 / 10; padding: var(--s4);
}
.card--media .card__body { padding: var(--s5); flex: 1; }
@media (max-width: 760px) { .card--media .card__body { padding: var(--s4); } }
.card__list { display: grid; gap: var(--s1); margin-top: var(--s3); }
.card__list li { display: grid; grid-template-columns: 18px 1fr; gap: var(--s1); color: var(--muted); font-size: 15px; }
.card__list li::before { content: "—"; color: var(--accent); }

.grid { display: grid; gap: var(--s3); }
/* Grid items must be allowed to shrink below their min-content width, or an
   aspect-ratio box inflates the track and overflows the viewport. */
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ------------------------------------------------- evidence placeholder
   §5 image rules: every important claim needs real evidence, and
   mockups/concepts must be clearly labelled. Until the owner supplies the
   approved asset, the slot says exactly what belongs there. Never a stock
   photo, never an AI portrait presented as a photograph.                  */
.evidence {
  position: relative;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(135deg, rgba(159,184,210,.035) 0 2px, transparent 2px 9px),
    var(--surface);
  min-height: 190px;
  display: flex; flex-direction: column; justify-content: center; gap: var(--s1);
  padding: var(--s5); text-align: center;
}
.evidence__label {
  font: 600 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.evidence__what { color: var(--text); font-weight: 600; }
.evidence__src { font-size: 13px; color: var(--muted); }
/* width:100% is load-bearing. With `aspect-ratio` and only a `min-height`,
   an auto-width element derives its WIDTH from that height — min-height 260px
   at 16/9 forced 462px, which overflowed a 390px phone by exactly 478-390px.
   Measured in-browser by selftest.html before this fix. Pinning the width
   means the container drives width and aspect-ratio only drives height. */
.evidence--portrait { width: 100%; min-height: 320px; aspect-ratio: 4 / 5; }
.evidence--wide { width: 100%; min-height: 260px; aspect-ratio: 16 / 9; }

/* ---------------------------------------------------------------- nav */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(8, 9, 12, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__in { display: flex; align-items: center; gap: var(--s4); min-height: 72px; }
.brand { display: flex; align-items: center; gap: var(--s2); text-decoration: none; font-weight: 600; letter-spacing: -.015em; }
.brand__mark { width: 26px; height: 26px; flex: 0 0 26px; color: var(--accent); }
.brand__sub { display: block; font: 500 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.nav__links { display: flex; align-items: center; gap: var(--s4); margin-left: auto; }
.nav__links a { text-decoration: none; color: var(--muted); font-size: 15px; transition: color .18s var(--ease); }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--text); }
.nav__cta { margin-left: var(--s2); }
.nav__toggle { display: none; }

/* ------------------------------------------------------------- hero */
.hero { padding-block: var(--s9) var(--s8); }
.hero__grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: var(--s8); align-items: center; }
.hero__grid > * { min-width: 0; }
.hero .display { margin-bottom: var(--s3); }
.hero .lead { max-width: 54ch; margin-bottom: var(--s5); }
.hero__trust { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }

/* the two service choices, visible in the first screen (§6.1) */
.choice {
  display: block; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s4);
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.choice + .choice { margin-top: var(--s3); }
.choice:hover { transform: translateY(-2px); border-color: var(--accent-edge); background: var(--surface-2); }
.choice__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.choice__name { font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.choice p { color: var(--muted); font-size: 15px; margin-top: var(--s2); }
.choice__go { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s3); color: var(--accent); font-size: 14px; font-weight: 600; }

/* ------------------------------------------------------------- steps */
.steps { counter-reset: step; display: grid; gap: var(--s3); }
.step { position: relative; padding-left: var(--s7); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--accent-edge); background: var(--accent-wash);
  color: var(--accent); font: 600 14px/1 var(--sans);
}
.step h3 { margin-bottom: 6px; }

/* --------------------------------------------------------------- form */
.form { display: grid; gap: var(--s3); }
.field { display: grid; gap: var(--s1); }
.field > label { font-size: 14px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 13px; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; min-height: 50px; padding: 13px var(--s3);
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: 400 16px/1.5 var(--sans);   /* 16px prevents iOS zoom-on-focus */
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: #6E7884; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--accent-edge); }
.textarea { min-height: 116px; resize: vertical; padding-top: var(--s2); }
.field--error .input, .field--error .textarea { border-color: #D98A8A; }
.error { font-size: 13px; color: #E8A9A9; display: none; }
.field--error .error { display: block; }

/* the §11 two-choice question, as big tap targets */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices label {
  display: flex; align-items: center; gap: var(--s2); min-height: 62px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--muted);
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease);
}
.choices label::before {
  content: ""; width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%;
  border: 1px solid var(--line); transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.choices label:hover { border-color: var(--accent-edge); color: var(--text); }
.choices input:checked + label {
  border-color: var(--accent); color: var(--text); background: var(--accent-wash);
}
.choices input:checked + label::before { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--accent); }
.choices input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; }

.formnote { font-size: 13px; color: var(--muted); }
.formstate {
  display: none; padding: var(--s3); border-radius: var(--radius-sm);
  border: 1px solid var(--accent-edge); background: var(--accent-wash); color: var(--text);
}
.formstate.is-on { display: block; }

/* contact rail */
.contactrail { display: grid; gap: var(--s2); }
.contactrow {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3); border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); text-decoration: none;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.contactrow:hover { border-color: var(--accent-edge); background: var(--surface-2); }
.contactrow__ico { width: 20px; height: 20px; flex: 0 0 20px; color: var(--accent); }
.contactrow b { display: block; font-size: 15px; }
.contactrow span { display: block; font-size: 13px; color: var(--muted); }

/* ----------------------------------------------------------------- faq */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: var(--s3) 0;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  font-size: 17px; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 22px; font-weight: 400; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .faq__body { padding: 0 0 var(--s3); color: var(--muted); max-width: 72ch; }

/* --------------------------------------------------------------- table */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.tbl td { color: var(--muted); }
.tbl td:first-child { color: var(--text); font-weight: 500; }

/* -------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--line); padding-block: var(--s8) var(--s9); }
.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--s6); }
.foot h4 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s3); }
.foot ul { display: grid; gap: var(--s2); }
.foot a { color: var(--muted); text-decoration: none; font-size: 15px; }
.foot a:hover { color: var(--text); }
.foot__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2);
  margin-top: var(--s8); padding-top: var(--s4); border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}

/* --------------------------------------------- sticky mobile contact bar
   §11: "Small sticky contact bar: Text Zach · Book a call."              */
.mobilebar { display: none; }
@media (max-width: 860px) {
  .mobilebar {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: var(--s2) var(--s3) calc(var(--s2) + env(safe-area-inset-bottom, 0px));
    background: rgba(8, 9, 12, .94);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  body { padding-bottom: 84px; }
}

/* ------------------------------------------------------------- banner
   Clearly labels every page as a prototype (§5).                        */
.protobanner {
  background: var(--accent-wash);
  border-bottom: 1px solid var(--accent-edge);
  font-size: 13px; color: var(--muted);
}
.protobanner__in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding-block: var(--s1); min-height: 38px; }
.protobanner b { color: var(--accent); letter-spacing: .1em; font-size: 11px; text-transform: uppercase; }
.protobanner a { color: var(--text); }

/* -------------------------------------------------------------- motion
   §5: gentle hero entrance, subtle card hover, lightweight section
   reveals. Nothing mandatory, nothing that delays reading.               */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .62s var(--ease), transform .62s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.rise { animation: rise .72s var(--ease) both; }
.rise--2 { animation-delay: .08s; }
.rise--3 { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* --------------------------------------------------------- breakpoints */
@media (max-width: 1040px) {
  .hero__grid { gap: var(--s6); }
  .foot__grid { grid-template-columns: 1fr 1fr; gap: var(--s5); }
}
@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__links.is-open {
    display: grid; gap: var(--s1);
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: var(--s3); margin: 0;
  }
  .nav__links.is-open a { padding: var(--s2) 0; font-size: 17px; }
  .nav__in { position: relative; }
  .nav__toggle {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: auto; width: 46px; height: 46px;
    background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--text); cursor: pointer;
  }
  .nav__cta { display: none; }
}
@media (max-width: 760px) {
  .section { padding-block: var(--s8); }
  .section--tight { padding-block: var(--s7); }
  .hero { padding-block: var(--s6) var(--s7); }
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  /* minmax(0,1fr), never a bare 1fr: a bare 1fr track takes its automatic
     minimum from min-content, which an aspect-ratio box inflates. */
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: var(--s4); }
  .foot__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .foot { padding-block: var(--s7); }
  .step { padding-left: var(--s6); }
  .tbl th, .tbl td { padding: var(--s2); }
}
@media (max-width: 420px) {
  .wrap { padding-inline: var(--s2); }
  .choices { grid-template-columns: minmax(0, 1fr); }
  .btn { padding-inline: var(--s3); }
}
