/* ==========================================================================
   Jiarui Liu · personal site

   1. PLAIN  : the default. Nearly plain text; this is all you get without
               JavaScript or with the theme switched off.
   2. CAMP   : everything under  html[data-theme="camp"]  near the bottom.
               Palette and fonts are the custom properties at the top of it.
   ========================================================================== */

/* ---------- 1. PLAIN ---------------------------------------------------- */

:root {
  color-scheme: light dark;
  --paper: Canvas;
  --rule: color-mix(in srgb, CanvasText 22%, transparent);
  --dim: color-mix(in srgb, CanvasText 62%, transparent);
}

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

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

body {
  margin: 0 auto;
  max-width: 46rem;
  padding: 1.25rem 1rem 3rem;
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.defs { position: absolute; }
html:not([data-theme="camp"]) .camp-only { display: none !important; }
.muted { color: var(--dim); font-weight: normal; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; padding: .4rem .8rem; background: Canvas; }

h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 1.35rem; margin: 2.4rem 0 .8rem; padding-bottom: .25rem; border-bottom: 1px solid var(--rule); }
h3 { font-size: 1rem; margin: 0; }
p { margin: .5rem 0; }
ul, ol { margin: .4rem 0; padding-left: 1.25rem; }
img { max-width: 100%; height: auto; }

/* nav */
.site-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--rule); font-size: .95rem; }
.brand { font-weight: 700; color: inherit; text-decoration: none; }
.nav-links { display: flex; flex-wrap: wrap; gap: .2rem .9rem; }
.theme-switch { margin-left: auto; display: none; align-items: baseline; gap: .45rem; color: var(--dim); }
.js .theme-switch { display: flex; }
.theme-switch button { font: inherit; padding: 0; border: 0; background: none; color: LinkText; text-decoration: underline; cursor: pointer; }
.theme-switch button[aria-pressed="true"] { color: inherit; font-weight: 700; text-decoration: none; cursor: default; }

/* intro */
.hero { margin-top: 1.6rem; }
.hero-card::after { content: ""; display: block; clear: both; }
.avatar-wrap { float: right; margin: 0 0 .8rem 1.2rem; }
.avatar { display: block; width: 8rem; height: 8rem; border-radius: 6px; object-fit: cover; }
.name { font-size: 2rem; margin: 0; }
.ipa { color: var(--dim); margin-top: .1rem; }
.interests i { font-style: normal; }
.addr { white-space: nowrap; user-select: all; }
.links { list-style: none; display: flex; flex-wrap: wrap; gap: .2rem 1rem; padding: 0; }

.sec-head { display: contents; }
.sec-note { color: var(--dim); }
.card-lead h3 { margin-top: 1.1rem; }
.refs { font-size: .92em; }

/* news */
.news { list-style: none; padding: 0; }
.news li { display: grid; grid-template-columns: 5.6rem 1fr; gap: .8rem; margin: .3rem 0; }
.news time { font-weight: 600; font-variant-numeric: tabular-nums; }

