/* Kai Park — research portfolio. Tokens mirror the "Marginalia" design system. */
:root {
  --surface: #ffffff; --surface-raised: #faf9f7;
  --ink: #1a1816; --ink-muted: #5a5550; --line: #ebe6df;
  --link: #1f5f7a; --signal: #a8360a;
  --field-mint: #9fdcc4; --field-aqua: #8fcfd6; --field-blue: #8fb0e8;
  --field-yellow: #fbe7a1; --field-pink: #f7c4d3; --field-peach: #fcd6bd;
  --field-lilac: #dcc6f0; --field-sky: #c2e2f3;
  --highlight-a: #c9ecdc; --highlight-b: #b4cdf2;
  --focus: var(--link);
  --star: var(--surface);
  --sky-bg: #fbfaf7;
  --font-sans: Montserrat, "Noto Sans KR", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Noto Sans KR", ui-monospace, monospace;
  --space-4: 4px; --space-8: 8px; --space-16: 16px; --space-24: 24px; --space-40: 40px; --space-64: 64px;
  --radius-0: 0; --radius-2: 2px; --radius-full: 9999px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #1c1a1f; --surface-raised: #252229;
    --ink: #f5f1ec; --ink-muted: #b4ada6; --line: #3a3640;
    --link: #8fd3e0; --signal: #ffa577;
    --field-mint: #1f5a4c; --field-aqua: #1d4f5a; --field-blue: #24407a;
    --field-yellow: #6b5a24; --field-pink: #6e3a4c; --field-peach: #6f4a34;
    --field-lilac: #4b3a6e; --field-sky: #2b4f63;
    --highlight-a: #1f5246; --highlight-b: #2c3770;
    --star: var(--ink);
    --sky-bg: #17162b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #1c1a1f; --surface-raised: #252229;
  --ink: #f5f1ec; --ink-muted: #b4ada6; --line: #3a3640;
  --link: #8fd3e0; --signal: #ffa577;
  --field-mint: #1f5a4c; --field-aqua: #1d4f5a; --field-blue: #24407a;
  --field-yellow: #6b5a24; --field-pink: #6e3a4c; --field-peach: #6f4a34;
  --field-lilac: #4b3a6e; --field-sky: #2b4f63;
  --highlight-a: #1f5246; --highlight-b: #2c3770;
  --star: var(--ink);
  --sky-bg: #17162b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 26px; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
img, svg { display: block; max-width: 100%; }
.mono { font-family: var(--font-mono); }
.label { font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.gloss { font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar (all pages) ---------- */
.bar { position: absolute; z-index: 5; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 26px var(--gutter); }
.mark { display: inline-flex; color: var(--ink); }
.mark svg line { stroke: currentColor; stroke-width: 1.5; }
.bar-left { position: relative; display: inline-flex; align-items: center; gap: 14px; }
.top-menu-btn { appearance: none; border: 0; background: transparent; padding: 0; width: 28px; height: 28px; display: grid; place-items: center; color: var(--ink); cursor: pointer; }
.top-menu-btn svg { width: 26px; height: 26px; }
.top-menu-btn svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.menu-panel.top-menu { position: absolute; top: 40px; left: 0; right: auto; bottom: auto; z-index: 30; }
.mark svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mark svg circle { fill: currentColor; }
.theme-btn { appearance: none; border: 1px solid color-mix(in oklab, var(--ink) 30%, transparent); background: transparent; color: var(--ink); width: 34px; height: 34px; border-radius: var(--radius-full); display: grid; place-items: center; cursor: pointer; }
.theme-btn svg { width: 17px; height: 17px; }
.theme-btn svg circle, .theme-btn svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .i-sun { display: none; } :root:not([data-theme="light"]) .theme-btn .i-moon { display: block; } }

/* ---------- watercolor Grue sky ---------- */
.sky { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(160deg, var(--field-mint) 0%, var(--field-aqua) 45%, var(--field-blue) 100%); }
.sky .pool { position: absolute; border-radius: var(--radius-full); filter: blur(60px); }
.sky .p1 { width: 52%; height: 68%; left: -12%; top: -14%; background: var(--field-mint); opacity: .9; }
.sky .p2 { width: 46%; height: 64%; left: 36%; top: 25%; background: var(--field-aqua); opacity: .8; }
.sky .p3 { width: 56%; height: 75%; left: 60%; top: 46%; background: var(--field-blue); opacity: .9; }
.sky .p4 { width: 36%; height: 40%; left: 18%; top: 54%; background: var(--surface); opacity: .35; }
.sky .p5 { width: 30%; height: 36%; left: 64%; top: 7%; background: var(--surface); opacity: .3; }
.sky .p6 { width: 24%; height: 29%; left: 82%; top: 25%; background: var(--field-lilac); opacity: .5; }
.sky .grain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .25; mix-blend-mode: soft-light; }

/* ---------- home hero ---------- */
.hero-track { height: 190vh; position: relative; }
.hero { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 520px; overflow: hidden; --name-size: clamp(76px, 16vw, 200px); --name-lift: calc(var(--name-size) * -0.12); --sky-gap: 72px; }
.bands { position: absolute; inset: 0; display: flex; pointer-events: none; }
.bands i { flex: none; height: 100%; }
.bands i.light { background: var(--surface); }
.wash { position: absolute; inset: 0; background: var(--surface); opacity: 0; pointer-events: none; }
.nameplate { position: absolute; z-index: 3; left: max(calc(var(--gutter) - 4px), calc((100% - 1080px) / 2 + var(--gutter) - 4px)); bottom: -0.12em; display: flex; align-items: flex-end; gap: .1em; font-size: clamp(76px, 16vw, 200px); }
.name { margin: 0; white-space: nowrap; font-size: 1em; line-height: .9; font-weight: 600; letter-spacing: -0.035em;
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 10%, color-mix(in oklab, var(--ink) 55%, var(--field-aqua)) 24%, color-mix(in oklab, var(--ink) 22%, var(--field-aqua)) 38%, color-mix(in oklab, var(--ink) 10%, var(--field-blue)) 50%, color-mix(in oklab, var(--ink) 6%, var(--field-blue)) 100%);
  background-size: 200% 100%; background-position: 0% 0; -webkit-background-clip: text; background-clip: text; color: transparent; mix-blend-mode: multiply; }
