/* ==========================================================================
   Design tokens — change these to re-brand the whole site
   ========================================================================== */
:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --border: #e6e3de;
  --accent: #3b5bdb;
  --accent-soft: #e7ecff;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: var(--font-sans); /* single typeface: Inter */

  --radius: 14px;
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

:root[data-theme="dark"] {
  --bg: #111213;
  --surface: #1a1b1d;
  --text: #f1f0ee;
  --muted: #a3a29f;
  --border: #2c2d30;
  --accent: #8ea4ff;
  --accent-soft: #23294a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111213;
    --surface: #1a1b1d;
    --text: #f1f0ee;
    --muted: #a3a29f;
    --border: #2c2d30;
    --accent: #8ea4ff;
    --accent-soft: #23294a;
  }
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 400; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 2.9rem); line-height: 1.12; letter-spacing: -.03em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.25rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(64px, 10vw, 120px) 0; }
.eyebrow { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 1rem; }
.muted { color: var(--muted); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 100; }

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-size: .95rem; }

.theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--accent); }

@media (max-width: 560px) {
  .nav-links li.hide-sm { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding-block: clamp(72px, 14vw, 160px) clamp(48px, 8vw, 96px); }
.hero h1 { max-width: 11.3em; margin: 0; }
.hero-hi { font-size: clamp(2.1rem, 4.6vw, 2.9rem); line-height: 1.12; letter-spacing: -.03em; color: var(--muted); margin: 0 0 .6em; }
.hero .lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; text-decoration: none; font-weight: 500;
  border: 1px solid var(--text); transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.btn-ghost:hover { border-color: var(--accent); }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); margin-bottom: 24px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2f9e44; }

/* ==========================================================================
   Work grid
   ========================================================================== */
.work-grid { display: grid; gap: clamp(24px, 4vw, 40px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.card { text-decoration: none; display: block; }
.card-media {
  aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  background: var(--accent-soft); border: 1px solid var(--border); margin-bottom: 18px;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card h3 { margin-bottom: .25em; }
.card:hover h3 { color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 10px 0 0; }
.tags li { font-size: .8rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }

/* ==========================================================================
   About
   ========================================================================== */
.about-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
.about-intro p { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 46ch; }
.about-intro a { color: var(--text); text-decoration: none; }
.about-intro a:hover { color: var(--accent); }
.about-intro .wave { font-size: 2.2rem; line-height: 1; margin-bottom: .6em; }
.about-intro .about-cta { margin-top: 1.6em; }
.about-photo { order: -1; width: 128px; height: auto; aspect-ratio: 1 / 1; align-self: start; border-radius: var(--radius); object-fit: cover; background: var(--accent-soft); }
@media (min-width: 860px) {
  .about-grid { grid-template-columns: auto 240px; justify-content: start; gap: 56px; }
  .about-photo { order: 0; width: 100%; margin-top: 64px; }
}

.expertise-title { font-weight: 400; color: var(--muted); margin-top: clamp(64px, 9vw, 112px); }
.expertise { display: grid; gap: 40px 48px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); margin-top: 24px; }
.expertise h3 { font-weight: 500; font-size: 1.15rem; margin-bottom: .6em; }
.expertise p { color: var(--muted); font-size: .95rem; margin: 0; }
.expertise a { color: var(--text); text-decoration: none; }
.expertise a:hover { color: var(--accent); }


.process { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 48px; }
.process-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.process-step span { font-size: .8rem; color: var(--accent); font-weight: 600; }
.process-step p { color: var(--muted); font-size: .95rem; margin: 0; }

.skills { columns: 2; padding-left: 1.1em; color: var(--muted); }

/* ==========================================================================
   Contact / footer
   ========================================================================== */
.contact { text-align: center; }
.contact h2 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.03em; }
.contact .email { font-size: clamp(1.1rem, 3vw, 1.6rem); word-break: break-word; }
.social { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; list-style: none; padding: 0; margin: 32px 0 0; }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: .9rem; color: var(--muted); }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================
   Case study pages
   ========================================================================== */
