/* Layout idea: a quiet editorial page in one sans family (wide cuts for headlines, regular width for text); the one bold element is the work index drawn as a cable run, hub to nodes, in gold on off-white, with purple for everything you can click. */
:root {
  --paper: #f7f6f8;
  --ink: #221a2b;
  --muted: #675e72;
  --rule: #e2dee7;
  --gold: #c99a1e;
  --accent: #5b2a86;
  --accent-deep: #45206a;
  --wash: #eeebf2;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17121d; --ink: #eee9f3; --muted: #a99fb5; --rule: #2e2638;
    --gold: #e0b445; --accent: #c39be8; --accent-deep: #d8bdf2; --wash: #211a29; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17121d; --ink: #eee9f3; --muted: #a99fb5; --rule: #2e2638;
  --gold: #e0b445; --accent: #c39be8; --accent-deep: #d8bdf2; --wash: #211a29; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6; font-stretch: 100%;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 0.5rem; background: var(--paper); padding: 0.5rem 0.75rem; z-index: 10; }

/* Header and footer */
.site-header, .site-footer, main { padding-inline: var(--gutter); max-width: 76rem; margin-inline: auto; }
.site-header {
  display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; align-items: baseline; justify-content: space-between;
  padding-block: 1.5rem; font-family: var(--display); font-size: 0.95rem;
}
.site-header .name { font-weight: 700; font-stretch: 112%; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.site-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--ink); }
.site-header nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold); }

.site-footer {
  margin-top: 6rem; padding-block: 2.5rem 3rem; border-top: 1px solid var(--rule);
  font-family: var(--display); font-size: 0.95rem; color: var(--muted);
  display: grid; gap: 1.25rem;
}
.site-footer .open { color: var(--ink); font-size: 1.15rem; font-stretch: 108%; font-weight: 600; margin: 0; max-width: 30ch; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }
.site-footer p { margin: 0; }

/* Type */
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; color: var(--ink); }
h1 { font-weight: 700; font-stretch: 118%; letter-spacing: -0.02em; line-height: 1.04; }
h2 { font-weight: 650; font-stretch: 112%; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; letter-spacing: -0.01em; }
h3 { font-weight: 650; font-stretch: 105%; font-size: 1.2rem; line-height: 1.25; }
p { margin: 0; }
.prose { max-width: var(--measure); display: grid; gap: 1.1rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.prose strong { font-weight: 600; }

/* Home hero */
.hero { padding-block: clamp(3rem, 9vw, 7rem) clamp(3rem, 6vw, 5rem); display: grid; gap: 1.75rem; }
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 5.2rem); max-width: 15ch; }
.hero .intro { max-width: 34rem; font-size: 1.2rem; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; font-family: var(--display); font-size: 1rem; }
.button {
  display: inline-block; background: var(--accent); color: var(--paper); text-decoration: none;
  padding: 0.8rem 1.2rem; border-radius: 3px; font-weight: 600;
}
.button:hover { background: var(--accent-deep); color: var(--paper); }

/* Work index drawn as a cable run */
.work { padding-block: 2rem; display: grid; gap: 3.5rem; }
.work > h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.employer { display: grid; gap: 1.25rem; }
.employer-head { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; font-family: var(--display); }
.employer-head h3 { font-size: 1.05rem; font-stretch: 100%; font-weight: 600; color: var(--muted); }
.legend { font-family: var(--display); font-size: 0.85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.legend span { display: inline-flex; gap: 0.45rem; align-items: center; }
.dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; border: 2px solid var(--gold); background: var(--gold); display: inline-block; }
.dot.open { background: var(--paper); border-color: var(--muted); }

.run { list-style: none; margin: 0; padding: 0; position: relative; }
.run::before {
  content: ""; position: absolute; left: 0.6rem; top: 2.5rem; bottom: 1.6rem; width: 3px;
  background: var(--gold); border-radius: 2px;
}
.run.planned::before { background: repeating-linear-gradient(var(--muted) 0 6px, transparent 6px 12px); width: 2px; left: 0.65rem; }
.stop { position: relative; padding-left: 2.75rem; }
.stop + .stop { margin-top: 0.25rem; }
.stop::before {
  content: ""; position: absolute; left: 0.21rem; top: 1.55rem; width: 0.95rem; height: 0.95rem; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px var(--paper);
}
.stop.hub::before { left: 0; top: 1.95rem; width: 1.35rem; height: 1.35rem; background: var(--accent); }
.planned .stop::before { background: var(--paper); border: 2px solid var(--muted); }
.stop a, .stop .static {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(9rem, 14rem); gap: 0.25rem 2rem;
  padding: 1.1rem 1rem 1.1rem 0; text-decoration: none; color: var(--ink); border-radius: 4px;
}
.stop a:hover { background: var(--wash); }
.stop a:hover .title { color: var(--accent); }
.stop .title { font-family: var(--display); font-weight: 650; font-stretch: 110%; font-size: 1.35rem; line-height: 1.2; }
.stop.hub .title { font-size: clamp(1.7rem, 3vw, 2.25rem); }
.stop .what { display: block; color: var(--muted); max-width: 34rem; margin-top: 0.3rem; }
.stop .result {
  font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 600; font-stretch: 105%;
  font-size: 1.05rem; align-self: center; text-align: right; color: var(--ink);
}
.planned .result { color: var(--muted); font-weight: 500; }
.stop.sub { margin-left: 0; }

