:root {
  color-scheme: light;
  --button-ink: #FFFFFF;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --ink: #171B22;
  --muted: #5C6572;
  --line: #DCE0E6;
  --accent: #1450B8;
  --accent-2: #B7791F;
  --focus: #1450B8;
  --body-font: "Anuphan", sans-serif;
  --display-font: "Bai Jamjuree", sans-serif;
  --mono-font: "JetBrains Mono", monospace;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11161D;
  --surface: #1B232D;
  --ink: #F0F3F7;
  --muted: #ADB8C6;
  --line: #394553;
  --accent: #7CC4FF;
  --accent-2: #EDBE70;
  --focus: #7CC4FF;
  --button-ink: #11161D;
}
.topbar-controls { display: flex; align-items: center; gap: 8px; }
.theme-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
.theme-btn:hover { border-color: var(--accent); }
.theme-sun { display: none; }
html[data-theme="dark"] .theme-moon { display: none; }
html[data-theme="dark"] .theme-sun { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* One icon set (Phosphor, bold weight: a 1.5px stroke at 16px), drawn from the inline
   sprite at the top of <body>. Icons take the colour of the text they sit with. */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { flex: none; width: 16px; height: 16px; fill: currentColor; }
* { box-sizing: border-box; }
html { scroll-padding-top: 140px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body-font); font-size: clamp(1rem, .95rem + .2vw, 1.0625rem); line-height: 1.65; }
html[data-lang="th"] [lang="en"]:not(.lang-btn),
html[data-lang="en"] [lang="th"]:not(.lang-btn) { display: none; }
h1, h2, h3, h4, p, figure, ul, ol, dl { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
button { font: inherit; color: inherit; cursor: pointer; }
a, button { transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.container, .topbar-inner { width: min(100%, 1080px); margin-inline: auto; padding-inline: 16px; }
.section, .hero { padding-block: clamp(3rem, 8vw, 6rem); }
.section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 32px; }
.section-title, .project-title, .display { font-family: var(--display-font); font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.display { font-size: clamp(2.4rem, 1.6rem + 3.5vw, 4.4rem); line-height: 1.05; margin-block: 24px; }
.section-title { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.2rem); line-height: 1.25; }
.project-title { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); line-height: 1.3; margin-block: 12px; }
.section-note { color: var(--muted); max-width: 70ch; margin-top: 12px; }
.mono, .receipt, .evidence, .chips, code, .footer-stamp { font-family: var(--mono-font); font-size: clamp(.8125rem, .78rem + .15vw, .875rem); }
code { overflow-wrap: anywhere; }
.eyebrow { color: var(--muted); font-size: .875rem; }
.skip { position: fixed; top: 8px; left: 16px; z-index: 30; padding: 12px 16px; background: var(--surface); border-radius: 10px; transform: translateY(-150%); }
.skip:focus { transform: translateY(0); }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 16px; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; width: fit-content; color: var(--ink); text-decoration: none; font-weight: 600; }
.brand-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.menu { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 8px; list-style: none; overflow-x: auto; padding: 4px; margin-inline: -4px; }
.menu a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding-inline: 12px; color: var(--muted); text-decoration: none; white-space: nowrap; border-radius: 10px; }
@media (max-width: 719px) { .menu { gap: 0; } .menu a { padding-inline: 8px; font-size: .9375rem; } }
.menu a:hover { color: var(--accent); background: var(--bg); }
.lang { display: flex; border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.lang-btn { min-width: 44px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.lang-btn[aria-pressed="true"] { color: var(--accent); background: var(--bg); font-weight: 600; }
.hero { display: grid; gap: 32px; }
.hero-copy { min-width: 0; }
.lede { max-width: 70ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 600; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--button-ink); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-ghost { background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); }
.hero-media { grid-row: 3; min-width: 0; }
.hero-media img { width: 100%; aspect-ratio: 4 / 5; max-height: 360px; object-fit: cover; border-radius: 10px; }
.receipt { min-width: 0; padding: 24px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.receipt-cmd { font-weight: 500; margin-bottom: 20px; }
.prompt { color: var(--muted); }
.receipt-lines { list-style: none; display: grid; gap: 16px; padding: 0; }
.rc-line { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 0 12px; align-items: baseline; }
.rc-mark { grid-column: 1; grid-row: 1 / 3; color: var(--accent); }
.rc-mark::before { content: "✓"; font-weight: 500; }
.rc-line[data-state="pending"] .rc-mark { color: var(--accent-2); }
.rc-line[data-state="pending"] .rc-mark::before { content: "✎"; }
.rc-line a { color: var(--ink); text-decoration-color: var(--line); width: fit-content; }
.rc-line a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.rc-meta { grid-column: 2; color: var(--muted); overflow-wrap: anywhere; }
.receipt-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
time[datetime=""] { color: var(--accent-2); }
.project { display: grid; gap: 32px; padding: 24px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 1px 2px rgb(23 27 34 / .06); transition: border-color 180ms ease; }
.project:hover { border-color: var(--accent); }
.project-side, .project-body { min-width: 0; }
.project-tag { color: var(--muted); }
.evidence { list-style: none; padding: 0; display: grid; gap: 4px; margin-top: 20px; }
.evidence a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.evidence-note { color: var(--muted); }
.app-badge { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.app-badge img { flex: none; width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF; }
.app-name { display: block; font-family: var(--body-font); font-weight: 600; color: var(--ink); }
.project-mascot { display: none; max-width: 120px; margin-top: 24px; }
.project-desc { max-width: 70ch; font-size: 1.0625rem; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin-top: 24px; }
.chips li { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; overflow-wrap: anywhere; max-width: 100%; }
.more { margin-top: 48px; }
.more-title, .sub-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 24px; }
.more-list { padding: 0; list-style: none; }
.more-list > li { display: grid; gap: 8px; padding-block: 24px; border-bottom: 1px solid var(--line); }
.more-name { font-weight: 600; }
.more-desc { color: var(--muted); max-width: 70ch; }
.more-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.more-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
/* Icon links can wrap (the NT paper title does), so the icon sits on the first line and the
   padding, not centring, makes a one-line row 44px tall. */
.evidence a, .more-links a, .activity-list a { align-items: flex-start; padding-block: calc((44px - 1lh) / 2); }
.evidence a .icon, .more-links a .icon, .activity-list a .icon { margin-top: calc((1lh - 16px) / 2); }
/* A mouse does not need 44px rows. Any touch input, even beside a trackpad, keeps them. */
@media (pointer: fine) and (not (any-pointer: coarse)) {
  .evidence a, .more-links a { min-height: 32px; padding-block: calc((32px - 1lh) / 2); }
}
/* Work categories: the tabs are plain jump links; script.js turns them into one-group-at-a-time tabs. */
.work-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.work-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-weight: 600; text-decoration: none; }
.work-tabs a:hover { border-color: var(--accent); }
.work-tabs a[aria-current="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.work-group + .work-group { margin-top: 72px; }
.work-group-head { margin-bottom: 24px; }
.work-group-title { font-family: var(--display-font); font-size: clamp(1.35rem, 1.15rem + .9vw, 1.8rem); font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.work-group-note { max-width: 70ch; margin-top: 8px; color: var(--muted); }
/* Skill groups differ in length (3 to 9 lines), so they flow in columns instead of a grid
   of equal cells; five narrow cells used to break words such as "sentence-transformers". */
.skills-grid { columns: 3 260px; column-gap: 24px; }
.skill-group { break-inside: avoid; margin-bottom: 24px; }
.skill-group h3 { font-size: 1rem; margin-bottom: 16px; }
.skill-group ul { padding-left: 20px; color: var(--muted); }
.skill-group li { margin-bottom: 8px; overflow-wrap: break-word; }
.dim { color: var(--muted); }
.about-grid { display: grid; gap: 32px; }
.about-copy p { max-width: 70ch; margin-bottom: 16px; }
.facts { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 24px; }
.facts dt { font-size: .875rem; color: var(--muted); }
.facts dd { margin: 4px 0 20px; }
.facts dd:last-child { margin-bottom: 0; }
/* The publication title wraps, so its icon sits on the first line instead of the middle. */
.facts a { display: inline-flex; align-items: flex-start; gap: 8px; }
.facts a .icon { margin-top: calc((1lh - 16px) / 2); }
.sub-title { margin-top: 48px; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 24px; list-style: none; padding: 0; }
.cert { display: block; width: 100%; min-height: 44px; text-align: left; background: transparent; border: 0; padding: 0; border-radius: 6px; }
.cert img { width: 100%; height: auto; aspect-ratio: 900 / 731; object-fit: contain; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; transition: border-color 180ms ease; }
.cert:hover img { border-color: var(--accent); }
.cert-cap { display: block; margin-top: 12px; color: var(--muted); font-size: .875rem; }
.activity-list { padding-left: 20px; margin-top: 32px; color: var(--muted); }
.activity-list li { margin-block: 8px; }
.activity-list a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.contact-list { list-style: none; padding: 0; }
.contact-list li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.contact-k { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.contact-list a { min-height: 44px; display: flex; align-items: center; width: fit-content; max-width: 100%; }
.footer { padding-block: 32px; color: var(--muted); border-top: 1px solid var(--line); }
.footer p + p { margin-top: 8px; }
.lightbox { border: 0; border-radius: 10px; padding: 16px; background: var(--surface); max-width: 98vw; max-height: 98vh; overscroll-behavior: contain; }
.lightbox::backdrop { background: rgb(23 27 34 / .8); }
.lightbox-bar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.lightbox-close { min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.lightbox-close:hover { border-color: var(--accent); }
.lightbox img { max-width: min(96vw, 1200px); max-height: calc(98vh - 110px); width: auto; height: auto; object-fit: contain; margin-inline: auto; }
@media (min-width: 720px) {
  .container, .topbar-inner { padding-inline: 32px; }
  .receipt { padding: 32px; }
  .rc-line { grid-template-columns: 20px 17ch minmax(0, 1fr); }
  .rc-mark { grid-row: 1; }
  .rc-meta { grid-column: 3; }
  .project { padding: 32px; }
  .contact-list li { grid-template-columns: 15ch minmax(0, 1fr); align-items: center; }
}
@media (min-width: 900px) {
  html { scroll-padding-top: 96px; }
  .topbar-inner { grid-template-columns: 1fr auto auto; gap: 32px; }
  .menu { grid-column: 2; grid-row: 1; }
  .hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: center; }
  .hero-media { grid-row: 1; grid-column: 2; }
  .hero-media img { max-height: none; }
  .receipt { grid-column: 1 / -1; }
  .project { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  .project-mascot { display: block; }
  .more-list > li { grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr); gap: 24px; }
  .about-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; }
  .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none; animation: none; scroll-behavior: auto; }
}
@media print {
  html[data-theme] { color-scheme: light; --bg: #F5F6F8; --surface: #FFFFFF; --ink: #171B22; --muted: #5C6572; --line: #DCE0E6; --accent: #1450B8; --accent-2: #B7791F; --button-ink: #FFFFFF; }
  .topbar, .lightbox, .skip, .work-tabs { display: none; }
  body { background: var(--surface); }
  .hero, .section { padding-block: 24px; }
  .project, .receipt { break-inside: avoid; box-shadow: none; }
  *, *::before, *::after { animation: none; transition: none; }
  .rc-line[data-state="pending"] .rc-mark { color: var(--accent); }
  .rc-line[data-state="pending"] .rc-mark::before { content: "✓"; }
}
.timeline { list-style: none; padding: 0; display: grid; gap: 32px; }
.role { display: grid; gap: 8px; }
.role-when { color: var(--muted); }
.role-body { min-width: 0; }
.role-title { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.role-org { color: var(--muted); margin-bottom: 12px; }
.role-body ul { padding-left: 20px; max-width: 70ch; }
.role-body li { margin-bottom: 8px; overflow-wrap: anywhere; }
@media (min-width: 720px) {
  .role { grid-template-columns: 18ch minmax(0, 1fr); gap: 24px; }
  .role-when { padding-top: 4px; }
}

/* Motion and reading cues: progressively enhanced, with visible static content. */
.topbar::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--accent); transform: scaleX(var(--read-progress, 0)); transform-origin: left; pointer-events: none; }
.topbar.is-scrolled { box-shadow: 0 4px 20px rgb(0 0 0 / .06); }
.menu a[aria-current="location"] { color: var(--accent); background: var(--bg); box-shadow: inset 0 -2px var(--accent); }
.hero { position: relative; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 16px 16px auto; height: min(460px, 70%); z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 80% 35%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 65%); }
.receipt { border-top: 3px solid var(--accent); }
.project { position: relative; }
.project:focus-within { border-color: var(--accent); }
.section-title::after { content: ""; display: block; width: 32px; height: 3px; margin-top: 16px; border-radius: 2px; background: var(--accent); }
.skill-group { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.theme-btn svg { transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn, .theme-btn, .lang-btn { transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease; }
  .btn:active, .theme-btn:active, .lang-btn:active { transform: translateY(2px); }
  .project, .skill-group { transition: border-color 220ms ease, box-shadow 220ms ease; }
  .theme-btn svg { animation: theme-turn 260ms ease-out; }
  .lightbox[open] { animation: dialog-enter 220ms ease-out; }
  @keyframes theme-turn { from { transform: rotate(-35deg); opacity: .5; } to { transform: rotate(0); opacity: 1; } }
  @keyframes dialog-enter { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
}
@media (hover: hover) and (pointer: fine) {
  .project:hover, .skill-group:hover { border-color: var(--accent); box-shadow: 0 8px 28px rgb(0 0 0 / .07); }
  .evidence a:hover, .more-links a:hover { text-decoration-thickness: 2px; }
}
@media print {
  .hero::before, .section-title::after { display: none; }
  .skill-group { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  :root :where(*, *::before, *::after) { transition: none; animation: none; }
}

/* ==========================================================================
   Persona console (redesign 2026-11-08). An original layer inspired by the
   menus of Persona 3 Reload: black and white, slanted plates, and one
   travelling selection cursor in the only colour, blue. It is not a copy of the game's
   art, fonts or branding. script.js turns it on; without JavaScript, and in
   print, the page stays the plain document styled above.
   Formal by design: every reading surface is upright 17-18px text on paper,
   and the slant lives only in titles, plates and motion.
   ========================================================================== */
body[data-screen] {
  /* Black and white (owner, 2026-11-08: "more black and white, it is too blue now").
     Blue is kept for one meaning only: what is selected or current. */
  --persona-ink: #0b0d12;
  --persona-graphite: #1d2029;
  --persona-steel: #6b7280;
  --persona-silver: #c3c8d0;
  --persona-paper: #f5f6f8;
  --persona-mist: #e7e9ed;
  --persona-card: #ffffff;
  --persona-blue: #1b63d6;
  --persona-line: rgb(11 13 18 / .16);
  /* Secondary text on black: 12:1. */
  --persona-on-ink: #c3c8d0;
  --skew: -14deg;
  --topbar-h: 68px;
  --screen-pad-top: 92px;
  --nav-h: 0px;
  --bg: #0b0d12;
  --surface: #f5f6f8;
  --ink: #111318;
  --muted: #4f5560;
  --line: rgb(11 13 18 / .2);
  --accent: #1450b8;
  --accent-2: #0e6a8a;
  --focus: #ffffff;
  --button-ink: #0b0d12;
  /* What the inner screens' content is drawn with. In light, black on paper; the dark theme
     below swaps them, so a card border, a title or an inverted plate keeps its role. */
  --content-ink: var(--persona-ink);
  --content-paper: var(--persona-paper);
  --content-mist: var(--persona-mist);
  --content-shadow: rgb(11 13 18 / .14);
  --chip-line: rgb(11 13 18 / .22);
  --band-stripe: var(--persona-ink);
  background: var(--bg);
}
/* Dark theme: the inner screens are dark too (owner, 2026-11-08: "dark mode should be dark
   everywhere, the background is still white"). Screen only, so print stays black on white. */
@media screen {
  html[data-theme="dark"] body[data-screen] {
    --surface: #13161d;
    --persona-card: #1b1f27;
    --ink: #e8eaee;
    --muted: #a9afba;
    --line: rgb(255 255 255 / .16);
    --persona-line: rgb(255 255 255 / .14);
    --accent: #8ab4ff;
    --accent-2: #7cc8e0;
    --content-ink: #e8eaee;
    --content-paper: #13161d;
    --content-mist: #2a2f39;
    --content-shadow: rgb(255 255 255 / .1);
    --chip-line: rgb(255 255 255 / .18);
    --band-stripe: var(--persona-silver);
  }
}
html[data-theme="light"] body[data-screen] {
  --bg: #eceef1;
  --surface: #ffffff;
  --persona-card: #ffffff;
  --ink: #111318;
  --muted: #4c525d;
  --line: rgb(11 13 18 / .18);
  --accent: #134aa8;
  --accent-2: #0b5f7c;
  --focus: #0f3f94;
  --button-ink: #ffffff;
}

.persona-menu,
.persona-back,
.key-hints { display: none; }

body.persona-mode { height: 100svh; overflow: hidden; }
body.persona-mode .skip { background: var(--persona-paper); color: var(--persona-ink); border-radius: 0; }

/* ---------- Topbar: floating on the home screen, a navy band everywhere else ---------- */
body.persona-mode .topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: var(--topbar-h);
  background: transparent;
  border: 0;
  pointer-events: none;
  box-shadow: none;
}
body.persona-mode:not([data-screen="home"]) .topbar { --focus: var(--persona-paper); }
/* The black band is a layer of its own, so a screen change can clip it along the sweep
   (script.js sets --bar-clip). */
body.persona-mode .topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  display: none;
  background: var(--persona-ink);
  box-shadow: inset 0 -1px 0 rgb(255 255 255 / .16);
  clip-path: var(--bar-clip, none);
}
body.persona-mode:is(:not([data-screen="home"]), .is-sweeping) .topbar::before { display: block; }
body.persona-mode .topbar::after { display: none; }
body.persona-mode .topbar-inner {
  width: 100%;
  height: 100%;
  padding: 10px clamp(16px, 3vw, 44px);
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
}
body.persona-mode .brand,
body.persona-mode .persona-back,
body.persona-mode .topbar-controls,
body.persona-mode .menu { pointer-events: auto; }
body.persona-mode .brand {
  grid-column: 1;
  grid-row: 1;
  min-width: 44px;
  gap: 8px;
  color: var(--persona-paper);
  font-family: var(--display-font);
  font-size: .9375rem;
}
/* The name sits on the blue corner on wide screens but can overhang it on narrow or
   short ones, so it carries its own navy plate instead of relying on what is behind it. */
body.persona-mode .brand-name { padding: 4px 8px; color: var(--persona-paper); background: var(--persona-ink); }
body.persona-mode .brand-mark {
  width: 13px;
  height: 13px;
  border-radius: 0;
  background: var(--persona-paper);
  transform: rotate(45deg);
}
/* On a screen the corner holds the way back instead of the brand: both go to #top, and a
   labelled button says so where the diamond alone does not. */
body.persona-mode:not([data-screen="home"]) .brand { display: none; }
body.persona-mode .persona-back {
  --focus: var(--persona-paper);
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 16px 8px 12px;
  color: var(--persona-paper);
  background: transparent;
  border: 2px solid var(--persona-paper);
  font: 600 1rem/1.2 var(--body-font);
  text-decoration: none;
  white-space: nowrap;
}
body.persona-mode:not([data-screen="home"]) .persona-back { display: inline-flex; }
/* During a sweep between home and a screen both topbar states are shown, and script.js
   clips each to its side of the line. */
body.persona-mode.is-sweeping .brand,
body.persona-mode.is-sweeping .persona-back { display: inline-flex; }
body.persona-mode .persona-back:hover { color: var(--persona-ink); background: var(--persona-paper); }
@media (pointer: fine) and (not (any-pointer: coarse)) and (min-width: 480px) {
  body.persona-mode .persona-back::after {
    content: "Esc";
    content: "Esc" / "";
    margin-left: 4px;
    padding: 0 6px;
    border: 1px solid currentColor;
    font: 500 .75rem/1.5 var(--mono-font);
    opacity: .85;
  }
}
body.persona-mode .topbar-controls { grid-column: 3; gap: 8px; }
body.persona-mode .theme-btn,
body.persona-mode .lang {
  min-height: 44px;
  background: var(--persona-paper);
  border: 2px solid var(--persona-ink);
  border-radius: 0;
}
body.persona-mode .theme-btn { min-width: 44px; padding: 8px; color: var(--persona-ink); }
body.persona-mode .lang { padding: 0; }
body.persona-mode .lang-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 0;
  color: var(--persona-ink);
}
/* The selected language needs 3:1 against the paper button beside it and must not vanish
   into the dark home: navy vanished, aqua is 1.6:1 on paper, blue is 5.1:1. */
body.persona-mode .lang-btn[aria-pressed="true"] {
  background: var(--persona-blue);
  color: var(--persona-paper);
}

/* "Page checked" date plate, built by script.js from the stamp that npm run check writes. */
.calendar { display: none; }
body.persona-mode .calendar {
  position: relative;
  z-index: 0;
  flex-direction: column;
  align-items: flex-end;
  margin-right: 12px;
  padding: 3px 16px 4px 18px;
  color: var(--persona-ink);
  line-height: 1.15;
  white-space: nowrap;
}
body.persona-mode .calendar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--persona-paper);
  box-shadow: 4px 4px 0 var(--persona-steel);
  transform: skewX(var(--skew));
}
/* Fixed grey, not --muted: the plate stays paper while the dark theme lightens --muted. 7:1. */
body.persona-mode .cal-label { color: #4f5560; font: 500 .75rem/1.3 var(--body-font); }
body.persona-mode .cal-date { font: italic 600 1.125rem/1.15 var(--display-font); letter-spacing: -.01em; }
@media (min-width: 900px) {
  body.persona-mode:is([data-screen="home"], .is-sweeping) .calendar { display: flex; }
  /* During a sweep the plate is out of the flow, where it sits on home (8px gap + its 12px
     margin), so the controls column keeps its screen width and the centred tabs stay put. */
  body.persona-mode .topbar-controls { position: relative; }
  body.persona-mode.is-sweeping .calendar { position: absolute; top: 50%; right: calc(100% + 8px); translate: 0 -50%; }
}

/* ---------- Section navigation: hidden on the home menu, always there on a screen ---------- */
body.persona-mode .menu { display: none; }
body.persona-mode .menu a { color: var(--persona-on-ink); text-decoration: none; border-radius: 0; }
body.persona-mode .menu a:hover { color: var(--persona-paper); background: none; }
@media (min-width: 1024px) {
  body.persona-mode:is(:not([data-screen="home"]), .is-sweeping) .menu {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  body.persona-mode .menu a {
    position: relative;
    z-index: 0;
    gap: 8px;
    min-height: 44px;
    padding: 8px 16px;
    font: 600 .9375rem/1.2 var(--body-font);
  }
  body.persona-mode .menu a::before {
    content: "";
    position: absolute;
    inset: 4px 0;
    z-index: -1;
    transform: skewX(var(--skew));
  }
  body.persona-mode .menu a:hover::before { background: rgb(255 255 255 / .14); }
  body.persona-mode .menu a[aria-current="page"] { color: var(--persona-paper); box-shadow: none; background: none; }
  body.persona-mode .menu a[aria-current="page"]::before { background: var(--persona-blue); }
}
/* Phones and tablets: a bottom bar with icon and label, where thumbs and older eyes look for it. */
@media (max-width: 1023px) {
  body.persona-mode:not([data-screen="home"]) { --nav-h: calc(64px + env(safe-area-inset-bottom)); }
  body.persona-mode:is(:not([data-screen="home"]), .is-sweeping) .menu {
    position: fixed;
    inset: auto 0 0;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    /* Not var(--nav-h): that is 0 on home, and the bar still shows during a sweep to home. */
    height: calc(64px + env(safe-area-inset-bottom));
    margin: 0;
    padding: 0 0 env(safe-area-inset-bottom);
    overflow: visible;
    background: var(--persona-ink);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .16);
  }
  body.persona-mode .menu a {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    height: 100%;
    min-height: 64px;
    padding: 6px 2px;
    font: 600 .8125rem/1.15 var(--body-font);
    text-align: center;
    /* One line always. The longest labels (Experience, ประสบการณ์) are 67-70px against a 64px
       column at 320px; centred, they spill a few px into the short labels' empty sides. */
    align-items: center;
    white-space: nowrap;
    overflow-wrap: normal;
  }
  body.persona-mode .menu .icon { width: 22px; height: 22px; }
  body.persona-mode .menu a[aria-current="page"] {
    color: var(--persona-paper);
    background: rgb(255 255 255 / .08);
    box-shadow: inset 0 3px 0 var(--persona-blue);
  }
}

/* ---------- Screens ---------- */
body.persona-mode main { height: 100svh; min-height: 0; padding: 0; }
body.persona-mode .screen {
  display: none;
  width: 100%;
  height: 100svh;
  min-height: 0;
  margin: 0;
  /* Content stops widening at about 1240px so lines stay readable on big monitors. */
  --screen-gutter: max(clamp(16px, 5vw, 80px), calc((100vw - 1240px) / 2));
  padding: var(--screen-pad-top) var(--screen-gutter) calc(40px + var(--nav-h));
  border: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--persona-steel) transparent;
  scrollbar-width: thin;
}
body.persona-mode .screen.active,
body.persona-mode .screen.is-leaving { display: block; }
/* Screen change (script.js): the old screen stays underneath, fixed where it was, while the
   new one is revealed over it along the sweep. "main >" outranks the home screen's own
   position: relative. */
