/* ------------------------------------------------------------------
   Jett Nguyen · portfolio
   Warm paper, one ink, one dried red. Instrument Serif for display,
   Instrument Sans for reading, Plex Mono only for dates and numbers.
   ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper:   #f3efe7;
  --paper-2: #eae5db;
  --paper-3: #e0dacd;
  --ink:     #1b1815;
  --ink-2:   #4a453f;
  --muted:   #7c756b;
  --rule:    rgba(27, 24, 21, 0.14);
  --rule-2:  rgba(27, 24, 21, 0.34);
  --accent:  #9a2f22;
  --accent-soft: rgba(154, 47, 34, 0.10);
  --c-cs: #3e4f9e; --c-pr: #b5533c; --c-other: #5f7a3a;
  --c-project: #5f7a3a; --c-presentation: #3e4f9e; --c-report: #c8901c; --c-homework: #b5533c;
  --foot-bg: #3b1b16; --foot-ink: #f3e9df; --foot-muted: #c4a59a; --foot-rule: rgba(243, 233, 223, 0.16); --foot-accent: #f0a48c;

  --serif: 'Instrument Serif', 'Iowan Old Style', 'Times New Roman', serif;
  --sans:  'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono:  'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --fs-display: clamp(2.75rem, 6.6vw, 6.25rem);
  --fs-h1:  clamp(2.5rem, 5.2vw, 4.75rem);
  --fs-h2:  clamp(1.9rem, 3.4vw, 2.9rem);
  --fs-h3:  clamp(1.35rem, 2vw, 1.75rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9rem;
  --fs-mono: 0.78rem;

  --ease: cubic-bezier(0.22, 0.75, 0.2, 1);
  --d-slow: 1.1s;
  --d: 0.6s;
  --d-fast: 0.22s;

  --gutter: clamp(20px, 4.5vw, 64px);
  --max: 1320px;
  --head-h: 64px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:   #161412;
    --paper-2: #1e1b18;
    --paper-3: #29251f;
    --ink:     #ece6da;
    --ink-2:   #bdb5a8;
    --muted:   #8b8478;
    --rule:    rgba(236, 230, 218, 0.14);
    --rule-2:  rgba(236, 230, 218, 0.34);
    --accent:  #d65a42;
    --accent-soft: rgba(214, 90, 66, 0.14);
    --c-cs: #8d9be6; --c-pr: #e8927a; --c-other: #9cb86f;
    --c-project: #9cb86f; --c-presentation: #8d9be6; --c-report: #e6b85a; --c-homework: #e8927a;
    --foot-bg: #24100d; --foot-ink: #ece0d6; --foot-muted: #a88a7f; --foot-rule: rgba(236, 224, 214, 0.14); --foot-accent: #f0a48c;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:   #161412;
  --paper-2: #1e1b18;
  --paper-3: #29251f;
  --ink:     #ece6da;
  --ink-2:   #bdb5a8;
  --muted:   #8b8478;
  --rule:    rgba(236, 230, 218, 0.14);
  --rule-2:  rgba(236, 230, 218, 0.34);
  --accent:  #d65a42;
  --accent-soft: rgba(214, 90, 66, 0.14);
  --c-cs: #8d9be6; --c-pr: #e8927a; --c-other: #9cb86f;
  --c-project: #9cb86f; --c-presentation: #8d9be6; --c-report: #e6b85a; --c-homework: #e8927a;
  --foot-bg: #24100d; --foot-ink: #ece0d6; --foot-muted: #a88a7f; --foot-rule: rgba(236, 224, 214, 0.14); --foot-accent: #f0a48c;
  color-scheme: dark;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: 'kern', 'liga', 'calt';
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; outline: none; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
em { font-style: italic; }
strong { font-weight: 600; }
::selection { background: var(--accent); color: var(--paper); }

/* ---------- utilities ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); font-size: var(--fs-mono); letter-spacing: 0.01em; color: var(--muted); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); font-weight: 400; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  padding: 8px 12px; background: var(--ink); color: var(--paper); border-radius: 4px;
}
.skip:focus { top: 12px; }

.arrow-link {
  display: inline-flex; align-items: baseline; gap: 0.4em;
  font-size: var(--fs-small); color: var(--ink);
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 1px;
  transition: border-color var(--d-fast), color var(--d-fast);
}
.arrow-link::after { content: '\2197'; font-family: var(--mono); font-size: 0.85em; transition: transform var(--d-fast) var(--ease); display: inline-block; }
.arrow-link:hover { border-color: var(--ink); color: var(--accent); }
.arrow-link:hover::after { transform: translate(2px, -2px); }

.text-link { border-bottom: 1px solid var(--rule-2); transition: border-color var(--d-fast), color var(--d-fast); }
.text-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--d-fast);
}
.site-head.scrolled { border-color: var(--rule); }
.site-head-row { height: var(--head-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.wordmark {
  font-family: var(--serif); font-size: 1.55rem; line-height: 1;
  letter-spacing: -0.01em;
  transition: color var(--d-fast);
}
.wordmark:hover { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); }
.site-nav a, .site-nav button {
  font-size: var(--fs-small); color: var(--ink-2);
  position: relative; padding: 4px 0;
  transition: color var(--d-fast);
}
.site-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--d-fast) var(--ease);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.theme-btn {
  display: grid; place-items: center; width: 34px; height: 34px; margin-right: -7px;
  color: var(--ink-2); border-radius: 50%;
  transition: color var(--d-fast), background-color var(--d-fast);
}
.theme-btn:hover { color: var(--ink); background: var(--paper-2); }
.theme-btn svg { width: 17px; height: 17px; display: block; transition: transform 0.55s var(--ease); }
.theme-btn circle { fill: none; stroke: currentColor; stroke-width: 1.3; }
.theme-btn path { fill: currentColor; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn svg { transform: rotate(180deg); } }
:root[data-theme="dark"] .theme-btn svg { transform: rotate(180deg); }

@media (width <= 640px) {
  .site-nav { gap: 13px; }
  .site-nav a, .site-nav button { font-size: 0.85rem; }
  .wordmark { font-size: 1.35rem; }
}

/* ---------- touch nav: a drum of words, the centred one selected ---------- */
.tnav { display: none; }