:root[data-theme="dark"] .name { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .name { mix-blend-mode: screen; } }
.role { position: absolute; z-index: 3; left: max(var(--gutter), calc((100% - 1080px) / 2 + var(--gutter))); bottom: calc(clamp(76px, 16vw, 200px) * .82); margin: 0; font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); opacity: .75; }
.profiles { display: flex; flex-wrap: wrap; gap: var(--space-8); margin: var(--space-16) 0 var(--space-24); padding: 0; list-style: none; }
.profiles a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-full); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink); text-decoration: none; }
.profiles a:hover { border-color: var(--ink); }
.hero-links { display: flex; gap: 12px; padding-bottom: .24em; }
.hero-links a { display: block; width: 28px; height: 28px; color: var(--star); opacity: .5; filter: drop-shadow(0 1px 4px rgba(20, 40, 60, .18)); transition: opacity .2s, transform .2s; }
.hero-links a:hover { opacity: 1; transform: translateY(-2px); }
.hero-links svg { width: 100%; height: 100%; }
.hero-links .cv-link { position: relative; text-decoration: none; }
.cv-ring { display: grid; place-items: center; width: 100%; height: 100%; border: 1.8px solid currentColor; border-radius: var(--radius-full); font-family: var(--font-sans); font-size: 10.5px; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.hero-links .cv-badge { position: absolute; right: -5px; bottom: -5px; width: 14px; height: 14px; }
.cv-badge circle { fill: currentColor; }
.cv-badge path { fill: none; stroke: var(--field-blue); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.scroll-hint { position: absolute; z-index: 3; right: calc(var(--gutter) + 12px); bottom: 28px; width: 1px; height: 32px; background: var(--ink); opacity: .35; }

/* constellation */
/* the constellation sits a fixed distance above the name, wherever the name lands */
.constellation { position: absolute; z-index: 4; right: 0; top: auto; bottom: calc(var(--name-lift) + var(--name-size) * 1.05 + var(--sky-gap)); width: min(100%, 1000px); height: min(560px, 62svh); pointer-events: none; }
.constellation svg { width: 100%; height: 100%; overflow: visible; }
.constellation .path { fill: none; stroke: var(--star); stroke-opacity: .8; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.constellation .dust { fill: var(--star); }
.constellation .twinkle { stroke: var(--star); stroke-width: 1; stroke-linecap: round; opacity: .7; }
.star { pointer-events: auto; cursor: pointer; text-decoration: none; }
.star:focus { outline: none; }
.star .bloom { fill: url(#bloom); opacity: .6; transform-box: fill-box; transform-origin: center; transform: scale(.75); transition: opacity .35s ease, transform .35s ease; }
.star .core { fill: var(--star); transition: r .3s ease; }
.star .spike { stroke: var(--star); stroke-width: 1.2; stroke-linecap: round; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.4); transition: opacity .35s ease, transform .35s ease; }
.star text { font-family: var(--font-sans); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; fill: var(--ink); fill-opacity: .62; transition: fill-opacity .3s; }
.star:hover .bloom, .star:focus-visible .bloom { opacity: 1; transform: scale(1.4); }
.star:hover .spike, .star:focus-visible .spike { opacity: 1; transform: scale(1); }
.star:hover .core, .star:focus-visible .core { r: 4.5; }
.star .globe, .star .ring { fill: none; stroke: var(--star); stroke-linecap: round; }
.star .saturn { transition: transform .4s ease; }
.star.planet:hover .saturn, .star.planet:focus-visible .saturn { transform: rotate(-14deg) scale(1.12); }
.star:hover text, .star:focus-visible text { fill-opacity: 1; }
.star:focus-visible .core { stroke: var(--focus); stroke-width: 2; }

/* intro under the hero */
.intro { position: relative; z-index: 2; max-width: 1080px; margin: 0 auto; padding: var(--space-64) var(--gutter); background: var(--surface); }
.intro .lead { font-size: clamp(22px, 3vw, 34px); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; max-width: 26ch; margin: 0 0 var(--space-40); text-wrap: balance; }
.intro.about { padding-top: 0; }
.alias { display: block; margin-top: var(--space-4); }
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--space-16); padding: var(--space-16) 0; border-top: 1px solid var(--line); }
.news li:first-child { border-top: 0; padding-top: 0; }
.news .gloss { line-height: 26px; }
@media (max-width: 760px) { .news li { grid-template-columns: 1fr; gap: var(--space-4); } }
.arc { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-24); border-top: 1px solid var(--line); padding-top: var(--space-24); }
.arc a { color: inherit; text-decoration: none; display: block; }
.arc h3 { margin: var(--space-8) 0 var(--space-4); font-size: 20px; line-height: 28px; font-weight: 600; }
.arc p { margin: 0; color: var(--ink-muted); font-size: 15px; line-height: 24px; }
.arc .chip { display: inline-block; width: 28px; height: 8px; border-radius: var(--radius-full); }
.arc a:hover h3 { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- section pages ---------- */
.page-head { position: relative; height: 300px; overflow: hidden; }
.page-head .title { position: absolute; z-index: 3; left: var(--gutter); bottom: 28px; margin: 0; font-size: clamp(44px, 8vw, 88px); line-height: .95; font-weight: 600; letter-spacing: -0.03em; }
.mini-nav { position: absolute; z-index: 4; right: var(--gutter); top: 84px; width: min(420px, 60vw); }
.mini-nav svg { width: 100%; height: auto; overflow: visible; }
.mini-nav .path { fill: none; stroke: var(--star); stroke-opacity: .85; stroke-width: 1; }
.mini-nav .star text { font-size: 10px; }
.mini-nav .star.current .core { fill: var(--signal); r: 4; }
.mini-nav .star.current text { fill-opacity: 1; }

main.content { max-width: 1080px; margin: 0 auto; padding: var(--space-64) var(--gutter) 120px; }
.section { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-24) var(--space-40); padding: var(--space-40) 0; border-top: 1px solid var(--line); }
.section > header .label { display: block; margin-bottom: var(--space-8); }
.section > header h2 { margin: 0; font-size: 22px; line-height: 30px; font-weight: 600; }
.section > header .sw { display: block; width: 36px; height: 10px; border-radius: var(--radius-full); margin-bottom: var(--space-16); }
.body p { margin: 0 0 var(--space-16); max-width: 68ch; }
.body h3 { margin: 0 0 var(--space-4); font-size: 18px; line-height: 26px; font-weight: 600; }
.body .meta { margin: 0 0 var(--space-16); }
.facts { display: flex; flex-wrap: wrap; gap: var(--space-8); margin: var(--space-16) 0; padding: 0; list-style: none; }
.facts li { font-family: var(--font-mono); font-size: 13px; line-height: 20px; padding: 4px 10px; border-radius: var(--radius-2); background: var(--highlight-a); color: var(--ink); }
.facts li:nth-child(even) { background: var(--highlight-b); }
.csw { display: grid; grid-template-columns: 96px 1fr; gap: 2px var(--space-16); margin: var(--space-16) 0; max-width: 68ch; }
.csw dt { font-family: var(--font-mono); font-size: 11px; line-height: 24px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.csw dd { margin: 0; }
.bul { margin: 0 0 var(--space-16); padding-left: 18px; max-width: 68ch; }
.bul li { margin-bottom: 6px; }
.item { padding: var(--space-24) 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 0; }
.item .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-8); align-items: baseline; }
/* Writing & tools: compact rows that open into a card (one at a time) */
.xlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); --ease: cubic-bezier(.2,.8,.2,1); --spring: cubic-bezier(.34,1.32,.5,1); }
.x { border-bottom: 1px solid var(--line); transition: opacity .35s var(--ease); }
.xlist.has-open .x:not(.open) { opacity: .45; }
.xlist.has-open .x:not(.open):hover { opacity: 1; }
.x-row { position: relative; appearance: none; border: 0; background: transparent; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  display: flex; align-items: center; gap: var(--space-16); padding: 14px 40px 14px 72px; min-height: 76px; transition: padding .5s var(--spring); }
.x-row:hover .x-t { color: var(--link); }
.x-thumb { position: absolute; left: 8px; top: 14px; width: 48px; height: 48px; border-radius: 2px; transition: width .55s var(--spring), height .55s var(--spring);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(70% 90% at var(--p1, 15% 20%), var(--c1) 0, transparent 70%), radial-gradient(70% 90% at var(--p2, 90% 85%), var(--c2) 0, transparent 72%), linear-gradient(var(--c0), var(--c0));
  background-blend-mode: overlay, normal, normal, normal; }