body.persona-mode main > .screen.is-leaving { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
body.persona-mode main > .screen.is-entering { z-index: 1; }

/* ---------- Home: the pause menu ---------- */
body.persona-mode .hero:is(.active, .is-leaving) {
  display: grid;
  width: 100%;
  max-width: none;
  --screen-gutter: clamp(16px, 5vw, 80px);
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .75fr);
  grid-template-rows: minmax(min-content, 1fr) auto;
  gap: 16px clamp(24px, 5vw, 80px);
  align-items: center;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(133deg, var(--persona-graphite) 0 10.4%, var(--persona-paper) 10.4% 10.8%, transparent 10.8% 100%),
    linear-gradient(313deg, var(--persona-paper) 0 11%, var(--persona-steel) 11% 11.5%, transparent 11.5% 100%),
    linear-gradient(104deg, transparent 0 54%, rgb(255 255 255 / .035) 54% 66%, transparent 66% 100%),
    radial-gradient(80% 70% at 72% 0%, rgb(255 255 255 / .07), transparent 70%),
    linear-gradient(180deg, transparent 35%, rgb(29 32 41 / .8)),
    /* Opaque base: during a screen change the old screen sits right under this one. */
    var(--bg);
}
body.persona-mode .hero::before { display: none; }
/* Rising bubbles (script.js, desktop only): the sea under the menu. */
.bubbles { display: none; }
@media (min-width: 900px) {
  body.persona-mode .bubbles {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
}
body.persona-mode .hero-media::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -10% -16% -8% -14%;
  background: var(--persona-paper);
  clip-path: polygon(8% 0, 100% 6%, 94% 100%, 0 90%);
  transform: rotate(-4deg);
}
body.persona-mode .hero-copy { align-self: center; max-width: 720px; }
body.persona-mode .eyebrow {
  display: inline-block;
  padding: 4px 10px;
  color: var(--persona-ink);
  background: var(--persona-paper);
  font: 600 clamp(.8125rem, .74rem + .25vw, .9375rem)/1.4 var(--body-font);
  transform: rotate(-2deg);
}
body.persona-mode .display,
body.persona-mode .section-title,
body.persona-mode .project-title {
  font-family: var(--display-font);
  font-weight: 600;
}
/* The home name is the one place with a coloured offset shadow. */
body.persona-mode .display {
  max-width: 8ch;
  margin-block: 16px 12px;
  color: var(--persona-paper);
  font-size: clamp(3.45rem, min(6.7vw, 9svh), 7.5rem);
  font-style: italic;
  line-height: .86;
  letter-spacing: -.045em;
  text-shadow: 4px 4px 0 var(--persona-steel);
}
body.persona-mode .lede {
  max-width: 53ch;
  color: var(--persona-paper);
  font-size: clamp(.95rem, .88rem + .3vw, 1.13rem);
  line-height: 1.5;
  text-wrap: balance;
}
body.persona-mode .cta-row { margin-top: 20px; }
body.persona-mode .btn {
  min-height: 44px;
  padding: 8px 20px;
  border: 2px solid var(--persona-ink);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--persona-ink);
  font: 600 .9375rem/1.2 var(--body-font);
}
body.persona-mode .btn-primary { background: var(--persona-paper); color: var(--persona-ink); box-shadow: 4px 4px 0 var(--persona-steel); }
body.persona-mode .btn-ghost { background: transparent; color: var(--persona-paper); border-color: var(--persona-paper); box-shadow: none; }
body.persona-mode .btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--persona-ink); }