/* publications */
.pub { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1.1rem; margin: 1.5rem 0; align-items: start; }
.pub-thumb img { display: block; width: 100%; max-height: 8.5rem; object-fit: contain; object-position: top; border: 1px solid var(--rule); background: #fff; }
.pub:has(.pub-thumb.camp-only) { grid-template-columns: 1fr; }
.pub-body p { margin: .15rem 0; }
.pub-venue { font-style: italic; color: var(--dim); }
.pub-links a { margin-right: .6rem; }
.pub-links a::before { content: "["; }
.pub-links a::after { content: "]"; }
details { margin-top: .3rem; }
summary { cursor: pointer; width: fit-content; color: var(--dim); font-size: .92rem; }
details p { font-size: .92rem; }
.tags { list-style: none; padding: 0; margin: .3rem 0 0; font-size: .85rem; color: var(--dim); }
.tags li { display: inline; }
.tags li + li::before { content: " · "; }

/* experience / education */
.entry { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; margin: 1.1rem 0; }
.entry-date { color: var(--dim); margin: 0; font-variant-numeric: tabular-nums; }
.entry-meta { margin: .1rem 0; color: var(--dim); }
.chip::before { content: "· "; }
.at { font-weight: 400; }
.trailmap { list-style: none; padding: 0; }
.trailmap li { margin: 1rem 0; }
.trailmap p { margin: .1rem 0; }
.entry-extra { color: var(--dim); font-size: .94rem; }
.mini { margin: 1.1rem 0; }

/* footer */
.site-footer { margin-top: 2.6rem; }
.colophon { margin-top: 1.4rem; font-size: .85rem; color: var(--dim); }

@media (max-width: 34rem) {
  .pub, .entry { grid-template-columns: 1fr; gap: .3rem; }
  .pub-thumb img { max-width: 12rem; }
  .avatar { width: 5.5rem; height: 5.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- 2. CAMP ------------------------------------------------------ */

html[data-theme="camp"] {
  color-scheme: light;

  /* palette */
  --paper: #f4efe3;
  --card: #fffdf7;
  --ink: #46372a;
  --ink-2: #6a5744;
  --ink-3: #8a7559;
  --pencil: #5b4b3e;
  --orange: #ef8b3d;
  --orange-ink: #b9540f;
  --blue: #5fb6cf;
  --blue-ink: #296a86;
  --green-ink: #4c7343;
  --pink: #f29bb8;
  --sun: #ffd97a;
  --edge: #cdb48a;

  /* type */
  --f-head: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  --f-body: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
  --f-hand: "Klee One", "Zen Maru Gothic", cursive;

  /* layout */
  --nav-h: 58px;
  --strip-h: max(240px, 29.17vw);
  --nstrip-h: max(220px, 25vw);
  --sketch: 255px 18px 225px 20px / 20px 225px 22px 255px;

  scroll-padding-top: calc(var(--nav-h) + 18px);
  background: var(--paper);

  .muted { color: var(--ink-3); }
  ::selection { background: #f6c58e; color: var(--ink); }

  body {
    max-width: none;
    padding: 0;
    overflow-x: hidden;
    color: var(--ink);
    font: 1.04rem/1.72 var(--f-body);
    -webkit-font-smoothing: antialiased;
    background-color: var(--paper);
    background-image:
      linear-gradient(60deg, transparent 49.6%, rgba(120, 108, 90, .05) 49.6%, rgba(120, 108, 90, .05) 50.4%, transparent 50.4%),
      linear-gradient(-60deg, transparent 49.6%, rgba(120, 108, 90, .05) 49.6%, rgba(120, 108, 90, .05) 50.4%, transparent 50.4%),
      linear-gradient(0deg, transparent 49.6%, rgba(120, 108, 90, .035) 49.6%, rgba(120, 108, 90, .035) 50.4%, transparent 50.4%);
    background-size: 76px 132px;
  }
  /* paper grain */
  body::after { content: ""; position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: .055; filter: url(#grain); }

  a { color: var(--orange-ink); text-decoration-color: rgba(239, 139, 61, .55); text-decoration-thickness: 2px; text-underline-offset: 3px; }
  a:hover { text-decoration-color: currentColor; }
  :focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
  h1, h2, h3 { font-family: var(--f-head); }
  h2 { border: 0; padding: 0; }

  /* ---- nav ---- */
  .site-nav {
    position: fixed; inset: 0 0 auto 0; z-index: 60;
    height: var(--nav-h); padding: 0 22px; gap: 14px;
    align-items: center; flex-wrap: nowrap;
    border: 0; font-size: .86rem;
    background: rgba(244, 239, 227, .86);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 0 rgba(91, 75, 62, .07);
  }
  .brand { display: flex; align-items: center; gap: 9px; font: 900 1rem var(--f-head); color: var(--ink); white-space: nowrap; }
  .brand-mark { width: 28px; height: 28px; }
  .nav-links { margin-left: auto; flex-wrap: nowrap; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    padding: 6px 13px; border-radius: 18px; white-space: nowrap;
    font: 700 .86rem var(--f-head); color: var(--ink-2); text-decoration: none;
    transition: background .2s, color .2s;
  }
  .nav-links a:hover, .nav-links a.is-active { background: #f3dcb8; color: #5a3a22; }
  .theme-switch { margin-left: 6px; gap: 0; align-items: center; padding: 3px; border-radius: 999px; background: rgba(91, 75, 62, .1); }
  .ts-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .theme-switch button {
    padding: 5px 13px; border-radius: 999px;
    font: 700 .8rem var(--f-head); color: var(--ink-2); text-decoration: none;
    transition: background .2s, color .2s;
  }
  .theme-switch button::before { content: "▲ "; font-size: .7em; vertical-align: .12em; color: var(--orange); }
  .theme-switch button[data-set-theme="plain"]::before { content: "Aa "; font-size: .86em; vertical-align: 0; color: var(--ink-3); }
  .theme-switch button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(91, 75, 62, .22); }

  /* ---- hero ---- */
  .hero {
    position: relative; isolation: isolate; overflow: hidden;
    margin: 0; padding: calc(var(--nav-h) + 20px) 20px 0;
    display: flex; flex-direction: column; align-items: center; text-align: center;
  }
  .scene { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
  .sky { position: absolute; inset: 0; background: linear-gradient(180deg, #a9dcec 0%, #c9e9ee 32%, #e6f1de 60%, var(--paper) 100%); }
  .sky-dusk { position: absolute; inset: 0; opacity: 0; background: linear-gradient(180deg, #f3a987 0%, #f8c795 34%, #fbe2b6 68%, var(--paper) 100%); }
  .sun {
    position: absolute; left: max(6%, calc(50% - 520px)); top: calc(var(--nav-h) + 44px);
    width: 88px; height: 88px; border-radius: 50%;
    background: radial-gradient(circle at 40% 38%, #fff6cf, var(--sun) 60%, #ffc35c);
    box-shadow: 0 0 0 14px rgba(255, 217, 122, .28), 0 0 0 32px rgba(255, 217, 122, .14), 0 0 60px 30px rgba(255, 200, 100, .3);
  }
  .cloud { position: absolute; width: 150px; }
  .cloud svg { display: block; width: 100%; overflow: visible; animation: drift 17s ease-in-out infinite alternate; }
  .cloud path { fill: var(--card); stroke: var(--pencil); stroke-width: 2.2; stroke-linejoin: round; }
  .c1 { right: max(5%, calc(50% - 560px)); top: calc(var(--nav-h) + 26px); }
  .c2 { left: 3%; top: 44%; width: 108px; }
  .c2 svg { animation-duration: 23s; animation-direction: alternate-reverse; }
  .c3 { right: 20%; top: 40%; width: 86px; opacity: .9; }
  .c3 svg { animation-duration: 20s; }

  .strip { position: absolute; left: 0; right: 0; bottom: 0; height: var(--strip-h); }
  .par { position: absolute; inset: 0; will-change: transform; }
  .layer { position: absolute; top: 0; left: -8px; width: calc(100% + 16px); height: 100%; display: block; }
  .wob { filter: url(#wob); }
  .live { pointer-events: none; }
  .hit { pointer-events: auto; cursor: pointer; }
  .tent, .fire-wrap, .flame, .pinecone { transform-box: fill-box; transform-origin: 50% 100%; }
  .flame { animation: flick 1.15s ease-in-out infinite alternate; }
  .flame-in { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .8s ease-in-out infinite alternate-reverse; }
  .smoke { fill: #fffdf7; opacity: 0; transform-box: fill-box; transform-origin: center; animation: smoke 5.4s ease-out infinite; }
  .smoke.s2 { animation-delay: 1.8s; }
  .smoke.s3 { animation-delay: 3.6s; }
  .shimmer { stroke-dasharray: 30 26; animation: shimmer 5s linear infinite; opacity: .85; }
  .ember {
    position: absolute; z-index: 3; width: 5px; height: 5px; border-radius: 50%; pointer-events: none;
    background: #ffc35c; box-shadow: 0 0 6px 2px rgba(255, 150, 60, .7);
    animation: ember var(--t, 1.4s) ease-out forwards;
  }
  .bubble {
    position: absolute; z-index: 4; padding: 3px 12px; white-space: nowrap;
    font: 600 .86rem var(--f-hand); color: var(--ink);
    background: var(--card); border: 2.5px solid var(--pencil); border-radius: 16px;
    transform-origin: 50% 100%;
  }
  .bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 10px; height: 10px; margin-left: -5px; background: var(--card); border: solid var(--pencil); border-width: 0 2.5px 2.5px 0; rotate: 45deg; }

  .hero-card { position: relative; max-width: 660px; margin-bottom: calc(var(--strip-h) - 70px); }
  .hero-card::after { content: none; }
  .avatar-wrap { float: none; position: relative; width: 150px; height: 150px; margin: 0 auto; }
  .avatar { width: 100%; height: 100%; border-radius: 50%; border: 4px solid var(--card); box-shadow: 0 12px 30px rgba(120, 80, 40, .22); animation: floaty 6s ease-in-out infinite; }
  .avatar-ring {
    position: absolute; inset: -14px; border-radius: 50%; opacity: .6;
    background-image: radial-gradient(circle, var(--orange) 1.5px, transparent 2px); background-size: 9px 9px;
    -webkit-mask-image: radial-gradient(circle, transparent 60%, #000 62%, #000 74%, transparent 78%);
    mask-image: radial-gradient(circle, transparent 60%, #000 62%, #000 74%, transparent 78%);
    animation: spin 60s linear infinite;
  }
  .name { position: relative; display: inline-block; margin: 22px 0 0; font-weight: 900; font-size: clamp(2.9rem, 9vw, 5.1rem); line-height: 1; color: var(--ink); letter-spacing: .005em; }
  .name-text { display: inline-block; }
  .name-text span { display: inline-block; cursor: default; }
  .tri { display: inline-block; margin-left: .12em; font-size: .46em; vertical-align: .62em; color: var(--orange); }
  .name-underline { display: block; width: min(300px, 72vw); height: 16px; margin: 6px auto 0; overflow: visible; filter: url(#wob-s); }
  .name-underline path { fill: none; stroke: var(--orange); stroke-width: 4.5; stroke-linecap: round; }
  .ipa { margin: 10px 0 0; font: 400 .95rem var(--f-hand); color: var(--ink-3); letter-spacing: .02em; }
  .role { margin: 14px 0 0; font: 700 1.1rem/1.5 var(--f-head); color: var(--blue-ink); }
  .role a { color: inherit; text-decoration-color: rgba(41, 106, 134, .4); }
  .interests { margin: 4px 0 0; font: 600 .95rem var(--f-hand); letter-spacing: .05em; color: var(--ink-2); }
  .interests i { font-size: 0; }
  .interests i::before { content: "▲"; font-size: .62rem; margin: 0 .5em; vertical-align: .15em; color: var(--orange); }
  .email { margin: 12px 0 0; font-size: .98rem; color: var(--ink-2); }
  .addr { font: 700 1em var(--f-head); color: var(--ink); letter-spacing: .01em; }
  .links { justify-content: center; gap: 12px; margin: 16px 0 0; }
  .btn {
    display: inline-block; padding: 9px 22px;
    font: 700 .92rem var(--f-head); color: var(--blue-ink); text-decoration: none;
    background: var(--card); border: 2.5px solid var(--blue); border-radius: var(--sketch);
    box-shadow: 0 5px 14px rgba(95, 182, 207, .22);
    transition: translate .2s, box-shadow .2s;
  }
  .btn:hover { translate: 0 -3px; box-shadow: 0 9px 18px rgba(95, 182, 207, .3); }
  .btn-primary { color: #43240c; background: var(--orange); border-color: #d9742a; box-shadow: 0 6px 16px rgba(239, 139, 61, .34); }
  .btn-primary:hover { box-shadow: 0 10px 20px rgba(239, 139, 61, .42); }
  .btn .muted { color: inherit; opacity: .7; font-weight: 500; }

  /* ---- main ---- */
  main { position: relative; z-index: 2; max-width: 900px; margin: -16px auto 0; padding: 0 22px; }
  .section { margin-top: 68px; }
  #about { margin-top: 0; }

  .card {
    position: relative; margin: 0; padding: 26px 30px;
    background: var(--card); border-radius: 22px;
    box-shadow: 0 10px 26px rgba(150, 110, 60, .1);
    transition: translate .22s, box-shadow .22s;
  }
  .card::before { content: ""; position: absolute; inset: 0; border: 2.5px solid var(--edge); border-radius: var(--sketch); filter: url(#wob); opacity: .75; pointer-events: none; }
  .pub.card:hover, .entry.card:hover { translate: 0 -4px; box-shadow: 0 18px 36px rgba(150, 110, 60, .16); }

  .sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
  .sec-icon { flex: none; display: grid !important; place-items: center; width: 46px; height: 46px; background: var(--blob, #ffe3b8); border-radius: 58% 42% 55% 45% / 48% 56% 44% 52%; }
  .sec-icon svg { width: 30px; height: 30px; }
  #news { --blob: #fdeeb5; }
  #research { --blob: #ffdcc0; }
  #experience { --blob: #dcebcb; }
  #education { --blob: #d3ebf2; }
  #more { --blob: #fbdbe6; }
  .sec-head h2 { margin: 0; font-weight: 900; font-size: 1.9rem; color: var(--ink); }
  .sec-sub { font: 600 .92rem var(--f-hand); color: var(--ink-3); white-space: nowrap; }
  .sec-rule { flex: 1; min-width: 20px; height: 3px; transform-origin: 0 50%; filter: url(#wob-s); background: repeating-linear-gradient(90deg, #d9c39e 0 9px, transparent 9px 18px); }
  .sec-head-inline { margin-bottom: 8px; }
  .sec-head-inline h2 { font: 600 1.15rem var(--f-hand); color: var(--blue-ink); letter-spacing: .04em; }
  .sec-head-inline .sec-icon { width: 36px; height: 36px; --blob: #d3ebf2; }
  .sec-head-inline .sec-icon svg { width: 24px; height: 24px; }
  .sec-note { margin: -8px 0 18px; font-size: .95rem; color: var(--ink-2); }

  .card-lead { padding: 30px 38px 32px; }
  .card-lead > p { margin: 12px 0 0; font-size: 1.14rem; line-height: 1.8; color: #574635; text-wrap: pretty; }
  .card-lead strong { color: var(--orange-ink); }
  .card-lead h3 { margin: 24px 0 8px; font: 600 1rem var(--f-hand); letter-spacing: .04em; color: var(--blue-ink); }
  .interests-list { list-style: none; padding: 0; margin: 0; }
  .interests-list li { position: relative; padding-left: 22px; margin-top: 6px; }
  .interests-list li::before, .entry li::before { content: "▲"; position: absolute; left: 2px; top: .42em; font-size: .6rem; color: var(--blue); }
  .interests-list strong { color: var(--ink); }

  /* news */
  .news.card { padding: 10px 30px; }
  .news li { grid-template-columns: 92px 1fr; gap: 18px; margin: 0; padding: 12px 0; border-bottom: 2px dashed #eadfc6; }
  .news li:last-child { border-bottom: 0; }
  .news time { font: 600 .92rem/1.9 var(--f-hand); color: var(--blue-ink); }

  /* publications */
  .pub { grid-template-columns: 208px 1fr; gap: 28px; margin: 20px 0 0; }
  .pub:has(.pub-thumb.camp-only) { grid-template-columns: 208px 1fr; }
  .pub-thumb {
    position: relative; display: block !important; margin-top: 6px; aspect-ratio: 4 / 3;
    background: #fff; border: 2.5px solid var(--pencil); border-radius: 12px;
    rotate: -1.6deg; box-shadow: 0 8px 18px rgba(120, 80, 40, .16);
    transition: rotate .3s, scale .3s;
  }
  .pub:nth-of-type(even) .pub-thumb { rotate: 1.4deg; }
  .pub-thumb:hover { rotate: 0deg; scale: 1.04; }
  .pub-thumb img, .pub-thumb svg { display: block; width: 100%; height: 100%; max-height: none; border: 0; border-radius: 9px; object-fit: contain; object-position: center; }
  /* washi tape */
  .pub-thumb::after { content: ""; position: absolute; left: 50%; top: -11px; width: 74px; height: 20px; margin-left: -37px; rotate: -3deg; background: rgba(242, 155, 184, .72); border-left: 2px dashed rgba(255, 255, 255, .7); border-right: 2px dashed rgba(255, 255, 255, .7); }
  .pub:nth-of-type(even) .pub-thumb::after { background: rgba(95, 182, 207, .62); rotate: 2deg; }
  .pub:nth-of-type(3n) .pub-thumb::after { background: rgba(255, 217, 122, .8); }
  .pub h3 { font-weight: 700; font-size: 1.2rem; line-height: 1.36; }
  .pub h3 a { color: var(--ink); text-decoration: none; }
  .pub h3 a:hover { color: var(--orange-ink); }
  .pub-authors { margin-top: 6px !important; font-size: .98rem; color: var(--ink-2); }
  .pub-authors strong { color: var(--ink); }
  .pub-venue { font: 600 .9rem var(--f-hand); color: var(--blue-ink); }
  .pub-tldr { margin-top: 10px !important; line-height: 1.66; color: #5e4c3a; text-wrap: pretty; }
  .pub-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px !important; }
  .pub-links a {
    margin: 0; padding: 3px 15px; border-radius: 999px;
    font: 700 .82rem/1.7 var(--f-head); color: var(--orange-ink); text-decoration: none;
    border: 2px solid var(--orange); transition: background .2s, color .2s;
  }
  .pub-links a::before, .pub-links a::after { content: none; }
  .pub-links a:hover { background: var(--orange); color: #43240c; }
  details { margin-top: 12px; }
  summary { font: 600 .92rem var(--f-hand); color: var(--ink-2); }
  summary:hover { color: var(--orange-ink); }
  details p { margin: 8px 0 0; padding: 12px 16px; font-size: .94rem; line-height: 1.68; color: #5e4c3a; background: #faf3e2; border-radius: 12px; }
  .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; color: var(--blue-ink); }
  .tags li { padding: 2px 11px; border-radius: 14px; font: 500 .78rem/1.7 var(--f-head); background: #e3f1f5; }
  .tags li::before, .tags li + li::before { content: "▲"; margin-right: 5px; font-size: .56rem; vertical-align: .16em; color: var(--blue); }

  /* experience */
  .entry { grid-template-columns: 124px 1fr; gap: 22px; margin: 16px 0 0; }
  .entry-date { font: 600 .92rem/1.9 var(--f-hand); color: var(--blue-ink); }
  .entry h3, .trailmap h3 { font-weight: 700; font-size: 1.14rem; color: var(--ink); }
  .at { font-weight: 700; color: var(--green-ink); }
  .at a { color: inherit; }
  .entry-meta { margin: 2px 0 0; font-size: .95rem; color: var(--ink-2); }
  .chip { display: inline-block; margin-left: 8px; padding: 1px 10px; border-radius: 12px; font: 500 .76rem/1.7 var(--f-head); color: #a13f66; background: #fde5ee; }
  .chip::before { content: none; }
  .entry ul { list-style: none; padding: 0; margin: 10px 0 0; }
  .entry li { position: relative; padding-left: 22px; margin-top: 5px; font-size: .98rem; line-height: 1.62; color: #5e4c3a; }
  .entry li::before { color: var(--orange); }

  /* education: the trail map */
  .trailmap { position: relative; margin: 0; padding: 0 0 0 60px; }
  .trailmap::before { content: ""; position: absolute; left: 19px; top: 30px; bottom: 34px; border-left: 3px dashed var(--orange); opacity: .65; }
  .trailmap li { margin: 16px 0 0; padding: 18px 26px; }
  .trailmap li::after {
    content: "▲"; position: absolute; left: -60px; top: 16px;
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    font-size: .85rem; color: var(--orange); background: var(--card); border: 3px solid var(--orange);
  }
  .trailmap .entry-date { margin: 0; }
  .trailmap .entry-meta { margin-top: 1px; }
  .entry-note { margin: 5px 0 0 !important; font: 600 .9rem var(--f-hand); color: #9a5f17; }
  .entry-extra { margin-top: 6px !important; color: var(--ink-2); }

  /* more */
  .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .mini { margin: 0; padding: 22px 26px; }
  .mini h3 { display: inline-block; margin-bottom: 8px; padding-bottom: 2px; font-weight: 700; font-size: 1.06rem; border-bottom: 3px solid var(--sun); }
  .mini:nth-child(2) h3 { border-color: var(--pink); }
  .mini:nth-child(3) h3 { border-color: var(--blue); }
  .mini:nth-child(4) h3 { border-color: #a9c690; }
  .mini ul { list-style: none; padding: 0; margin: 0; }
  .mini li { margin-top: 6px; font-size: .97rem; line-height: 1.6; color: #5e4c3a; }

  /* ---- footer: night falls ---- */
  .site-footer {
    position: relative; isolation: isolate; overflow: hidden;
    margin-top: 80px; padding: 310px 22px 0; text-align: center; color: #f4ecd8;
    background: linear-gradient(180deg, var(--paper) 0, #f9e0b0 56px, #f6b78a 124px, #d68b90 190px, #8b6a9c 250px, #4a4a80 310px, #283059 420px, #1c2347 100%);
  }
  .night { position: absolute; inset: 0; z-index: -1; }
  .stars { position: absolute; left: 0; top: 232px; width: 100%; height: 300px; fill: #fff7d6; -webkit-mask-image: linear-gradient(transparent, #000 40%); mask-image: linear-gradient(transparent, #000 40%); }
  .stars circle { animation: twinkle 3.4s ease-in-out infinite alternate; }
  .stars circle:nth-child(3n) { animation-delay: -1.2s; animation-duration: 2.6s; }
  .stars circle:nth-child(4n+1) { animation-delay: -2.3s; animation-duration: 4.4s; }
  .stars circle:nth-child(5n+2) { animation-delay: -.6s; }
  .shooting-star { position: absolute; left: 62%; top: 300px; width: 110px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #fff7d6, transparent); rotate: -24deg; opacity: 0; animation: shoot 11s ease-in 3s infinite; }
  .moon { position: absolute; right: max(8%, calc(50% - 470px)); top: 300px; width: 52px; height: 52px; border-radius: 50%; rotate: -18deg; box-shadow: inset -13px 6px 0 0 #ffeeb0; filter: drop-shadow(0 0 12px rgba(255, 238, 176, .55)); }
  .site-footer .strip { height: var(--nstrip-h); }
  .site-footer .smoke { fill: #c9cfe8; }
  .fire-glow { transform-box: fill-box; transform-origin: center; animation: glow 1.7s ease-in-out infinite alternate; }
  .tent-door { animation: twinkle 3.6s ease-in-out -1s infinite alternate; }
  .smoke-wrap { transition: opacity 1.2s; }
  .footer-inner { max-width: 620px; margin: 0 auto; padding-bottom: calc(var(--nstrip-h) + 6px); }
  .site-footer h2 { margin: 0; font-weight: 900; font-size: 1.8rem; color: #fff3d6; }
  .contact-line { margin: 10px 0 0; font-size: 1.06rem; }
  .site-footer .addr { color: var(--sun); }
  .site-footer a { color: var(--sun); text-decoration-color: rgba(255, 217, 122, .5); }
  .signoff { margin: 20px 0 0; font: 600 1.35rem var(--f-hand); letter-spacing: .08em; color: var(--sun); }
  .signoff::after { content: " △"; color: var(--orange); }
  .colophon { margin-top: 22px; font-size: .8rem; line-height: 1.7; color: rgba(244, 236, 216, .72); }
  .colophon a { color: inherit; }

  /* ---- scroll trail (built by main.js on wide screens) ---- */
  .trail { position: fixed; z-index: 40; left: max(18px, calc(50% - 574px)); top: 50%; translate: 0 -46%; width: 64px; display: none; opacity: 0; pointer-events: none; transition: opacity .45s; }
  .trail.is-on { opacity: 1; pointer-events: auto; }
  .trail svg { display: block; overflow: visible; }
  .trail-path { fill: none; stroke: var(--orange); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 10; opacity: .8; }
  .wp { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--card); border: 3px solid var(--orange); transition: scale .25s, background .25s; }
  .wp:hover, .wp.is-active { scale: 1.35; background: var(--orange); }
  .wp span {
    position: absolute; left: 22px; top: 50%; translate: -6px -50%; padding: 1px 10px; border-radius: 12px; white-space: nowrap; pointer-events: none;
    font: 700 .74rem/1.7 var(--f-head); color: var(--ink); background: var(--card); box-shadow: 0 2px 8px rgba(60, 40, 20, .22);
    opacity: 0; transition: opacity .2s, translate .2s;
  }
  .wp:hover span, .wp:focus-visible span { opacity: 1; translate: 0 -50%; }
  @media (min-width: 1200px) and (min-height: 560px) { .trail { display: block; } }

  /* ---- responsive ---- */
  @media (max-width: 760px) {
    --nav-h: 92px;
    .site-nav { flex-wrap: wrap; align-content: center; gap: 4px 10px; padding: 0 14px; }
    .theme-switch { order: 2; margin-left: auto; }
    .nav-links { order: 3; flex: 0 0 100%; margin-left: -6px; }
    .cloud.c2, .cloud.c3 { display: none !important; }
    .sun { width: 60px; height: 60px; left: 5%; top: calc(var(--nav-h) + 14px); }
    .c1 { width: 96px; right: 3%; top: calc(var(--nav-h) + 8px); }
    .hero-card { margin-bottom: calc(var(--strip-h) - 30px); }
    .avatar-wrap { width: 128px; height: 128px; }
    .role .sep { display: block; font-size: 0; }
    main { padding: 0 14px; margin-top: -12px; }
    .section { margin-top: 52px; }
    .card { padding: 22px 20px; }
    .card-lead { padding: 24px 22px; }
    .card-lead > p { font-size: 1.05rem; }
    .sec-head h2 { font-size: 1.6rem; }
    .sec-sub { display: none !important; }
    .news.card { padding: 6px 20px; }
    .news li { grid-template-columns: 76px 1fr; gap: 12px; }
    .pub, .pub:has(.pub-thumb.camp-only) { grid-template-columns: 1fr; gap: 18px; }
    .pub-thumb { width: min(230px, 78%); margin: 8px auto 0; }
    .entry { grid-template-columns: 1fr; gap: 2px; }
    .trailmap { padding-left: 46px; }
    .trailmap::before { left: 14px; }
    .trailmap li::after { left: -46px; width: 32px; height: 32px; font-size: .7rem; }
    .grid { grid-template-columns: 1fr; }
    .moon { right: 9%; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .smoke { opacity: .3; }
  }
}

/* Hidden until the intro / scroll reveals run (classes are set by JS only when
   animation is actually going to happen). */
html.pre-anim :is(.scene .layer, .sun, .cloud, .avatar-wrap, .name, .hero-card .fade) { opacity: 0; }
html.anim-on [data-reveal] { opacity: 0; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; }

@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes drift { from { transform: translateX(-22px); } to { transform: translateX(26px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flick {
  0% { transform: scale(1, 1) skewX(0deg); }
  40% { transform: scale(.93, 1.08) skewX(-4deg); }
  70% { transform: scale(1.05, .95) skewX(3deg); }
  100% { transform: scale(.97, 1.1) skewX(-2deg); }
}
@keyframes smoke {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  18% { opacity: .34; }
  100% { opacity: 0; transform: translate(26px, -92px) scale(2.3); }
}
@keyframes shimmer { to { stroke-dashoffset: -112; } }
@keyframes ember { to { opacity: 0; transform: translate(var(--dx, 0), var(--dy, -80px)) scale(.2); } }
@keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }
@keyframes glow { from { opacity: .72; transform: scale(.96); } to { opacity: 1; transform: scale(1.04); } }
@keyframes shoot {
  0% { opacity: 0; transform: translateX(120px); }
  2% { opacity: 1; }
  7% { opacity: 0; transform: translateX(-260px); }
  100% { opacity: 0; transform: translateX(-260px); }
}
