@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

:root {
  --frame: #E4E4E4;          /* outer grey behind the white canvas */
  --bg: #ECECEC;
  --surface: #FFFFFF;
  --text: #232323;
  --text-muted: #6E6E6E;
  --border: #E6E6E6;
  --line: #DCDCDC;
  --grid: #E0E0E0;           /* dashed guide lines */
  --grid-ink: #C2C2C2;       /* ruler numbers + dots */
  --accent: #5B76F0;
  --accent-ink: #4763E0;
  --tint: #EEF1FE;
  --lav: #ECEAF8;
  --lav-ink: #5E5A86;
  --shadow: 0 1px 2px rgba(20,20,20,0.05), 0 14px 40px rgba(20,20,20,0.09);
  --radius: 16px;
  --mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
[data-theme="dark"] {
  --frame: #16121c;
  --bg: #211b29;
  --surface: #221b2b;
  --text: #F1EEF6;
  --text-muted: #a99fb6;
  --border: #352b42;
  --line: #352b42;
  --grid: #322940;
  --grid-ink: #4a3f5c;
  --accent: #9d8bf2;
  --accent-ink: #b7a8ff;
  --tint: #2c2438;
  --lav: #352b44;
  --lav-ink: #c7bce0;
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 14px 40px rgba(0,0,0,0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--frame); }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 12px;
  border-radius: 18px;
  min-height: calc(100vh - 24px);
  position: relative;
  transition: background 0.4s ease, color 0.4s ease;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 760px; }
a { color: inherit; text-decoration: none; }
.serif { font-family: 'Fraunces', Georgia, serif; font-weight: 400; }
.mono { font-family: var(--mono); }

/* ---------- Figma-canvas grid (dashed guides + ruler) ---------- */
.canvas-board { position: absolute; top: 0; left: 0; width: 100%; pointer-events: none; z-index: 0; overflow: hidden; border-radius: 18px; }
.cb-frame { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); width: min(1180px, 94%); }
.cb-v { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--grid); }
.cb-v.cb-edge { border-left-style: solid; border-left-color: var(--line); }
.cb-h { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.cb-dot { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--grid-ink); transform: translate(-50%, -50%); opacity: 0.85; }
.cb-ruler b { position: absolute; left: -18px; font-family: var(--mono); font-size: 9px; font-weight: 400; color: var(--grid-ink); transform: translateY(-50%); }

/* ---------- Grid-aligned proportional jump rail (case studies) ---------- */
.jump {
  position: fixed; top: 50%; transform: translateY(-50%);
  left: calc(50% - min(590px, 47vw));   /* sits on the left vertical grid guide */
  height: clamp(340px, 64vh, 580px); z-index: 42;
  pointer-events: auto;   /* override the global nav{pointer-events:none} so dots are clickable */
}
.jump-stop { pointer-events: auto; }
.jump-track { position: relative; height: 100%; }
.jump-fill { position: absolute; left: 0; top: 0; width: 2px; height: 0; background: var(--accent); border-radius: 2px; transition: height 0.18s linear; opacity: 0.85; }
.jump-stop {
  position: absolute; left: 0; transform: translateY(-50%);
  display: flex; align-items: center; gap: 13px;
  background: none; border: 0; cursor: pointer; padding: 7px 10px 7px 0; text-align: left;
}
.jump-dot {
  width: 11px; height: 11px; border-radius: 50%; margin-left: -5px; flex-shrink: 0; position: relative; z-index: 1;
  background: var(--surface); border: 2px solid var(--grid-ink);
  transition: transform 0.28s cubic-bezier(.2,.7,.2,1), background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.jump-label {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); white-space: nowrap;
  opacity: 0.5; transition: opacity 0.25s ease, transform 0.25s ease, color 0.25s;
}
.jump:hover .jump-label { opacity: 0.85; }
.jump-stop:hover .jump-dot { border-color: var(--accent); transform: scale(1.18); }
.jump-stop:hover .jump-label { color: var(--text); opacity: 1; transform: translateX(2px); }
.jump-stop.active .jump-dot { background: var(--accent); border-color: var(--accent); transform: scale(1.34); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent); }
.jump-stop.active .jump-label { color: var(--text); opacity: 1; font-weight: 700; }
@media (max-width: 1240px) { .jump { display: none; } }
nav, .wrap, footer { position: relative; z-index: 1; }
@media (max-width: 1180px) { .canvas-board { display: none; } }