/* The menu steps down and to the right like a staircase; one cursor plate travels behind
   the selected item. Text keeps its colour on the cursor (white on blue 5.1:1 in the dark
   theme, black on pale blue 13:1 in the light one), so contrast holds whether selected or not. */
body.persona-mode .persona-menu {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 2px;
  width: min(100%, 560px);
  margin-top: clamp(24px, 4vh, 40px);
}
body.persona-mode .persona-menu a {
  position: relative;
  z-index: 1;
  display: block;
  width: fit-content;
  margin-left: calc(var(--step, 0) * 22px);
  padding: 2px 34px 4px 12px;
  color: var(--persona-paper);
  font-family: var(--display-font);
  font-size: clamp(1.55rem, min(3.7vw, 5svh), 3.25rem);
  font-style: italic;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1;
  text-decoration: none;
  text-shadow: 3px 3px 0 var(--persona-ink);
}
body.persona-mode .persona-menu a:nth-of-type(2) { --step: 1; }
body.persona-mode .persona-menu a:nth-of-type(3) { --step: 2; }
body.persona-mode .persona-menu a:nth-of-type(4) { --step: 3; }
body.persona-mode .persona-menu a:nth-of-type(5) { --step: 4; }
body.persona-mode .persona-menu a::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 8px;
  border: 8px solid transparent;
  border-left: 11px solid var(--persona-paper);
  border-right-width: 0;
  opacity: 0;
  transform: translate(-8px, -50%);
}
body.persona-mode .persona-menu a.is-selected::after { opacity: 1; transform: translate(0, -50%); }
body.persona-mode .menu-cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  transform-origin: 0 50%;
}
body.persona-mode .menu-cursor::before,
body.persona-mode .menu-cursor::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: skewX(var(--skew));
}
body.persona-mode .menu-cursor::before { background: var(--persona-blue); }
body.persona-mode .menu-cursor::after { z-index: -1; background: var(--persona-paper); translate: 10px 6px; }
body.persona-mode .hero-media {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  width: min(100%, 430px);
  justify-self: center;
  align-self: center;
  margin: 0;
  transform: rotate(3deg);
}
body.persona-mode .hero-media img {
  max-height: min(60svh, 620px);
  border: 6px solid var(--persona-ink);
  border-radius: 0;
  box-shadow: 12px 12px 0 var(--persona-steel);
  object-position: 52% 30%;
}
/* The receipt remains in the normal document and print view; the console home
   prioritizes showing every navigable section in its first frame. */
