/* ============================================================
   GRAYSTONE CONSULTANTS — shared stylesheet
   Palette: basalt / pale stone / lichen
   Type: Fraunces (display) · IBM Plex Sans (body) · IBM Plex Mono (labels)
   ============================================================ */

:root {
  --ground:    #EDEEEB;
  --surface:   #F7F8F6;
  --surface-2: #E3E5E0;
  --ink:       #14181A;
  --ink-2:     #39423F;
  --muted:     #6D7772;
  --line:      #CDD2CB;
  --line-soft: #DEE1DB;
  --accent:    #2C5A4E;
  --accent-2:  #1D4136;
  --on-accent: #F2F5F1;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --rail: 8.5rem;

  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.83rem);
  --step-0:  clamp(1rem, 0.97rem + 0.16vw, 1.09rem);
  --step-1:  clamp(1.2rem, 1.13rem + 0.34vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.36rem + 0.7vw, 1.95rem);
  --step-3:  clamp(1.95rem, 1.68rem + 1.35vw, 2.8rem);
  --step-4:  clamp(2.5rem, 1.9rem + 3vw, 4.4rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:    #101413;
    --surface:   #161B19;
    --surface-2: #1E2523;
    --ink:       #E9EDE8;
    --ink-2:     #BEC7C1;
    --muted:     #8B958F;
    --line:      #2B3431;
    --line-soft: #222A28;
    --accent:    #83BFA9;
    --accent-2:  #A9D6C4;
    --on-accent: #0D1110;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ground:    #101413;
  --surface:   #161B19;
  --surface-2: #1E2523;
  --ink:       #E9EDE8;
  --ink-2:     #BEC7C1;
  --muted:     #8B958F;
  --line:      #2B3431;
  --line-soft: #222A28;
  --accent:    #83BFA9;
  --accent-2:  #A9D6C4;
  --on-accent: #0D1110;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: Fraunces, "Iowan Old Style", Georgia, serif;
  font-variation-settings: "SOFT" 0, "WONK" 1;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.018em;
  text-wrap: balance;
  margin: 0;
}
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.25; }

p { margin: 0; }
a { color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0.6rem 0; width: 4rem; }

.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--step--1);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 500;
}

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--on-accent);
  padding: 0.6rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- shell ---------- */

