/* ---------- Tokens: navy & cream ----------
   An ink and a paper colour for light (-l) and dark (-d).
   Everything else (muted text, lines, buttons) is mixed from those two. */
:root {
  --paper-l: #f2ede2; --ink-l: #1c2b4b;
  --paper-d: #0f1626; --ink-d: #ece5d6;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --max: 1080px;
  --gutter: clamp(16px, 5vw, 48px);
}

:root { --paper: var(--paper-l); --ink: var(--ink-l); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: var(--paper-d); --ink: var(--ink-d); }
}
:root[data-theme="dark"] { --paper: var(--paper-d); --ink: var(--ink-d); }

:root {
  --bg: var(--paper);
  --text: var(--ink);
  --muted: color-mix(in srgb, var(--ink) 62%, var(--paper));
  --line: color-mix(in srgb, var(--ink) 14%, var(--paper));
  --surface: color-mix(in srgb, var(--ink) 5%, var(--paper));
  --invert-bg: var(--ink);
  --invert-text: var(--paper);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

a { color: inherit; }

::selection { background: var(--text); color: var(--bg); }

:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

/* Pixel monogram with a block cursor. script.js adds .power-on to play a CRT switch-on */
.mark { display: block; width: 72px; color: var(--text); }
.mark svg { display: block; width: 100%; height: auto; overflow: visible; transform-origin: center; }
.mark .cursor { opacity: .9; animation: blink 1s steps(1) infinite; }

.mark.power-on svg { animation: power-on .9s cubic-bezier(.2, .8, .2, 1) both; }
.mark.power-on .cursor { animation: blink 1s steps(1) .9s infinite; opacity: 0; }

@keyframes power-on {
  0%   { transform: scale(0, .03); filter: brightness(3); }
  35%  { transform: scale(1, .03); filter: brightness(3); }
  60%  { transform: scale(1, 1.08); filter: brightness(1.6); }
  75%  { transform: scale(1, .97); }
  100% { transform: scale(1, 1); filter: none; }
}

@keyframes blink { 0% { opacity: .9; } 50% { opacity: 0; } }

nav { display: flex; gap: 28px; margin-left: auto; }

nav a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
nav a:hover { color: var(--text); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, transform .3s;
}
.theme-toggle:hover { border-color: var(--text); }
:root[data-theme="dark"] .theme-toggle svg { transform: rotate(180deg); }

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(72px, 14vw, 160px);
  padding-bottom: clamp(64px, 10vw, 120px);
}

.meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 28px;
}

.status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--text);
  vertical-align: 1px;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: .25; } }

@media (min-width: 721px) {
  .hero h1 { white-space: nowrap; }
}

h1 {
  /* sized so the full name fits on one line on desktop (it needs ~9.6em of width) */
  font-size: clamp(44px, 8.6vw, 96px);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.045em;
  margin: 0 0 32px;
}

.lede {
  max-width: 34ch;
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 40px;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border: 1px solid var(--text);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.btn:hover { background: var(--text); color: var(--bg); }

.btn-solid { background: var(--invert-bg); color: var(--invert-text); }
.btn-solid:hover { background: transparent; color: var(--text); }

.actions { align-items: center; }
.text-link, .more-link {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.text-link { margin-left: 8px; }
.text-link:hover, .more-link:hover { color: var(--text); }
.more-link { display: inline-block; margin-top: 28px; }

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--line);
}

.section-label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 40px;
}

/* ---------- Experience ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.timeline li:first-child { border-top: 1px solid var(--line); }

.when {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  padding-top: 4px;
}

.timeline h3 { font-size: 19px; font-weight: 500; margin: 0 0 4px; }
.timeline .at { color: var(--muted); font-weight: 400; }
.timeline p { margin: 0; color: var(--muted); max-width: 60ch; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(32px, 6vw, 80px);
}

.about-text p { margin: 0 0 20px; font-size: 19px; max-width: 46ch; }

.skills { margin: 0; display: grid; gap: 20px; }
.skills div { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.skills dt { font-weight: 500; margin-bottom: 4px; }
.skills dd { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Contact ---------- */
.contact-line {
  font-size: clamp(24px, 3.6vw, 40px);
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.25;
  max-width: 24ch;
  margin: 0 0 32px;
}
.contact-line a {
  display: inline-block;
  text-decoration: underline;
  text-underline-offset: 8px;
  text-decoration-thickness: 1px;
  word-break: break-all;
}
.contact-line a:hover { text-decoration-thickness: 2px; }