body.persona-mode .receipt { display: none; }
/* Keyboard prompts, only where a keyboard and a fine pointer are likely. */
@media (min-width: 900px) and (pointer: fine) {
  body.persona-mode .key-hints {
    display: block;
    position: absolute;
    right: var(--screen-gutter);
    bottom: 18px;
    padding: 6px 12px;
    color: var(--persona-paper);
    background: rgb(11 13 18 / .88);
    font: 500 .875rem/1.4 var(--body-font);
  }
}
body.persona-mode .key-hints kbd {
  display: inline-block;
  min-width: 24px;
  margin: 0 2px 0 6px;
  padding: 1px 6px;
  color: var(--persona-ink);
  background: var(--persona-paper);
  box-shadow: 0 2px 0 var(--persona-steel);
  font: 600 .75rem/1.4 var(--mono-font);
  text-align: center;
}
body.persona-mode .key-hints kbd:first-child { margin-left: 0; }

/* ---------- Inner screens: navy band on top, paper below ---------- */
body.persona-mode .section {
  --band-tail: 56px;
  position: relative;
  isolation: isolate;
  max-width: none;
  color: var(--ink);
  font-size: 1.0625rem;
  background:
    linear-gradient(316deg, var(--persona-ink) 0 4%, var(--persona-steel) 4% 4.5%, transparent 4.5% 100%),
    var(--surface);
}
/* Watermark: the screen's name, faint white on the band. */
body.persona-mode .section::before {
  content: attr(id);
  position: absolute;
  z-index: -1;
  right: clamp(18px, 4vw, 64px);
  top: 84px;
  color: rgb(255 255 255 / .07);
  font: italic 600 clamp(4rem, 13vw, 12rem)/.8 var(--display-font);
  letter-spacing: -.06em;
  text-transform: uppercase;
  pointer-events: none;
}
body.persona-mode .section-head { position: relative; max-width: none; margin-bottom: calc(var(--band-tail) + 28px); }
body.persona-mode .section-head::before,
body.persona-mode .section-head::after {
  content: "";
  position: absolute;
  z-index: -2;
  top: calc(-1 * var(--screen-pad-top));
  left: calc(-1 * var(--screen-gutter));
  right: calc(-1 * var(--screen-gutter));
  pointer-events: none;
}
/* The band reaches a little below the head, then ends on a slant, echoed by a thin black
   stripe just below it. */