.wrap {
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band {
  border-top: 1px solid var(--line);
  padding-block: clamp(3.5rem, 8vw, 7rem);
}
.band--flush { border-top: 0; }
.band--tight { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.band--surface { background: var(--surface); }

.band__grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.band__label {
  color: var(--muted);
  padding-top: 0.45em;
  position: sticky;
  top: 4.5rem;
}

.stack { display: flex; flex-direction: column; gap: 1.8rem; }

.prose {
  display: flex;
  flex-direction: column;
  gap: 1.15em;
  max-width: var(--measure);
  color: var(--ink-2);
}
.prose--wide { max-width: 44rem; }
.prose > h2, .prose > h3 { color: var(--ink); }
.prose .lede { font-size: var(--step-1); color: var(--ink); line-height: 1.5; }
.prose .beat { color: var(--ink); font-weight: 500; }
.prose .small { color: var(--muted); font-size: 0.89rem; }
.prose a { text-decoration-color: var(--line); text-underline-offset: 0.18em; }
.prose a:hover { color: var(--accent); text-decoration-color: var(--accent); }

@media (max-width: 46rem) {
  .band__grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .band__label { position: static; padding-top: 0; }
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.95rem;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark {
  font-family: Fraunces, Georgia, serif;
  font-variation-settings: "SOFT" 0, "WONK" 1;
  font-weight: 600;
  font-size: 1.16rem;
  letter-spacing: -0.02em;
}
.brand__sub {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
}
@media (max-width: 34rem) { .brand__sub { display: none; } }

.nav__links { display: flex; align-items: center; gap: 1.6rem; }
.nav__links a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 0.86rem;
  transition: color 140ms ease;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav__links a:hover { color: var(--accent); }
.nav__links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.nav__links a.btn { border-bottom: 1px solid transparent; padding-bottom: 0.72rem; }
.nav__links a.btn--solid, .nav__links a.btn--solid:hover { color: var(--on-accent); }
@media (max-width: 52rem) { .nav__links .hide-sm { display: none; } }

/* subnav shown on small screens where top links hide */
.subnav {
  display: none;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.subnav .wrap { display: flex; gap: 1.2rem; overflow-x: auto; padding-block: 0.7rem; }
.subnav a { text-decoration: none; color: var(--ink-2); font-size: 0.84rem; white-space: nowrap; }
.subnav a[aria-current="page"] { color: var(--accent); }
@media (max-width: 52rem) { .subnav { display: block; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 1.15rem;
  border-radius: 2px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.btn--solid { background: var(--accent); color: var(--on-accent); }
.btn--solid:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn--ghost { border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn__arrow { transition: transform 150ms ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex; gap: 0.4rem; align-items: center;
  text-decoration: none; color: var(--accent); font-weight: 500; font-size: 0.92rem;
}
.link-arrow:hover .btn__arrow { transform: translateX(3px); }

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(4rem, 11vw, 8.5rem) clamp(3.5rem, 9vw, 6.5rem);
  position: relative;
  overflow: hidden;
}
.hero--page { padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero__eyebrow { color: var(--accent); display: block; margin-bottom: 1.6rem; }
.hero h1 {
  font-size: var(--step-4);
  max-width: 17ch;
  font-weight: 600;
}
.hero--page h1 { font-size: var(--step-3); max-width: 20ch; }
.hero__sub {
  margin-top: 1.6rem;
  max-width: 42ch;
  font-size: var(--step-1);
  color: var(--ink-2);
  line-height: 1.5;
}
.hero__actions {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.hero__note {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.strata-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mask-image: linear-gradient(to bottom, transparent, #000 45%, transparent);
}
.strata-bg span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}

/* ---------- credentials strip ---------- */

.creds {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.creds__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0;
}
.cred {
  padding: 1.9rem var(--gutter);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cred:last-child { border-right: 0; }
.cred__fig {
  font-family: Fraunces, Georgia, serif;
  font-variation-settings: "SOFT" 0, "WONK" 1;
  font-size: var(--step-2);
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cred__txt { color: var(--ink-2); font-size: 0.92rem; line-height: 1.45; }
@media (max-width: 46rem) {
  .cred { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .cred:last-child { border-bottom: 0; }
}

/* ---------- question / symptom stack ---------- */

.qstack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.4rem 0;
  padding-left: 1.15rem;
  border-left: 2px solid var(--accent);
}
.qstack p { color: var(--ink); font-weight: 500; }

/* stacked one-liners: verse-like beats */
.beats { display: flex; flex-direction: column; gap: 0.55rem; margin: 0.3rem 0; }
.beats p { color: var(--ink); }

/* ---------- symptom cards (Home) ---------- */

.symptoms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin-top: 0.4rem;
  max-width: 48rem;
}
@media (max-width: 40rem) { .symptoms { grid-template-columns: 1fr; } }
.symptom {
  background: var(--surface-2);
  padding: 1.4rem 1.3rem;
  border-top: 3px solid var(--accent);
  display: flex; flex-direction: column; gap: 0.6rem;
}
.symptom h3 { font-size: 1.1rem; color: var(--ink); }
.symptom p { color: var(--ink-2); font-size: 0.93rem; line-height: 1.5; }
.symptom .mono { color: var(--muted); }

/* ---------- two-column contrast (Home: what changes) ---------- */

.contrast {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin-top: 0.4rem;
  max-width: 48rem;
}
.contrast > div { padding: 1.5rem 1.4rem; background: var(--surface-2); display: flex; flex-direction: column; gap: 0.7rem; }
.contrast > div:last-child { background: var(--accent); color: var(--on-accent); }
.contrast > div:last-child .mono, .contrast > div:last-child p { color: var(--on-accent); }
.contrast .mono { color: var(--muted); }
.contrast p { font-size: 0.95rem; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 40rem) { .contrast { grid-template-columns: 1fr; } }

/* ---------- strata diagram ---------- */

.strata {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 0.5rem;
  max-width: 46rem;
}
.layer {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  transition: transform 200ms ease, background 200ms ease;
}
.layer:hover { background: var(--surface); transform: translateX(3px); }
.layer__i { color: var(--muted); font-variant-numeric: tabular-nums; }
.layer__name { font-weight: 600; color: var(--ink); font-size: 0.98rem; }
.layer__gloss { color: var(--muted); font-size: 0.87rem; line-height: 1.4; }

.layer:nth-child(1) { width: 46%; }
.layer:nth-child(2) { width: 57%; }
.layer:nth-child(3) { width: 68%; }
.layer:nth-child(4) { width: 79%; }
.layer:nth-child(5) { width: 90%; }
.layer:nth-child(6) { width: 100%; }
@media (max-width: 40rem) { .layer { width: 100% !important; } }

.strata-caption, .caption {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 0.87rem;
  max-width: 44ch;
}

/* ---------- process steps (Approach) ---------- */

.steps { display: flex; flex-direction: column; gap: 0; max-width: 46rem; }
.step {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line-soft);
}
.step:first-child { border-top: 0; padding-top: 0.3rem; }
.step__n { color: var(--accent); padding-top: 0.35rem; }
.step h3 { font-size: 1.15rem; color: var(--ink); margin-bottom: 0.45rem; }
.step p { color: var(--ink-2); max-width: 40rem; }

/* ---------- engagements ---------- */

.engagements { display: flex; flex-direction: column; gap: 0; margin-top: 0.5rem; }
.eng {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: 1.9rem;
  border-top: 1px solid var(--line-soft);
}
.eng:first-child { border-top: 0; padding-top: 0.5rem; }
.eng__name { font-size: var(--step-1); color: var(--ink); font-weight: 600; font-family: Fraunces, Georgia, serif; font-variation-settings: "SOFT" 0, "WONK" 1; line-height: 1.2; letter-spacing: -0.015em; }
.eng__meta { margin-top: 0.5rem; color: var(--accent); }
.eng__body { color: var(--ink-2); display: flex; flex-direction: column; gap: 0.8rem; }
.eng__for { color: var(--muted); font-size: 0.89rem; }
.eng__out { font-size: 0.92rem; }
.eng__out strong { color: var(--ink); font-weight: 600; }
@media (max-width: 46rem) { .eng { grid-template-columns: 1fr; gap: 0.9rem; } }

/* ---------- proof ---------- */

.proofs { display: flex; flex-direction: column; gap: 1.6rem; margin-top: 0.4rem; }
.proof {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1.2rem;
  align-items: baseline;
}
.proof__when { color: var(--muted); }
.proof__what { color: var(--ink-2); max-width: 46ch; }
.proof__what strong { color: var(--ink); font-weight: 600; }
@media (max-width: 40rem) { .proof { grid-template-columns: 1fr; gap: 0.35rem; } }

/* case: before / after */
.cases { display: flex; flex-direction: column; gap: 3px; margin-top: 0.4rem; max-width: 48rem; }
.case {
  background: var(--surface-2);
  padding: 1.6rem 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.4rem 2rem;
}
.case__head { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.35rem; }
.case__head h3 { font-size: 1.15rem; color: var(--ink); }
.case__head .mono { color: var(--muted); }
.case__col { display: flex; flex-direction: column; gap: 0.5rem; }
.case__col .mono { color: var(--accent); }
.case__col p { color: var(--ink-2); font-size: 0.93rem; line-height: 1.5; }
.case__col p strong { color: var(--ink); }
@media (max-width: 40rem) { .case { grid-template-columns: 1fr; } }

/* ---------- pull quote ---------- */

.pull {
  border-left: 2px solid var(--accent);
  padding-left: 1.4rem;
  margin: 0.6rem 0;
}
.pull p {
  font-family: Fraunces, Georgia, serif;
  font-variation-settings: "SOFT" 0, "WONK" 1;
  font-size: var(--step-2);
  line-height: 1.24;
  color: var(--ink);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.pull--big p { font-size: var(--step-3); }

/* ---------- essay (About / Manifesto) ---------- */

.essay { max-width: 36rem; display: flex; flex-direction: column; gap: 1.15em; color: var(--ink-2); }
.essay .beat { color: var(--ink); font-weight: 500; }
.essay .lede { font-size: var(--step-1); color: var(--ink); line-height: 1.5; }
.essay hr { margin: 1.2rem 0; }
.essay h2 { font-size: var(--step-2); color: var(--ink); margin-top: 0.6rem; }

.bio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.bio__facts { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.4rem 1.3rem; background: var(--surface-2); border-top: 3px solid var(--accent); }
.bio__facts .mono { color: var(--muted); }
.bio__facts p { font-size: 0.92rem; color: var(--ink-2); line-height: 1.45; }
.bio__facts p strong { color: var(--ink); font-weight: 600; }
@media (max-width: 46rem) { .bio { grid-template-columns: 1fr; } }

/* ---------- tools (products) ---------- */

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 3px;
  margin-top: 0.4rem;
}
.tool {
  background: var(--surface-2);
  padding: 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border-top: 3px solid var(--line);
  transition: border-color 200ms ease, background 200ms ease;
}
.tool:hover { border-top-color: var(--accent); background: var(--surface); }
.tool h3 { font-size: 1.12rem; color: var(--ink); }
.tool .mono { color: var(--muted); }
.tool p { color: var(--ink-2); font-size: 0.93rem; line-height: 1.5; flex: 1; }
.tool .link-arrow { margin-top: 0.3rem; }

.funnel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  max-width: 48rem;
  margin-top: 0.4rem;
}
.funnel > div { background: var(--surface-2); padding: 1.3rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; border-left: 3px solid var(--accent); }
.funnel .mono { color: var(--muted); }
.funnel h3 { font-size: 1.05rem; }
.funnel p { font-size: 0.9rem; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 40rem) { .funnel { grid-template-columns: 1fr; } }

/* ---------- close ---------- */

.close { background: var(--surface); border-top: 1px solid var(--line); }
.close__inner {
  padding-block: clamp(4rem, 9vw, 7rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
  max-width: 44rem;
}
.close h2 { font-size: var(--step-3); }
.close p { color: var(--ink-2); font-size: var(--step-1); line-height: 1.5; max-width: 40ch; }
.close__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); background: var(--ground); }
.foot__inner {
  padding-block: 2.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 3rem;
  justify-content: space-between;
  align-items: flex-start;
}
.foot__col { display: flex; flex-direction: column; gap: 0.55rem; }
.foot__col h4 { margin: 0 0 0.25rem; color: var(--muted); font-weight: 500; }
.foot__col a, .foot__col span { color: var(--ink-2); text-decoration: none; font-size: 0.9rem; }
.foot__col a:hover { color: var(--accent); }
.foot__tag { color: var(--muted); font-size: 0.86rem; max-width: 26ch; line-height: 1.5; }
.foot__legal { color: var(--muted); font-size: 0.8rem; padding-bottom: 2.2rem; }

/* ---------- motion ---------- */

.rise { opacity: 0; transform: translateY(14px); }
.is-in { animation: rise 700ms cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

.hero .rise:nth-child(1) { animation-delay: 60ms; }
.hero .rise:nth-child(2) { animation-delay: 150ms; }
.hero .rise:nth-child(3) { animation-delay: 240ms; }
.hero .rise:nth-child(4) { animation-delay: 330ms; }

@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; animation: none !important; }
  * { transition-duration: 1ms !important; }
  html { scroll-behavior: auto; }
}