.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.links a { font-family: var(--mono); font-size: 14px; text-decoration: none; color: var(--muted); }
.links a:hover { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  padding-block: 32px 48px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- CRT texture: scanlines + grain + vignette ---------- */
:root {
  --scan: rgba(0, 0, 0, .045);
  --grain-opacity: .06;
  --vignette: rgba(0, 0, 0, .08);
  --glow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --scan: rgba(0, 0, 0, .25);
    --grain-opacity: .08;
    --vignette: rgba(0, 0, 0, .55);
    --glow: 0 0 18px color-mix(in srgb, var(--ink) 22%, transparent);
  }
}
:root[data-theme="dark"] {
  --scan: rgba(0, 0, 0, .25);
  --grain-opacity: .08;
  --vignette: rgba(0, 0, 0, .55);
  --glow: 0 0 18px color-mix(in srgb, var(--ink) 22%, transparent);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

body::before {
  background:
    repeating-linear-gradient(to bottom, var(--scan) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, var(--vignette) 100%);
}

body::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  inset: -10%; /* room to jitter without exposing edges */
  opacity: var(--grain-opacity);
  animation: grain 1s steps(4) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -3%); }
  75%  { transform: translate(-2%, -1%); }
}

h1, .mark { text-shadow: var(--glow); }
.mark svg { filter: drop-shadow(var(--glow-drop, 0 0 0 transparent)); }
:root[data-theme="dark"] .mark svg { --glow-drop: 0 0 6px color-mix(in srgb, var(--ink) 55%, transparent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark svg { --glow-drop: 0 0 6px color-mix(in srgb, var(--ink) 55%, transparent); }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .status::before, body::after, .mark .cursor { animation: none; }
  .mark .cursor { opacity: .9; }
}

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .about-grid { grid-template-columns: 1fr; }
}


/* ---------- Work page ---------- */
nav a[aria-current="page"] { color: var(--text); }

.hero-sm { padding-top: clamp(56px, 10vw, 112px); padding-bottom: clamp(40px, 6vw, 72px); }
.hero-sm h1 { font-size: clamp(44px, 8vw, 96px); }
.meta a { color: inherit; text-decoration: none; }
.meta a:hover { color: var(--text); }

.company { margin-bottom: 36px; }
.company .kicker { margin-bottom: 12px; }
.company-name {
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 0 0 10px;
}
.company-desc { margin: 0; color: var(--muted); max-width: 56ch; }

/* Slim bar that pins under the site header once a company's heading has scrolled away,
   so it's always clear which company the roles belong to. Zero height so it takes no space. */