body.persona-mode .section-head::before {
  bottom: calc(-1 * var(--band-tail));
  background:
    linear-gradient(136deg, var(--persona-steel) 0 6%, transparent 6% 100%),
    radial-gradient(70% 120% at 88% 0%, rgb(255 255 255 / .08), transparent 70%),
    linear-gradient(165deg, var(--persona-ink) 35%, var(--persona-graphite));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), 0 100%);
}
body.persona-mode .section-head::after {
  bottom: calc(-1 * var(--band-tail) - 12px);
  background: var(--band-stripe);
  clip-path: polygon(0 calc(100% - 4px), 100% calc(100% - 44px), 100% calc(100% - 40px), 0 100%);
}
body.persona-mode .section-title {
  width: fit-content;
  padding: 8px 18px 12px;
  color: var(--persona-ink);
  background: var(--persona-paper);
  box-shadow: 7px 7px 0 var(--persona-steel);
  font-size: clamp(2.4rem, 4.6vw, 4.6rem);
  font-style: italic;
  line-height: .95;
  letter-spacing: -.03em;
  /* Off so the title measures the same while script.js splits it into letters (each letter
     is its own box, so pairs cannot be kerned); with kerning the plate shrank 1-2px at the end. */
  font-kerning: none;
  transform: rotate(-1.5deg);
}
body.persona-mode .section-title::after { width: 64px; height: 4px; margin-top: 14px; border-radius: 0; background: var(--persona-ink); }
body.persona-mode .section-note { max-width: 60ch; margin-top: 22px; color: var(--persona-on-ink); font-size: 1.0625rem; font-weight: 500; }