@media (hover: none) and (pointer: coarse) {
  .site-nav a { display: none; }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

  .tnav {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--paper) 84%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--rule);
  }
  /* the seat: a short rule marking the slot that counts as selected */
  .tnav::after {
    content: ''; position: absolute; left: 50%; bottom: calc(11px + env(safe-area-inset-bottom));
    width: 22px; height: 1px; background: var(--rule-2); transform: translateX(-50%);
  }
  .tnav-track {
    display: flex; align-items: center; gap: 4px;
    height: 84px; padding-inline: 42vw;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    perspective: 560px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .tnav-track::-webkit-scrollbar { display: none; }

  .tnav-item {
    flex: 0 0 auto; scroll-snap-align: center;
    padding: 8px 16px 16px;
    font-family: var(--serif); font-size: 1.5rem; line-height: 1;
    color: var(--ink-2); white-space: nowrap;
    transform: rotateY(calc(var(--d, 0) * -44deg)) translateZ(calc(var(--a, 0) * -30px)) scale(calc(1 - var(--a, 0) * 0.13));
    opacity: calc(1 - var(--a, 0) * 0.6);
    transition: color 0.25s var(--ease);
    will-change: transform, opacity;
  }
  .tnav-item.on { color: var(--accent); }
  .tnav-item .ext { font-family: var(--mono); font-size: 0.62em; vertical-align: 0.35em; margin-left: 0.25em; }
}

@media (hover: none) and (pointer: coarse) and (prefers-reduced-motion: reduce) {
  .tnav-track { perspective: none; }
  .tnav-item { transform: none; opacity: 1; }
}

/* ---------- section scaffolding ---------- */
.section { padding-block: clamp(56px, 9vw, 128px); }
.section + .section { padding-top: 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding-bottom: 20px; margin-bottom: clamp(28px, 4vw, 56px);
  border-bottom: 1px solid var(--rule);
}
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-h2); line-height: 1; letter-spacing: -0.01em; }
.section-head .aside { font-size: var(--fs-small); color: var(--muted); white-space: nowrap; }

.page-head { padding-block: clamp(40px, 7vw, 96px) clamp(28px, 4vw, 56px); }
.page-head h1 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-h1); line-height: 0.98; letter-spacing: -0.015em; }
.page-head .lede { max-width: 58ch; margin-top: 20px; color: var(--ink-2); font-size: 1.125rem; line-height: 1.55; }
.page-head .crumb { display: inline-block; margin-bottom: 22px; }

/* ---------- reveal on scroll ---------- */
[data-reveal] {
  opacity: 0; transform: translate3d(0, calc(18px + var(--py, 0px)), 0);
  transition: opacity 0.7s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
[data-reveal].in { opacity: 1; transform: translate3d(0, var(--py, 0px), 0); }
[data-reveal].settled { transition: none; }
[data-px]:not([data-reveal]) { transform: translate3d(var(--mx, 0px), calc(var(--py, 0px) + var(--my, 0px)), 0); will-change: transform; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 8vw, 112px) clamp(48px, 8vw, 112px); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(32px, 6vw, 96px); align-items: end;
}
.display {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--fs-display); line-height: 0.96; letter-spacing: -0.02em;
  text-wrap: balance;
}
.display em { color: var(--accent); }
.display .line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.display .line > span {
  display: block; transform: translateY(108%);
  transition: transform var(--d-slow) var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.hero.in .display .line > span { transform: none; }

.hero-intro {
  max-width: 54ch; margin-top: clamp(24px, 3vw, 40px);
  font-size: clamp(1.05rem, 1.35vw, 1.25rem); line-height: 1.55; color: var(--ink-2);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.8s var(--ease) 0.35s, transform 0.9s var(--ease) 0.35s;
}
.hero-facts {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  margin-top: clamp(24px, 3vw, 40px); padding-top: 18px;
  border-top: 1px solid var(--rule);
  opacity: 0; transition: opacity 0.8s var(--ease) 0.55s;
}
.hero-facts li { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); }
.hero.in .hero-intro, .hero.in .hero-facts { opacity: 1; transform: none; }

.hero-portrait { position: relative; }
.hero-portrait .frame { aspect-ratio: 1; border-radius: 50%; }
.hero-portrait img {
  width: 100%; height: 100%; object-fit: contain;
  transform: scale(1.045); opacity: 0;
  transition: transform 1.5s var(--ease) 0.1s, opacity 0.9s var(--ease) 0.1s;
}
.hero.in .hero-portrait img { transform: none; opacity: 1; }
.hero-portrait figcaption { margin-top: 14px; text-align: center; font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); }