.company-bar { position: sticky; top: 65px; height: 0; z-index: 4; }
.company-bar > div {
  position: absolute;
  top: 0;
  left: calc(-1 * var(--gutter));
  right: calc(-1 * var(--gutter));
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.company-bar strong { color: var(--text); font-weight: 400; }
.company-bar.show > div { opacity: 1; transform: none; }

.roles { list-style: none; margin: 0; padding: 0; }
.roles > li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.roles h3 { font-size: 21px; font-weight: 500; letter-spacing: -.01em; margin: 0 0 12px; }
.roles .at { color: var(--muted); font-weight: 400; }
.roles > li > div > h3:only-child { margin: 0; }

.points { list-style: none; margin: 0; padding: 0; max-width: 68ch; }
.points li { position: relative; padding-left: 22px; margin-bottom: 8px; color: var(--muted); }
.points li::before { content: "—"; position: absolute; left: 0; color: var(--line); }

.callout {
  margin-top: 20px;
  padding: 20px 22px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.callout-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.callout .points li { color: var(--text); }

@media (max-width: 720px) {
  .roles > li { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Phosphor trail (hero background) ---------- */
body { overflow-x: clip; }
.hero { position: relative; isolation: isolate; }
.phosphor {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

/* ---------- Hidden terminal ----------
   Always the dark navy palette, whichever theme the page is in. */
.term {
  --t-bg: #0f1626;
  --t-fg: #ece5d6;
  --t-dim: color-mix(in srgb, var(--t-fg) 55%, var(--t-bg));
  width: min(680px, calc(100vw - 32px));
  height: min(480px, calc(100vh - 64px));
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--t-fg) 22%, transparent);
  border-radius: 6px;
  background: var(--t-bg);
  color: var(--t-fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  text-shadow: 0 0 8px color-mix(in srgb, var(--t-fg) 30%, transparent);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.term[open] { display: flex; flex-direction: column; animation: term-on .4s cubic-bezier(.2, .8, .2, 1); }
.term::backdrop { background: rgba(15, 22, 38, .55); backdrop-filter: blur(2px); }
.term::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
}

@keyframes term-on {
  0%   { transform: scale(1, .02); filter: brightness(2.5); }
  50%  { transform: scale(1, 1.03); filter: brightness(1.4); }
  100% { transform: none; filter: none; }
}

.term-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--t-fg) 15%, transparent);
  color: var(--t-dim);
  font-size: 12px;
}
.term-close {
  background: none;
  border: 0;
  padding: 0 4px;
  color: inherit;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.term-close:hover { color: var(--t-fg); }

.term-body { flex: 1; overflow-y: auto; padding: 16px 18px 4px; }
.term-line { white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; }
.term-line.muted, .term-prompt { color: var(--t-dim); }
.term .k { color: var(--t-fg); font-weight: 600; }
.term a { color: inherit; text-underline-offset: 3px; }

.term-form { display: flex; align-items: center; gap: 10px; padding: 8px 18px 18px; }
.term-form input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: inherit;
  font: inherit;
  text-shadow: inherit;
  caret-color: var(--t-fg);
}
.term-form input:focus-visible { outline: none; }

/* Footer hint that opens the terminal */
.site-footer { flex-wrap: wrap; gap: 8px 24px; }
.term-hint {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.term-hint:hover { color: var(--text); }
.term-hint kbd {
  font: inherit;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .term[open] { animation: none; }
}

/* ---------- Work page scroll effects (work.js adds .scroll-fx) ---------- */
.scroll-fx .roles { position: relative; }
.scroll-fx .roles > li { position: relative; padding-left: 32px; }

/* Timeline spine that fills as you scroll, with a glowing beam at its tip */
.spine { position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--line); }
.spine-fill { position: absolute; left: 0; top: 0; width: 1px; height: 0; background: var(--text); }
.spine-fill::after {
  content: "";
  position: absolute;
  left: -3px;
  bottom: -3px;
  width: 7px;
  height: 7px;
  background: var(--text);
  box-shadow: 0 0 12px 2px color-mix(in srgb, var(--text) 45%, transparent);
  transition: opacity .3s;
}
.spine-fill.done::after { opacity: 0; }

/* A square node per role that lights when the beam reaches it */
.scroll-fx .roles > li::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 33px;
  width: 7px;
  height: 7px;
  background: var(--bg);
  border: 1px solid var(--line);
  transition: background-color .25s, border-color .25s;
}
.scroll-fx .roles > li.lit::before { background: var(--text); border-color: var(--text); }

/* Scan-in: content is revealed top to bottom */
.scroll-fx .roles > li > .when,
.scroll-fx .roles > li > div {
  clip-path: inset(0 0 100% 0);
  transition: clip-path .8s cubic-bezier(.3, .7, .2, 1);
}
.scroll-fx .roles > li.in > .when,
.scroll-fx .roles > li.in > div { clip-path: inset(0 0 -20px 0); }

/* Bullets follow the scan, one after another */
.scroll-fx .roles .points li {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .4s ease, transform .4s ease;
  transition-delay: calc(var(--i, 0) * 70ms + 300ms);
}
.scroll-fx .roles > li.in .points li { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .scroll-fx .roles > li { padding-left: 24px; }
}

/* ---------- Work page: summary view with expandable details ---------- */
.summary { margin: 0 0 14px; color: var(--muted); max-width: 62ch; }