.x-thumb[data-tone="blue"]   { --c0: var(--field-blue);   --c1: var(--field-sky);    --c2: var(--field-lilac); }
.x-thumb[data-tone="pink"]   { --c0: var(--field-pink);   --c1: var(--field-peach);  --c2: var(--field-lilac); --p1: 85% 15%; --p2: 10% 90%; }
.x-thumb[data-tone="mint"]   { --c0: var(--field-aqua);   --c1: var(--field-mint);   --c2: var(--field-blue); }
.x-thumb[data-tone="yellow"] { --c0: var(--field-yellow); --c1: var(--field-peach);  --c2: var(--field-mint); --p1: 80% 80%; --p2: 10% 10%; }
.x-thumb[data-tone="lilac"]  { --c0: var(--field-lilac);  --c1: var(--field-sky);    --c2: var(--field-pink); --p1: 20% 85%; --p2: 90% 15%; }
.x-thumb[data-tone="aqua"]   { --c0: var(--field-mint);   --c1: var(--field-yellow); --c2: var(--field-aqua); --p1: 90% 20%; }
.x-thumb[data-tone="xmas"]   { --c0: var(--field-mint);   --c1: var(--field-yellow); --c2: var(--field-pink); --p1: 50% 8%; --p2: 85% 90%; }
.x-thumb[data-tone="dusk"]   { background-image: radial-gradient(circle, rgba(255, 196, 110, .6) 0 .9px, transparent 1.5px), radial-gradient(90% 75% at 50% 118%, #ff8a4a 0, transparent 72%), linear-gradient(#1b2150, #3a2f6b 58%, #b8577a);
  background-size: 6px 6px, auto, auto; background-blend-mode: normal; }
.x-head { display: flex; flex-direction: column-reverse; gap: 2px; min-width: 0; }
.x-t { font-weight: 600; line-height: 22px; transition: color .2s; }
.x-chev { position: absolute; right: 12px; top: 34px; width: 8px; height: 8px; border-right: 1.5px solid var(--ink-muted); border-bottom: 1.5px solid var(--ink-muted); transform: rotate(45deg); transition: transform .4s var(--spring); }
.x.open .x-row { padding: 108px 40px 10px 8px; }
.x.open .x-thumb { width: calc(100% - 16px); height: 82px; }
.x.open .x-chev { transform: rotate(-135deg); }
.x-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.x.open .x-panel, .xlist:not(.js) .x-panel { grid-template-rows: 1fr; }
.x-in { overflow: hidden; padding: 0 8px; opacity: 0; transform: translateY(8px); transition: opacity .3s var(--ease), transform .4s var(--ease); }
.x.open .x-in, .xlist:not(.js) .x-in { opacity: 1; transform: none; transition-delay: .12s; }
.x-in p { margin: 0 0 var(--space-16); color: var(--ink-muted); max-width: 60ch; }
.x-go { display: inline-block; margin-bottom: var(--space-24); padding: 6px 14px; border-radius: var(--radius-full); background: var(--ink); color: var(--surface); font-size: 13px; line-height: 20px; font-weight: 600; text-decoration: none; }
.x-go:hover { background: var(--link); }
@media (prefers-reduced-motion: reduce) { .x, .x-row, .x-thumb, .x-chev, .x-panel, .x-in { transition: none; } }

/* research map */
.map-wrap { position: relative; max-width: 1080px; margin: 0 auto; padding: var(--space-40) var(--gutter) 0; }
.map-wrap svg { width: 100%; height: auto; }
.rm .s { stroke: var(--ink); stroke-opacity: .45; stroke-width: 1; vector-effect: non-scaling-stroke; }
.rm .f { mix-blend-mode: multiply; fill-opacity: .78; }
:root[data-theme="dark"] .rm .f { mix-blend-mode: normal; fill-opacity: .55; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rm .f { mix-blend-mode: normal; fill-opacity: .55; } }
.rm .yellow { fill: var(--field-yellow); } .rm .cream { fill: color-mix(in oklab, var(--field-yellow) 35%, var(--surface)); }
.rm .peach { fill: var(--field-peach); } .rm .pink { fill: var(--field-pink); } .rm .lilac { fill: var(--field-lilac); }
.rm .sky2 { fill: var(--field-sky); } .rm .sand { fill: color-mix(in oklab, var(--field-peach) 55%, var(--line)); }
.rm .none { fill: none; }
.rm .grid { stroke: var(--ink); stroke-opacity: .2; stroke-width: 1; vector-effect: non-scaling-stroke; }
.rm .spine { stroke: var(--ink); stroke-opacity: .55; stroke-width: 1; vector-effect: non-scaling-stroke; }
.rm .zone { transition: opacity .3s; cursor: pointer; }
.rm.focus .zone { opacity: .35; }
.rm.focus .zone.on { opacity: 1; }
.map-legend { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: var(--space-16); }
.map-legend a { color: inherit; text-decoration: none; }
.map-legend a:nth-child(2) { text-align: center; } .map-legend a:nth-child(3) { text-align: right; }
.map-legend a:hover .label, .map-legend a.on .label { color: var(--ink); }

.fig { margin: var(--space-16) 0 var(--space-24); max-width: 680px; }
.fig img { width: 100%; height: auto; border: 1px solid var(--line); background: #fff; }
.fig figcaption { margin-top: var(--space-8); }
.fig .crop { overflow: hidden; border: 1px solid var(--line); background: #fff; }
.fig .crop img { border: 0; width: 100%; height: 100%; object-fit: cover; object-position: bottom; }
.fig-pair .fig { margin-bottom: var(--space-16); }
.fig .video { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--line); background: #f6f8fb; }
.sib { margin: 4px 0 var(--space-16); max-width: 680px; }
.sib summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.sib summary::-webkit-details-marker { display: none; }
.sib summary:hover { border-color: var(--link); }
.sib summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sib-arrow { flex: none; width: 8px; height: 8px; border-right: 2px solid var(--link); border-bottom: 2px solid var(--link); transform: rotate(-45deg); transition: transform .25s ease; }
.sib[open] .sib-arrow { transform: rotate(45deg); }
.sib-body { padding: var(--space-8) 2px 0; }
.sib-body .fig { margin-top: var(--space-8); }
@media (prefers-reduced-motion: reduce) { .sib-arrow { transition: none; } }
.fig .video video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }

/* line-art robot doodle: context in (?), cue noticed (!) */
.robot { margin: 0 0 var(--space-16); width: 120px; }
.robot svg { width: 120px; height: 72px; overflow: visible; }
.robot .pen { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.robot .thin { stroke-width: 1; opacity: .6; }
.robot .head { fill: var(--field-mint); }
.robot .ear, .robot .leg { fill: var(--field-blue); }
.robot .tip { fill: var(--field-yellow); }
.robot .cheek { fill: var(--field-pink); }
.robot .dot { fill: var(--ink); }
.robot .q { stroke: var(--ink-muted); }
.robot .dot.q { fill: var(--ink-muted); stroke: none; }
.robot .ex { stroke: var(--signal); }
.robot .dot.ex { fill: var(--signal); stroke: none; }
.robot .bot { animation: bob 4s ease-in-out infinite; transform-origin: 60px 40px; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .robot .bot { animation: none; } }

/* timeline (education, experience) */
.tl { position: relative; margin: 0; padding: 0 0 0 28px; list-style: none; }
.tl::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl > li { position: relative; padding-bottom: var(--space-24); }
.tl > li::before { content: ""; position: absolute; left: -27px; top: 8px; width: 9px; height: 9px; border-radius: var(--radius-full); background: var(--surface); border: 1.5px solid var(--ink); }
.tl > li.major::before { background: var(--ink); }
.cert-dots { display: flex; margin: var(--space-8) 0 var(--space-24); }
.cert-dots span { width: 56px; height: 56px; border-radius: var(--radius-full); margin-right: -18px; mix-blend-mode: multiply; }
:root[data-theme="dark"] .cert-dots span { mix-blend-mode: screen; opacity: .9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cert-dots span { mix-blend-mode: screen; opacity: .9; } }

details.more { margin-top: var(--space-16); border-top: 1px solid var(--line); }
details.more summary { cursor: pointer; list-style: none; padding: var(--space-16) 0; display: flex; align-items: center; gap: var(--space-8); }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-muted); border-bottom: 1.5px solid var(--ink-muted); transform: rotate(-45deg); transition: transform .2s; }
details.more[open] summary::before { transform: rotate(45deg); }
details.more summary:hover .label { color: var(--ink); }
.tl details.more { margin-top: var(--space-8); }
.tl details.more summary { padding: var(--space-8) 0; }
.links-row { font-size: 14px; line-height: 22px; margin: 0 0 var(--space-8); }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 28px; transform: translate(-50%, 8px); padding: 10px 16px; border-radius: var(--radius-full); background: var(--ink); color: var(--surface); font-family: var(--font-mono); font-size: 12px; line-height: 16px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.to-top { position: fixed; z-index: 20; right: var(--gutter); bottom: 24px; width: 44px; height: 44px; border-radius: var(--radius-full); border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 10px rgba(20, 40, 60, .08); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .25s, transform .25s, border-color .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top.to-menu { right: calc(var(--gutter) + 54px); }
.to-top.to-menu { transition: opacity .25s, transform .25s, border-color .2s, right .25s; }
.to-top.to-menu.solo, .menu-panel.solo { right: var(--gutter); }
.menu-panel { position: fixed; z-index: 21; right: calc(var(--gutter) + 54px); bottom: 80px; min-width: 180px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 6px 24px rgba(20, 40, 60, .12); }
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 20px; font-weight: 500; }
.menu-panel a::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--line); flex: none; }
.menu-panel a:hover, .menu-panel a:focus-visible { background: var(--surface-raised); }
.menu-panel a[aria-current="page"]::before { background: var(--signal); }
.menu-panel a[aria-current="page"] { font-weight: 600; }
.menu-panel .menu-cv { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.menu-panel .menu-cv a::before { display: none; }
.menu-panel .menu-cv a { font-weight: 600; }
footer.site .cv-foot { font-weight: 600; }
/* leave room so the floating buttons never sit on the footer links */
footer.site { padding-bottom: 96px; }
.to-top:hover { border-color: var(--ink); }
.to-top svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

footer.site { border-top: 1px solid var(--line); padding: var(--space-40) var(--gutter); max-width: 1080px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: var(--space-16) var(--space-40); justify-content: space-between; }
footer.site .links { display: flex; flex-wrap: wrap; gap: var(--space-24); }
footer.site:has(.peek) { position: relative; padding-bottom: 104px; }

@media (max-width: 760px) {
  .arc { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
  .hero-links { flex-direction: column; gap: 10px; padding-bottom: .3em; }
  .hero-links a { width: 22px; height: 22px; }
  .cv-ring { font-size: 8.5px; border-width: 1.5px; }
  .hero-links .cv-badge { width: 11px; height: 11px; right: -4px; bottom: -4px; }
  .nameplate { bottom: 20px; }
  .hero { --name-lift: 20px; --sky-gap: 56px; }
  .intro { padding-top: var(--space-24); }
  .role { font-size: 9.5px; line-height: 14px; letter-spacing: .05em; right: var(--gutter); bottom: calc(20px + clamp(76px, 16vw, 200px) * 1.02); }
  .section { grid-template-columns: 1fr; gap: var(--space-16); }
  .csw { grid-template-columns: 1fr; }
  .csw dt { line-height: 18px; margin-top: var(--space-8); }
  .constellation { width: 100%; }
  .page-head { height: 260px; }
  .mini-nav { top: 74px; width: 72vw; }
  .map-legend .label { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .star .bloom, .star .spike, .star .core, .rm .zone { transition: none; }
}

/* ---------- Publications: sky / list views ---------- */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-full); padding: 2px; margin-bottom: var(--space-16); }
.view-toggle button { appearance: none; border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; border-radius: var(--radius-full);
  font-family: var(--font-mono); font-size: 11px; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; padding: 5px 14px; transition: background .25s, color .25s; }
.view-toggle button:hover { color: var(--ink); }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
[data-pubs] [hidden] { display: none !important; }
[data-pubs] .body { min-width: 0; }
.pub-sky { position: relative; max-width: 100%; border: 1px solid var(--line); background: var(--sky-bg); color: var(--ink); }
.sky-scroll { overflow: visible; }
.pub-sky.narrow .sky-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.sky-stage { position: relative; min-width: 580px; }
.sky-scroll::-webkit-scrollbar { display: none; }
.pub-sky svg { width: 100%; height: auto; }
.pub-sky .pen { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pub-sky .thin { stroke-width: 1; }
.pub-sky .hatch { stroke-width: 1; opacity: .55; }
.pub-sky .route { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-dasharray: .5 9; stroke-linecap: round; opacity: .4; }
.pub-sky .stars { fill: currentColor; }
.pub-sky .tw { animation: sky-tw 3.6s ease-in-out infinite; }
@keyframes sky-tw { 0%, 100% { opacity: .2; } 50% { opacity: .85; } }
.pub-sky .rock { fill: var(--sky-bg); }
.planet { cursor: pointer; outline: none; }
.planet .fill { fill: var(--tone); }
.planet .crater { fill: var(--sky-bg); fill-opacity: .45; }
.planet .band { fill: var(--band); opacity: .75; }
.planet .halo { fill: none; stroke: var(--shine); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; opacity: 0; transition: opacity .3s; }
.planet .pl { transition: filter .35s; }
.planet.hot .pl, .planet:hover .pl, .planet:focus-visible .pl { filter: drop-shadow(0 0 6px var(--shine)) drop-shadow(0 0 16px var(--shine)); }
.planet.hot .halo, .planet:hover .halo, .planet:focus-visible .halo, .planet.here .halo { opacity: .95; }
.planet .yr { font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; fill: var(--ink-muted); transition: fill .25s; }
.planet:hover .yr, .planet:focus-visible .yr, .planet.here .yr { fill: var(--ink); }
.planet .hit { fill: transparent; }
.rocket .body { fill: var(--sky-bg); }
.rocket .win { fill: var(--field-sky); }
.rocket .flame { fill: #ffb277; }
.pub-sky .hint { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; fill: var(--ink-muted); opacity: .8; }
.pub-sky:not(.narrow) + .sky-info { display: none; }
.sky-info { padding: var(--space-16) 0 0; min-height: 84px; }
.sky-info.idle { color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) { .pub-sky .tw { animation: none; opacity: .6; } .planet .pl { transition: none; } }
.sky-tags { position: absolute; inset: 0; pointer-events: none; }
.tag { position: absolute; z-index: 1; transform: translateX(-50%); pointer-events: auto; cursor: pointer; overflow: hidden;
  max-width: calc(var(--kw, 90px) + 22px); padding: 2px 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--sky-bg);
  transition: max-width .5s cubic-bezier(.34,1.25,.5,1), padding .3s, border-color .3s, box-shadow .3s; }
.tag.al { transform: translateX(-26px); }
.tag.ar { transform: translateX(calc(-100% + 26px)); }
.tag .kw { display: block; width: max-content; white-space: nowrap; font-family: var(--font-mono); font-size: 11px; line-height: 18px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); transition: color .25s; }
.tag .full { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s cubic-bezier(.2,.8,.2,1); }
.tag .fin { overflow: hidden; width: 250px; opacity: 0; transition: opacity .2s; }
.tag .fin .gloss { display: block; margin-top: 4px; font-size: 11px; line-height: 16px; }
.tag .fin .tt { display: block; font-size: 13px; line-height: 19px; font-weight: 600; color: var(--ink); }
.tag .fin a { color: var(--ink); text-decoration-color: var(--shine); text-decoration-thickness: 2px; }
.tag .fin a:hover { color: var(--link); }
.tag.open { z-index: 3; max-width: 272px; padding: 6px 10px 10px; border-color: var(--shine); box-shadow: 0 8px 28px rgba(20, 18, 30, .14); }
.tag.open .kw, .tag.sel .kw { color: var(--ink); }
.tag.sel { border-color: var(--shine); }
.tag.open .full { grid-template-rows: 1fr; }
.tag.open .fin { opacity: 1; transition: opacity .3s .12s; }
.pub-sky.narrow .tag { pointer-events: none; }
.pub-sky.narrow .tag.open { max-width: calc(var(--kw, 90px) + 22px); padding: 2px 10px; box-shadow: none; }
.pub-sky.narrow .tag .full { display: none; }
@media (prefers-reduced-motion: reduce) { .tag, .tag .full, .tag .fin { transition: none; } }
.sky-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-16); margin-bottom: var(--space-16); }
.sky-bar .view-toggle { margin-bottom: 0; }
.sky-nav { display: inline-flex; gap: var(--space-8); }
.sky-nav button { appearance: none; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: var(--radius-full); background: transparent; color: var(--ink); cursor: pointer; font-size: 15px; line-height: 1; transition: border-color .2s, background .2s, opacity .2s; }
.sky-nav button:hover:not(:disabled) { border-color: var(--ink); background: var(--surface-raised); }
.sky-nav button:disabled { opacity: .3; cursor: default; }
article.item[id] { scroll-margin-top: 72px; }
article.item.flash { animation: item-flash 2.2s ease-out; }
@keyframes item-flash { 0%, 25% { box-shadow: -14px 0 0 -10px var(--field-aqua); background: color-mix(in srgb, var(--highlight-a) 45%, transparent); } 100% { box-shadow: -14px 0 0 -10px transparent; background: transparent; } }
@media (prefers-reduced-motion: reduce) { article.item.flash { animation: none; } }