@media (width <= 820px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-portrait { max-width: 56%; order: -1; }
}
@media (width <= 480px) {
  .hero-portrait { max-width: 72%; }
}

/* ---------- selected work (home) ---------- */
.work-list { display: grid; gap: clamp(48px, 7vw, 112px); }
.work-item { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(20px, 3vw, 48px); align-items: end; }
.work-item:nth-child(even) { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
.work-item:nth-child(even) .work-frame { order: 2; }

.work-frame {
  display: block; position: relative; overflow: hidden;
  aspect-ratio: 16 / 10;
  background: color-mix(in srgb, var(--tint, var(--paper-2)) 26%, var(--paper-2));
  border-radius: 4px;
  transition: background-color 0.5s var(--ease);
}
.work-frame:hover { background: color-mix(in srgb, var(--tint, var(--paper-2)) 40%, var(--paper-2)); }
.work-frame-inner {
  position: absolute; inset: 13% 6%;
  display: flex; justify-content: center; align-items: center; gap: 3%;
}
.work-frame-inner img {
  width: auto; height: auto; max-height: 100%;
  max-width: calc((100% - 3% * (var(--n, 1) - 1)) / var(--n, 1));
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.16));
}
.work-frame[data-kind="landscape"] .work-frame-inner img:not(:first-child) { display: none; }
.work-frame[data-kind="logo"] .work-frame-inner img { max-height: 40%; filter: none; }

.work-meta h3 { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-weight: 400; font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -0.01em; }
.work-logo { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.work-meta h3 a { transition: color var(--d-fast); }
.work-meta h3 a:hover { color: var(--accent); }
.work-meta p { margin-top: 10px; color: var(--ink-2); font-size: var(--fs-small); line-height: 1.55; max-width: 44ch; }
.work-meta .mono { display: block; margin-top: 14px; }

@media (width <= 820px) {
  .work-item, .work-item:nth-child(even) { grid-template-columns: 1fr; }
  .work-item:nth-child(even) .work-frame { order: 0; }
}

/* scroll-linked drift on work frames; the fallback is a static frame */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .work-frame-inner { animation: drift linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    @keyframes drift { from { transform: translateY(4%); } to { transform: translateY(-4%); } }
  }
}

/* ---------- pull quote ---------- */
.pull { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(24px, 4vw, 64px); align-items: end; }
.pull blockquote { font-family: var(--serif); font-size: clamp(1.5rem, 2.8vw, 2.4rem); line-height: 1.2; letter-spacing: -0.01em; text-wrap: pretty; }
.pull blockquote::before { content: '\201C'; color: var(--accent); }
.pull blockquote::after { content: '\201D'; color: var(--accent); }
.pull .pull-side { color: var(--ink-2); font-size: var(--fs-small); line-height: 1.6; }
.pull .pull-side .arrow-link { margin-top: 14px; }
@media (width <= 820px) { .pull { grid-template-columns: 1fr; } }

/* ---------- experience ---------- */
.xp { display: grid; }
.xp-row {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px;
  padding-block: 28px; border-top: 1px solid var(--rule);
}
.xp-row:last-child { border-bottom: 1px solid var(--rule); }
.xp-when { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); padding-top: 4px; display: grid; gap: 10px; justify-items: start; align-content: start; }
.xp-logo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
@media (width <= 640px) { .xp-when { grid-template-columns: auto 1fr; align-items: center; } }
.xp-role { font-family: var(--serif); font-size: 1.45rem; line-height: 1.15; }
.xp-org { color: var(--ink-2); margin-top: 4px; font-size: var(--fs-small); }
.xp-org a { border-bottom: 1px solid var(--rule-2); transition: color var(--d-fast); }
.xp-org a:hover { color: var(--accent); }
.xp-points { margin-top: 14px; display: grid; gap: 8px; max-width: 70ch; }
.xp-points li { position: relative; padding-left: 18px; font-size: var(--fs-small); color: var(--ink-2); line-height: 1.55; }
.xp-points li::before { content: ''; position: absolute; left: 0; top: 0.72em; width: 8px; height: 1px; background: var(--rule-2); }
.xp-points strong { color: var(--ink); font-weight: 500; }
.xp-points .spec { color: var(--ink); }
.xp-foot { margin-top: 24px; }
@media (width <= 640px) { .xp-row { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- footer ---------- */
.site-foot { margin-top: clamp(56px, 9vw, 128px); background: var(--foot-bg); color: var(--foot-ink); }
.site-foot ::selection { background: var(--foot-ink); color: var(--foot-bg); }
.foot-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 80px);
  padding-block: clamp(48px, 7vw, 96px) 40px;
}
.foot-kicker { font-family: var(--mono); font-size: var(--fs-mono); color: var(--foot-accent); }
.foot-big {
  display: inline-block; margin-top: 14px;
  font-family: var(--serif); font-size: clamp(1.6rem, 4vw, 3.4rem); line-height: 1.05; letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  border-bottom: 1px solid transparent; transition: color var(--d-fast), border-color var(--d-fast);
}
.foot-big:hover { color: var(--foot-accent); border-color: var(--foot-accent); }
.foot-avail { margin-top: 18px; max-width: 52ch; color: var(--foot-muted); font-size: var(--fs-small); line-height: 1.6; }