/* How I work */
.how { padding-block: 4rem 0; display: grid; gap: 2rem; }
.how dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2rem 3rem; }
.how dt { font-family: var(--display); font-weight: 650; font-stretch: 110%; font-size: 1.2rem; margin-bottom: 0.5rem; }
.how dd { margin: 0; color: var(--muted); }

/* Case study */
.case-head { padding-block: clamp(2.5rem, 7vw, 5rem) 2.5rem; display: grid; gap: 1.5rem; border-bottom: 1px solid var(--rule); }
.crumb { font-family: var(--display); font-size: 0.95rem; color: var(--muted); }
.crumb a { color: var(--muted); }
.case-head h1 { font-size: clamp(2.2rem, 5.2vw, 4rem); max-width: 18ch; }
.case-head .lead { max-width: 40rem; font-size: 1.25rem; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem 2rem; font-family: var(--display); font-size: 0.95rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0.15rem 0 0; font-weight: 600; }

.case-body { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 4rem; padding-top: 3rem; }
.toc { position: sticky; top: 1.5rem; align-self: start; font-family: var(--display); font-size: 0.95rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; border-left: 2px solid var(--rule); }
.toc a { color: var(--muted); text-decoration: none; padding-left: 1rem; display: block; margin-left: -2px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--gold); }
.sections { display: grid; gap: 3.5rem; min-width: 0; }
.sections section { display: grid; gap: 1.1rem; scroll-margin-top: 1.5rem; }

.results { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem 2.5rem; max-width: 52rem; }
.results div { border-top: 3px solid var(--gold); padding-top: 0.75rem; }
.results dt { font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 700; font-stretch: 112%; font-size: 1.6rem; line-height: 1.15; }
.results dd { margin: 0.35rem 0 0; color: var(--muted); font-size: 1rem; }

figure.screen { margin: 0; display: grid; gap: 0.6rem; max-width: 52rem; }
.screen-slot {
  aspect-ratio: 16 / 9; border: 2px dashed var(--rule); border-radius: 4px; background: var(--wash);
  display: grid; place-items: center; text-align: center; padding: 1.5rem;
  font-family: var(--display); color: var(--muted); font-size: 0.95rem;
}
figure.screen figcaption { font-family: var(--display); font-size: 0.9rem; color: var(--muted); }

.next-studies { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.next-studies a { font-family: var(--display); font-weight: 600; font-size: 1.15rem; }
.next-studies span { color: var(--muted); }

blockquote.moment { margin: 0; padding-left: 1.25rem; border-left: 3px solid var(--gold); max-width: var(--measure); }

/* About */
.about-head { padding-block: clamp(3rem, 8vw, 6rem) 1rem; }
.about-text { display: grid; gap: 1.75rem; }
.about-head h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
.wide-photo { margin: 2.5rem 0 0; display: grid; gap: 0.6rem; }
.wide-photo img { display: block; width: 100%; height: auto; border-radius: 4px; }
.wide-photo figcaption { font-family: var(--display); font-size: 0.9rem; color: var(--muted); }
.about-section { padding-top: 3.5rem; display: grid; gap: 1.1rem; }
.about-section .facts { max-width: 52rem; }

@media (max-width: 52rem) {
  .case-body { grid-template-columns: 1fr; gap: 2rem; }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; border-left: 0; }
  .toc a { padding-left: 0; border-left: 0; }
}
@media (max-width: 40rem) {
  .stop a, .stop .static { grid-template-columns: 1fr; }
  .stop .result { text-align: left; }
}
@media (prefers-reduced-motion: no-preference) {
  .run::before { transform-origin: top; animation: lay 900ms cubic-bezier(.3,.7,.2,1) both; }
  @keyframes lay { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  html { scroll-behavior: smooth; }
}

/* Resume page */
.note { color: var(--muted); font-size: 0.95rem; }
.case-head .actions { margin-top: 0.25rem; }
.resume { display: grid; gap: 3.5rem; padding-top: 3rem; max-width: 50rem; }
.resume section { display: grid; gap: 1.5rem; }
.resume ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.role { display: grid; gap: 0.6rem; }
.role .where { color: var(--muted); font-family: var(--display); font-size: 0.95rem; }
.skills { margin: 0; display: grid; gap: 1rem; }
.skills dt { font-family: var(--display); font-weight: 650; }
.skills dd { margin: 0.2rem 0 0; color: var(--muted); }