/* ---------- peeking friends: fun projects, from the bottom of the page ---------- */
.peek { position: absolute; z-index: 2; left: var(--gutter); bottom: 0; display: flex; align-items: flex-end; gap: 6px; pointer-events: none; }
.pk { position: static; }
.pk-bot { --w: 92px; --h: 58px; --sh: 74px; --hide: 42px; --show: 1px; --tilt: -6deg; }
.pk-tree { --w: 64px; --h: 84px; --sh: 83.2px; --hide: 66px; --show: 1px; --tilt: 5deg; }
.pk-btn { position: relative; display: block; width: var(--w); height: var(--h); padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.pk-btn svg { position: absolute; left: 0; top: 0; width: var(--w); height: var(--sh); overflow: visible; transform: translateY(var(--hide)); transform-origin: 50% 100%;
  transition: transform .55s cubic-bezier(.34,1.5,.5,1); }
.pk-btn:hover svg, .pk-btn:focus-visible svg, .pk.open .pk-btn svg { transform: translateY(var(--show)) rotate(var(--tilt)); }
.pk-btn:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; border-radius: 12px 12px 0 0; }
.peek .pen { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.peek .thin { stroke-width: 1; opacity: .6; }
.peek .head, .peek .tier { fill: var(--field-mint); }
.peek .ear { fill: var(--field-blue); }
.peek .tip, .peek .star, .peek .chick { fill: var(--field-yellow); }
.peek .bead { fill: var(--b); stroke-width: 1; }
.peek .gl { opacity: .8; }
.peek .heart { fill: var(--field-pink); stroke-width: 1.1; }
.peek .ceye { fill: var(--surface); stroke-width: 1.3; }
.peek .beak { fill: var(--field-peach); stroke-width: 1.1; }
.peek .cheek { fill: var(--field-pink); opacity: 0; transition: opacity .3s; }
.pk-btn:hover .cheek, .pk.open .cheek { opacity: 1; }
.peek .dot { fill: var(--ink); }
.peek .eyes { animation: peek-blink 5s infinite; transform-box: fill-box; transform-origin: center; }
.pk-tree .eyes { animation-delay: -2.2s; }
.peek .mouth { opacity: 0; transition: opacity .25s; }
.pk-btn:hover .mouth, .pk.open .mouth { opacity: 1; }
.peek .ant { transform-origin: 46px 20px; animation: peek-wiggle 3.2s ease-in-out infinite; }
.peek .star { transform-box: fill-box; transform-origin: center; animation: peek-twinkle 2.8s ease-in-out infinite; }
@keyframes peek-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes peek-wiggle { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(4deg); } }
@keyframes peek-twinkle { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.08); } }
.pk-say { position: absolute; z-index: 3; left: var(--sx, calc(var(--w) - 22px)); bottom: calc(var(--h) - 6px); width: min(300px, var(--sw, 300px)); padding: 14px 16px 16px; pointer-events: auto;
  background: var(--surface); color: var(--ink); border: 1.6px solid var(--ink); border-radius: 18px 225px 16px 255px / 255px 18px 225px 16px;
  box-shadow: 4px 4px 0 -1px var(--field-yellow); transform-origin: 0 100%; transform: scale(.6) rotate(-4deg); opacity: 0; visibility: hidden;
  transition: transform .45s cubic-bezier(.34,1.5,.5,1), opacity .2s, visibility 0s .45s; }
