/* Portfolio — control-plane aesthetic. System fonts only; no external assets. */
:root {
  --bg: #0a0c0f;
  --panel: #11151a;
  --panel-2: #161b21;
  --line: #232b35;
  --line-strong: #33404d;
  --text: #e7eaef;
  --body: var(--body);
  --muted: #8d98a7;
  --placeholder: #4d5866;
  --accent: #7be0b3;
  --accent-rgb: 123 224 179;
  --accent-ink: #062a1b;
  --warn: #f2b45a;
  --warn-rgb: 242 180 90;
  --danger: #ff9aa6;
  --danger-line: #ff7a8a;
  --topbar: rgb(10 12 15 / 0.82);
  --shadow: rgb(0 0 0 / 0.6);
  --net-line: 96 112 130;
  --net-node: 200 210 222;
  --radius: 10px;
  --mag: 1;          /* text size from the magnifier bubble (assets/magnifier.js); every font size is multiplied by it */
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

/* Light theme: follows the visitor's system setting unless they pick one with
   the switch (html[data-theme] wins over the system setting). */
:root[data-theme="light"] {
  --bg: #f5f7f9;
  --panel: #ffffff;
  --panel-2: #eef2f5;
  --line: #dbe1e8;
  --line-strong: #b9c3ce;
  --text: #0f151c;
  --body: #2e3a47;
  --muted: #5a6676;
  --placeholder: #9aa5b2;
  --accent: #0b7a53;
  --accent-rgb: 11 122 83;
  --accent-ink: #ffffff;
  --warn: #9a5a00;
  --warn-rgb: 178 106 0;
  --danger: #b3263a;
  --danger-line: #c9364b;
  --topbar: rgb(245 247 249 / 0.85);
  --shadow: rgb(20 35 50 / 0.18);
  --net-line: 150 165 182;
  --net-node: 120 135 152;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f7f9;
    --panel: #ffffff;
    --panel-2: #eef2f5;
    --line: #dbe1e8;
    --line-strong: #b9c3ce;
    --text: #0f151c;
    --body: #2e3a47;
    --muted: #5a6676;
    --placeholder: #9aa5b2;
    --accent: #0b7a53;
    --accent-rgb: 11 122 83;
    --accent-ink: #ffffff;
    --warn: #9a5a00;
    --warn-rgb: 178 106 0;
    --danger: #b3263a;
    --danger-line: #c9364b;
    --topbar: rgb(245 247 249 / 0.85);
    --shadow: rgb(20 35 50 / 0.18);
    --net-line: 150 165 182;
    --net-node: 120 135 152;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
html { background: var(--bg); }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 85% -10%, rgb(var(--accent-rgb) / 0.07), transparent 60%) no-repeat, var(--bg);
  color: var(--text);
  font: calc(16px * var(--mag))/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
ul { padding-left: calc(1.1rem * var(--mag)); }   /* the bullets grow with the text, so their indent does too */

.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 12px; z-index: 10; }

/* Top bar ------------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--topbar);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand__mark {
  font: 600 calc(12px * var(--mag))/1 var(--mono); letter-spacing: 0.08em;
  border: 1px solid var(--accent); color: var(--accent);
  padding: 6px 7px; border-radius: 6px;
}
nav { display: flex; align-items: center; gap: 22px; font-size: calc(14px * var(--mag)); }
nav a { color: var(--muted); }
nav a:hover { color: var(--text); text-decoration: none; }
.nav__cta {
  color: var(--accent-ink) !important; background: var(--accent);
  padding: 7px 14px; border-radius: 999px; font-weight: 600; border: 0;
  font: 600 calc(14px * var(--mag)) var(--sans); cursor: pointer;
}

/* Hero --------------------------------------------------------------------- */
.hero { padding: 96px 0 56px; }
/* Location and availability: one line when they fit. When they don't, the
   availability moves to its own line as a whole, its bullet under the location's
   dot, and any further wrapping stays in the text column (a hanging indent). */
