/* Chris-Jay Mabalot — site styles
   Palette: ultramarine hero, lilac paper, pink/magenta accents. Display: Young Serif. Body: Hanken Grotesk. */
@font-face { font-family: "Young Serif"; font-weight: 400; font-display: swap; src: url(fonts/YoungSerif.woff2) format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400 700; font-display: swap; src: url(fonts/HankenGrotesk.woff2) format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/HankenGrotesk-italic.woff2) format("woff2"); }

:root {
  --ultra: #2633C9;
  --ultra-deep: #1B248F;
  --lilac: #EFEDF8;
  --sheet: #FAF9FE;
  --pale: #F4F2FF;
  --pink: #FF9ED8;
  --magenta: #D63F8C;
  --ink: #1B1F4A;
  --muted: #565B86;
  --rule: #D9D6EE;
  --contract: #B4B8F0;
  --display: "Young Serif", Georgia, serif;
  --col-label: 15rem;
  --measure: 38rem;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--lilac); color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif; font-size: 1.0625rem; line-height: 1.55;
}
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--magenta); outline-offset: 3px; border-radius: 3px; }
.wrap { max-width: 74rem; margin: 0 auto; padding: 0 2.5rem; }
.nb { white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--pale); color: var(--ink); padding: 0.5rem 0.9rem; border-radius: 6px; z-index: 20; }
.skip:focus { left: 0.5rem; }

/* ---------- header ---------- */
.hero { background: var(--ultra); color: var(--pale); padding-bottom: 10rem; }
.hero.home { padding-bottom: 12rem; }
.hero.short { padding-bottom: 6rem; }
.hero :focus-visible { outline-color: var(--pink); }
.bar { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem 2rem; padding: 1.75rem 0; flex-wrap: wrap; }
.bar nav { display: flex; gap: 1.75rem; }
.bar a { text-decoration: none; opacity: 0.8; }
.bar a:hover, .bar a[aria-current] { opacity: 1; }
.bar a[aria-current] { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 0.4em; }
.bar .name { font-weight: 600; opacity: 1; }

.hero .eyebrow { margin-top: 4.5rem; font-size: 1rem; opacity: 0.8; }
.hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(3rem, 8vw, 6.5rem); line-height: 1; letter-spacing: -0.015em;
  margin-top: 4.5rem; text-wrap: balance;
}
.hero .eyebrow + h1 { margin-top: 0.75rem; }
.hero .sum { margin-top: 1.5rem; font-size: 1.5rem; line-height: 1.45; max-width: 36rem; }