/* ---------- Cards and lists ---------- */
body.persona-mode .project,
body.persona-mode .skill-group,
body.persona-mode .facts,
body.persona-mode .contact-list {
  background: var(--persona-card);
  border: 2px solid var(--content-ink);
  border-radius: 0;
  box-shadow: 6px 6px 0 var(--content-shadow);
}
body.persona-mode .project { gap: 28px; padding: clamp(20px, 3vw, 36px); margin-bottom: 28px; }
/* Black corner with a grey edge: the one ornament a card gets. */
body.persona-mode .project::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(225deg, var(--content-ink) 0 42%, var(--persona-steel) 42% 50%, transparent 50% 100%);
  pointer-events: none;
}
/* Cards are not links, so hover leaves them as they are; keyboard focus inside one marks it. */
body.persona-mode .project:hover,
body.persona-mode .skill-group:hover { border-color: var(--content-ink); box-shadow: 6px 6px 0 var(--content-shadow); }
body.persona-mode .project:focus-within { border-color: var(--accent); }
/* Card meta is quiet text, not a badge. */
body.persona-mode .project .eyebrow {
  display: block;
  padding: 0;
  color: var(--muted);
  background: none;
  font: 600 .9375rem/1.5 var(--body-font);
  transform: none;
}
body.persona-mode .project-title {
  margin-block: 10px 8px;
  color: var(--content-ink);
  font-size: clamp(1.4rem, 1.2rem + .8vw, 1.85rem);
  font-style: italic;
  line-height: 1.2;
  letter-spacing: -.01em;
}
body.persona-mode .project-tag { font-size: 1.0625rem; }
body.persona-mode .project-desc { color: var(--ink); font-size: 1.125rem; line-height: 1.75; }
body.persona-mode .evidence { gap: 10px; margin-top: 20px; font: 1rem/1.5 var(--body-font); }
body.persona-mode .evidence-note { font-size: .9375rem; }
body.persona-mode .app-name { font-size: 1.0625rem; }
/* Every evidence link is a plain button with an icon, so it reads as clickable without
   relying on colour or underline. */
body.persona-mode .evidence a,
body.persona-mode .more-links a {
  gap: 10px;
  width: fit-content;
  min-height: 44px;
  padding: calc((44px - 4px - 1lh) / 2) 16px;
  color: var(--content-ink);
  background: var(--content-paper);
  border: 2px solid var(--content-ink);
  box-shadow: 3px 3px 0 var(--content-shadow);
  font-weight: 600;
  text-decoration: none;
}
body.persona-mode .evidence a:hover,
body.persona-mode .more-links a:hover { color: var(--content-paper); background: var(--content-ink); }
body.persona-mode .chips { gap: 8px; margin-top: 24px; }
body.persona-mode .chips li {
  padding: 4px 10px;
  color: var(--ink);
  background: var(--content-mist);
  border: 1px solid var(--chip-line);
  border-radius: 0;
  font-size: .875rem;
}
body.persona-mode .more { margin-top: 56px; }
body.persona-mode .more-title,
body.persona-mode .sub-title {
  color: var(--content-ink);
  font: italic 600 clamp(1.4rem, 1.2rem + .8vw, 1.85rem)/1.25 var(--display-font);
  letter-spacing: -.01em;
}
body.persona-mode .more-list > li { gap: 10px; padding-block: 24px; border-bottom: 2px solid var(--persona-line); }
body.persona-mode .more-name { color: var(--content-ink); font: italic 600 1.1875rem/1.35 var(--display-font); }
body.persona-mode .more-name::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 14px;
  margin-right: 10px;
  background: var(--content-ink);
  transform: skewX(var(--skew));
}
body.persona-mode .more-desc { font-size: 1.0625rem; line-height: 1.7; }
body.persona-mode .more-links { gap: 10px; align-content: start; }
body.persona-mode .more-links .dim { font-size: .9375rem; }

/* Work categories: slanted tabs in a bar that sticks under the topbar and spans the
   screen's full width. Sticky offsets count from the screen's padding edge, so
   top = topbar height - screen padding-top. */
body.persona-mode .work-tabs {
  position: sticky;
  top: calc(var(--topbar-h) - var(--screen-pad-top));
  z-index: 5;
  gap: 12px;
  margin: 0 calc(-1 * var(--screen-gutter)) 32px;
  padding: 12px calc(var(--screen-gutter) + 6px);
  background: var(--surface);
  border-bottom: 2px solid var(--content-ink);
}
/* Once stuck, the bar also fills the strip under the topbar, so cards do not show
   through above it. script.js sets .is-stuck. */
body.persona-mode .work-tabs::before {
  content: "";
  position: absolute;
  inset: auto 0 100%;
  height: 120px;
  background: var(--surface);
  opacity: 0;
  pointer-events: none;
}
body.persona-mode .work-tabs.is-stuck::before { opacity: 1; }
body.persona-mode .work-tabs a {
  position: relative;
  z-index: 0;
  padding: 8px 20px;
  color: var(--content-ink);
  background: none;
  border: 0;
  border-radius: 0;
  font: italic 600 1.0625rem/1.1 var(--display-font);
}
body.persona-mode .work-tabs a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--content-mist);
  border: 2px solid var(--content-ink);
  transform: skewX(var(--skew));
}
body.persona-mode .work-tabs a:hover::before { background: color-mix(in srgb, var(--content-ink) 12%, var(--content-paper)); }
body.persona-mode .work-tabs a[aria-current="true"] { color: var(--content-paper); background: none; }
body.persona-mode .work-tabs a[aria-current="true"]::before { background: var(--content-ink); box-shadow: 4px 4px 0 var(--persona-blue); }
body.persona-mode .work-group-title {
  color: var(--content-ink);
  font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.25rem);
  font-style: italic;
}
body.persona-mode .work-group-note { color: var(--muted); font-size: 1.0625rem; font-weight: 500; }
body.persona-mode .work-group,
body.persona-mode .work-group .project { scroll-margin-top: 150px; }
@media screen {
  /* Tall enough that switching from a long, scrolled category to a short one can still put
     the new heading right under the stuck tab bar instead of clamping halfway. */
  body.persona-mode .work-group { min-height: calc(100svh - 160px); margin-top: 0; }
  body.persona-mode .work-group:not(.is-current) { display: none; }
}