.eyebrow { font: calc(13px * var(--mag))/1.4 var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; margin: 0 0 22px; }
.eyebrow__item { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.eyebrow__item > .status-dot, .eyebrow__bullet { flex: none; margin-top: calc((1.4em - 8px) / 2); }   /* centered on the first line */
.eyebrow__bullet { width: 8px; height: 8px; display: grid; place-items: center; }
.eyebrow__bullet::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.15); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgb(var(--accent-rgb) / 0); } }
.hero h1 { font-size: calc(clamp(40px, 7vw, 76px) * var(--mag)); letter-spacing: -0.03em; font-weight: 700; }
.hero__headline { font: 500 calc(clamp(17px, 2.2vw, 21px) * var(--mag))/1.4 var(--mono); color: var(--accent); margin: 14px 0 0; }
.hero__tagline { font-size: calc(clamp(19px, 2.4vw, 24px) * var(--mag)); color: var(--text); max-width: 760px; margin: 22px 0 0; opacity: 0.92; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 32px; }
.btn {
  display: inline-block; padding: 11px 18px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--text); background: var(--panel); font-weight: 600; font-size: calc(15px * var(--mag));
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.link-out { font: calc(14px * var(--mag)) var(--mono); margin-left: 6px; }
.link-out::after { content: " ↗"; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 56px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metric { background: var(--panel); padding: 22px 22px 20px; }
.metric dt { font: 700 calc(32px * var(--mag))/1 var(--mono); color: var(--text); letter-spacing: -0.02em; }
.metric dd { margin: 10px 0 0; color: var(--muted); font-size: calc(14px * var(--mag)); line-height: 1.4; }

/* Sections ----------------------------------------------------------------- */
section { padding: 56px 0; }
.section-title { font-size: calc(28px * var(--mag)); letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.section-title span { font: 500 calc(13px * var(--mag)) var(--mono); color: var(--accent); }
.section-lead { color: var(--muted); max-width: 720px; margin: 0 0 28px; }

/* How I work */
.loop__steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: step; }
.loop__steps li {
  counter-increment: step; position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 44px 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.loop__steps li::before { content: counter(step, upper-alpha);   /* letters: the section itself is numbered */ position: absolute; top: 16px; left: 18px; font: calc(12px * var(--mag)) var(--mono); color: var(--accent); }
.loop__steps li:not(:last-child)::after { content: "→"; position: absolute; right: -12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-family: var(--mono); z-index: 1; }
.loop__steps strong { font-size: calc(16px * var(--mag)); }
.loop__steps span { color: var(--muted); font-size: calc(14px * var(--mag)); line-height: 1.5; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { font: calc(13px * var(--mag)) var(--mono); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.project {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; gap: 12px; transition: border-color .15s ease, transform .15s ease;
}
.project:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.project[hidden] { display: none; }
.project__head { display: flex; justify-content: space-between; font: calc(12px * var(--mag)) var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.project__cat { color: var(--accent); }
.project h3 { font-size: calc(21px * var(--mag)); }
.project__body { margin: 0; display: grid; grid-template-columns: 64px 1fr; gap: 8px 14px; font-size: calc(14.5px * var(--mag)); }
.project__body dt { font: calc(12px * var(--mag))/1.9 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.project__body dd { margin: 0; color: var(--body); }
.tags { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font: calc(12px * var(--mag)) var(--mono); color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px; }

/* Capabilities */
.caps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.caps > .cap:last-child:nth-child(3n+1) { grid-column: 1 / -1; }   /* a lone last card spans the row */
.cap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.cap__idx { font: calc(12px * var(--mag)) var(--mono); color: var(--accent); }
.cap h3 { font-size: calc(18px * var(--mag)); }
.cap p { margin: 0; color: var(--muted); font-size: calc(14.5px * var(--mag)); }

/* Case studies */
.cases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.case { border-left: 2px solid var(--accent); background: linear-gradient(90deg, rgb(var(--accent-rgb) / 0.05), transparent 70%); padding: 18px 22px; border-radius: 0 var(--radius) var(--radius) 0; }
.case__meta { font: calc(12px * var(--mag)) var(--mono); color: var(--muted); margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.case h3 { font-size: calc(19px * var(--mag)); margin-bottom: 8px; }
.case p { color: var(--body); font-size: calc(14.5px * var(--mag)); margin: 0 0 10px; }
.case__results { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.case__results li { font: calc(13px * var(--mag))/1.5 var(--mono); color: var(--text); }
.case__results li::before { content: "✓ "; color: var(--accent); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 8px 0 0; border-left: 1px solid var(--line); }
.role { display: grid; grid-template-columns: 190px 1fr; gap: 24px; padding: 0 0 30px 24px; position: relative; }
.role::before { content: ""; position: absolute; left: -5px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.role__dates { font: calc(13px * var(--mag))/1.9 var(--mono); color: var(--muted); margin: 0; }
.role h3 { font-size: calc(18px * var(--mag)); }
.role__org { color: var(--muted); margin: 2px 0 6px; font-size: calc(14px * var(--mag)); }
.role ul { margin: 0; color: var(--body); font-size: calc(14.5px * var(--mag)); }
.edu { margin-top: 12px; padding-left: 24px; color: var(--muted); font-size: calc(14.5px * var(--mag)); }
.edu p { margin: 4px 0; }
.edu strong { color: var(--text); }

.notice { color: var(--warn); font-family: var(--mono); font-size: calc(14px * var(--mag)); }

.footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px 0 40px; font-size: calc(13px * var(--mag)); color: var(--muted); }
.footer__stack { font-family: var(--mono); }

/* Fade in once content arrives */
main section { transition: opacity .4s ease; }
body[data-page="home"]:not(.is-loaded) main section:not(.hero):not(.loop) { opacity: 0; }

/* Resume page -------------------------------------------------------------- */
.resume { max-width: 820px; padding: 56px 0 80px; }
.resume section { padding: 18px 0; border-top: 1px solid var(--line); opacity: 1; }
.resume h2 { font: 600 calc(12px * var(--mag)) var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.resume__head h1 { font-size: calc(40px * var(--mag)); letter-spacing: -0.02em; }
.resume__title { font: 500 calc(16px * var(--mag)) var(--mono); color: var(--accent); margin: 8px 0 4px; }
.resume__meta { color: var(--muted); margin: 0 0 18px; }
.resume p, .resume li { color: var(--body); font-size: calc(15px * var(--mag)); }
.resume__caps, .resume__list { margin: 0; display: grid; gap: 4px; }
.resume__role { margin-bottom: 14px; }
.resume__role-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.resume__role-head h3 { font-size: calc(16px * var(--mag)); }
.resume__role-head span { font: calc(13px * var(--mag)) var(--mono); color: var(--muted); white-space: nowrap; }
.resume__loc { margin: 0 0 4px; color: var(--muted) !important; font-size: calc(13.5px * var(--mag)) !important; }
.resume__role ul { margin: 0; }

/* Opening intro ------------------------------------------------------------ */
.intro-overlay { display: none; }
html.intro body { overflow: hidden; }
html.intro .intro-overlay {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: fixed; inset: 0; z-index: 100; cursor: pointer;
  background: radial-gradient(900px 520px at 50% 45%, rgb(var(--accent-rgb) / 0.08), transparent 70%), var(--bg);
  transition: opacity .9s ease;
}
.intro-overlay.is-leaving { opacity: 0; pointer-events: none; }
.intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-copy {
  position: relative; text-align: center; padding: 0 24px; margin-top: -14vh;
  animation: introOut .7s ease 3.05s forwards;
}
.intro-eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font: calc(13px * var(--mag)) var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  animation: introIn .8s ease .15s both;
}
.intro-title {
  margin: 0; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05;
  font-size: calc(clamp(36px, 6.4vw, 72px) * var(--mag)); color: var(--text);
  text-shadow: 0 0 40px var(--bg);
  animation: introIn 1s cubic-bezier(.2, .7, .2, 1) .4s both;
}
.intro-sub {
  margin: 16px 0 0; color: var(--muted); font-size: calc(clamp(16px, 2vw, 20px) * var(--mag));
  animation: introIn .9s ease .95s both;
}
.intro-skip {
  position: absolute; bottom: 28px; margin: 0; font: calc(12px * var(--mag)) var(--mono); color: var(--muted); opacity: .6;
  animation: introIn .6s ease 1.4s both;
}
@keyframes introIn { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes introOut { to { opacity: 0; transform: translateY(-18px); filter: blur(4px); } }

/* The site rises into place as the intro dissolves */
html.intro-done .topbar { animation: siteIn .8s ease both; }
html.intro-done .hero > * { animation: siteIn .9s cubic-bezier(.2, .7, .2, 1) both; }
html.intro-done .hero > :nth-child(2) { animation-delay: .08s; }
html.intro-done .hero > :nth-child(3) { animation-delay: .16s; }
html.intro-done .hero > :nth-child(4) { animation-delay: .24s; }
html.intro-done .hero > :nth-child(5) { animation-delay: .32s; }
html.intro-done .hero > :nth-child(6) { animation-delay: .42s; }
@keyframes siteIn { from { opacity: 0; transform: translateY(22px) scale(.99); } to { opacity: 1; transform: none; } }

/* Contact ------------------------------------------------------------------ */
.btn--ghost { background: transparent; }
.contact { display: grid; grid-template-columns: 1fr 1.05fr; gap: 40px; align-items: start; }
.contact .section-lead { margin-bottom: 22px; }
.contact__steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: cstep; }
.contact__steps li { counter-increment: cstep; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: baseline; }
.contact__steps li::before {
  content: counter(cstep, upper-alpha); grid-row: span 2; font: calc(12px * var(--mag)) var(--mono); color: var(--accent);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 0; text-align: center;
}
.contact__steps strong { font-size: calc(15px * var(--mag)); }
.contact__steps span { color: var(--muted); font-size: calc(14px * var(--mag)); }
.contact__steps em, .contact__done em { font-style: normal; color: var(--accent); font-family: var(--mono); font-size: .92em; }

.contact__panel {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px;
  box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / 0.04), 0 30px 60px -30px var(--shadow);
}
.contact__panel::before {
  content: ""; position: absolute; inset: -1px; border-radius: 14px; pointer-events: none;
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.35), transparent 35%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; border: 1px solid transparent;
}
.contact__form { display: grid; gap: 18px; }
.contact__form[hidden], .contact__done[hidden] { display: none; }
.field { display: grid; gap: 7px; }
.field label { font: calc(12px * var(--mag)) var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field input {
  width: 100%; font: max(16px, calc(16px * var(--mag))) var(--sans); color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--placeholder); }
.field input:hover { border-color: var(--line-strong); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.15); }
.field input[aria-invalid="true"] { border-color: var(--danger-line); }
.field__error { margin: 0; font-size: calc(13px * var(--mag)); color: var(--danger); }
.field--trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact__submit { justify-self: start; border: 0; cursor: pointer; font: 600 calc(15px * var(--mag)) var(--sans); display: inline-flex; align-items: center; gap: 10px; }
.contact__submit:disabled { opacity: .75; cursor: progress; }
.contact__submit.is-busy::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgb(var(--accent-rgb) / 0.35); border-color: color-mix(in srgb, var(--accent-ink) 30%, transparent); border-top-color: var(--accent-ink); animation: spin .8s linear infinite;
}
.contact__status { margin: 0; min-height: 1.2em; font-size: calc(14px * var(--mag)); }
.contact__status.is-error { color: var(--danger); }
.contact__fine { margin: 0; font-size: calc(12.5px * var(--mag)); color: var(--muted); }
.contact__done { display: grid; gap: 12px; justify-items: start; outline: none; }
.contact__done h3 { font-size: calc(22px * var(--mag)); }
.contact__done p { margin: 0; color: var(--body); }
.contact__done strong { color: var(--text); word-break: break-all; }
.contact__check {
  width: 44px; height: 44px; border-radius: 50%; position: relative;
  background: rgb(var(--accent-rgb) / 0.12); border: 1px solid rgb(var(--accent-rgb) / 0.45);
  animation: pop .5s cubic-bezier(.2, .9, .3, 1.4) both;
}
.contact__check::after {
  content: ""; position: absolute; left: 15px; top: 10px; width: 9px; height: 17px;
  border: solid var(--accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* Email confirmation page --------------------------------------------------- */
.verify-page .verify { min-height: calc(100vh - 61px); display: grid; place-items: center; padding: 48px 0; }
.verify__card {
  width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 36px 34px;
  box-shadow: 0 30px 80px -40px var(--shadow);
}
.verify__label { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; font: calc(12px * var(--mag)) var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.verify__state { display: grid; gap: 14px; justify-items: start; }
.verify__state[hidden] { display: none; }
.verify__state h1 { font-size: calc(clamp(26px, 4vw, 32px) * var(--mag)); letter-spacing: -0.02em; outline: none; }
.verify__state p { margin: 0; color: var(--body); }
.verify__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.verify__actions .btn { border: 1px solid var(--line); cursor: pointer; font: 600 calc(15px * var(--mag)) var(--sans); }
.verify__actions .btn--primary { border-color: var(--accent); }
.verify__spinner { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
.verify__mark { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 700 calc(20px * var(--mag)) var(--mono); }
.verify__mark--warn { color: var(--warn); background: rgb(var(--warn-rgb) / 0.1); border: 1px solid rgb(var(--warn-rgb) / 0.45); }

/* Privacy policy ------------------------------------------------------------ */
.policy { max-width: 820px; padding: 64px 0 80px; }
.policy section { padding: 22px 0; border-top: 1px solid var(--line); }
.policy__head { padding-bottom: 28px; }
.policy__label { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font: calc(12px * var(--mag)) var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.policy h1 { font-size: calc(clamp(32px, 5vw, 46px) * var(--mag)); letter-spacing: -0.02em; }
.policy__lead { font-size: calc(18px * var(--mag)); color: var(--text); opacity: .92; margin: 16px 0 10px; max-width: 680px; }
.policy__meta { font: calc(13px * var(--mag)) var(--mono); color: var(--muted); margin: 0; }
.policy h2 { font-size: calc(20px * var(--mag)); margin-bottom: 10px; }
.policy p, .policy li { color: var(--body); font-size: calc(15.5px * var(--mag)); }
.policy ul { display: grid; gap: 8px; }
.policy strong { color: var(--text); }
.policy__table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: calc(14.5px * var(--mag)); }
.policy__table th { text-align: left; font: calc(12px * var(--mag)) var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.policy__table td { vertical-align: top; padding: 12px; border-bottom: 1px solid var(--line); color: var(--body); background: var(--panel); }
.policy__table td:first-child { color: var(--text); width: 34%; }
.policy__back { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 18px; }
.footer a, .contact__fine a, .verify__fine a { color: var(--accent); }
.verify__fine { margin: 26px 0 0; font-size: calc(13px * var(--mag)); color: var(--muted); }
@media (max-width: 600px) {
  .policy__table thead { display: none; }
  .policy__table, .policy__table tbody, .policy__table tr, .policy__table td { display: block; width: 100%; }
  .policy__table tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
  .policy__table td { border-bottom: 0; }
  .policy__table td:first-child { width: 100%; }
}

/* Responsive --------------------------------------------------------------- */
@media (max-width: 900px) {
  .contact { grid-template-columns: 1fr; gap: 28px; }
  .metrics, .loop__steps { grid-template-columns: repeat(2, 1fr); }
  .loop__steps li::after { display: none; }
  .projects, .cases { grid-template-columns: 1fr; }
  .caps { grid-template-columns: 1fr 1fr; }
  nav a:not(.nav__cta) { display: none; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .contact__panel, .verify__card { padding: 22px 18px; }
  .hero { padding-top: 64px; }
  .caps, .metrics, .loop__steps { grid-template-columns: 1fr; }
  .role { grid-template-columns: 1fr; gap: 2px; }
  .brand__name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Print: the resume page becomes a clean one-color document */
@media print {
  :root, :root[data-theme] { --mag: 1 !important; --text: #111; --body: #111; --muted: #555; --accent: #111; --line: #ccc; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .no-print, .topbar, .footer { display: none !important; }
  .resume { padding: 0; max-width: none; }
  .resume p, .resume li { color: #111; font-size: 10.5pt; }
  .resume section { break-inside: avoid-page; }
  a { color: #111; }
  .link-out::after { content: " (" attr(href) ")"; }
}

/* Light/dark switch ---------------------------------------------------------- */
.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
@media print { .theme-toggle { display: none; } }

/* Privacy page: "Email me my details" */
.policy__request { margin: 22px 0 6px; max-width: 560px; }
.policy__request .contact__fine { font-size: calc(12.5px * var(--mag)); color: var(--muted); }
.policy em { font-style: normal; color: var(--accent); }

.policy__aside { font-size: calc(14px * var(--mag)) !important; color: var(--muted) !important; }

/* Phones -------------------------------------------------------------------
   Everything here applies at 600px and below only; larger screens are unchanged. */
@media (max-width: 600px) {
  /* Less dead space between sections */
  section { padding: 40px 0; }
  .hero { padding: 44px 0 32px; }
  .section-lead { margin-bottom: 22px; }

  /* A little more line spacing for the location and availability lines */
  .eyebrow { line-height: 1.6; margin-bottom: 16px; }
  .eyebrow__item > .status-dot, .eyebrow__bullet { margin-top: calc((1.6em - 8px) / 2); }

  /* Hero buttons: an even 2 x 2 grid instead of ragged rows */
  .hero__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; }
  .hero__actions .btn { display: flex; align-items: center; justify-content: center; text-align: center; padding-inline: 10px; }
  .hero__actions #links { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }

  /* Highlights */
  .metrics { margin-top: 32px; }
  .metric { padding: 18px 18px 16px; }
  .metric dt { font-size: calc(28px * var(--mag)); }

  /* Section titles: the number sits above the title, not beside its last line */
  .section-title { display: block; font-size: calc(25px * var(--mag)); line-height: 1.2; }
  .section-title span { display: block; margin-bottom: 6px; }

  /* Cards: a little less padding, and project text uses the full width
     (labels above their text instead of in a narrow side column) */
  .loop__steps li { padding: 40px 16px 18px; }
  .project { padding: 20px 18px; gap: 10px; }
  .project h3 { font-size: calc(19px * var(--mag)); }
  .project__body { grid-template-columns: 1fr; gap: 2px; }
  .project__body dt { line-height: 1.5; }
  .project__body dd { margin-bottom: 10px; }
  .project__body dd:last-of-type { margin-bottom: 4px; }
  .cap { padding: 18px; }
  .case { padding: 16px; }
  .case h3 { font-size: calc(18px * var(--mag)); }
  .case__results li { font-size: calc(12.5px * var(--mag)); }

  /* Timeline: entries and the education lines share one left edge */
  .role { padding: 0 0 26px 20px; }
  .edu { padding-left: 20px; }

  /* Contact and privacy forms: full-width button, and no empty gap before the
     fine print while there's no status message to show */
  .contact__panel { border-radius: 12px; }
  .contact__submit { justify-self: stretch; justify-content: center; padding-block: 13px; }
  .contact__status:empty { margin-top: -18px; }

  /* Confirmation and deletion pages: the two buttons share the width evenly */
  .verify__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .verify__actions .btn { display: flex; align-items: center; justify-content: center; text-align: center; padding-inline: 10px; }
  .policy__back { display: grid; grid-template-columns: 1fr; }
  .policy__back .btn { text-align: center; }

  /* Privacy table as cards: label each part (the column headings are hidden) */
  .policy__table td { padding: 10px 14px; }
  .policy__table td + td { padding-top: 2px; }
  .policy__table td::before {
    display: block; margin-bottom: 3px;
    font: calc(11px * var(--mag)) var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  }
  .policy__table td:nth-child(1)::before { content: "What"; }
  .policy__table td:nth-child(2)::before { content: "Why"; }
  .policy__table td:nth-child(3)::before { content: "How long"; }

  /* Resume: dates under each job title so the title keeps the full width */
  .resume { padding: 32px 0 56px; }
  .resume__head h1 { font-size: calc(34px * var(--mag)); }
  .resume__title { font-size: calc(14.5px * var(--mag)); }
  .resume__role-head { display: block; }
  .resume__role-head span { display: block; margin-top: 2px; white-space: normal; }
}

/* Text-size magnifier (assets/magnifier.js) ----------------------------------
   A bubble that scales every font size on the site through --mag. The bubble,
   its menu and its hints keep fixed sizes so the controls never move under you. */

/* Bigger text: long words may break instead of pushing cards off screen, and
   tight grids give their columns more room as the size goes up. */
html.mag-on main, html.mag-on .footer { overflow-wrap: anywhere; }
html[data-mag="lg"] .project__body, html[data-mag="xl"] .project__body { grid-template-columns: 1fr; gap: 2px; }
html[data-mag="lg"] .project__body dd, html[data-mag="xl"] .project__body dd { margin-bottom: 10px; }
html[data-mag="lg"] .role, html[data-mag="xl"] .role { grid-template-columns: 1fr; gap: 2px; }
html[data-mag="lg"] .projects, html[data-mag="lg"] .cases,
html[data-mag="xl"] .projects, html[data-mag="xl"] .cases,
html[data-mag="lg"] .contact, html[data-mag="xl"] .contact { grid-template-columns: 1fr; }
html[data-mag="lg"] .metrics, html[data-mag="lg"] .loop__steps, html[data-mag="lg"] .caps { grid-template-columns: repeat(2, 1fr); }
html[data-mag="lg"] .loop__steps li::after, html[data-mag="xl"] .loop__steps li::after { display: none; }
html[data-mag="xl"] .metrics, html[data-mag="xl"] .loop__steps, html[data-mag="xl"] .caps { grid-template-columns: 1fr; }
html[data-mag="lg"] .resume__role-head, html[data-mag="xl"] .resume__role-head { display: block; }
html[data-mag] .verify__actions { display: grid; grid-template-columns: 1fr; }
html[data-mag="lg"] .resume__role-head span, html[data-mag="xl"] .resume__role-head span { display: block; white-space: normal; }
/* The top bar drops its section links when bigger text no longer fits beside them */
html.mag-on .topbar nav a, html.mag-on .brand__name { white-space: nowrap; }
html.mag-compact nav a:not(.nav__cta) { display: none; }
html.mag-tight .brand__name { display: none; }
html.mag-bare nav .nav__cta { display: none; }
html.mag-bare nav { gap: 12px; }

/* "Aa" button beside the light/dark switch: opens the bubble's menu, and
   brings the bubble back after it has been hidden. */
.mag-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
  font: 600 13px/1 var(--mono); letter-spacing: -0.02em; transition: color .15s, border-color .15s;
}
.mag-toggle:hover, .mag-toggle[aria-expanded="true"] { color: var(--text); border-color: var(--line-strong); }
.mag-toggle.is-nudged { animation: magNudge 1.1s ease 2; color: var(--accent); border-color: var(--accent); }
@keyframes magNudge { 50% { box-shadow: 0 0 0 7px rgb(var(--accent-rgb) / 0.18); } }

/* The bubble */
.mag-bubble {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.15), 0 12px 28px -10px var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, opacity .5s ease;
}
/* Fades back when it isn't being used; comes back on hover, focus, a nearby
   pointer or a tap. */
.mag-bubble.is-idle { opacity: .28; box-shadow: none; }
.mag-bubble.is-idle .mag-bubble__label { opacity: 0; }
.mag-bubble.is-idle:focus-visible { opacity: 1; }
@media (hover: hover) { .mag-bubble.is-idle:hover { opacity: 1; } }   /* phones keep :hover after a tap */
.mag-bubble__label { transition: opacity .5s ease; }
.mag-bubble[hidden] { display: none; }
@media (hover: hover) { .mag-bubble:hover { box-shadow: 0 0 0 6px rgb(var(--accent-rgb) / 0.2), 0 12px 28px -10px var(--shadow); } }
.mag-bubble:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 50%; }
.mag-bubble.is-dragging { cursor: grabbing; transform: scale(1.06); box-shadow: 0 0 0 8px rgb(var(--accent-rgb) / 0.18), 0 18px 36px -12px var(--shadow); }
.mag-bubble svg { width: 24px; height: 24px; pointer-events: none; }
.mag-bubble__label {
  position: absolute; right: -6px; bottom: -6px; pointer-events: none;
  font: 700 10px/1 var(--mono); padding: 3px 5px; border-radius: 6px;
  background: var(--panel); color: var(--accent); border: 1px solid var(--line);
}
html.intro .mag-bubble, html.intro .mag-hint { visibility: hidden; }

/* Shared panel look for the menu and the first-visit hint */
.mag-menu, .mag-hint {
  position: fixed; z-index: 61; font: 14px/1.5 var(--sans); color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 0 0 1px rgb(var(--accent-rgb) / 0.04), 0 30px 60px -24px var(--shadow);
}
.mag-label { display: flex; align-items: center; gap: 8px; margin: 0; font: 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.mag-label .status-dot { width: 6px; height: 6px; }
.mag-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: transparent;
  color: var(--text); font: 600 13px/1.2 var(--sans); cursor: pointer;
}
.mag-btn:hover { border-color: var(--accent); }
.mag-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mag-btn--quiet { border-color: transparent; color: var(--muted); padding-inline: 6px; }
.mag-btn--quiet:hover { color: var(--text); border-color: transparent; text-decoration: underline; }

/* The menu */
.mag-menu { width: 260px; padding: 16px; display: grid; gap: 12px; opacity: 0; transform: translateY(6px) scale(.97); pointer-events: none; visibility: hidden; transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s; }
.mag-menu.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .15s ease, transform .15s ease; }
.mag-menu__head { display: flex; align-items: center; justify-content: space-between; }
.mag-close {
  width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font: 14px/1 var(--sans); cursor: pointer;
}
.mag-close:hover { color: var(--text); border-color: var(--line-strong); }
.mag-menu { touch-action: manipulation; }   /* no double-tap zoom inside the menu */
.mag-wheel { position: relative; height: 200px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.mag-wheel:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.15); }
.mag-wheel::before, .mag-wheel::after { content: ""; position: absolute; left: 0; right: 0; height: 72px; z-index: 2; pointer-events: none; }
.mag-wheel::before { top: 0; background: linear-gradient(var(--bg) 15%, transparent); }
.mag-wheel::after { bottom: 0; background: linear-gradient(transparent, var(--bg) 85%); }
.mag-wheel__line {
  position: absolute; top: 80px; height: 40px; left: 6px; right: 6px; z-index: 1; pointer-events: none;
  border-top: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent); border-radius: 6px;
  background: rgb(var(--accent-rgb) / 0.08);
}
.mag-wheel__scroll { height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; outline: none; padding: 80px 0; overscroll-behavior: contain; touch-action: pan-y; }
.mag-wheel__scroll::-webkit-scrollbar { display: none; }
.mag-wheel__item {
  height: 40px; display: flex; align-items: center; justify-content: center; scroll-snap-align: center;
  font: 500 14px/1 var(--mono); color: var(--muted); opacity: .6; cursor: ns-resize;
  transition: color .1s, font-size .1s, opacity .1s;
}
.mag-wheel__item.is-active { color: var(--text); font-size: 17px; font-weight: 700; opacity: 1; }
.mag-readout { margin: 0; text-align: center; font: 12px/1.4 var(--mono); color: var(--muted); }
.mag-readout strong { color: var(--accent); font-size: 14px; }
.mag-tips { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.mag-tips b { color: var(--text); font-weight: 600; }
.mag-menu__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }

/* First-visit hint, pointing at the bubble */
.mag-hint { width: 270px; padding: 16px 16px 14px; display: grid; gap: 8px; border-color: rgb(var(--accent-rgb) / 0.45); animation: magHintIn .35s cubic-bezier(.2, .7, .2, 1) both; }
.mag-hint[hidden] { display: none; }
.mag-hint h2 { font-size: 16px; line-height: 1.3; margin: 2px 0 0; }
.mag-hint p { margin: 0; color: var(--body); font-size: 13.5px; }
.mag-hint ol { margin: 0; padding-left: 18px; color: var(--body); font-size: 13.5px; display: grid; gap: 3px; }
.mag-hint ol b { color: var(--text); }
.mag-hint__actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.mag-hint::after {   /* the pointer: JS sets which side via data-side */
  content: ""; position: absolute; width: 12px; height: 12px; background: var(--panel);
  border: solid rgb(var(--accent-rgb) / 0.45); border-width: 0 1px 1px 0;
}
.mag-hint[data-side="above"]::after { bottom: -7px; right: var(--arrow, 22px); transform: rotate(45deg); }
.mag-hint[data-side="below"]::after { top: -7px; right: var(--arrow, 22px); transform: rotate(225deg); }
@keyframes magHintIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Short confirmation, e.g. after hiding the bubble */
.mag-toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 62; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font: 13.5px/1.45 var(--sans);
  box-shadow: 0 20px 40px -20px var(--shadow); transition: opacity .2s ease, transform .2s ease;
}
.mag-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.mag-toast b { color: var(--accent); font-family: var(--mono); }

@media (max-width: 600px) {
  .mag-bubble { right: 14px; bottom: 14px; width: 50px; height: 50px; }
}
@media print { .mag-bubble, .mag-menu, .mag-hint, .mag-toast, .mag-toggle { display: none !important; } }

/* Accessibility page and the bubble's "learn more" links */
.mag-more { justify-self: center; font: 12.5px/1.4 var(--sans); color: var(--accent); }
.mag-hint a { color: var(--accent); }
.a11y-steps { display: grid; gap: 10px; padding-left: calc(1.4rem * var(--mag)); }
.a11y-steps li::marker { color: var(--accent); font-family: var(--mono); }
.a11y-keys { list-style: none; padding: 0; display: grid; gap: 8px; }
.a11y-keys li { display: grid; grid-template-columns: minmax(150px, max-content) 1fr; gap: 6px 16px; align-items: baseline; }
.policy kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; text-align: center;
  font: 600 calc(12px * var(--mag))/1.5 var(--mono); color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
}
@media (max-width: 600px) { .a11y-keys li { display: flex; flex-wrap: wrap; gap: 4px 10px; } }

/* Two-column capabilities: a lone last card spans the row */
@media (max-width: 900px) {
  .caps > .cap:last-child:nth-child(3n+1) { grid-column: auto; }
  .caps > .cap:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 600px) { .caps > .cap:last-child { grid-column: auto; } }
html[data-mag="lg"] .caps > .cap:last-child:nth-child(3n+1) { grid-column: auto; }
html[data-mag="lg"] .caps > .cap:last-child:nth-child(odd) { grid-column: 1 / -1; }
html[data-mag="xl"] .caps > .cap:last-child { grid-column: auto; }
