/* ==========================================================================
   Oakes Consulting

   Tokens live in tokens.css. No literal hex below this line, so a palette
   change stays a one-file change.

   Layout is a measured spine with breakout tiers rather than a centred
   container. Sections are separated by hairline rules that span the full
   width, never by alternating background colours.
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

/* ==========================================================================
   THE SPINE
   ========================================================================== */

.spine {
  display: grid;
  grid-template-columns:
    [full-start] var(--edge)
    [feature-start] var(--feature)
    [popout-start] var(--popout)
    [content-start] var(--content) [content-end]
    var(--popout) [popout-end]
    var(--feature) [feature-end]
    var(--edge) [full-end];
}

.spine > *      { grid-column: content; }
.spine > .popout  { grid-column: popout; }
.spine > .feature { grid-column: feature; }
.spine > .full    { grid-column: full; }

/* ==========================================================================
   SECTIONS: ruled, not striped
   ========================================================================== */

.section {
  padding-block: var(--section-pad);
  border-top: 1px solid var(--hairline);
  position: relative;
}

.section:first-of-type { border-top: 0; }

/* The folio aligns with the section heading rather than sitting out in the
   gutter. Stranded in the far-left edge tier it read as detached. */
.folio {
  grid-column: feature;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 0 0 var(--space-4);
}

/* Exactly one section per page may take a filled ground, and it should be the
   one that matters most. Here that is the closing invitation. */
.section--filled { background: var(--surface); }

/* ==========================================================================
   TYPE
   ========================================================================== */

h1, h2, h3 {
  font-family: var(--font-display);
  font-variation-settings: var(--display-axes);
  font-weight: 400;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.024em;
}

h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
}

h3 {
  font-size: 1.28rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* The signature move, used once per page rather than on every heading. */
.accent { font-style: italic; color: var(--steel); }

p { margin: 0 0 var(--space-2); }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  line-height: 1.55;
  color: var(--secondary);
  max-width: 54ch;
}

.small { font-size: 0.9rem; line-height: 1.55; }
.muted { color: var(--secondary); }

/* ==========================================================================
   STRUCTURAL TYPE IN THE GROUND LAYER
   One instance per page. Sub-1 line height is what makes large type read as
   architecture rather than as an oversized heading.
   ========================================================================== */


/* ==========================================================================
   LINKS AND BUTTONS
   ========================================================================== */

a { color: var(--steel); text-decoration: none; }

.prose a,
.link {
  border-bottom: 1px solid currentColor;
  transition: color var(--dur-fast) var(--ease-out);
}
.prose a:hover, .link:hover { color: var(--steel-deep); }

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

.button {
  display: inline-block;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: 2px;
  background: var(--steel);
  color: var(--base);
  transition: background var(--dur-fast) var(--ease-out);
}
.button:hover { background: var(--steel-deep); }

.actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-5);
}

/* ==========================================================================
   HEADER: hides on scroll down, returns on scroll up
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--base);
  border-bottom: 1px solid transparent;
  transition: transform var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out),
              background var(--dur-mid) var(--ease-out);
}

/* Applied by main.js. The guard is that the class is only ever added, never
   an inline style, so a JS failure leaves a perfectly usable static header. */
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.is-stuck {
  background: var(--surface);
  border-bottom-color: var(--hairline);
}
/* The stuck fill is deliberately the quarry grey and not a lighter tone.
   A near-white bar on this ground reads as a foreign element. */

.site-header__inner {
  grid-column: full;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--gutter);
}

.wordmark {
  font-family: var(--font-display);
  font-variation-settings: var(--display-axes);
  font-size: 1.1rem;
  letter-spacing: -0.012em;
  color: var(--ink);
  white-space: nowrap;
}

.site-nav { display: flex; gap: var(--space-4); font-size: 0.95rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink); }
.site-nav a:hover { color: var(--steel); }
.site-nav a[aria-current="page"] { color: var(--steel); }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  padding-block: clamp(3.5rem, 8vw, 7rem) var(--section-pad);
  position: relative;
  align-items: center;
  row-gap: var(--space-6);
}

.hero__body { grid-column: feature; }
.hero h1 { margin-bottom: var(--space-4); }

/* ==========================================================================
   THIRDS: a sticky one-third heading beside two-thirds of content
   ========================================================================== */

.thirds {
  grid-column: feature;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.thirds__head { position: sticky; top: 7rem; }
.thirds__head h2 { margin-bottom: var(--space-2); }

@media (max-width: 899px) {
  .thirds { grid-template-columns: 1fr; }
  .thirds__head { position: static; }
}

/* symptom list */
.symptoms { list-style: none; padding: 0; margin: 0; }

.symptoms li {
  padding: var(--space-2) 0 var(--space-2) var(--space-4);
  border-top: 1px solid var(--hairline);
  position: relative;
  max-width: 58ch;
}
.symptoms li:last-child { border-bottom: 1px solid var(--hairline); }

.symptoms li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--space-2) + 0.72em);
  width: 24px;
  height: 2px;
  background: var(--brass);
}