/* ---------- footer ---------- */
footer { margin-top: 8rem; background: var(--ultra); color: var(--pale); padding: 5rem 0 3rem; }
footer :focus-visible { outline-color: var(--pink); }
footer h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; max-width: 14em; }
footer .contact { margin-top: 2rem; display: flex; gap: 1rem 2rem; flex-wrap: wrap; align-items: baseline; font-size: 1.125rem; }
footer .mail { font-family: var(--display); font-size: 1.5rem; text-decoration-color: var(--pink); text-decoration-thickness: 3px; }
footer .small { margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid rgba(244, 242, 255, 0.25); font-size: 0.875rem; opacity: 0.75; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- shared section heading ---------- */
section.block { padding-top: 7rem; }
section.block > h2, .h-section { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; color: var(--ultra); }
.section-intro { margin-top: 1rem; color: var(--muted); max-width: 36rem; font-size: 1.125rem; }
.see-all { margin-top: 2rem; display: inline-block; font-weight: 600; color: var(--ultra); }

@media (max-width: 760px) {
  :root { --col-label: 10.5rem; }
  .wrap { padding: 0 1.25rem; }
  body { font-size: 1rem; }
  .bar { padding: 1.25rem 0; }
  .bar nav { width: 100%; gap: 1.25rem; font-size: 0.9375rem; overflow-x: auto; }
  .hero { padding-bottom: 8rem; }
  .hero.short { padding-bottom: 4.5rem; }
  .hero h1, .hero .eyebrow { margin-top: 2.5rem; }
  .hero .sum { font-size: 1.25rem; }
  footer { padding-top: 3.5rem; margin-top: 6rem; }
  article { font-size: 1.0625rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- draft helper: dummy content ---------- */
.draft-toggle {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 30;
  font: 600 0.8125rem/1 "Hanken Grotesk", system-ui, sans-serif; color: var(--ink);
  background: #FFE9A8; border: 0; border-radius: 999px; padding: 0.6rem 0.9rem; cursor: pointer;
  box-shadow: 0 6px 18px -6px rgba(27, 31, 74, 0.5);
}
.show-dummy .dummy { background: #FFE9A8; color: var(--ink); box-shadow: 0 0 0 2px #FFE9A8; border-radius: 2px; }
@media print { .draft-toggle { display: none; } }

/* =================== home =================== */
  .hero h1.sentence {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(2.5rem, 6.6vw, 4.75rem);
    line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance;
    margin-top: 5.5rem; max-width: 15em;
  }
  .tok {
    all: unset; cursor: pointer; position: relative; white-space: nowrap; border-radius: 0.08em;
    background-image: linear-gradient(var(--pink), var(--pink));
    background-repeat: no-repeat; background-position: 0 92%;
    background-size: 100% calc(var(--p) * 0.16em + 0.03em);
    transition: background-size 220ms ease;
  }
  .tok:hover, .tok[aria-expanded="true"] { background-size: 100% 0.2em; }
  .tok:focus-visible { outline: 2px solid var(--pink); outline-offset: 0.08em; }
  .hint { margin-top: 2.5rem; font-size: 1.25rem; line-height: 1.5; opacity: 0.88; max-width: 34rem; }

  .pop {
    position: absolute; z-index: 10; min-width: 15rem;
    background: var(--pale); color: var(--ink); border-radius: 8px; padding: 0.5rem;
    box-shadow: 0 18px 40px -12px rgba(15, 18, 80, 0.55);
    font-size: 1rem; line-height: 1.3;
    opacity: 0; transform: translateY(-4px); pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
  }
  .pop[data-show] { opacity: 1; transform: none; pointer-events: auto; }
  .pop button {
    all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 1rem;
    width: 100%; padding: 0.45rem 0.6rem; border-radius: 5px; position: relative; overflow: hidden;
  }
  .pop button::before { content: ""; position: absolute; inset: 0; width: calc(var(--p) * 100%); background: var(--pink); opacity: 0.32; }
  .pop button > * { position: relative; }
  .pop button:hover, .pop button:focus-visible { background: #E4E0F8; }
  .pop button[aria-current="true"] { font-weight: 650; }
  .pop .p { font-variant-numeric: tabular-nums; color: var(--muted); }
  .pop .cap { padding: 0.35rem 0.6rem 0.5rem; font-size: 0.875rem; color: var(--muted); }

  /* ---------- trace (straddles the hero edge) ---------- */
  .trace-wrap { margin-top: -8rem; position: relative; }
  .trace {
    background: var(--sheet); border-radius: 10px; overflow: hidden;
    box-shadow: 0 1px 0 var(--rule), 0 24px 48px -28px rgba(27, 36, 143, 0.45);
  }
  .trace-head { display: grid; grid-template-columns: var(--col-label) 1fr; border-bottom: 1px solid var(--rule); }
  .trace-head h2 { font-family: var(--display); font-weight: 400; font-size: 1.375rem; line-height: 1.2; color: var(--ultra); padding: 1rem 1.25rem; }
  .axis { position: relative; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
  .axis span { position: absolute; bottom: 0.7rem; transform: translateX(-50%); }
  .axis span::after {
    content: ""; position: absolute; left: 50%; top: 1.85rem; width: 1px; height: 2000px;
    background: var(--rule); opacity: 0.7; pointer-events: none;
  }

  .span { border-bottom: 1px solid var(--rule); }
  .span:last-child { border-bottom: 0; }
  .span > button {
    all: unset; box-sizing: border-box; cursor: pointer;
    display: grid; grid-template-columns: var(--col-label) 1fr; align-items: center;
    width: 100%; min-height: 2.875rem;
  }
  .span > button:hover { background: #F2F0FB; }
  .span > button:focus-visible { outline: 2px solid var(--magenta); outline-offset: -2px; }
  .label { padding: 0.5rem 1.25rem; display: flex; gap: 0.55rem; align-items: center; font-size: 0.9375rem; font-weight: 550; }
  .label .caret { width: 0.75rem; color: var(--muted); transition: transform 160ms ease; display: inline-block; }
  .span[data-open] .caret { transform: rotate(90deg); }
  .d1 .label { padding-left: 2.5rem; font-weight: 400; color: var(--muted); }
  .lane { position: relative; height: 100%; min-height: 2.875rem; }
  .bar-s { position: absolute; top: 50%; transform: translateY(-50%); border-radius: 3px; }
  .bar-s.role { background: var(--ultra); height: 0.875rem; }
  .bar-s.project { background: var(--magenta); height: 0.625rem; }
  .bar-s.study { box-shadow: inset 0 0 0 1.5px var(--ultra); height: 0.625rem; }
  .bar-s.open { background: repeating-linear-gradient(90deg, var(--magenta) 0 6px, transparent 6px 10px); height: 0.875rem; }
  .bar-note { position: absolute; top: 50%; transform: translateY(-50%); font-size: 0.8125rem; color: var(--muted); white-space: nowrap; padding: 0 0.6rem; }

  .detail {
    display: grid; grid-template-columns: var(--col-label) 1fr;
    max-height: 0; overflow: hidden; transition: max-height 260ms ease;
    position: relative; background: var(--sheet);
  }
  .span[data-open] .detail { max-height: 30rem; }
  .detail-inner { grid-column: 2; padding: 0.25rem 1.5rem 1.5rem 0; max-width: 40rem; }
  .attrs { margin-top: 0.875rem; display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1.25rem; font-size: 0.9375rem; }
  .attrs dt { color: var(--muted); }

  .legend span { white-space: nowrap; }
  .legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.875rem; color: var(--muted); padding: 0.875rem 0 0; }
  .legend i { display: inline-block; width: 0.875rem; height: 0.5rem; border-radius: 2px; margin-right: 0.45rem; vertical-align: 0.05em; }

  section.block { padding-top: 7rem; }
  section.block > h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; color: var(--ultra); }

  .projects { margin-top: 3rem; }
  .proj { display: grid; grid-template-columns: 5fr 6fr; gap: 3rem; align-items: center; padding: 2.5rem 0; border-top: 1px solid var(--rule); }
  .proj:last-child { border-bottom: 1px solid var(--rule); }
  .proj h3 { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.1; }
  .proj .year { color: var(--muted); font-size: 0.9375rem; margin-top: 0.4rem; }
  .proj p { margin-top: 1rem; max-width: 30rem; }
  .proj .links { margin-top: 1rem; display: flex; gap: 1.25rem; }
  .thumb { aspect-ratio: 16 / 10; border-radius: 10px; background: var(--ultra); overflow: hidden; position: relative; }
  .thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }

  .log { list-style: none; margin-top: 2rem; max-width: 50rem; }
  .log li { display: grid; grid-template-columns: 8rem 1fr; gap: 1.5rem; padding: 1.25rem 0; border-top: 1px solid var(--rule); }
  .log time { color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; padding-top: 0.15rem; }
  .log strong { font-weight: 650; font-size: 1.125rem; }
  .log p { color: var(--muted); margin-top: 0.2rem; max-width: 36rem; }

  @media (max-width: 760px) {
    :root { --col-label: 10.5rem; }
    .hero h1.sentence { margin-top: 3rem; }
    .hero.home { padding-bottom: 9rem; }
    .trace-wrap { margin-top: -6rem; }
    .trace-head h2 { font-size: 1.0625rem; padding: 0.875rem 0.75rem; }
    .label { font-size: 0.8125rem; padding: 0.5rem 0.75rem; }
    .d1 .label { padding-left: 1.4rem; }
    .label .caret { display: none; }
    .bar-note { display: none; }
    .axis span.minor { visibility: hidden; }
    .detail { grid-template-columns: 1fr; }
    .detail-inner { grid-column: 1; padding: 0.25rem 1rem 1.25rem; }
    .proj { grid-template-columns: 1fr; gap: 1.5rem; }
    .log li { grid-template-columns: 1fr; gap: 0.25rem; }
  }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
  @media (prefers-reduced-motion: no-preference) {
    .bar-s { animation: grow 700ms cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms + 300ms); }
    @keyframes grow { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
  }
  /* ---------- additions for real content ---------- */
  .nb { white-space: nowrap; }
  .bar-s { min-width: 5px; }
  .bar-s.role, .bar-s.study:not(.d1 *) { height: 1.375rem; }
  .bar-in {
    position: absolute; top: 50%; transform: translateY(-50%); height: 1.375rem;
    display: flex; align-items: center; justify-content: flex-end; padding-right: 0.75rem;
    font-size: 0.8125rem; white-space: nowrap; overflow: hidden; pointer-events: none;
  }
  :root { --contract: #B4B8F0; }
  .bar-s.contract { background: var(--contract); height: 1.375rem; }
  .bar-in.on-role { color: var(--pale); }
  .bar-in.on-contract { color: var(--ink); }
  .bar-in.on-study { color: var(--ultra); }
  /* zoomed timeline */
  .axis .zone { position: absolute; top: 0; right: 0; height: 2000px; background: rgba(38, 51, 201, 0.045); pointer-events: none; }
  .axis .seam { position: absolute; top: 0; width: 10px; height: 2000px; transform: translateX(-50%); pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='12'%3E%3Cpath d='M5 0 L9 6 L5 12' fill='none' stroke='%232633C9' stroke-opacity='.45' stroke-width='1.2'/%3E%3C/svg%3E") repeat-y; }
  .axis .zcap em { font-style: normal; }
  .axis .zcap { position: absolute; top: 0.6rem; padding-left: 0.7rem; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ultra); white-space: nowrap; font-weight: 600; }
  .axis .now { position: absolute; bottom: 0; top: 0; width: 0; pointer-events: none; }
  .axis .now b { position: absolute; bottom: 0.7rem; transform: translateX(-50%); font-size: 0.8125rem; font-weight: 600; color: var(--magenta); }
  .axis .now b::after { content: ""; position: absolute; left: calc(50% - 0.75px); top: 1.6rem; width: 1.5px; height: 2000px; background: var(--magenta); opacity: 0.5; }
  .live { position: absolute; top: 50%; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--c); box-shadow: 0 0 0 3px var(--sheet), 0 0 0 5px color-mix(in srgb, var(--c) 30%, transparent); z-index: 1; }
  @media (prefers-reduced-motion: no-preference) {
    .live { animation: pulse 2.4s ease-in-out infinite 1.4s; }
    @keyframes pulse { 50% { box-shadow: 0 0 0 3px var(--sheet), 0 0 0 8px color-mix(in srgb, var(--c) 0%, transparent); } }
  }
  @media (max-width: 760px) { .axis .zcap .long { display: none; } .axis .now b { font-size: 0.75rem; } }
  @media (min-width: 761px) { .axis .zcap .short { display: none; } }
  .bar-s.fade { -webkit-mask-image: linear-gradient(90deg, transparent, #000 3rem); mask-image: linear-gradient(90deg, transparent, #000 3rem); }
  .trace-head h2 small { display: block; font-family: "Hanken Grotesk", system-ui, sans-serif; font-size: 0.8125rem; color: var(--muted); margin-top: 0.15rem; }
  .axis span.minor-tick { opacity: 0.7; }

  .more { margin-top: 4rem; }
  .more h3 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; color: var(--ultra); }
  .more ul { list-style: none; margin-top: 1.25rem; display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .more li { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding: 1rem 0; border-top: 1px solid var(--rule); align-content: start; }
  .more strong { font-weight: 650; font-size: 1.0625rem; }
  .more .when { color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; text-align: right; }
  .more p { grid-column: 1 / -1; color: var(--muted); font-size: 0.9875rem; max-width: 32rem; }
  .more .where { grid-column: 1 / -1; font-size: 0.9375rem; }
  .private { color: var(--muted); }
  .proj .year .private { white-space: nowrap; }

  @media (max-width: 760px) {
    .more ul { grid-template-columns: 1fr; }
    .bar-in { display: none; }
  }

/* =================== case study =================== */
  /* facts sheet straddles the header edge, like the career trace on the home page */
  .facts {
    margin-top: -6rem; position: relative;
    background: var(--sheet); border-radius: 10px;
    box-shadow: 0 1px 0 var(--rule), 0 24px 48px -28px rgba(27, 36, 143, 0.45);
    display: grid; grid-template-columns: repeat(4, 1fr);
  }
  .facts div { padding: 1.25rem 1.5rem 1.4rem; border-left: 1px solid var(--rule); font-size: 1rem; line-height: 1.5; }
  .facts div:first-child { border-left: 0; }
  .facts dt { color: var(--muted); font-size: 0.9375rem; }
  .facts dd { margin-top: 0.2rem; }

  /* ---------- article ---------- */
  article { padding-top: 5rem; font-size: 1.1875rem; line-height: 1.65; }
  article > * { max-width: var(--measure); }
  article h2 {
    font-family: var(--display); font-weight: 400; color: var(--ultra);
    font-size: 2rem; line-height: 1.15; margin-top: 4.5rem;
  }
  article h2:first-child { margin-top: 0; }
  article p { margin-top: 1.1rem; }
  article h2 + p { margin-top: 1rem; }
  article ul { margin-top: 1rem; padding-left: 1.2rem; }
  article li { margin-top: 0.45rem; }
  article li::marker { color: var(--magenta); }
  code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85em; background: #E3E0F4; padding: 0.1em 0.35em; border-radius: 4px; }

  figure { max-width: none; margin: 2.75rem 0 0.5rem; }
  figcaption { margin-top: 0.875rem; font-size: 1rem; color: var(--muted); max-width: var(--measure); }
  .sheet {
    background: var(--sheet); border-radius: 10px; overflow: hidden;
    box-shadow: 0 1px 0 var(--rule), 0 18px 40px -30px rgba(27, 36, 143, 0.4);
  }

  /* run trace figure */
  .run { --label: 14rem; --dur: 5rem; font-size: 0.9375rem; }
  .run-head, .run-row { display: grid; grid-template-columns: var(--label) 1fr var(--dur); align-items: center; }
  .run-head { border-bottom: 1px solid var(--rule); color: var(--muted); font-size: 0.8125rem; min-height: 2.75rem; }
  .run-head .t { font-family: var(--display); font-size: 1.125rem; color: var(--ultra); padding: 0 1.25rem; }
  .run-axis { position: relative; height: 100%; font-variant-numeric: tabular-nums; }
  .run-axis span { position: absolute; top: 50%; transform: translate(-50%, -50%); }
  .run-axis span::after { content: ""; position: absolute; left: 50%; top: 1.6rem; width: 1px; height: 1000px; background: var(--rule); opacity: .7; }
  .run-body { position: relative; overflow: hidden; }
  .run-row { min-height: 2.6rem; border-bottom: 1px solid var(--rule); }
  .run-row:last-child { border-bottom: 0; }
  .run-row .lbl { padding: 0.4rem 1.25rem; }
  .run-row .lbl .k { color: var(--muted); }
  .run-row.d1 .lbl { padding-left: 2.5rem; }
  .run-row .lane { position: relative; height: 100%; min-height: 2.6rem; }
  .run-row .b { position: absolute; top: 50%; transform: translateY(-50%); height: 0.625rem; border-radius: 3px; }
  .b.root { background: var(--ultra); height: 0.875rem; }
  .b.llm { background: var(--ultra); }
  .b.tool { background: var(--magenta); }
  .b.eval { box-shadow: inset 0 0 0 1.5px var(--ultra); }
  .run-row .ms { text-align: right; padding-right: 1.25rem; color: var(--muted); font-variant-numeric: tabular-nums; }
  .run-legend { display: flex; gap: 1.5rem; font-size: 0.875rem; color: var(--muted); padding: 0.875rem 0 0; }
  .run-legend i { display: inline-block; width: 0.875rem; height: 0.5rem; border-radius: 2px; margin-right: 0.45rem; vertical-align: 0.05em; }

  /* eval comparison table */
  .cmp { width: 100%; border-collapse: collapse; font-size: 1rem; font-variant-numeric: tabular-nums; }
  .cmp caption { text-align: left; font-family: var(--display); color: var(--ultra); font-size: 1.125rem; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--rule); }
  .cmp th { text-align: right; font-weight: 400; color: var(--muted); font-size: 0.875rem; padding: 0.7rem 1.25rem; border-bottom: 1px solid var(--rule); }
  .cmp th:first-child, .cmp td:first-child { text-align: left; }
  .cmp td { text-align: right; padding: 0.8rem 1.25rem; border-bottom: 1px solid var(--rule); }
  .cmp tr:last-child td { border-bottom: 0; }
  .cmp .up { color: var(--ultra); }
  .cmp .same { color: var(--muted); }
  .cmp tr.regress td { background: #FCE6F1; }
  .cmp tr.regress .chg { color: var(--magenta); font-weight: 650; }

  .learned { margin-top: 1.5rem; list-style: none; padding: 0; }
  .learned li { padding: 1rem 0 1rem; border-top: 1px solid var(--rule); margin: 0; }
  .learned strong { display: block; font-weight: 650; }
  .learned span { color: var(--muted); }

  /* ---------- next / footer ---------- */
  .next { margin-top: 7rem; border-top: 1px solid var(--rule); }
  .next a {
    display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2rem;
    padding: 2.5rem 0 0; text-decoration: none;
  }
  .next .lbl { color: var(--muted); font-size: 1rem; }
  .next .title { font-family: var(--display); font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.05; color: var(--ultra); margin-top: 0.4rem; }
  .next a:hover .title { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 0.08em; text-underline-offset: 0.12em; }

  @media (max-width: 760px) {
    .facts { grid-template-columns: 1fr 1fr; margin-top: -5rem; }
    .facts div:nth-child(3) { border-left: 0; }
    .facts div:nth-child(n+3) { border-top: 1px solid var(--rule); }
    .run { --label: 9rem; --dur: 3.75rem; font-size: 0.8125rem; }
    .run-row .lbl, .run-head .t { padding-left: 0.75rem; padding-right: 0.5rem; }
    .run-row.d1 .lbl { padding-left: 1.25rem; }
    .run-row .lbl .k { display: none; }
    .run-row .ms { padding-right: 0.75rem; }
    .run-axis span.minor { visibility: hidden; }
    .cmp { font-size: 0.875rem; }
    .cmp th, .cmp td { padding-left: 0.6rem; padding-right: 0.6rem; }
    .cmp .cases { display: none; }
  }

  /* memory sample figure */
  .mem-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--rule); }
  .mem-head .t { font-family: var(--display); color: var(--ultra); font-size: 1.125rem; }
  .mem-head .s { color: var(--muted); font-size: 0.875rem; }
  .mem { list-style: none; margin: 0; padding: 0; }
  .mem li { display: grid; grid-template-columns: 1fr 7.5rem; gap: 1.5rem; align-items: start; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--rule); margin: 0; font-size: 1rem; line-height: 1.5; }
  .mem li:last-child { border-bottom: 0; }
  .mem .scope { display: block; color: var(--muted); font-size: 0.875rem; margin-top: 0.15rem; }
  .chip { justify-self: end; font-size: 0.8125rem; padding: 0.15rem 0.6rem; border-radius: 999px; white-space: nowrap; }
  .chip.expected { background: var(--ultra); color: var(--pale); }
  .chip.acceptable { box-shadow: inset 0 0 0 1.5px var(--ultra); color: var(--ultra); }
  .chip.junk { background: #FCE6F1; color: var(--magenta); font-weight: 650; }
  .keys { margin-top: 1.25rem; padding-left: 0; list-style: none; display: grid; gap: 0.5rem; max-width: var(--measure); font-size: 1rem; color: var(--muted); }
  .keys li { margin: 0; display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; align-items: baseline; }
  .keys .chip { justify-self: start; }
  .cmp tr.win td { background: #EEF0FD; }
  .cmp .range { color: var(--muted); font-size: 0.875rem; }
  @media (max-width: 760px) {
    .mem li { grid-template-columns: 1fr; gap: 0.5rem; }
    .chip { justify-self: start; }
    .keys li { grid-template-columns: 1fr; gap: 0.25rem; }
    .cmp .range { display: block; }
  }

/* =================== index pages, about, CV =================== */
.lead-sheet { margin-top: -3rem; position: relative; }
.cards { margin-top: 2.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.card { display: block; text-decoration: none; background: var(--sheet); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 0 var(--rule), 0 18px 40px -30px rgba(27, 36, 143, 0.45); transition: transform 180ms ease, box-shadow 180ms ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 1px 0 var(--rule), 0 26px 48px -28px rgba(27, 36, 143, 0.55); }
.card .thumb { border-radius: 0; }
.card .body { padding: 1.5rem 1.5rem 1.75rem; }
.card h3 { font-family: var(--display); font-weight: 400; font-size: 1.75rem; line-height: 1.1; color: var(--ultra); }
.card .year { color: var(--muted); font-size: 0.9375rem; margin-top: 0.3rem; }
.card p { margin-top: 0.75rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; list-style: none; padding: 0; }
.tags li { font-size: 0.8125rem; padding: 0.15rem 0.6rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--rule); color: var(--muted); margin: 0; }

.entries { list-style: none; margin-top: 2rem; }
.entries > li { display: grid; grid-template-columns: 9rem 1fr; gap: 2rem; padding: 1.75rem 0; border-top: 1px solid var(--rule); }
.entries time { color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; padding-top: 0.3rem; }
.entries h3 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; line-height: 1.2; color: var(--ink); }
.entries h3 a { text-decoration-color: var(--pink); text-decoration-thickness: 2px; }
.entries p { margin-top: 0.4rem; color: var(--muted); max-width: 38rem; }
.entries .tags { margin-top: 0.75rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 2rem; }
.prose { font-size: 1.1875rem; line-height: 1.65; max-width: var(--measure); }
.prose p + p { margin-top: 1.1rem; }
.portrait { aspect-ratio: 4 / 5; border-radius: 10px; background: var(--ultra); position: relative; overflow: hidden; max-width: 22rem; justify-self: end; width: 100%; }
.portrait svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.portrait.photo { background: none; overflow: visible; aspect-ratio: auto; margin-right: 14px; }
.portrait.photo img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 14px 14px 0 var(--pink), 0 24px 48px -28px rgba(27, 36, 143, 0.45); }
.portrait figcaption { position: absolute; left: 1rem; top: 0.9rem; color: var(--pale); font-size: 0.875rem; opacity: 0.85; margin: 0; }
.principles { list-style: none; margin-top: 2rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; counter-reset: p; }
.principles li { border-top: 2px solid var(--ultra); padding-top: 1rem; counter-increment: p; }
.principles li::before { content: "0" counter(p); display: block; font-family: var(--display); color: var(--magenta); font-size: 1.125rem; }
.principles strong { display: block; font-size: 1.1875rem; margin-top: 0.4rem; }
.principles p { color: var(--muted); margin-top: 0.4rem; }
.skills { margin-top: 2rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.skills h3 { font-size: 1rem; font-weight: 650; }
.skills .tags { margin-top: 0.6rem; }

/* CV sheet straddles the header edge, like the trace and the facts strip */
.cv-actions { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.btn { font: 600 1rem/1 "Hanken Grotesk", system-ui, sans-serif; padding: 0.85rem 1.2rem; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.primary { background: var(--pink); color: var(--ink); }
.btn.ghost { box-shadow: inset 0 0 0 1.5px rgba(244, 242, 255, 0.6); color: var(--pale); background: transparent; }
.cv { margin-top: -5rem; position: relative; background: #fff; border-radius: 10px; box-shadow: 0 1px 0 var(--rule), 0 24px 48px -28px rgba(27, 36, 143, 0.45); padding: 3.5rem 4rem 4rem; max-width: 60rem; font-size: 1rem; line-height: 1.55; }
.cv-top { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: end; padding-bottom: 1.5rem; border-bottom: 2px solid var(--ultra); }
.cv-top h2 { font-family: var(--display); font-weight: 400; font-size: 2.5rem; line-height: 1; color: var(--ultra); }
.cv-top .role { margin-top: 0.5rem; color: var(--muted); }
.cv-top ul { list-style: none; text-align: right; font-size: 0.9375rem; }
.cv section { display: grid; grid-template-columns: 10rem 1fr; gap: 2rem; padding-top: 1.75rem; }
.cv section > h3 { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--magenta); font-weight: 650; padding-top: 0.25rem; }
.cv .item + .item { margin-top: 1.25rem; }
.cv .item-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cv .item-head strong { font-weight: 650; }
.cv .item-head > span { color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.cv .item .sub { color: var(--muted); }
.cv ul.pts { margin-top: 0.4rem; padding-left: 1.1rem; }
.cv ul.pts li { margin-top: 0.2rem; }
.cv ul.pts li::marker { color: var(--magenta); }

@media (max-width: 760px) {
  .cards, .two-col, .principles, .skills { grid-template-columns: 1fr; }
  .entries > li { grid-template-columns: 1fr; gap: 0.25rem; }
  .portrait { justify-self: start; max-width: 14rem; order: -1; }
  .cv { padding: 2rem 1.25rem 2.5rem; margin-top: -3rem; }
  .cv section { grid-template-columns: 1fr; gap: 0.5rem; }
  .cv-top ul { text-align: left; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 10pt; }
  .hero, footer, .skip { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .cv { margin: 0; box-shadow: none; padding: 0; max-width: none; font-size: 9.5pt; }
  .cv section { padding-top: 1.1rem; break-inside: avoid; }
  .cv a { text-decoration: none; }
  .show-dummy .dummy { background: none; box-shadow: none; }
}