.pk-say::after { content: ""; position: absolute; left: 10px; bottom: -12px; width: 18px; height: 14px; background: var(--surface);
  border-left: 1.6px solid var(--ink); border-bottom: 1.6px solid var(--ink); border-bottom-left-radius: 14px 12px; transform: skewX(-28deg); }
.pk.open .pk-say { transform: none; opacity: 1; visibility: visible; transition: transform .45s cubic-bezier(.34,1.5,.5,1), opacity .2s, visibility 0s; }
.pk-say .label { display: block; margin-bottom: 6px; }
.pk-say b { display: block; font-size: 15px; line-height: 21px; padding-right: 18px; }
.pk-say p { margin: 4px 0 12px; font-size: 13px; line-height: 19px; color: var(--ink-muted); }
.pk-go { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border: 1.4px solid var(--ink); background: var(--field-mint); color: var(--ink); text-decoration: none;
  font-size: 13px; line-height: 18px; font-weight: 600; border-radius: 14px 225px 16px 255px / 255px 16px 225px 14px; transform: rotate(-1.5deg); transition: transform .3s cubic-bezier(.34,1.5,.5,1), box-shadow .3s; }
.pk-go:hover { transform: rotate(0) translate(-1px, -1px); box-shadow: 3px 3px 0 -1px var(--ink); }
.pk-x { position: absolute; right: 8px; top: 6px; width: 26px; height: 26px; border: 0; background: none; color: var(--ink-muted); cursor: pointer; font-size: 18px; line-height: 1; border-radius: 50%; }
.pk-x:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .pk-btn svg, .pk-say, .pk-go { transition: none; } .peek .eyes, .peek .ant, .peek .star { animation: none; } }
@media print { .peek { display: none; } }