.cs-hero { padding: clamp(56px, 10vw, 112px) 0 40px; }
.cs-hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); max-width: 20ch; }
.cs-cover { border-radius: var(--radius); border: 1px solid var(--border); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--accent-soft); }

.cs-meta { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); max-width: 640px; margin: 0; padding: 0 0 48px; }
.cs-meta dt { font-size: .95rem; color: var(--muted); }
.cs-meta dd { margin: 4px 0 0; }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 2.2em; }
.prose ul { padding-left: 1.2em; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: var(--radius); border: 1px solid var(--border); }
.prose figcaption { font-size: .9rem; color: var(--muted); margin-top: 8px; }
.wide { max-width: none; }

.callout { background: var(--accent-soft); border-radius: var(--radius); padding: 24px 28px; margin: 2em 0; }
.callout p:last-child { margin: 0; }

.metrics { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 2em 0; }
.metric { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; background: var(--surface); }
.metric strong { display: block; font-size: 2rem; font-weight: 400; letter-spacing: -.03em; color: var(--accent); }
.metric span { color: var(--muted); font-size: .95rem; }

.next-project { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 40px 0; border-top: 1px solid var(--border); margin-top: 64px; }
.next-project a { font-size: 1.3rem; text-decoration: none; letter-spacing: -.01em; }

.card.is-soon { cursor: default; }
.card.is-soon:hover h3 { color: inherit; }
.card.is-soon:hover .card-media img { transform: none; }


.experience { list-style: none; padding: 0; margin: 0; }
.experience li { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }

/* Experience timeline */
.timeline { list-style: none; padding: 0; margin: 40px 0 0; }
.job { display: grid; grid-template-columns: 1fr; gap: 8px 40px; padding: 28px 0; border-top: 1px solid var(--border); }
@media (min-width: 760px) { .job { grid-template-columns: 220px 1fr; } }
.job-company h3 { margin: 0; }
.job-company span { font-size: .9rem; }
.role + .role { margin-top: 20px; }
.role-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 16px; }
.role-head span { font-size: .9rem; }
.role ul { color: var(--muted); padding-left: 1.1em; margin: 8px 0 0; font-size: .98rem; }
.role li + li { margin-top: 4px; }

.facts { display: grid; gap: 24px 40px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); padding-top: 32px; border-top: 1px solid var(--border); }
.facts h3 { margin-bottom: .4em; }

.hmw { margin: 1.5em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--accent); font-size: clamp(1.3rem, 2.6vw, 1.7rem); line-height: 1.35; letter-spacing: -.02em; }
.metric span:only-child { color: var(--text); }

/* Figures that break out of the text column to the full container width */
.prose figure.fig-wide { width: calc(min(100vw, var(--max)) - 2 * var(--gutter)); max-width: none; }

/* Several images side by side inside one figure */
.fig-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.fig-row-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }

/* Click-to-enlarge for case study images */
.prose figure img { cursor: zoom-in; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lightbox::backdrop { background: rgb(0 0 0 / .85); }
.lightbox img { display: block; max-width: 96vw; max-height: 92vh; border-radius: 8px; cursor: zoom-out; }
.lightbox p { color: #fff; font-size: .9rem; text-align: center; margin: 8px 0 0; }

/* Current page in the menu */
.nav-links a[aria-current="page"] { color: var(--accent); }
.about-page { padding-top: clamp(48px, 8vw, 96px); }

/* Case study headings: section titles (h2) and sub-sections (h3) */
.prose h3 { margin-top: 2.2em; font-weight: 500; color: var(--text); }
.prose h2 + h3 { margin-top: .8em; }

/* Atomic design diagram */
.prose figure.atomic { margin: 2.5em 0; max-width: 640px; }
.atomic svg { width: 100%; height: auto; display: block; }
.atomic-labels { fill: var(--muted); font-family: var(--font-sans); }
.prose p, .prose li { color: var(--muted); }
.prose p strong { color: var(--text); }