.foot-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.foot-links a { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--foot-rule); transition: color var(--d-fast); }
.foot-links a:hover { color: var(--foot-accent); }
.foot-links .l { font-size: var(--fs-small); }
.foot-links .h { font-family: var(--mono); font-size: var(--fs-mono); color: var(--foot-muted); }

.foot-now { margin-top: 32px; display: grid; gap: 8px; }
.foot-now div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; font-size: var(--fs-small); }
.foot-now dt { font-family: var(--mono); font-size: var(--fs-mono); color: var(--foot-muted); padding-top: 3px; }
.foot-now dd { color: var(--foot-ink); }

.foot-colophon {
  grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--foot-rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font-family: var(--mono); font-size: var(--fs-mono); color: var(--foot-muted);
}
@media (width <= 820px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- index (work page) ---------- */
.index { border-top: 1px solid var(--rule); }
.idx-head, .index-row a {
  display: grid; grid-template-columns: 44px minmax(0, 3fr) minmax(0, 5fr) minmax(0, 2fr) 64px;
  gap: 20px; align-items: center;
}
.idx-head { align-items: baseline; padding: 10px 0; font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); border-bottom: 1px solid var(--rule); }
.index-row { padding-inline: 14px; margin-inline: -14px; border-radius: 3px; transition: background-color 0.4s var(--ease); }
.index-row:hover { background: color-mix(in srgb, var(--tint, transparent) 14%, transparent); }
.index-row a { padding: 18px 0; border-bottom: 1px solid var(--rule); transition: color var(--d-fast); }
.index-row:hover .idx-title { color: var(--accent); }
.idx-n, .idx-year { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.idx-year { text-align: right; }
.idx-title { font-family: var(--serif); font-size: 1.45rem; line-height: 1.1; }
.idx-logo { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; display: inline-block; vertical-align: -12px; margin-right: 13px; }
.idx-sum { color: var(--ink-2); font-size: var(--fs-small); line-height: 1.5; }
.idx-type { font-size: var(--fs-small); color: var(--muted); }
.index-row .flag { font-family: var(--mono); font-size: var(--fs-mono); color: var(--accent); margin-left: 8px; }
@media (width <= 820px) {
  .idx-head { display: none; }
  .index-row a { grid-template-columns: 36px minmax(0, 1fr) 56px; grid-template-areas: 'n t y' 'n s s' 'n k k'; align-items: baseline; }
  .idx-n { grid-area: n; } .idx-title { grid-area: t; } .idx-year { grid-area: y; }
  .idx-sum { grid-area: s; margin-top: 6px; } .idx-type { grid-area: k; margin-top: 6px; }
}


/* ---------- résumé page ---------- */
.on-print { display: none; }

.resume-head { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(28px, 5vw, 72px); align-items: end; }
.resume-intro .lede { max-width: 50ch; }

.panel { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 6px; padding: 22px 24px; }
.resume-aside { display: grid; gap: 18px; align-content: start; }
.resume-contact { display: grid; }
.resume-contact li { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; padding-block: 9px; border-bottom: 1px solid var(--rule); font-size: var(--fs-small); }
.resume-contact li:last-child { border-bottom: 0; padding-bottom: 0; }
.resume-contact li:first-child { padding-top: 0; }
.resume-contact span { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); padding-top: 3px; }
.resume-contact a { overflow-wrap: anywhere; font-size: 0.83rem; color: var(--ink); transition: color var(--d-fast); }
.resume-contact a:hover { color: var(--accent); }
.resume-dl {
  display: block; text-align: center;
  font-family: var(--mono); font-size: var(--fs-mono); letter-spacing: 0.04em;
  padding: 12px 18px; border-radius: 3px;
  background: var(--accent); color: var(--paper);
  transition: filter var(--d-fast), transform var(--d-fast) var(--ease);
}
.resume-dl:hover { filter: brightness(1.12); transform: translateY(-1px); }

.resume-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(28px, 5vw, 72px); padding-bottom: clamp(60px, 9vw, 120px); }
.resume-main { display: grid; gap: clamp(44px, 6vw, 76px); align-content: start; }
.resume-side { display: grid; gap: 20px; align-content: start; }

.rs-h {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--serif); font-weight: 400; font-size: var(--fs-h3); line-height: 1;
  padding-bottom: 12px; border-bottom: 2px solid var(--accent); margin-bottom: 4px;
}
.rs-h span { font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); margin-left: auto; }
.rs-h span a { border-bottom: 1px solid var(--rule-2); transition: color var(--d-fast); }
.rs-h span a:hover { color: var(--accent); }
.panel .rs-h { font-size: 1.3rem; padding-bottom: 9px; border-bottom-width: 1px; border-color: var(--rule-2); }