/* ---------- Scroll-reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.65s ease, transform 0.65s cubic-bezier(.2,.7,.2,1); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }

/* ---------- Floating pill nav ---------- */
nav { position: sticky; top: 16px; z-index: 50; display: flex; justify-content: center; pointer-events: none; margin-top: 16px; }
.nav-inner {
  pointer-events: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); position: relative;
  display: inline-flex; align-items: center; gap: 36px;
  height: auto; width: auto; max-width: none; margin: 0; padding: 12px 28px;
  transition: box-shadow 0.3s ease;
}
.nav-inner:hover { box-shadow: 0 1px 2px rgba(20,20,20,0.05), 0 18px 50px rgba(20,20,20,0.14); }
.brand { display: none; }
.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a { font-size: 14px; color: var(--text-muted); position: relative; padding-bottom: 3px; transition: color 0.22s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after, .has-drop:hover > a::after { content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--text); }

/* Contact dropdown */
.has-drop { position: relative; display: inline-flex; }
.has-drop > a { cursor: pointer; }
.nav-drop {
  position: absolute; top: calc(100% + 16px); left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 14px 26px; min-width: 240px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.28s cubic-bezier(.2,.7,.2,1);
}
.has-drop:hover .nav-drop, .has-drop:focus-within .nav-drop { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.nav-drop a { font-size: 14px; color: var(--text-muted); padding-bottom: 0; transition: color 0.2s ease; }
.nav-drop a:hover { color: var(--accent); }

/* ---------- "Lights on·off" switch (fixed, all pages) ---------- */
.theme-toggle {
  position: fixed; left: 18px; bottom: 16px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px;
  background: none; border: 0; cursor: pointer; padding: 6px;
}
.theme-toggle::before {
  content: ""; width: 34px; height: 18px; border-radius: 999px;
  background-color: #cdcdcd;
  background-image: radial-gradient(circle 6px at 10px 50%, #fff 96%, rgba(0,0,0,0) 97%);
  transition: background 0.3s; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}
[data-theme="dark"] .theme-toggle::before {
  background-color: var(--accent);
  background-image: radial-gradient(circle 6px at 24px 50%, #fff 96%, rgba(0,0,0,0) 97%);
}
.theme-toggle::after { content: "Lights on·off"; font-family: 'Fraunces', Georgia, serif; font-style: italic; font-size: 13px; color: var(--text-muted); }

/* ---------- Hero ---------- */
header.hero { text-align: center; padding: 104px 0 6px; position: relative; }
.hero-photo {
  width: 150px; height: 158px; margin: 0 auto 28px;
  border-radius: 16px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 14%, #cfe0ff 0%, transparent 55%), linear-gradient(160deg, #b9c6f7 0%, #d9c2ec 55%, #f7c6dc 100%);
  border: 1px solid var(--border); display: grid; place-items: center;
  font-family: 'Fraunces', serif; font-size: 34px; color: #fff; text-shadow: 0 1px 8px rgba(80,80,140,0.35);
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1), box-shadow 0.5s ease;
}
.hero-photo:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 18px 40px rgba(80,80,140,0.28); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-hi { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-size: 20px; color: var(--text-muted); margin-bottom: 26px; }
.hero h1 {
  font-family: 'Fraunces', Georgia, serif; font-weight: 400;
  font-size: clamp(30px, 4.4vw, 46px); line-height: 1.22; letter-spacing: -0.012em;
  max-width: 22ch; margin: 0 auto; color: var(--text-muted);
}
.hero h1 .blue { color: var(--accent); font-weight: 500; }
.hero h1 strong { font-weight: 700; color: var(--text); }

/* ---------- Location / live time row ---------- */
.meta-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: min(1180px, calc((100vw - 24px) * 0.94));   /* match the grid frame exactly */
  margin-top: 80px;
  margin-left: calc(50% - min(1180px, calc((100vw - 24px) * 0.94)) / 2);   /* center w/o transform (reveal anim uses transform) */
  padding: 13px clamp(16px, 5vw, 64px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted);
}
.meta-row .loc { display: flex; align-items: center; gap: 9px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- Section marker circle ---------- */
.sec-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 15px; color: var(--text-muted); margin: 38px 0 18px; }

/* ---------- Section heading ---------- */
.sec-head { margin-bottom: 24px; }
.sec-head h2 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(32px, 4.4vw, 48px); font-weight: 600; letter-spacing: -0.025em; }
section { padding: 24px 0; }