/* ---------- December theme: html.xmas, switched on by main.js from Dec 1 to Jan 6 ---------- */
:root.xmas .hero, :root.xmas .page-head {
  --field-mint: #d4e5f4; --field-aqua: #bad1ee; --field-blue: #a6b6ea; --field-lilac: #f1cbd5;
}
:root.xmas[data-theme="dark"] .hero, :root.xmas[data-theme="dark"] .page-head {
  --field-mint: #17345c; --field-aqua: #1b2b60; --field-blue: #201f58; --field-lilac: #4d2247; --star: #ffe3a8;
}
@media (prefers-color-scheme: dark) {
  :root.xmas:not([data-theme="light"]) .hero, :root.xmas:not([data-theme="light"]) .page-head {
    --field-mint: #17345c; --field-aqua: #1b2b60; --field-blue: #201f58; --field-lilac: #4d2247; --star: #ffe3a8;
  }
}
/* New Year (html.xmas.newyear): a dawn sky instead of the winter one */
:root.newyear .hero, :root.newyear .page-head {
  --field-mint: #fcdcc8; --field-aqua: #f7cad6; --field-blue: #d3c9f0; --field-lilac: #fde4a6;
}
:root.newyear[data-theme="dark"] .hero, :root.newyear[data-theme="dark"] .page-head {
  --field-mint: #2b2c66; --field-aqua: #43306a; --field-blue: #22235a; --field-lilac: #74404f; --star: #ffd9a8;
}
@media (prefers-color-scheme: dark) {
  :root.newyear:not([data-theme="light"]) .hero, :root.newyear:not([data-theme="light"]) .page-head {
    --field-mint: #2b2c66; --field-aqua: #43306a; --field-blue: #22235a; --field-lilac: #74404f; --star: #ffd9a8;
  }
}
.xmas-town.globe { width: clamp(190px, 19vw, 290px); filter: drop-shadow(0 14px 20px rgba(60, 30, 50, .2)); }
@media (max-width: 760px) { .xmas-town.globe { width: min(36vw, 200px); } }
/* New Year banner: a small cloth banner hung across the front of the globe's base */
.ny-banner { position: absolute; z-index: 1; left: 50%; bottom: 9%; margin: 0; padding: 5px 12px 6px; text-align: center;
  background: #fff8ec; color: #b3261e; border-top: 2px solid #d9a441; border-bottom: 2px solid #d9a441; border-radius: 2px;
  font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  box-shadow: 0 6px 12px rgba(120, 50, 60, .18); transform: translateX(-50%); transform-origin: 50% -16px; animation: banner-sway 5.5s ease-in-out infinite; }