/* Experience: the date sits on a slanted navy plate; the current role's plate is blue. */
body.persona-mode .timeline { gap: 0; }
body.persona-mode .role { padding: 28px 0; border-bottom: 2px solid var(--persona-line); }
body.persona-mode .role-when {
  position: relative;
  z-index: 0;
  align-self: start;
  width: fit-content;
  padding: 6px 16px;
  color: var(--content-paper);
  font: 600 .9375rem/1.4 var(--body-font);
}
body.persona-mode .role-when::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--content-ink);
  transform: skewX(var(--skew));
}
body.persona-mode .role:first-child .role-when { color: var(--persona-paper); }
body.persona-mode .role:first-child .role-when::before { background: var(--persona-blue); }
body.persona-mode .role-title {
  color: var(--content-ink);
  font: italic 600 clamp(1.35rem, 1.2rem + .6vw, 1.75rem)/1.25 var(--display-font);
}
body.persona-mode .role-org { color: var(--accent); font-size: 1.0625rem; font-weight: 600; }
body.persona-mode .role-body li { line-height: 1.7; }
/* The rail through the date plates (script.js draws it on arrival). Only where the plates
   form a column; under the plates (z -1 in the section's stacking context) and the content. */
.timeline-rail { display: none; }
@media screen and (min-width: 720px) {
  body.persona-mode .timeline { position: relative; }
  body.persona-mode .timeline-rail { display: block; position: absolute; z-index: -1; width: 4px; overflow: visible; pointer-events: none; }
  body.persona-mode .timeline-rail path { fill: none; stroke: var(--content-ink); stroke-width: 3; stroke-linecap: butt; }
}

/* Skills: each group is a panel with a navy header strip. */
body.persona-mode .skills-grid { columns: 3 280px; column-gap: 28px; }
body.persona-mode .skill-group { padding: 0 0 8px; margin-bottom: 28px; }
body.persona-mode .skill-group h3 {
  margin: 0 0 16px;
  padding: 10px 20px;
  color: var(--content-paper);
  background: var(--content-ink);
  font: italic 600 1.25rem/1.3 var(--display-font);
}
body.persona-mode .skill-group ul { padding: 0 20px 8px 40px; color: var(--ink); }
body.persona-mode .skill-group li::marker { color: var(--content-ink); }

/* About */
body.persona-mode .about-copy p { font-size: 1.125rem; line-height: 1.8; }
body.persona-mode .facts { padding: 24px 28px; }
body.persona-mode .facts dt { font-size: .9375rem; font-weight: 600; }
body.persona-mode .facts dd { color: var(--ink); }
body.persona-mode .sub-title { margin: 56px 0 24px; }
body.persona-mode .cert img { border: 2px solid var(--content-ink); border-radius: 0; }
body.persona-mode .cert:hover img { border-color: var(--accent); box-shadow: 4px 4px 0 var(--content-shadow); }
body.persona-mode .cert-cap { color: var(--ink); font-size: 1rem; }
body.persona-mode .activity-list { color: var(--ink); }

/* Contact: one panel; email first because it is the fastest way in. */
body.persona-mode .contact-list { width: min(100%, 800px); }
body.persona-mode .contact-list li { padding: 10px 24px; border-bottom: 1px solid var(--persona-line); }
body.persona-mode .contact-list li:last-child { border-bottom: 0; }
body.persona-mode .contact-list li:first-child { box-shadow: inset 6px 0 0 var(--content-ink); }
body.persona-mode .contact-k { font-weight: 600; }
body.persona-mode .contact-list a { color: var(--accent); font-size: 1.125rem; font-weight: 600; }
body.persona-mode .footer { display: none; }
body.persona-mode .lightbox { color: var(--ink); border-radius: 0; border: 3px solid var(--content-ink); box-shadow: 8px 8px 0 var(--content-shadow); }
body.persona-mode .lightbox-close { color: var(--ink); border: 2px solid var(--content-ink); border-radius: 0; font-weight: 600; }

/* Screen change: three slanted bands sweep across (script.js, anime.js). */
.wipe { display: none; }
body.persona-mode .wipe {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}
/* script.js moves each band with a transform, so the slant lives on its ::before. */
body.persona-mode .wipe i { position: absolute; top: -10%; bottom: -10%; left: 0; }
body.persona-mode .wipe i::before { content: ""; position: absolute; inset: 0; transform: skewX(-18deg); }
body.persona-mode .wipe i:nth-child(1) { width: 9vw; }
body.persona-mode .wipe i:nth-child(2) { width: 30vw; }
body.persona-mode .wipe i:nth-child(3) { width: 22vw; }
body.persona-mode .wipe i:nth-child(1)::before { background: var(--persona-paper); }
body.persona-mode .wipe i:nth-child(2)::before { background: var(--persona-steel); }
body.persona-mode .wipe i:nth-child(3)::before { background: var(--persona-ink); }

@media (min-width: 900px) {
  body.persona-mode .project { grid-template-columns: minmax(0, 3.4fr) minmax(0, 8.6fr); }
}
@media (max-width: 719px) {
  body[data-screen] { --topbar-h: 58px; --screen-pad-top: 78px; }
  body.persona-mode .topbar-inner { padding: 8px 12px; }
  body.persona-mode .brand-name { display: none; }
  body.persona-mode .lang-btn { font-size: .8125rem; }
  body.persona-mode .screen { --screen-gutter: 16px; }
  body.persona-mode .work-tabs { gap: 10px; }
  body.persona-mode .work-tabs a { padding: 8px 14px; font-size: 1rem; }
  body.persona-mode .hero:is(.active, .is-leaving) { display: block; overflow: hidden auto; }
  body.persona-mode .display { font-size: clamp(3.15rem, 16vw, 5.1rem); }
  body.persona-mode .persona-menu { margin-top: 24px; }
  body.persona-mode .persona-menu a { margin-left: calc(var(--step, 0) * 12px); font-size: clamp(1.7rem, 9.8vw, 2.7rem); }
  body.persona-mode .hero-media { width: min(72vw, 300px); margin: 28px auto 24px; transform: rotate(2deg); }
  body.persona-mode .hero-media img { max-height: none; }
  body.persona-mode .section::before { top: 96px; }
  body.persona-mode .section-title { font-size: clamp(2.2rem, 11vw, 3.4rem); }
  body.persona-mode .project { padding: 20px 18px; }
  body.persona-mode .contact-list li { padding-inline: 16px; }
}
/* Smallest phones: Main menu plus the theme and language controls need 8px back. */
@media (max-width: 379px) {
  body.persona-mode .topbar-inner { gap: 8px; }
  body.persona-mode .persona-back { gap: 8px; padding-inline: 10px 12px; }
}
@media print {
  body.persona-mode { height: auto; overflow: visible; }
  body.persona-mode .screen,
  body.persona-mode .screen.active { display: block; height: auto; overflow: visible; padding: 24px 16px; }
  body.persona-mode .hero.active { display: grid; }
  body.persona-mode .persona-menu,
  body.persona-mode .key-hints,
  body.persona-mode .wipe,
  body.persona-mode .bubbles,
  body.persona-mode .section::before,
  body.persona-mode .section-head::before,
  body.persona-mode .section-head::after { display: none; }
  body.persona-mode .display,
  body.persona-mode .lede { color: var(--persona-ink); text-shadow: none; }
  body.persona-mode .section-note { color: var(--muted); }
  body.persona-mode .footer { display: block; }
}