.rs-item { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 18px; padding-block: 22px; border-bottom: 1px solid var(--rule); }
.rs-item:last-child { border-bottom: 0; padding-bottom: 4px; }
.rs-logo { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; margin-top: 3px; }
.rs-logo.blank { display: none; }
.rs-top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.rs-body h3 { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.15; }
.rs-body h3 a { transition: color var(--d-fast); }
.rs-body h3 a:hover { color: var(--accent); }
.rs-date {
  margin-left: auto; white-space: nowrap;
  font-family: var(--mono); font-size: var(--fs-mono); padding: 4px 9px; border-radius: 3px;
  background: color-mix(in srgb, var(--tint, var(--ink)) 13%, transparent);
  color: color-mix(in srgb, var(--tint, var(--ink)) 55%, var(--ink));
}
.rs-flag { font-family: var(--mono); font-size: var(--fs-mono); color: var(--accent); margin-left: 10px; vertical-align: 2px; }
.rs-org { color: var(--ink-2); margin-top: 5px; font-size: var(--fs-small); }
.rs-org a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.rs-org a:hover { border-bottom-color: var(--accent); }
.rs-points { margin-top: 13px; display: grid; gap: 8px; max-width: 66ch; }
.rs-points li { position: relative; padding-left: 20px; font-size: var(--fs-small); color: var(--ink-2); line-height: 1.55; }
.rs-points li::before {
  content: ''; position: absolute; left: 0; top: 0.62em; width: 9px; height: 2px; border-radius: 1px;
  background: color-mix(in srgb, var(--tint, var(--accent)) 70%, transparent);
}

.resume-side .rs-item { grid-template-columns: 38px minmax(0, 1fr); gap: 14px; padding-block: 0; border-bottom: 0; }
.resume-side .rs-logo { width: 38px; height: 38px; border-radius: 9px; margin-top: 2px; }
.resume-side .rs-body h3 { font-size: 1.08rem; line-height: 1.3; }
.resume-side .rs-body { display: grid; }
.resume-side .rs-top { display: contents; }
.resume-side .rs-body h3 { order: 1; }
.resume-side .rs-org { order: 2; }
.resume-side .rs-date { order: 3; justify-self: start; margin: 8px 0 0; }
.resume-side .rs-points { order: 4; }

.rs-skills { display: grid; }
.rs-skills div { padding-block: 10px; border-bottom: 1px solid var(--rule); }
.rs-skills div:last-child { border-bottom: 0; padding-bottom: 0; }
.rs-skills dt { font-family: var(--mono); font-size: var(--fs-mono); color: var(--accent); }
.rs-skills dd { margin-top: 4px; font-size: var(--fs-small); color: var(--ink-2); line-height: 1.5; }

.rs-act { padding-block: 13px; border-bottom: 1px solid var(--rule); }
.rs-act:last-of-type { border-bottom: 0; padding-bottom: 0; }
.rs-act-org { font-size: var(--fs-small); color: var(--ink); }
.rs-act-org span { display: block; font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); margin-top: 2px; }
.rs-act ul { margin-top: 9px; display: grid; gap: 9px; padding-left: 13px; border-left: 1px solid var(--rule-2); }
.rs-act li { display: grid; gap: 1px; font-size: var(--fs-small); }
.rs-act .t { color: var(--ink); }
.rs-act .m { font-family: var(--mono); font-size: var(--fs-mono); color: var(--accent); }
.rs-act .n { color: var(--muted); }

.rs-certs { display: grid; }
.rs-certs li { position: relative; padding: 9px 0 9px 20px; border-bottom: 1px solid var(--rule); font-size: var(--fs-small); color: var(--ink-2); }
.rs-certs li:last-child { border-bottom: 0; padding-bottom: 0; }
.rs-certs li::before { content: ''; position: absolute; left: 0; top: 1.15em; width: 9px; height: 2px; border-radius: 1px; background: color-mix(in srgb, var(--accent) 70%, transparent); }