.toggle { display: none; }
.js-details .toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
}
.toggle-icon { display: inline-block; transition: transform .3s ease; }
.toggle[aria-expanded="true"] .toggle-icon,
.expand-all.is-open span { transform: rotate(45deg); }
.toggle:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Collapse by animating the grid row from 0 to its content height */
.js-details .details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s cubic-bezier(.3, .7, .2, 1);
}
.js-details .details.open { grid-template-rows: 1fr; }
.details-inner { min-height: 0; overflow: hidden; }
.js-details .details-inner > :first-child { margin-top: 18px; }

/* Bullets cascade in each time details open */
html.js-details .details:not(.open) .points li {
  opacity: 0;
  transform: translateX(-6px);
  transition-delay: 0s;
}
.js-details .details .points li { transition: opacity .35s ease, transform .35s ease; transition-delay: calc(var(--i, 0) * 50ms + 120ms); }

.expand-all { display: inline-flex; gap: 8px; align-items: center; margin: 0; padding: 0; background: none; border: 0; cursor: pointer; }
.expand-all span { display: inline-block; transition: transform .3s ease; }
.expand-all[hidden] { display: none; }

/* ---------- Music ---------- */
.music-intro { font-size: 19px; max-width: 46ch; margin: 0 0 32px; }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.label-card {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(24px, 5vw, 56px);
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  background: var(--surface);
}
.label-card h3 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 0 0 6px;
  text-shadow: var(--glow);
}
.label-tagline { font-family: var(--mono); font-size: 14px; color: var(--muted); margin: 0; }

/* Logo header: the PNG is used as a mask so it takes the ink colour in either theme */
.label-head { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.label-logo {
  flex: none;
  width: 84px;
  aspect-ratio: 1265 / 1252;
  background: var(--text);
  -webkit-mask: url("alws-logo.png") center / contain no-repeat;
  mask: url("alws-logo.png") center / contain no-repeat;
  transition: transform .4s cubic-bezier(.3, 1.4, .5, 1);
}
.label-card:hover .label-logo { transform: rotate(-8deg); }
@media (max-width: 720px) {
  .label-head { gap: 16px; }
  .label-logo { width: 64px; }
}
.label-main > p:not(.kicker):not(.label-tagline) { margin: 0 0 24px; max-width: 54ch; }

.label-stats { margin: 0; display: grid; align-content: center; gap: 0; }
.label-stats div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.label-stats div:first-child { border-top: 1px solid var(--line); }
.label-stats dt { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.label-stats dd { margin: 0; font-size: 32px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.projects { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.project {
  display: block;
  padding: 24px;
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color .2s, background-color .2s;
}
.project:hover { border-color: var(--text); background: var(--surface); }
.project h3 { font-size: 22px; font-weight: 500; letter-spacing: -.01em; margin: 0 0 8px; }
.project h3 span { display: inline-block; font-size: 16px; color: var(--muted); transition: transform .2s; }
.project:hover h3 span { transform: translate(2px, -2px); color: var(--text); }
.project p:last-child { margin: 0; color: var(--muted); font-size: 15px; }

@media (max-width: 720px) {
  .label-card, .projects { grid-template-columns: 1fr; }
}

/* ---------- Company separators ----------
   The "·" comes from CSS so it can be dropped when the company wraps onto its own line. */
.timeline .at::before, .roles .at::before { content: "· "; }

/* ---------- Bigger tap areas ----------
   Padding grows the hit area to ~44px; the matching negative margin keeps the layout unchanged. */
.text-link, .more-link, .links a, .toggle, .expand-all, .term-hint {
  padding-block: 13px;
  margin-block: -13px;
}
.more-link { margin-top: 15px; }
.links a { display: inline-block; }
.js-details .toggle { padding-block: 13px; margin-block: -13px; }
.meta a { display: inline-block; padding-block: 13px; margin-block: -13px; }

/* ---------- Mobile menu ---------- */
.menu-toggle { display: none; }

@media (max-width: 720px) {
  .theme-toggle { margin-left: auto; }
  .mark { padding-block: 10px; margin-block: -10px; }

  .menu-toggle {
    display: grid;
    place-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }
  .theme-toggle { width: 40px; height: 40px; }
  .menu-toggle span {
    display: block;
    width: 14px;
    height: 1.5px;
    background: currentColor;
    transition: transform .25s ease;
  }
  .menu-open .menu-toggle span:first-child { transform: translateY(3.25px) rotate(45deg); }
  .menu-open .menu-toggle span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

  nav { display: none; }

  /* backdrop-filter would make the header the containing block for the fixed menu */
  .menu-open .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .menu-open { overflow: hidden; }

  .menu-open nav {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 16px var(--gutter) 32px;
    background: var(--bg);
    overflow-y: auto;
    animation: menu-in .3s cubic-bezier(.2, .8, .2, 1);
  }
  .menu-open nav a {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -.02em;
    color: var(--text);
  }
  .menu-open nav a[aria-current="page"]::after { content: "●"; margin-left: 10px; font-size: 12px; vertical-align: middle; }

  /* Hero: "Open to new roles" gets its own line instead of wrapping mid-phrase */
  .meta .sep { display: none; }
  .meta .status { display: block; margin-top: 8px; }
  .actions .text-link { margin-left: 0; flex-basis: 100%; }

  /* Company drops under the role title without a dangling separator */
  .timeline .at, .roles .at { display: block; }
  .timeline .at::before, .roles .at::before { content: none; }

  /* AI & automation box: less padding so the text isn't squeezed */
  .callout { padding: 16px 16px 8px; margin-left: -4px; margin-right: -4px; }
  .callout .points li { font-size: 15px; padding-left: 18px; }

  /* Footer stacks neatly */
  .site-footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-footer .term-hint { order: 3; }
}

@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .menu-open nav { animation: none; } }

/* ---------- Experience companion (roamer.js) ---------- */
#experience { position: relative; }
.roamer {
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 42px;
  z-index: 2;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transition: opacity .5s ease;
  will-change: transform;
}
.roamer.ready { opacity: 1; }
.roamer svg { display: block; overflow: visible; opacity: .92; }
/* gentle hover; facing is flipped on the svg, so the bob lives on its wrapper */
.roamer-body { animation: ghost-bob 1.6s ease-in-out infinite; }
.roamer.boo .roamer-body { animation: ghost-boo .35s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes ghost-bob { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(1px); } }
@keyframes ghost-boo { from { transform: scale(.8); } to { transform: scale(1.25) translateY(-4px); } }
.roamer .eye { fill: var(--bg); }

:root[data-theme="dark"] .roamer svg { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--ink) 45%, transparent)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .roamer svg { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--ink) 45%, transparent)); }
}

