/* ==========================================================================
   Alderspan — site.css
   A single, dependency-free stylesheet. Light theme by default,
   dark theme via prefers-color-scheme.

   Palette is derived from the approved Alderspan mark
   (/assets/brand/alderspan-mark.png):
     deep navy  #012049
     vivid blue #0070f8
     cyan       #4fdcf9
   The neutrals are cooled to sit with that identity; saturated brand colour
   is used sparingly so the mark stays the strongest colour on the page.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */

:root {
  /* Brand (as supplied — do not re-tint) */
  --navy:  #012049;
  --blue:  #0070f8;
  --cyan:  #4fdcf9;

  /* Surfaces & ink */
  --paper:      #fafbfc;
  --paper-band: #f1f4f8;
  --ink:        #0c1c33;
  --ink-2:      #3d4c60;
  --ink-3:      #5c6b7d;
  --rule:       rgba(12, 28, 51, 0.15);
  --rule-soft:  rgba(12, 28, 51, 0.075);
  --accent:     #0b5fd0;  /* text-safe step of the brand blue */
  --focus:      #0b5fd0;
  --on-solid:   #fafbfc;
  --plate:      #fefefe;  /* ground the supplied brand PNGs ship on */
  --paper-head: #fefefe;  /* header surface, matched to that ground */

  /* Type */
  --font-sans: "Segoe UI Variable Display", "Segoe UI", -apple-system,
               BlinkMacSystemFont, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", "SF Mono",
               Consolas, "Liberation Mono", Menlo, monospace;

  /* Structure */
  --shell-max: 1240px;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --section-y: clamp(5rem, 11vh + 3rem, 9.5rem);
  --header-h: 4.75rem;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 220ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #071120;
    --paper-band: #0b1828;
    --ink:        #eaf0f7;
    --ink-2:      #b3c1d0;
    --ink-3:      #8497a9;
    --rule:       rgba(234, 240, 247, 0.17);
    --rule-soft:  rgba(234, 240, 247, 0.085);
    --accent:     #6fb0ff;
    --focus:      #8fc4ff;
    --on-solid:   #071120;
    --paper-head: #071120;
  }
}

/* --- Base --------------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

a { color: inherit; }

svg { display: block; }

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

::selection {
  background: var(--navy);
  color: #fafbfc;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--navy);
  color: #fafbfc;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
  outline-offset: -4px;
}

/* --- Shell / structural rules ------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
}

/* Hairline "spans" at the edges of the measure — the structural motif that
   echoes the layered geometry of the mark. */
@media (min-width: 60rem) {
  .hero .shell::before,
  .hero .shell::after,
  .section .shell::before,
  .section .shell::after {
    content: "";
    position: absolute;
    top: calc(var(--section-y) * -0.5);
    bottom: calc(var(--section-y) * -0.5);
    width: 1px;
    background: var(--rule-soft);
    pointer-events: none;
  }
  .hero .shell::before,
  .section .shell::before { left: calc(var(--gutter) * 0.5); }
  .hero .shell::after,
  .section .shell::after { right: calc(var(--gutter) * 0.5); }
}

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

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

.site-header[data-scrolled="true"] { border-bottom-color: var(--rule-soft); }

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Approved wordmark, used exactly as supplied — uniform scaling only, never
   cropped, recoloured or redrawn. The PNG carries its own clearspace and
   ships on a near-white ground rather than transparency, so each theme
   contains that ground deterministically instead of blending it away:
     light — the header surface is set to that same ground (--paper-head),
             so the artwork's edge is invisible without any blend mode; the
             negative inline margin pulls the PNG's built-in clearspace back
             so the artwork aligns to the layout gutter.
     dark  — the artwork sits on an explicit light plate. */
.brand {
  --logo-h: 2.6rem;
  display: inline-flex;
  align-items: center;
  flex: none;
  text-decoration: none;
  border-radius: 3px;
}

.brand__logo {
  display: block;
  height: var(--logo-h);
  width: auto;
}