@media (width <= 900px) {
  .resume-head, .resume-grid { grid-template-columns: minmax(0, 1fr); }
  .resume-head { gap: 30px; }
  .rs-item { grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
  .rs-logo { width: 40px; height: 40px; }
  .rs-date { margin-left: 0; }
}

/* ---------- print: this page is the PDF ---------- */
@media print {
  @page { size: letter; margin: 0.5in 0.52in; }
  /* beats both dark-theme selectors, so a printed page is always on paper */
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --paper: #fff; --paper-2: #fff; --paper-3: #fff;
    --ink: #16130f; --ink-2: #34302a; --muted: #6a655c;
    --rule: rgba(0,0,0,0.16); --rule-2: rgba(0,0,0,0.34); --accent: #8c2a1e;
    --fs-small: 8.9pt; --fs-mono: 7pt;
  }
  html, body { background: #fff; font-size: 10pt; }
  body { padding-bottom: 0; }
  .site-head, .site-foot, .tnav, .skip, .off-print, .lightbox { display: none !important; }
  .on-print { display: inline; }
  .wrap { max-width: none; padding-inline: 0; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .page-head { padding-block: 0 10px; }
  .page-head h1 { font-size: 24pt; line-height: 1; }
  .page-head .lede { margin-top: 6px; font-size: 9.2pt; line-height: 1.38; max-width: none; }
  .resume-head, .resume-grid { grid-template-columns: minmax(0, 1fr) 2.3in; gap: 0.28in; align-items: start; }
  .resume-grid { padding-bottom: 0; }
  .resume-main { gap: 16px; }
  .resume-side { gap: 12px; }
  .panel { background: none; border: 0; border-top: 1px solid var(--rule-2); border-radius: 0; padding: 0; padding-top: 8px; }
  .resume-head .panel { border-top: 0; padding-top: 0; }
  .resume-contact li { padding-block: 3px; gap: 8px; grid-template-columns: 48px minmax(0, 1fr); font-size: 7.8pt; }
  .rs-h { font-size: 13pt; padding-bottom: 4px; margin-bottom: 2px; border-bottom-width: 1.5px; }
  .panel .rs-h { font-size: 10.5pt; }
  .rs-item { padding-block: 8px; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; break-inside: avoid; }
  .rs-logo { width: 26px; height: 26px; border-radius: 5px; margin-top: 2px; }
  .rs-body h3 { font-size: 12.5pt; }
  .resume-side .rs-item { grid-template-columns: 22px minmax(0, 1fr); gap: 9px; }
  .resume-side .rs-logo { width: 22px; height: 22px; }
  .resume-side .rs-body h3 { font-size: 10.5pt; }
  .rs-date { padding: 1px 5px; }
  .rs-points { margin-top: 5px; gap: 3px; max-width: none; }
  .rs-points li { line-height: 1.38; padding-left: 15px; }
  .rs-skills div, .rs-certs li { padding-block: 4px; break-inside: avoid; }
  .rs-skills dd { line-height: 1.4; }
  .rs-act { padding-block: 6px; break-inside: avoid; }
  .rs-act ul { margin-top: 5px; gap: 5px; }
  a { color: inherit; }
  .rs-org a, .rs-skills dt, .rs-act .m { color: var(--accent); }
}

/* ---------- project page ---------- */
.proj-band { background: color-mix(in srgb, var(--tint, var(--paper-2)) 16%, var(--paper)); }
.proj-head { padding-block: clamp(32px, 6vw, 80px) clamp(24px, 4vw, 48px); }
.proj-head h1 img { width: 0.72em; height: 0.72em; border-radius: 0.16em; object-fit: cover; display: inline-block; vertical-align: -0.04em; margin-right: 0.22em; }
.proj-head h1 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-h1); line-height: 0.98; letter-spacing: -0.015em; }
.proj-head .status { display: inline-block; margin-left: 14px; font-family: var(--mono); font-size: var(--fs-mono); color: var(--accent); vertical-align: middle; }
.proj-summary { margin-top: 22px; max-width: 60ch; font-size: clamp(1.05rem, 1.35vw, 1.25rem); line-height: 1.55; color: var(--ink-2); }

.proj-meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 24px;
  padding-block: 22px; margin-top: 32px;
  border-top: 1px solid var(--rule);
}
.proj-meta dt { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); margin-bottom: 6px; }
.proj-meta dd { font-size: var(--fs-small); line-height: 1.5; }
.proj-meta dd a { border-bottom: 1px solid var(--rule-2); transition: color var(--d-fast); }
.proj-meta dd a:hover { color: var(--accent); }
.proj-meta .links { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.proj-meta .store-link { color: var(--accent); border-bottom-color: color-mix(in srgb, var(--accent) 40%, transparent); }
@media (width <= 720px) { .proj-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.proj-shots { display: grid; gap: 16px; margin-block: clamp(32px, 5vw, 64px); }
.proj-shots[data-n="1"] { grid-template-columns: 1fr; }
.proj-shots[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.proj-shots[data-n="3"], .proj-shots[data-n="4"] { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.proj-shot { background: color-mix(in srgb, var(--tint, var(--paper-2)) 22%, var(--paper-2)); border-radius: 4px; overflow: hidden; padding: 6%; cursor: zoom-in; }
.proj-shots[data-n="1"] .proj-shot { padding: 4%; }
.proj-shot img { width: 100%; height: auto; max-height: 72vh; object-fit: contain; margin: 0 auto; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.14)); }
.proj-shot figcaption { margin-top: 10px; font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); }
.proj-shot.first img { view-transition-name: work-image; }

.proj-body { display: grid; gap: clamp(28px, 4vw, 48px); max-width: 980px; margin-top: clamp(24px, 4vw, 48px); }
.proj-sec { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px; }
.proj-sec h2 { font-family: var(--mono); font-weight: 400; font-size: var(--fs-mono); color: var(--muted); padding-top: 6px; }
.proj-sec p { color: var(--ink-2); line-height: 1.65; max-width: 66ch; }
.proj-sec .poster { cursor: zoom-in; border-radius: 4px; overflow: hidden; background: var(--paper-2); }
@media (width <= 640px) { .proj-sec { grid-template-columns: 1fr; gap: 6px; } }

.embed { margin-top: 12px; }
.embed iframe { width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper-2); }
.embed .embed-bar { margin-top: 8px; display: flex; gap: 20px; }

.proj-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-top: clamp(48px, 7vw, 96px); padding-top: 24px; border-top: 1px solid var(--rule);
}
.proj-nav a { display: grid; gap: 4px; transition: color var(--d-fast); }
.proj-nav a:hover { color: var(--accent); }
.proj-nav a.next { text-align: right; }
.proj-nav .k { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); }
.proj-nav .t { font-family: var(--serif); font-size: 1.4rem; line-height: 1.1; }