.ny-strings { position: absolute; left: 0; top: -17px; width: 100%; height: 16px; overflow: visible; }
.ny-strings path { fill: none; stroke: #b08a52; stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.ny-strings circle { fill: #d9a441; }
:root[data-theme="dark"] .ny-banner { background: #3b2150; color: #ffd98a; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ny-banner { background: #3b2150; color: #ffd98a; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); } }
@keyframes banner-sway { 0%, 100% { transform: translateX(-50%) rotate(-2deg); } 50% { transform: translateX(-50%) rotate(2deg); } }
@media (max-width: 760px) { .ny-banner { font-size: 10px; line-height: 13px; padding: 4px 9px 5px; } }
@media (prefers-reduced-motion: reduce) { .ny-banner { animation: none; } }
.bar-right { display: inline-flex; align-items: center; gap: 10px; }
.snow-btn svg path { stroke-width: 1.5; }
.snow-btn[aria-pressed="false"] { opacity: .5; }
.xmas-snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.xmas-town { position: absolute; right: max(var(--gutter), calc((100% - 1360px) / 2)); bottom: 4vh; width: clamp(220px, 26vw, 390px); height: auto;
  pointer-events: none; opacity: 0; transition: opacity .8s ease; filter: drop-shadow(0 16px 22px rgba(20, 30, 70, .22)); animation: town-float 7s ease-in-out infinite; }
.xmas-town.in { opacity: 1; }
.xmas-town img { display: block; width: 100%; height: auto; }
.xmas-town .town-lights { position: absolute; left: 37.5%; top: 17.262%; width: 26.25%; opacity: 0; animation: tree-twinkle 3.3s ease-in-out infinite; }
.xmas-town .town-lights[data-g="1"] { animation-delay: -1.1s; }
.xmas-town .town-lights[data-g="2"] { animation-delay: -2.2s; }
@keyframes tree-twinkle { 0%, 100% { opacity: 0; } 30% { opacity: 1; } 62% { opacity: 0; } }
.music-btn[hidden] { display: none; }
@keyframes town-float { 50% { transform: translateY(-7px); } }
@media (max-width: 760px) {
  .xmas-town { width: min(46vw, 300px); right: auto; left: var(--gutter); bottom: calc(20px + clamp(76px, 16vw, 200px) * 1.02 + 60px); }
}
@media (prefers-reduced-motion: reduce) { .xmas-town { animation: none; transition: none; } .xmas-town .town-lights { animation: none; opacity: .55; } }
