/* ─── Tokens ────────────────────────────────────────────────────────────── */
:root {
  --paper:          #FBFAF8;
  --ink:            #14161A;
  --graphite:       #5A5F66;
  --seam:           #C8CDD2;
  --accent:         #1F3A5F;
  --nav-bg:         rgba(251, 250, 248, 0.94);

  --seam-x:         7.5rem;
  --content-inset:  11.5rem;
  --content-max:    42rem;

  --nav-h:          4rem;
}

/* ─── Dark mode token overrides ─────────────────────────────────────────── */
[data-theme="dark"] {
  --paper:    #12141A;
  --ink:      #E8E6E1;
  --graphite: #8A9099;
  --seam:     #2C3040;
  --accent:   #7BA7D4;
  --nav-bg:   rgba(18, 20, 26, 0.94);
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

/* ─── Base ──────────────────────────────────────────────────────────────── */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Nav ───────────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--seam);
}

.wordmark {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.015em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
  text-decoration: none;
  transition: color 150ms ease;
}

.nav-links a:hover { color: var(--accent); }

/* ─── Page wrapper & seam line ──────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  padding-top: var(--nav-h);
}

.seam-line {
  position: absolute;
  inset: 0 auto 0 var(--seam-x);
  width: 1px;
  background: var(--seam);
  pointer-events: none;
}

/* ─── Node ──────────────────────────────────────────────────────────────── */
.node {
  position: absolute;
  left: calc(var(--seam-x) - 4px);
  top: 3rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--seam);
  transform: scale(0.6);
  transform-origin: center center;
  transition: background 220ms ease-out, transform 220ms ease-out;
}

.node.revealed {
  background: var(--accent);
  transform: scale(1);
}

/* Delay hero node so it reads as a page-load moment */
.hero .node {
  top: 4rem;
  transition-delay: 350ms;
}

/* ─── Section shell ─────────────────────────────────────────────────────── */
.section {
  position: relative;
  padding: 6rem 3rem 6rem var(--content-inset);
}

.section-content {
  max-width: var(--content-max);
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: center;
  padding-top: 6rem;
  padding-bottom: 6rem;
}

.hero h1 {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-size: clamp(4.5rem, 8.5vw, 6rem);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 2rem;
}

.hero-sub {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--graphite);
  line-height: 1.7;
  max-width: 34rem;
  margin-bottom: 2.75rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.btn-primary {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.btn-primary:hover { opacity: 0.82; }

.btn-secondary {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
  text-decoration: none;
  transition: color 150ms ease;
}

.btn-secondary:hover { color: var(--accent); }

/* ─── Eyebrow ───────────────────────────────────────────────────────────── */
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: 1.25rem;
}

/* ─── Section headings ──────────────────────────────────────────────────── */
h2 {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-size: clamp(2rem, 3.5vw, 2.625rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.75rem;
}

p + p { margin-top: 1rem; }

/* ─── Approach ──────────────────────────────────────────────────────────── */
.approach-section {
  border-top: 1px solid var(--seam);
}

/* ─── Stats strip ───────────────────────────────────────────────────────── */
.stats-strip {
  border-top: 1px solid var(--seam);
  border-bottom: 1px solid var(--seam);
  padding: 4rem 3rem 4rem var(--content-inset);
}

.stats-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem 3rem;
  max-width: calc(var(--content-max) + 10rem);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.stat-number {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-size: clamp(2.25rem, 3.5vw, 3rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.stat-unit {
  font-size: 0.55em;
  vertical-align: super;
  letter-spacing: 0;
}

.stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
  line-height: 1.5;
}

/* ─── Selected Work ─────────────────────────────────────────────────────── */
.work-section {
  position: relative;
  border-top: 1px solid var(--seam);
}

.work-header {
  padding: 6rem 3rem 3rem var(--content-inset);
}

.engagement {
  position: relative;
  padding: 3rem 3rem 3rem var(--content-inset);
  border-top: 1px solid var(--seam);
}

.engagement .node {
  top: 2rem;
}

.engagement-type {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-size: 0.95rem;
  font-weight: 300;
  font-style: italic;
  color: var(--graphite);
  margin-bottom: 0.375rem;
}

.engagement-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.625rem;
}

.engagement-label-note {
  color: var(--graphite);
}

.engagement-outcome {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 0.875rem;
}

.engagement-body {
  font-size: 0.95rem;
  color: var(--graphite);
  line-height: 1.7;
}

/* ─── About ─────────────────────────────────────────────────────────────── */
.about-section {
  border-top: 1px solid var(--seam);
}

/* ─── Contact ───────────────────────────────────────────────────────────── */
.contact-section {
  border-top: 1px solid var(--seam);
}

.contact-sub {
  font-size: 0.95rem;
  color: var(--graphite);
}

.email-link {
  display: block;
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-size: clamp(1.35rem, 2.8vw, 1.875rem);
  font-weight: 400;
  color: var(--accent);
  text-decoration: none;
  margin-top: 1.75rem;
  margin-bottom: 1rem;
  transition: opacity 150ms ease;
}

.email-link:hover {
  opacity: 0.75;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--seam);
}

.linkedin-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
  text-decoration: none;
  transition: color 150ms ease;
}

.linkedin-link:hover { color: var(--accent); }

/* ─── Footer ────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--seam);
}

.footer-inner {
  padding: 2.5rem 3rem 2.5rem var(--content-inset);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.footer-name {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--ink);
}

.footer-meta,
.footer-copy {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.63rem;
  letter-spacing: 0.07em;
  color: var(--graphite);
}

/* ─── Theme toggle ──────────────────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--seam);
  color: var(--graphite);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ─── Focus ─────────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ─── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  :root {
    --seam-x:        1.5rem;
    --content-inset: 3.25rem;
  }

  nav {
    padding: 0 1.25rem;
  }

  .wordmark {
    font-size: 0.8rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .nav-links a {
    font-size: 0.63rem;
  }

  .section {
    padding: 4rem 1.25rem 4rem var(--content-inset);
  }

  .work-header {
    padding: 4rem 1.25rem 2.5rem var(--content-inset);
  }

  .engagement {
    padding: 2.5rem 1.25rem 2.5rem var(--content-inset);
  }

  .footer-inner {
    padding: 2rem 1.25rem 2rem var(--content-inset);
  }

  .stats-strip {
    padding: 3rem 1.25rem 3rem var(--content-inset);
  }

  .stats-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 2rem;
  }

  .hero {
    min-height: calc(100svh - var(--nav-h));
    align-items: flex-start;
    padding-top: 4rem;
  }

  .hero h1 {
    font-size: clamp(3rem, 12vw, 4.5rem);
  }

  .hero-actions {
    gap: 1.5rem;
  }
}

@media (max-width: 400px) {
  .nav-links {
    display: none;
  }
}