/* study figure (Splitsy) */
.study { display: grid; gap: 12px; }
.study-chart { width: 100%; max-width: 420px; height: auto; font-family: var(--mono); font-size: 11px; }
.study-lbl { fill: var(--ink-2); }
.study-val { fill: var(--ink); }
.study-bar.manual { fill: var(--paper-3); }
.study-bar.splitsy { fill: var(--accent); }
.study-track { fill: var(--paper-3); }
.study-sd { stroke: var(--ink); stroke-width: 1; }
.study-mark { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 2; }
.study-note { font-size: var(--fs-mono); font-family: var(--mono); color: var(--muted); line-height: 1.5; }

/* ---------- about page ---------- */
.about-head { padding-bottom: clamp(30px, 4vw, 52px); }
.about-lede {
  font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2.15rem); line-height: 1.28;
  color: var(--ink); max-width: 38ch; margin-top: 22px;
}
.about-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 clamp(20px, 3vw, 44px); margin-top: clamp(34px, 4vw, 52px);
}
.about-facts li { display: grid; gap: 5px; align-content: start; padding-top: 12px; border-top: 1px solid var(--rule-2); font-size: var(--fs-small); line-height: 1.4; }
.about-facts span { font-family: var(--mono); font-size: var(--fs-mono); color: var(--accent); }
.about-facts a { border-bottom: 1px solid var(--rule-2); overflow-wrap: anywhere; transition: color var(--d-fast); }
.about-facts a:hover { color: var(--accent); }

.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-bio { display: grid; }
.bio-block { padding-block: clamp(24px, 3vw, 38px); border-top: 1px solid var(--rule); }
.bio-block:first-child { border-top: 0; padding-top: 0; }
.bio-block h2 {
  font-family: var(--mono); font-weight: 500; font-size: var(--fs-mono); letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 12px;
}
.bio-block p { color: var(--ink-2); line-height: 1.65; max-width: 60ch; font-size: 1.05rem; }
.bio-mark { color: var(--ink); font-weight: 500; }

.about-side { position: sticky; top: calc(var(--head-h) + 24px); display: grid; gap: 22px; }
.about-portrait .frame { aspect-ratio: 1; border-radius: 50%; }
.about-portrait img { width: 100%; height: 100%; object-fit: contain; }
.about-portrait figcaption { margin-top: 14px; text-align: center; font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); }
.now h2 { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; line-height: 1; padding-bottom: 10px; border-bottom: 1px solid var(--rule-2); }
.now dl { display: grid; }
.now div { padding-block: 11px; border-bottom: 1px solid var(--rule); }
.now div:last-child { border-bottom: 0; padding-bottom: 0; }
.now dt { font-family: var(--mono); font-size: var(--fs-mono); color: var(--accent); }
.now dd { margin-top: 3px; font-size: var(--fs-small); color: var(--ink-2); line-height: 1.45; }

@media (width <= 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-side { position: static; }
  .about-portrait .frame { max-width: 56%; margin-inline: auto; }
}

.skills { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.skills div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; padding-block: 14px; border-bottom: 1px solid var(--rule); }
.skills dt { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); padding-top: 3px; }
.skills dd { font-size: var(--fs-small); color: var(--ink-2); line-height: 1.6; }
@media (width <= 640px) { .skills div { grid-template-columns: 1fr; gap: 4px; } }

.essay { display: grid; gap: clamp(48px, 7vw, 96px); }
.essay-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px; align-items: baseline; margin-bottom: 28px; }
.essay-head h3 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-h2); line-height: 1; letter-spacing: -0.01em; }
.essay-head p { color: var(--ink-2); font-size: var(--fs-small); max-width: 56ch; }
@media (width <= 640px) { .essay-head { grid-template-columns: 1fr; gap: 8px; } }

.shelf { display: grid; gap: 28px 20px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.shelf[data-aspect="portrait"] { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.piece { display: grid; gap: 10px; align-content: start; cursor: zoom-in; }
.piece-img { position: relative; overflow: hidden; aspect-ratio: 1; background: var(--paper-2); border-radius: 3px; }
.shelf[data-aspect="portrait"] .piece-img { aspect-ratio: 2 / 3; }
.piece-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), opacity 0.45s var(--ease); }
.piece:hover .piece-img img { transform: scale(1.03); }
.piece-img .back { position: absolute; inset: 0; opacity: 0; }
.piece.tee:hover .piece-img .front, .piece.tee.flipped .piece-img .front { opacity: 0; }
.piece.tee:hover .piece-img .back,  .piece.tee.flipped .piece-img .back  { opacity: 1; }
.piece-title { font-size: var(--fs-small); line-height: 1.35; }
.piece-sub { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); margin-top: 2px; }
.piece-desc { font-size: 0.82rem; color: var(--ink-2); line-height: 1.5; margin-top: 4px; }

.questions { counter-reset: q; display: grid; border-top: 1px solid var(--rule); }
.questions li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; padding-block: 20px; border-bottom: 1px solid var(--rule); }
.questions li::before { counter-increment: q; content: counter(q, decimal-leading-zero); font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); padding-top: 6px; }
.questions h4 { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; line-height: 1.15; }
.questions .sub { color: var(--muted); font-size: var(--fs-small); margin-top: 2px; font-style: italic; font-family: var(--serif); font-size: 1.05rem; }
.questions p { color: var(--ink-2); font-size: var(--fs-small); margin-top: 8px; max-width: 62ch; line-height: 1.55; }