/* Below 352px the wordmark crowds the navigation, so the markup serves the
   standalone mark instead. It carries almost no built-in clearspace, so the
   negative margin that compensates for the wordmark's must not apply to it. */
@media (min-width: 22.0625rem) {
  .brand__logo { margin-inline: calc(var(--logo-h) * -0.42); }
}

@media (max-width: 22rem) {
  .brand { --logo-h: 2.2rem; }
}

@media (min-width: 48rem) {
  .brand { --logo-h: 3.6rem; }
}

@media (prefers-color-scheme: dark) {
  .brand__logo {
    margin-inline: 0;
    background: var(--plate);
    border-radius: 4px;
  }
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin: 0;
}

.site-nav a {
  position: relative;
  display: inline-block;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}

.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); }

.site-nav a[aria-current="true"] { color: var(--ink); }
.site-nav a[aria-current="true"]::after {
  transform: scaleX(1);
  background: var(--accent);
}

@media (max-width: 26rem) {
  .site-nav ul { gap: 0.95rem; }
  .site-nav a { font-size: 0.8125rem; }
}

/* --- Type ---------------------------------------------------------------- */

.display {
  font-size: clamp(2.25rem, 1.35rem + 4.1vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
  font-weight: 600;
  max-width: 17ch;
  text-wrap: balance;
}

.heading {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-weight: 600;
  max-width: 20ch;
  text-wrap: balance;
}

.lede {
  margin-top: clamp(1.5rem, 3vw, 2rem);
  max-width: 54ch;
  font-size: clamp(1.0625rem, 1rem + 0.42vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-2);
}

.body-lg {
  margin-top: 1.5rem;
  max-width: 62ch;
  font-size: clamp(1rem, 0.97rem + 0.24vw, 1.125rem);
  line-height: 1.65;
  color: var(--ink-2);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow__dot { color: var(--accent); padding-inline: 0.15em; }

.label {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.label__idx { color: var(--accent); }

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

.btn {
  --btn-y: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: var(--btn-y) 1.4rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

.btn--primary {
  background: var(--navy);
  color: #fafbfc;
  border-color: var(--navy);
}

.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn--ghost {
  border-color: var(--rule);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--ink);
  background: var(--rule-soft);
}

.btn--lg {
  --btn-y: 1rem;
  padding-inline: 1.75rem;
  font-family: var(--font-mono);
  font-size: clamp(0.9375rem, 0.9rem + 0.3vw, 1.0625rem);
  letter-spacing: 0.01em;
}

@media (prefers-color-scheme: dark) {
  .btn--primary {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--on-solid);
  }
  .btn--primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #071120;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .btn:active { transform: translateY(1px); }
}

@media (max-width: 24rem) {
  .btn { width: 100%; }
}

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

.hero {
  padding-block: clamp(3.5rem, 8vh + 1rem, 7rem) clamp(4rem, 9vh + 1rem, 8rem);
  position: relative;
  border-bottom: 1px solid var(--rule-soft);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(3rem, 6vw, 4rem);
  align-items: center;
}

@media (min-width: 62rem) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: clamp(2rem, 5vw, 5rem);
  }
}

.hero__figure { justify-self: center; width: 100%; max-width: 38rem; }

.span-figure { width: 100%; height: auto; }