.roamer-bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 5px 9px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.3;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--text);
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.roamer-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--text);
}
.roamer.talking .roamer-bubble { opacity: 1; transform: translate(-50%, 0); }

/* near the column edges, anchor the bubble so it stays on screen */
.roamer.edge-right .roamer-bubble { left: auto; right: 0; transform: translate(0, 4px); }
.roamer.edge-right.talking .roamer-bubble { transform: none; }
.roamer.edge-right .roamer-bubble::after { left: auto; right: 10px; }
.roamer.edge-left .roamer-bubble { left: 0; transform: translate(0, 4px); }
.roamer.edge-left.talking .roamer-bubble { transform: none; }
.roamer.edge-left .roamer-bubble::after { left: 15px; }

/* ---------- Work page chase (chase.js): Pac-Man rides the spine tip ---------- */
.spine.has-chase .spine-fill::after { display: none; } /* Pac-Man replaces the beam */
.chase { position: absolute; left: 0; top: 0; bottom: 0; width: 1px; z-index: 3; }
.chase-dots i {
  position: absolute;
  left: -2px;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  background: var(--text);
  opacity: .5;
}
.chase-dots i.power { left: -4px; width: 9px; height: 9px; margin-top: -4px; opacity: 1; animation: power-blink .5s steps(1) infinite; }
.chase-dots i.eaten { opacity: 0; animation: none; }
@keyframes power-blink { 50% { opacity: .15; } }