/* ---------- in-page jump links ---------- */
.page-jump { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.page-jump a {
  display: grid; gap: 3px; padding: 13px 20px;
  border: 1px solid var(--rule); border-radius: 4px;
  transition: border-color var(--d-fast), background-color var(--d-fast);
}
.page-jump a:hover { border-color: var(--rule-2); background: var(--paper-2); }
.page-jump .k { font-family: var(--serif); font-size: 1.2rem; line-height: 1.1; }
.page-jump a:hover .k { color: var(--accent); }
.page-jump .m { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); }

/* ---------- archive page ---------- */
.pres-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px 20px; }
.pres { display: grid; gap: 12px; align-content: start; }
.pres-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-2); border-radius: 3px; }
.pres-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.pres-thumb.playable { cursor: pointer; }
.pres-thumb.playable:hover img { transform: scale(1.03); }
.pres-thumb .play {
  position: absolute; left: 12px; bottom: 12px;
  font-family: var(--mono); font-size: var(--fs-mono);
  background: var(--paper); color: var(--ink); padding: 6px 10px; border-radius: 3px;
}
.pres-thumb iframe { width: 100%; height: 100%; border: 0; }
.pres-thumb.static img { object-fit: cover; }
.pres-course { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); }
.pres-course[data-subj="cs"] { color: var(--c-cs); }
.pres-course[data-subj="pr"] { color: var(--c-pr); }
.pres-course[data-subj="other"] { color: var(--c-other); }
.pres-title { font-family: var(--serif); font-size: 1.3rem; line-height: 1.15; margin-top: 4px; }
.pres-desc { font-size: var(--fs-small); color: var(--ink-2); line-height: 1.5; margin-top: 6px; }
.pres-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 8px; }

.cw { display: grid; gap: clamp(32px, 5vw, 56px); }
.cw-term h3 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; line-height: 1; padding-bottom: 12px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: baseline; }
.cw-term h3 .mono { font-size: var(--fs-mono); }
.cw-course { display: grid; grid-template-columns: 110px minmax(0, 1fr) 40px; gap: 16px; padding-block: 16px; border-bottom: 1px solid var(--rule); }
.cw-code, .cw-grade { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); padding-top: 4px; }
.cw-grade { text-align: right; }
.cw-name { font-size: 1.05rem; }
.cw-theme { color: var(--muted); font-size: var(--fs-small); margin-top: 2px; }
.cw-arts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.cw-art { font-size: var(--fs-small); color: var(--ink-2); border-bottom: 1px solid var(--rule-2); transition: color var(--d-fast); }
.cw-art:hover { color: var(--accent); }
.cw-art .k { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); margin-right: 6px; }
.cw-art .k::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--muted); }
.cw-art .k[data-type="project"]::before { background: var(--c-project); }
.cw-art .k[data-type="presentation"]::before { background: var(--c-presentation); }
.cw-art .k[data-type="report"]::before { background: var(--c-report); }
.cw-art .k[data-type="homework"]::before { background: var(--c-homework); }
.cw-code[data-subj="cs"] { color: var(--c-cs); }
.cw-code[data-subj="pr"] { color: var(--c-pr); }
@media (width <= 640px) { .cw-course { grid-template-columns: minmax(0, 1fr) 40px; } .cw-code { grid-column: 1 / -1; padding: 0; } }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center; padding: clamp(16px, 4vw, 48px);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.lightbox.on { opacity: 1; }
.lightbox-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: min(1100px, 100%); max-height: 100%; }
.lightbox-stage { position: relative; display: grid; place-items: center; max-height: 72vh; }
.lightbox-stage img { max-height: 72vh; max-width: 100%; width: auto; object-fit: contain; border-radius: 3px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22); transform: scale(0.96); transition: transform 0.5s var(--ease), opacity 0.35s; }
.lightbox.on .lightbox-stage img { transform: none; }
.lightbox-stage img.back { position: absolute; inset: 0; margin: auto; opacity: 0; }
.lightbox-stage.flipped img.front { opacity: 0; }
.lightbox-stage.flipped img.back { opacity: 1; }
.lightbox-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; align-items: baseline; }
.lightbox-cap .t { font-family: var(--serif); font-size: 1.3rem; }
.lightbox-cap .s { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); }
.lightbox-cap .d { flex-basis: 100%; color: var(--ink-2); font-size: var(--fs-small); max-width: 60ch; }
.lightbox-close { position: fixed; top: 18px; right: 22px; font-family: var(--mono); font-size: var(--fs-mono); padding: 8px 12px; border: 1px solid var(--rule-2); border-radius: 3px; background: var(--paper); }
.lightbox-close:hover, .flip-btn:hover { color: var(--accent); border-color: var(--accent); }
.flip-btn { font-family: var(--mono); font-size: var(--fs-mono); padding: 6px 10px; border: 1px solid var(--rule-2); border-radius: 3px; }

/* ---------- view transitions ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.32s; animation-timing-function: var(--ease); }
::view-transition-group(work-image) { animation-duration: 0.6s; animation-timing-function: var(--ease); }
::view-transition-old(work-image), ::view-transition-new(work-image) { animation: none; mix-blend-mode: normal; object-fit: contain; }

/* ---------- focus ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; transition-delay: 0s !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .display .line > span, .hero-intro, .hero-facts, .hero-portrait img { transform: none; opacity: 1; }
}