/* Readability: focus ring and light-theme home. Aqua is too faint on the paper
   screens, and paper text is invisible on the pale home in the light theme. */
body.persona-mode:not([data-screen="home"]) { --focus: var(--accent); }
html[data-theme="light"] body.persona-mode .brand,
html[data-theme="light"] body.persona-mode .display,
html[data-theme="light"] body.persona-mode .lede,
html[data-theme="light"] body.persona-mode .persona-menu a { color: var(--persona-ink); }
html[data-theme="light"] body.persona-mode .display { text-shadow: 4px 4px 0 var(--persona-silver); }
html[data-theme="light"] body.persona-mode .persona-menu a { text-shadow: 3px 3px 0 var(--persona-silver); }
html[data-theme="light"] body.persona-mode .hero .eyebrow { color: var(--persona-paper); background: var(--persona-ink); }
html[data-theme="light"] body.persona-mode .calendar { color: var(--persona-paper); }
html[data-theme="light"] body.persona-mode .calendar::before { background: var(--persona-ink); box-shadow: 4px 4px 0 var(--persona-silver); }
html[data-theme="light"] body.persona-mode .cal-label { color: var(--persona-on-ink); }
html[data-theme="light"] body.persona-mode .btn-primary { color: var(--persona-paper); background: var(--persona-ink); box-shadow: 4px 4px 0 var(--persona-silver); }
html[data-theme="light"] body.persona-mode .btn-ghost { color: var(--persona-ink); background: var(--persona-card); border-color: var(--persona-ink); box-shadow: 4px 4px 0 var(--persona-silver); }
html[data-theme="light"] body.persona-mode .persona-menu a::after { border-left-color: var(--persona-ink); }
html[data-theme="light"] body.persona-mode .menu-cursor::before { background: #c9dbf7; }
html[data-theme="light"] body.persona-mode .menu-cursor::after { background: var(--persona-ink); }
html[data-theme="light"] body.persona-mode .hero:is(.active, .is-leaving) {
  background:
    linear-gradient(133deg, var(--persona-ink) 0 10.4%, var(--persona-steel) 10.4% 10.8%, transparent 10.8% 100%),
    linear-gradient(313deg, var(--persona-ink) 0 11%, var(--persona-steel) 11% 11.5%, transparent 11.5% 100%),
    radial-gradient(80% 70% at 72% 0%, rgb(255 255 255 / .7), transparent 70%),
    var(--bg);
}

/* Motion: one load sequence and the screen sweep (script.js), one title entrance (below),
   and hover replies. Everything here lives under no-preference, so reduced motion needs
   no overrides. */
@media (prefers-reduced-motion: no-preference) {
  body.persona-mode .persona-menu a::after { transition: transform 160ms ease, opacity 160ms ease; }
  body.persona-mode .cert img { transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease; }
  body.persona-mode .brand-mark { transition: background-color 160ms ease; }
  body.persona-mode .persona-back,
  body.persona-mode .evidence a,
  body.persona-mode .more-links a { transition: color 160ms ease, background-color 160ms ease; }
  body.persona-mode .menu a::before,
  body.persona-mode .work-tabs a::before { transition: background-color 160ms ease; }
  body.persona-mode.is-transitioning .screen.active .section-title { animation: persona-title-in 520ms 120ms cubic-bezier(.22, 1, .36, 1) both; }
  body.persona-mode.is-transitioning .screen.active::before { animation: persona-mark-in 700ms 80ms ease-out both; }
  body.persona-mode.is-transitioning .screen.active .section-note { animation: persona-rise 440ms 220ms cubic-bezier(.22, 1, .36, 1) both; }
  @keyframes persona-title-in {
    from { opacity: 0; transform: translateX(-28px) rotate(-5deg); }
    to { opacity: 1; transform: translateX(0) rotate(-1.5deg); }
  }
  @keyframes persona-mark-in {
    from { opacity: 0; transform: translateX(64px); }
    to { opacity: 1; transform: translateX(0); }
  }
  @keyframes persona-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
@media (hover: hover) and (pointer: fine) {
  /* Only links and buttons answer hover; cards, the portrait and the chips are not interactive. */
  body.persona-mode .cert:hover img { transform: translate(-2px, -2px); }
  body.persona-mode .brand:hover .brand-mark { background: var(--persona-paper); }
}
@media (min-width: 900px) and (max-height: 860px) {
  /* Short laptop viewports: keep the whole menu in the first frame. */
  body.persona-mode .display { font-size: clamp(3rem, min(5.4vw, 8.5svh), 5.6rem); margin-block: 12px 10px; }
  body.persona-mode .lede { font-size: 1rem; }
  body.persona-mode .persona-menu { margin-top: 18px; }
  body.persona-mode .persona-menu a { font-size: clamp(1.4rem, min(2.9vw, 4.6svh), 2.5rem); }
  body.persona-mode .hero-media img { max-height: min(56svh, 520px); }
}
@media (min-width: 900px) and (max-height: 720px) {
  /* 13-inch laptops in a short browser window still expose every menu action. */
  body.persona-mode .screen-home { padding-top: 72px; padding-bottom: 16px; }
  body.persona-mode .display { font-size: 2.6rem; margin-block: 8px; }
  body.persona-mode .lede { font-size: .9rem; line-height: 1.42; }
  body.persona-mode .cta-row { margin-top: 12px; }
  body.persona-mode .persona-menu { gap: 0; margin-top: 12px; }
  body.persona-mode .persona-menu a { font-size: 1.65rem; line-height: .94; }
  body.persona-mode .hero-media img { max-height: min(50svh, 380px); }
  body.persona-mode .key-hints { display: none; }
}
/* The desktop home is a menu, not a reading surface. Detail screens retain
   their own vertical scroll containers; touch-sized layouts keep home scrollable. */
@media screen and (min-width: 900px) {
  body.persona-mode .screen-home { overflow: clip; }
}