/* ---------- Projects (home) ---------- */
.projects { display: flex; flex-direction: column; }
.project { display: grid; grid-template-columns: 0.78fr 1.22fr; gap: 44px; align-items: stretch; padding: 30px 0; border-top: 1px solid var(--line); transition: opacity 0.25s ease; }
.project:last-child { border-bottom: 1px solid var(--line); }
.project .p-text { display: flex; flex-direction: column; padding: 6px 0; }
.project .p-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.project .p-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 14px; flex-shrink: 0; background: var(--lav); transition: transform 0.3s ease; }
.project:hover .p-ic { transform: rotate(-6deg) scale(1.08); }
.project h3 { font-family: 'Fraunces', Georgia, serif; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: text-decoration-color 0.2s; }
.project:hover h3 { text-decoration-color: var(--accent); }
.project p { color: var(--text-muted); font-size: 14px; line-height: 1.5; max-width: 40ch; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; padding-top: 16px; }
.tag { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em; padding: 4px 8px; border-radius: 4px; background: var(--lav); color: var(--lav-ink); }

.thumb { border-radius: 12px; min-height: 280px; position: relative; overflow: hidden; border: 1px solid rgba(0,0,0,0.04); transition: transform 0.5s cubic-bezier(.2,.7,.2,1), box-shadow 0.5s ease; }
.project:hover .thumb { transform: translateY(-4px) scale(1.012); box-shadow: 0 18px 44px rgba(20,20,20,0.14); }
.thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(255,255,255,0.18), transparent 45%); opacity: 0; transition: opacity 0.5s ease; }
.project:hover .thumb::after { opacity: 1; }
.thumb.pink   { background: linear-gradient(135deg, #fbd0e1, #f6b2cf); }
.thumb.peri   { background: linear-gradient(135deg, #c3c6f2, #abafe6); }
.thumb.dark   { background: linear-gradient(150deg, #241224, #120a16); }
.thumb.blue   { background: linear-gradient(135deg, #2b8fe6, #0a5fb0); }
.thumb.coral  { background: linear-gradient(135deg, #ff8a5c, #ef5f78); }
.thumb.green  { background: linear-gradient(135deg, #57b894, #2f8f6e); }
.thumb.violet { background: linear-gradient(135deg, #9a7bf0, #6c4fd0); }

/* ---------- Approach ---------- */
.approach { display: grid; grid-template-columns: 0.78fr 1.22fr; gap: 44px; align-items: start; }
.approach .sec-head { margin: 0; }
.method-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px 44px; }
.step-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.step .step-num { font-family: 'Fraunces', Georgia, serif; font-size: 18px; color: var(--text); font-weight: 600; }
.step .step-ic { margin-left: auto; font-size: 22px; opacity: 0.85; }
.step h4 { font-family: 'Fraunces', Georgia, serif; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.step p { color: var(--text-muted); font-size: 14px; margin-top: 10px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- CTA ---------- */
.cta { text-align: center; padding: 50px 0 70px; }
.cta .sec-mark { margin: 0 auto 30px; }
.cta h2 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(30px, 5vw, 52px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.12; max-width: 18ch; margin: 0 auto 18px; }
.cta .lead { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-size: clamp(18px, 2.4vw, 24px); color: var(--text-muted); margin-bottom: 30px; }
.cta .lead strong { color: var(--text); font-style: italic; font-weight: 700; }
.btn { display: inline-flex; align-items: center; gap: 10px; background: var(--accent); color: #fff; padding: 16px 34px; border-radius: 999px; font-size: 16px; font-weight: 600; transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn:hover { transform: translateY(-2px); }
.btn span { transition: transform 0.2s; }
.btn:hover span { transform: translateX(3px); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); box-shadow: none; }

/* ---------- Footer ---------- */
footer { padding: 26px 0 40px; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; font-family: var(--mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.foot-links { display: flex; gap: 20px; }
.foot-links a:hover { color: var(--accent); }

/* ================= CASE STUDY ================= */
.cs-hero { padding: 50px 0 22px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 30px; transition: gap 0.2s, color 0.2s; }
.back:hover { gap: 12px; color: var(--accent); }
.cs-hero .eyebrow { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 16px; }
.cs-hero h1 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(32px, 5.2vw, 54px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.08; }
.cs-hero .subtitle { margin-top: 20px; font-size: 18px; color: var(--text-muted); max-width: 60ch; }

.cs-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 44px 0 10px; }
.cs-meta .cell { background: var(--surface); padding: 22px 24px; }
.cs-meta .k { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 8px; }
.cs-meta .v { font-size: 15px; font-weight: 500; }

.cs-band { height: 200px; border-radius: var(--radius); margin: 12px 0 4px; border: 1px solid rgba(0,0,0,0.05); }

.media { width: 100%; border-radius: var(--radius); border: 1px dashed var(--border); background: repeating-linear-gradient(45deg, var(--tint), var(--tint) 12px, transparent 12px, transparent 24px); display: grid; place-items: center; text-align: center; color: var(--text-muted); font-size: 13px; padding: 20px; margin: 14px 0 4px; aspect-ratio: 16 / 8; }
.media.tall { aspect-ratio: 16 / 10; }
.artifact-placeholder {
  width: 100%;
  min-height: 180px;
  border-radius: var(--radius);
  border: 1px dashed color-mix(in srgb, var(--accent) 42%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34%),
    repeating-linear-gradient(45deg, var(--tint), var(--tint) 12px, transparent 12px, transparent 24px);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  margin: 14px 0 4px;
  aspect-ratio: 16 / 8;
  position: relative;
  overflow: hidden;
}
.artifact-placeholder::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: calc(var(--radius) - 4px);
  pointer-events: none;
}
.artifact-placeholder.tall { aspect-ratio: 16 / 10; }
.artifact-placeholder.square { aspect-ratio: 4 / 3; }
.artifact-placeholder .placeholder-copy {
  position: relative;
  display: grid;
  gap: 8px;
  justify-items: center;
  max-width: 38ch;
}
.artifact-placeholder .placeholder-type {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.artifact-placeholder .placeholder-title {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
}
.caption { font-size: 13px; color: var(--text-muted); font-style: italic; margin: 8px 0 0; text-align: center; }

/* Design artifact images */
.cs-figures { display: grid; gap: 16px; margin: 24px 0 4px; }
.cs-figures.two-up { grid-template-columns: 1fr 1fr; }
figure.cs-fig { margin: 0; }
figure.cs-fig img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); display: block; background: var(--tint); }
figure.cs-fig figcaption { font-size: 12.5px; color: var(--text-muted); font-style: italic; margin-top: 6px; text-align: center; }
@media (max-width: 640px) { .cs-figures.two-up { grid-template-columns: 1fr; } }

.block { padding: 42px 0; border-top: 1px solid var(--border); scroll-margin-top: 104px; }
.block:first-of-type { border-top: none; }
.kicker { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 16px; }
.block h2 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(25px, 3.4vw, 36px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.14; margin-bottom: 20px; }
.block h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin: 32px 0 12px; }
.block p { font-size: 16.5px; color: var(--text-muted); margin-bottom: 18px; max-width: 68ch; }
.block p strong { color: var(--text); font-weight: 600; }
.block ol.steps { list-style: none; counter-reset: s; display: grid; gap: 12px; max-width: 70ch; }
.block ol.steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 52px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; font-size: 15.5px; color: var(--text-muted); }
.block ol.steps li::before { content: counter(s); position: absolute; left: 13px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--mono); font-size: 12px; display: grid; place-items: center; }
.block ol.steps li strong { color: var(--text); }
.block ul { list-style: none; margin: 0 0 18px; max-width: 68ch; }
.block ul li { position: relative; padding-left: 26px; margin-bottom: 12px; color: var(--text-muted); font-size: 16px; }
.block ul li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.block ul li strong { color: var(--text); }

.entry + .entry { margin-top: 38px; border-top: 1px solid var(--border); padding-top: 34px; }
.entry h3 { margin-top: 0; }
.entry-meta { font-size: 15px; color: var(--text-muted); font-weight: 500; margin: 2px 0 14px; }
.entry-meta strong { color: var(--accent); font-weight: 600; }
.courses-label { font-size: 14px; color: var(--text-muted); margin: 20px 0 10px; }

.quote { border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; padding: 26px 30px; margin: 26px 0; box-shadow: var(--shadow); }
.quote p { font-family: 'Fraunces', Georgia, serif; font-size: 21px; line-height: 1.42; color: var(--text); margin: 0; max-width: none; font-style: italic; }
.quote .who { display: block; margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); font-style: normal; text-transform: uppercase; letter-spacing: 0.04em; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 26px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); }
.stat.red::before { background: #D32F2F; } .stat.amber::before { background: #E65100; }
.stat .big { font-family: 'Fraunces', Georgia, serif; font-size: 40px; line-height: 1; letter-spacing: -0.02em; }
.stat .big.red { color: #D32F2F; } .stat .big.amber { color: #E65100; }
.stat .small { margin-top: 11px; font-size: 14px; color: var(--text-muted); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.card h4 { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.card p { font-size: 15px; margin-bottom: 0; }

.data-strip { background: var(--tint); border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 12px; padding: 16px 20px; font-size: 14.5px; color: var(--text-muted); margin: 8px 0; }
.data-strip strong { color: var(--accent-ink); }

.bars { margin: 16px 0; max-width: 70ch; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.bar-row .name { font-size: 13px; color: var(--text-muted); width: 210px; flex-shrink: 0; }
.bar-row .track { flex: 1; background: var(--tint); border-radius: 6px; height: 18px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 6px; background: var(--accent); }
.bar-row .fill.hw { background: #2b8fe6; opacity: 0.7; }
.bar-row .val { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text); width: 52px; text-align: right; }

.video-chip { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); padding: 8px 14px; border-radius: 999px; margin-top: 18px; }

/* ===================================================
   BLOG — home grid + individual post pages
   (base definitions — MUST come before media queries)
   =================================================== */

/* ---------- Blog cards (home section) ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.blog-card {
  display: flex;
  flex-direction: column;
  padding: 28px 28px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: box-shadow 0.3s ease, transform 0.3s cubic-bezier(.2,.7,.2,1), border-color 0.25s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.blog-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.blog-card:hover::before { opacity: 1; }
.blog-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.blog-date { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.blog-cat {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 4px; background: var(--lav); color: var(--lav-ink);
}
.blog-cat.cat-collab { background: #eaf7f0; color: #287a52; }
.blog-cat.cat-process { background: #fef4e8; color: #8a5c1e; }
.blog-cat.cat-people { background: #f5eaff; color: #6e3fa3; }
[data-theme="dark"] .blog-cat.cat-collab { background: #1a3328; color: #5fcb96; }
[data-theme="dark"] .blog-cat.cat-process { background: #2e2010; color: #e8a85e; }
[data-theme="dark"] .blog-cat.cat-people { background: #2a1840; color: #c191f0; }
.blog-card h3 { font-family: 'Fraunces', Georgia, serif; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.28; margin-bottom: 10px; }
.blog-card p { font-size: 14px; color: var(--text-muted); line-height: 1.55; flex: 1; margin-bottom: 18px; }
.blog-read-more { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); display: flex; align-items: center; gap: 6px; margin-top: auto; }
.blog-card:hover .blog-read-more { gap: 10px; }

/* ---------- Blog post page ---------- */
.blog-hero { padding: 50px 0 22px; }
.blog-hero .eyebrow { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 16px; }
.blog-hero h1 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(30px, 4.8vw, 50px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; }
.blog-hero .subtitle { margin-top: 18px; font-size: 17px; color: var(--text-muted); max-width: 58ch; }
.blog-meta-row { display: flex; align-items: center; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.blog-meta-row .blog-date { font-size: 12px; }
.blog-meta-row .reading-time { font-family: var(--mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.blog-body { max-width: 720px; margin: 0 auto; }
.blog-body p { font-size: 16.5px; color: var(--text-muted); line-height: 1.75; margin-bottom: 22px; }
.blog-body p strong { color: var(--text); font-weight: 600; }
.blog-body h2 { font-family: 'Fraunces', Georgia, serif; font-size: clamp(22px, 2.8vw, 30px); font-weight: 500; letter-spacing: -0.018em; margin: 48px 0 16px; color: var(--text); }
.blog-body h3 { font-size: 18px; font-weight: 600; margin: 34px 0 12px; color: var(--text); }
.blog-body ul { list-style: none; margin: 0 0 22px; }
.blog-body ul li { position: relative; padding-left: 26px; margin-bottom: 12px; color: var(--text-muted); font-size: 16px; line-height: 1.6; }
.blog-body ul li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.blog-body ul li strong { color: var(--text); }
.blog-tip {
  background: var(--tint); border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 12px; padding: 20px 24px; margin: 28px 0;
  font-size: 15px; color: var(--text-muted); line-height: 1.6;
}
.blog-tip strong { color: var(--accent-ink); }
.blog-divider { border: none; border-top: 1px solid var(--line); margin: 48px 0; }

/* ---------- Stakeholder map ---------- */
.smap-wrap { width: 100%; max-width: 900px; margin: 40px auto; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.smap-wrap svg { display: block; width: 100%; height: auto; }
.smap-hint { display: none; text-align: center; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 6px 0 10px; }

/* ---------- Character sheet cards ---------- */
.char-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 36px 0; }
.char-sheet {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); transition: box-shadow 0.3s ease, transform 0.3s cubic-bezier(.2,.7,.2,1);
}
.char-sheet:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.char-header { padding: 18px 22px; display: flex; align-items: flex-start; gap: 14px; }
.char-avatar {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-family: 'Fraunces', serif; font-size: 18px; color: #fff;
}
.char-avatar.av-content    { background: linear-gradient(135deg, #f6a623, #e07b1a); }
.char-avatar.av-learning   { background: linear-gradient(135deg, #f0a0c8, #c057a0); }
.char-avatar.av-prodops    { background: linear-gradient(135deg, #57b894, #2f8f6e); }
.char-avatar.av-dev        { background: linear-gradient(135deg, #5b76f0, #3a55d0); }
.char-avatar.av-leadership { background: linear-gradient(135deg, #9a7bf0, #6c4fd0); }
.char-name { font-family: 'Fraunces', serif; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.char-role { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-top: 3px; }
.char-type { font-size: 12px; font-style: italic; color: var(--accent); margin-top: 4px; }
.char-body { padding: 0 22px 18px; }
.char-row { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.char-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.char-value { font-size: 13.5px; color: var(--text); line-height: 1.5; }
.char-divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ---------- Highlight pull-quote for blog ---------- */
.blog-pull { border-left: 3px solid var(--accent); padding: 20px 26px; margin: 36px 0; background: var(--tint); border-radius: 0 12px 12px 0; }
.blog-pull p { font-family: 'Fraunces', Georgia, serif; font-size: 20px; font-style: italic; line-height: 1.45; color: var(--text); margin: 0; }

/* ---------- Pill tags for blog benefits ---------- */
.benefit-pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 28px; }
.benefit-pill { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; color: var(--text-muted); background: var(--surface); }
.benefit-pill strong { color: var(--text); font-weight: 600; }

/* =================================================================
   ALL RESPONSIVE BREAKPOINTS — after all base definitions so
   media-query overrides correctly win over base rules
   ================================================================= */

/* ---- 760px — tablets & large phones ---- */
@media (max-width: 760px) {
  body { margin: 6px; }

  /* layout */
  .wrap { padding: 0 18px; }

  /* nav */
  .nav-inner { gap: 20px; padding: 10px 18px; }

  /* home hero */
  header.hero { padding: 30px 0 4px; }
  .hero-handle { margin-bottom: 36px; }

  /* meta row */
  .meta-row { width: auto; margin: 44px 0 0; transform: none; padding: 13px 4px; }

  /* work grid */
  .project { grid-template-columns: 1fr; gap: 16px; }
  .project p { max-width: none; }
  .thumb { min-height: 180px; order: -1; }

  /* approach */
  .approach { grid-template-columns: 1fr; gap: 18px; }
  .method-grid, .cs-meta, .two-col, .stats { grid-template-columns: 1fr; }

  /* bars */
  .bar-row .name { width: 120px; }

  /* case-study */
  .cs-hero { padding: 28px 0 14px; }

  /* section blocks */
  .block { padding: 28px 0; }

  /* quotes */
  .quote { padding: 18px 22px; }
  .quote p { font-size: 17px; }

  /* blog */
  .blog-grid { grid-template-columns: 1fr; }
  .blog-hero { padding: 28px 0 14px; }
  .blog-divider { margin: 30px 0; }
  .blog-body h2 { margin: 30px 0 12px; }
  .blog-pull { padding: 14px 20px; margin: 24px 0; }
  .blog-pull p { font-size: 17px; }
  .blog-tip { padding: 16px 18px; }

  /* character sheets */
  .char-grid { grid-template-columns: 1fr; }

  /* footer */
  .foot-inner { flex-direction: column; align-items: center; text-align: center; }
  .foot-links { justify-content: center; }
}

/* ---- 580px — SVG stakeholder map scroll ---- */
@media (max-width: 580px) {
  .smap-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
  .smap-wrap svg { min-width: 560px; width: 560px; height: auto; }
  .smap-hint { display: block; }
}

/* ---- 480px — small phones (iPhone SE etc.) ---- */
@media (max-width: 480px) {
  /* layout */
  .wrap { padding: 0 14px; }

  /* nav */
  .nav-inner { gap: 14px; padding: 9px 14px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 13px; }

  /* hide "Lights on·off" text — keep just the toggle switch icon */
  .theme-toggle::after { display: none; }

  /* home hero — tighten */
  header.hero { padding: 22px 0 4px; }
  .hero-photo { width: 110px; height: 116px; font-size: 26px; margin-bottom: 18px; }
  .hero-hi { font-size: 17px; margin-bottom: 16px; }
  .meta-row { margin-top: 28px; }

  /* back link — bigger touch target */
  .back { min-height: 40px; padding: 6px 0; }

  /* blog body */
  .blog-body p { font-size: 15.5px; }
  .blog-body ul li { font-size: 15px; }
  .blog-hero h1 { font-size: clamp(26px, 7vw, 40px); }
  .blog-hero .subtitle { font-size: 15px; }
  .blog-meta-row { gap: 10px; margin-top: 18px; }

  /* case-study */
  .cs-hero h1 { font-size: clamp(26px, 7.5vw, 44px); }
  .cs-hero .subtitle { font-size: 15px; }

  /* CTA */
  .cta { padding: 32px 0 44px; }

  /* quotes */
  .quote p { font-size: 16px; }

  /* nav dropdown: right-align to avoid clipping */
  .nav-drop { left: auto; right: -14px; transform: translateY(-8px); min-width: 200px; }
  .has-drop:hover .nav-drop,
  .has-drop:focus-within .nav-drop { transform: translateY(0); }

  /* benefit pills */
  .benefit-pill { padding: 8px 12px; font-size: 13px; }

  /* character sheets */
  .char-header { padding: 14px 16px; gap: 10px; }
  .char-body { padding: 0 16px 14px; }
  .char-avatar { width: 38px; height: 38px; font-size: 16px; }
}

/* ============================================================
   PASSWORD GATE
   ============================================================ */
#gate {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s ease;
}
#gate.gate-out { opacity: 0; pointer-events: none; }

.gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.gate-logo {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  display: grid; place-items: center;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}

.gate-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 10px;
}

.gate-sub {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 28px;
}

.gate-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gate-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.gate-input:focus { border-color: var(--accent); }

.gate-btn {
  width: 100%;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.gate-btn:hover { background: var(--accent-ink); }
.gate-btn:active { transform: scale(0.98); }

.gate-err {
  font-size: 13px;
  color: #e05f5f;
  min-height: 18px;
  margin: 6px 0 0;
}

.gate-back {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 20px;
  transition: color 0.15s;
}
.gate-back:hover { color: var(--text); }

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}
.gate-shake { animation: gate-shake 0.45s ease; }

@media (max-width: 480px) {
  .gate-card { padding: 36px 24px 28px; }
}