.chase-pac, .chase-ghost {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--text);
  opacity: 0;
  transition: opacity .3s ease;
  will-change: transform;
}
.chase.live .chase-pac, .chase.live .chase-ghost { opacity: 1; }
.chase.live .chase-ghost.hide, .chase.over .chase-ghost, .chase.over .chase-pac { opacity: 0; }
.chase-pac svg, .chase-ghost svg { display: block; }
.chase-ghost { cursor: pointer; }
.chase-body { animation: ghost-bob 1.6s ease-in-out infinite; }
.chase-ghost .eye { fill: var(--bg); }
.chase-ghost[data-mode="scared"] { color: var(--muted); }
.chase-ghost[data-mode="caught"] svg { opacity: 0; }
.chase-ghost.boo .chase-body { animation: ghost-boo .3s cubic-bezier(.3, 1.6, .5, 1) both; }

.chase-score {
  position: absolute;
  left: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
}
.chase-score.pop { animation: score-pop .9s ease-out both; }
@keyframes score-pop { 0% { opacity: 1; transform: translateY(-50%); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(calc(-50% - 14px)); } }

/* bubble opens to the right, over the text column, so it never leaves the screen */
.chase-bubble {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translate(4px, -50%);
  padding: 4px 8px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.3;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--text);
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.chase-ghost.talking .chase-bubble { opacity: 1; transform: translate(0, -50%); }

:root[data-theme="dark"] .chase svg { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--ink) 45%, transparent)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chase svg { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--ink) 45%, transparent)); }
}


/* ---------- Portfolio ---------- */
.pf-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 36px; }
.pf-chip {
  font: 13px var(--mono);
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.pf-chip:hover { color: var(--text); border-color: var(--text); }
.pf-chip[aria-pressed="true"] { background: var(--invert-bg); color: var(--invert-text); border-color: var(--invert-bg); }

.pf-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 48px 32px;
}
.pf-card[hidden] { display: none; }
.pf-card a { display: block; text-decoration: none; }
.pf-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 18px;
}
.pf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.pf-card a:hover .pf-thumb img { transform: scale(1.03); }
.pf-draft {
  position: absolute; top: 10px; left: 10px;
  font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase;
  background: var(--invert-bg); color: var(--invert-text); padding: 3px 8px;
}
.pf-kicker, .pf-card-co { font: 13px var(--mono); color: var(--muted); margin: 0 0 6px; }
.pf-card h2 { font-size: 22px; font-weight: 500; letter-spacing: -.01em; line-height: 1.25; margin: 0 0 8px; }
.pf-card a:hover h2 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.pf-card-summary { color: var(--muted); margin: 0 0 10px; }
.pf-empty { color: var(--muted); max-width: 52ch; }

/* Case study */
.pf-case .hero h1 { white-space: normal; }
.pf-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pf-tags li { font: 12px var(--mono); color: var(--muted); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.pf-cover img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.pf-cover { margin-bottom: clamp(48px, 7vw, 80px); }

.pf-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.pf-dl { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 32px; align-content: start; }
.pf-dl dt { font: 13px var(--mono); color: var(--muted); margin-bottom: 2px; }
.pf-dl dd { margin: 0; }
.pf-metrics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px; }
.pf-metrics strong { display: block; font-size: clamp(32px, 4vw, 44px); font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.pf-metrics span { color: var(--muted); font-size: 15px; }

.pf-blocks { max-width: 68ch; }
.pf-blocks > * + * { margin-top: 28px; }
.pf-text p { margin: 0 0 16px; font-size: 18px; }
.pf-text p:last-child { margin-bottom: 0; }
.pf-figure { margin-inline: 0; }
.pf-figure img, .pf-figure video { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--surface); }
@media (min-width: 900px) { .pf-figure { width: calc(100% + 18ch); max-width: calc(var(--max) - 2 * var(--gutter)); } }
.pf-figure figcaption { font: 13px var(--mono); color: var(--muted); margin-top: 10px; }
.pf-quote { margin-inline: 0; padding-left: 22px; border-left: 2px solid var(--text); }
.pf-quote blockquote { margin: 0; font-size: 21px; line-height: 1.45; }
.pf-quote figcaption { font: 13px var(--mono); color: var(--muted); margin-top: 10px; }

@media (max-width: 720px) {
  .pf-facts { grid-template-columns: 1fr; }
}