.span-figure__grid path {
  fill: none;
  stroke: var(--rule-soft);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.span-figure__truss path {
  fill: none;
  stroke: var(--ink);
  stroke-opacity: 0.5;
  stroke-width: 1.25;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.span-figure__nodes circle {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-opacity: 0.55;
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}

/* The single highlighted span picks up the blue-to-cyan of the mark. */
.span-figure__lift {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.span-figure__key {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.75;
  vector-effect: non-scaling-stroke;
}

@media (prefers-color-scheme: dark) {
  .span-figure__lift { stroke: #4a94ff; }
}

@media (prefers-reduced-motion: no-preference) {
  .span-figure .draw {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: draw-span 1400ms var(--ease) forwards;
  }
  .draw--1 { animation-delay: 120ms; }
  .draw--2 { animation-delay: 300ms; }
  .draw--3 { animation-delay: 480ms; }
  .draw--4 { animation-delay: 900ms; animation-duration: 1000ms; }

  .span-figure__nodes circle,
  .span-figure__key {
    opacity: 0;
    animation: fade-in 700ms var(--ease) 1100ms forwards;
  }
}

@keyframes draw-span { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }

@media (max-width: 61.9375rem) {
  .hero__figure { max-width: 26rem; opacity: 0.92; }
}

/* --- Sections ------------------------------------------------------------ */

.section {
  padding-block: var(--section-y);
  position: relative;
  /* Keep anchored sections clear of the sticky header. */
  scroll-margin-top: var(--header-h);
}

.section--band {
  background: var(--paper-band);
  border-block: 1px solid var(--rule-soft);
}

.section__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 60rem) {
  .section__head {
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 5rem);
  }
  .label { padding-top: 0.85rem; }
}

/* --- Approach: areas ----------------------------------------------------- */

.areas {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
}

.area {
  padding-block: clamp(1.75rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.area::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 2.5rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 420ms var(--ease);
}

.area:hover::before,
.area:focus-within::before { transform: scaleX(1); }

.area__title {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.area__body {
  margin-top: 0.6rem;
  max-width: 46ch;
  color: var(--ink-2);
}

@media (min-width: 48rem) {
  .areas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(2rem, 5vw, 5rem);
  }
}

@media (min-width: 60rem) {
  .areas { margin-left: calc(12rem + clamp(2rem, 5vw, 5rem)); }
}

/* --- Process: stages ----------------------------------------------------- */

.stages {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 2.5rem);
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

@media (min-width: 48rem) {
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 60rem) {
  .stages { margin-left: calc(12rem + clamp(2rem, 5vw, 5rem)); }
}

.stage {
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  position: relative;
}

.stage::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

.stage__head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.stage__name { color: var(--ink); }
.stage__dash { color: var(--rule); }

.stage__body {
  margin-top: 0.75rem;
  max-width: 34ch;
  color: var(--ink-2);
}

/* --- Work: status -------------------------------------------------------- */

/* The Work section has nothing to show yet; the panel makes that a
   deliberate, framed slot rather than an empty gap. */
.status {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

@media (min-width: 60rem) {
  .status { margin-left: calc(12rem + clamp(2rem, 5vw, 5rem)); }
}

.status__label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.status__rule svg { width: 100%; height: 16px; }

.status__rule path {
  fill: none;
  stroke: var(--ink-3);
  stroke-opacity: 0.5;
  stroke-width: 1;
  stroke-dasharray: 2 6;
  vector-effect: non-scaling-stroke;
}

.status__rule circle {
  fill: var(--paper-band);
  stroke: var(--ink-3);
  stroke-opacity: 0.65;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* --- Contact ------------------------------------------------------------- */

.section--contact { padding-bottom: clamp(5rem, 10vh + 2rem, 9rem); }

.contact__action { margin-top: clamp(2rem, 4vw, 2.75rem); }

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

.site-footer {
  border-top: 1px solid var(--rule-soft);
  background: var(--paper-band);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

@media (min-width: 48rem) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: end;
  }
}

.footer__name {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.footer__tag {
  margin-top: 0.3rem;
  font-size: 0.9375rem;
  color: var(--ink-3);
}

.footer__meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
  display: grid;
  gap: 0.4rem;
}

.footer__email a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.footer__email a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.footer__legal { letter-spacing: 0.01em; }

.footer__top a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.footer__top a:hover { color: var(--ink); }

/* --- Reveal (extremely light) -------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 620ms var(--ease), transform 620ms var(--ease);
  }
  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* --- 404 ----------------------------------------------------------------- */

.page-narrow {
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-content: center;
  padding-block: clamp(4rem, 12vh, 8rem);
}

.page-narrow .display { max-width: 14ch; }

/* --- Print --------------------------------------------------------------- */

@media print {
  .site-header, .hero__figure, .footer__top { display: none; }
  body { background: #fff; color: #000; }
}