/* ==========================================================================
   RULED ROWS: what the work is. Not cards, not icons.
   ========================================================================== */

.rows { grid-column: feature; }

.row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(1.25rem, 2.6vw, 2.5rem);
  padding-block: clamp(1.4rem, 2.4vw, 2.1rem);
  border-top: 1px solid var(--hairline);
  align-items: start;
}
.row:last-child { border-bottom: 1px solid var(--hairline); }

.row__index {
  font-family: var(--font-display);
  font-variation-settings: var(--display-axes);
  font-size: 2.4rem;
  line-height: 0.9;
  color: var(--brass);
  font-variant-numeric: tabular-nums;
}

.row__body { color: var(--secondary); max-width: 52ch; }

@media (max-width: 899px) {
  .row { grid-template-columns: 3rem minmax(0, 1fr); }
  .row__body { grid-column: 2; }
}

/* ==========================================================================
   OFFSET PANEL: a steel plate behind a raised surface.
   Two children, same grid cell, z-index. No negative margins.
   ========================================================================== */

.offset {
  grid-column: full;
  display: grid;
  grid-template-columns:
    [plate-start] var(--edge) var(--feature)
    [panel-start] var(--popout) minmax(0, 64ch) var(--popout)
    [plate-end] var(--feature) [panel-end] var(--edge);
  grid-template-rows: clamp(2rem, 4vw, 4rem) [row-start] auto [row-end] clamp(2rem, 4vw, 4rem);
  margin-block: var(--space-4);
}

.offset__plate {
  grid-column: plate-start / plate-end;
  grid-row: 1 / row-end;
  background: var(--steel);
  z-index: 0;
}

.offset__panel {
  grid-column: panel-start / panel-end;
  grid-row: row-start / -1;
  background: var(--surface);
  padding: clamp(2rem, 4vw, 3.5rem);
  z-index: 1;
  border: 1px solid var(--hairline);
}

@media (max-width: 899px) {
  .offset { grid-template-columns: var(--gutter) [plate-start panel-start] 1fr [plate-end panel-end] var(--gutter); }
  .offset__plate { grid-column: plate-start / plate-end; }
  .offset__panel { grid-column: panel-start / panel-end; }
}

/* proof figures */
.proof {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-5) var(--space-4);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.proof__figure {
  font-family: var(--font-display);
  font-variation-settings: var(--display-axes);
  font-size: clamp(2.2rem, 3.4vw, 3.2rem);
  line-height: 0.95;
  color: var(--ink);
  display: block;
  margin-bottom: var(--space-1);
  font-variant-numeric: tabular-nums;
}

.proof__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--secondary);
  display: block;
  line-height: 1.5;
}

/* ==========================================================================
   ADJACENCY: quiet, ruled, no coloured border strip
   ========================================================================== */

.adjacent {
  grid-column: popout;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding-block: var(--space-5);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: baseline;
}

@media (max-width: 899px) {
  .adjacent { grid-template-columns: 1fr; gap: var(--space-2); }
}

/* ==========================================================================
   TERMINAL FOOTER
   Built by inverting the ink and ground tokens. No new colour enters the
   palette, which is what stops a dark footer reading as bolted on. Inset from
   the viewport edges so it sits as a slab with the page ground around it.
   ========================================================================== */

.site-footer {
  background: var(--ink);
  color: var(--base);
  /* Full bleed, edge to edge and bottom. A footer is a terminal, not a
     floating card. */
}

.site-footer a { color: var(--base); }
.site-footer a:hover { color: #FFFFFF; }

.footer__inner {
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.5rem, 4vw, 4rem);
  display: grid;
  gap: 0;
}

.footer__tree { width: clamp(64px, 7vw, 104px); opacity: 0.9; }

.footer__cols {
  display: grid;
  grid-template-columns: auto repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-5);
  padding-bottom: clamp(1.75rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--hairline-invert);
  align-items: start;
}

.footer__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--base);
  opacity: 0.55;
  margin: 0 0 var(--space-2);
}

.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.footer__list a { opacity: 0.88; }
.footer__list a:hover { opacity: 1; }

.footer__colophon {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-top: clamp(1.5rem, 3vw, 2rem);
  font-size: 0.85rem;
  opacity: 0.62;
}

.footer__colophon p { margin: 0; }

@media (max-width: 700px) {
  /* ==========================================================================
   MOTION
   One reveal, used on one thing, is a decision. Forty is a template.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .site-header.is-hidden { transform: none; }
}
