/* ==========================================================================
   Jinseong Han — personal site
   Plain CSS, no build step.  Sections: tokens · base · pieces · nav · hero ·
   research · demo · publications · about · footer · modal · responsive
   ========================================================================== */

/* ---------- Typeface: NanumSquare, Bold (700) for text + ExtraBold (800) for headings ---------- */
@font-face {
  font-family: "NanumSquare"; font-style: normal; font-weight: 700; font-display: swap;
  src: local("NanumSquare Bold"), local("NanumSquareB"), local("NanumSquareOTF Bold"),
       url("https://cdn.jsdelivr.net/gh/moonspam/NanumSquare@2.0/NanumSquareB.woff2") format("woff2"),
       url("https://cdn.jsdelivr.net/gh/moonspam/NanumSquare@2.0/NanumSquareB.woff") format("woff");
}
@font-face {
  font-family: "NanumSquare"; font-style: normal; font-weight: 800; font-display: swap;
  src: local("NanumSquare ExtraBold"), local("NanumSquareEB"), local("NanumSquareOTF ExtraBold"),
       url("https://cdn.jsdelivr.net/gh/moonspam/NanumSquare@2.0/NanumSquareEB.woff2") format("woff2"),
       url("https://cdn.jsdelivr.net/gh/moonspam/NanumSquare@2.0/NanumSquareEB.woff") format("woff");
}

/* ---------- Tokens ---------- */
:root {
  --sans: "NanumSquare", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: var(--sans); /* labels use the same family; kept as a token so label styles stay grouped */

  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --tint: #eceef6;
  --ink: #0b1020;
  --ink-2: #394154;
  --ink-3: #596177;
  --line: #e0e3ee;
  --line-2: #cdd2e1;
  --hover: rgba(11, 16, 32, .05);
  --nav-bg: rgba(244, 245, 250, .8);

  --accent: #4a3fe0;
  --accent-soft: #ecebff;
  --amber: #f2a20c;
  --amber-ink: #8a5300;
  --amber-soft: #fff2d1;
  --green: #35a873;
  --green-ink: #1b7a52;
  --green-soft: #e1f5ea;
  --mark: #ffe08a;

  --grid: rgba(11, 16, 32, .055);

  --paper: #ffffff; /* research figures always sit on white */
  --shadow-sm: 0 1px 2px rgba(11, 16, 32, .04), 0 4px 14px -8px rgba(11, 16, 32, .1);
  --shadow: 0 1px 2px rgba(11, 16, 32, .05), 0 18px 40px -18px rgba(11, 16, 32, .22);
  --wrap: 1140px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  --bg: #090c17;
  --surface: #111629;
  --surface-2: #0d1222;
  --tint: #0c101f;
  --ink: #f4f6fc;
  --ink-2: #c9cfdf;
  --ink-3: #a9b1c7;
  --line: #1f2640;
  --line-2: #2c3556;
  --hover: rgba(255, 255, 255, .06);
  --nav-bg: rgba(9, 12, 23, .78);

  --accent: #928bff;
  --accent-soft: rgba(146, 139, 255, .14);
  --amber: #fbbf24;
  --amber-ink: #fcd34d;
  --amber-soft: rgba(251, 191, 36, .13);
  --green: #3ecf8e;
  --green-ink: #5fd6a7;
  --green-soft: rgba(64, 200, 160, .13);
  --mark: rgba(251, 191, 36, .34);

  --grid: rgba(255, 255, 255, .045);

  --paper: #f3f4f8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 24px 50px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; scrollbar-gutter: stable; }
html.is-locked { overflow: hidden; }
body {
  margin: 0; font-family: var(--sans); font-size: 16px; font-weight: 700; line-height: 1.6;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
b, strong { font-weight: 800; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - clamp(32px, 6vw, 64px), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); transition: top .2s; }
.skip:focus { top: 12px; }

/* ---------- Pieces ---------- */
.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i--fill { fill: currentColor; }
.i--amber { color: var(--amber); }

.eyebrow { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.no { font-family: var(--mono); font-size: 13px; font-weight: 400; letter-spacing: .06em; color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 550; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--ink-3); }
.btn:active { transform: none; }
.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--primary:hover { border-color: var(--ink); box-shadow: 0 10px 24px -12px var(--ink); }
.btn--sm { height: 36px; padding: 0 13px; border-radius: 10px; font-size: 13.5px; }
.btn--light { background: #fff; border-color: #fff; color: #0b1020; }
.btn--ghost { background: transparent; border-color: rgba(255, 255, 255, .2); color: #e9ecf6; }
.btn--ghost:hover { border-color: rgba(255, 255, 255, .5); }

.iconbtn {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 16px;
  transition: color .2s, border-color .2s, background .2s;
}
.iconbtn:hover { color: var(--ink); border-color: var(--line-2); }

.badges, .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.badge, .chips li, .tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  font-family: var(--mono); font-size: 12px; font-style: normal; letter-spacing: .02em; white-space: nowrap;
}
.badge--amber, .tag--amber { background: var(--amber-soft); border-color: transparent; color: var(--amber-ink); }
.badge--green { background: var(--green-soft); border-color: transparent; color: var(--green-ink); }
.tag { height: 22px; padding: 0 8px; font-size: 11.5px; vertical-align: 1px; }
.tag--muted { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 500; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }

.paper { background: var(--paper); }
[data-theme="dark"] .paper img { filter: brightness(.95); }

/* armed by main.js, so a script that never loads cannot leave the page blank */
.reveal.is-armed { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-armed.is-in { opacity: 1; transform: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .25s;
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__in { display: flex; align-items: center; gap: 14px; height: 72px; }
/* affiliation marks: KAIST | SDL */
.logos { display: flex; align-items: center; gap: 16px; flex: none; }
.logo { display: block; border-radius: 6px; transition: opacity .2s, transform .2s var(--ease); }
.logo:hover { opacity: .82; transform: translateY(-1px); }
.logo img { display: block; width: auto; height: 34px; }
.logo--sdl img { height: 42px; border-radius: 6px; }
.logos__sep { width: 1px; height: 32px; background: var(--line-2); }
[data-theme="light"] .on-dark, [data-theme="dark"] .on-light { display: none; }
.nav__links { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav__links::-webkit-scrollbar { display: none; }
.nav__home { display: inline-flex; align-items: center; padding-inline: 11px; }
.nav__home .i { font-size: 20px; stroke-width: 2.2; }
.nav__links a { padding: 7px 14px; border-radius: 999px; font-size: 16.5px; font-weight: 800; color: var(--ink); white-space: nowrap; transition: color .2s, background .2s, box-shadow .2s; }
.nav__links a:hover { color: var(--ink); background: var(--hover); }
.nav__links a.is-active { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.nav__tools { display: flex; align-items: center; gap: 8px; }
.nav__mail { padding: 7px 14px; border-radius: 999px; font-size: 16.5px; font-weight: 800; color: var(--accent); }
.nav__mail:hover { background: var(--accent-soft); }
[data-theme="light"] .i-sun, [data-theme="dark"] .i-moon { display: none; }
.on-narrow { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(28px, 4.5vw, 60px) 0 clamp(44px, 6vw, 76px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 34px 34px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 72% 38%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 85% at 72% 38%, #000 10%, transparent 72%);
}
.hero__in { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(24px, 5vw, 72px); }
/* status line above the name: same place as before, a notch larger and in the main text colour */
/* 17px, not 18px: this line's own leading is deeper than the tagline's, so a slightly
   smaller margin makes the gaps above and below the name *look* equal (~23px of ink). */
.hero__eyebrow { display: flex; align-items: baseline; gap: 10px; margin-bottom: 17px; font-size: clamp(16px, 1.5vw, 19.5px); font-weight: 800; line-height: 1.45; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
.hero__eyebrow .dot { flex: none; width: 8px; height: 8px; transform: translateY(-1px); }
.hero__name { margin: 0 0 18px; font-weight: 800; font-size: clamp(40px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -.03em; }
.hero__lead { max-width: 24em; text-wrap: balance; font-size: clamp(22px, 2.7vw, 34px); font-weight: 700; line-height: 1.36; letter-spacing: -.02em; color: var(--ink-2); }

.hero__photo { position: relative; z-index: 0; width: clamp(200px, 23vw, 290px); margin: 0 14px 14px 0; }
.hero__photo::before { content: ""; position: absolute; inset: 14px -14px -14px 14px; z-index: -1; border: 2px solid var(--accent); border-radius: 24px; opacity: .55; }
.hero__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 24px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.hero__lead mark { padding: 0 .08em; color: var(--ink); font-weight: 800; background: linear-gradient(transparent 62%, var(--mark) 62%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* interest chips — one hue per topic (reused in the About card) */
.chips { gap: 12px 14px; margin-top: clamp(28px, 3.2vw, 40px); }
.chips li { --c: var(--accent); --c-soft: var(--accent-soft); gap: 9px; height: 36px; padding: 0 17px 0 14px; border-color: transparent; background: var(--c-soft); color: var(--c); font-size: 14.5px; font-weight: 800; letter-spacing: 0; }
.chips li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chips li:nth-child(2) { --c: var(--green-ink); --c-soft: var(--green-soft); }
.chips li:nth-child(3) { --c: var(--amber-ink); --c-soft: var(--amber-soft); }

/* contact / profile links — each in its own brand colour */
.social { display: flex; flex-wrap: wrap; gap: 12px 14px; margin-top: clamp(22px, 2.6vw, 32px); }
.social a { --c: var(--accent); display: inline-flex; align-items: center; gap: 11px; height: 44px; padding: 0 18px 0 15px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); font-size: 15px; font-weight: 800; color: var(--ink); transition: border-color .2s, background .2s, transform .2s var(--ease); }
.social a:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 11%, var(--surface)); transform: translateY(-1px); }
.social .i { font-size: 19px; color: var(--c); stroke-width: 2.2; }
.social .s-mail { --c: #ea4335; }
.social .s-scholar { --c: #4285f4; }
.social .s-linkedin { --c: #0a66c2; }
.social .s-github { --c: var(--ink); }
[data-theme="dark"] .social .s-mail { --c: #ff6b5e; }
[data-theme="dark"] .social .s-scholar { --c: #6ea8ff; }
[data-theme="dark"] .social .s-linkedin { --c: #4aa3ff; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections ---------- */
.sec { padding: clamp(56px, 8vw, 100px) 0; }
.sec--tint { background: var(--tint); border-top: 1px solid var(--line); }
.sec__head { position: relative; display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: end; column-gap: 14px; margin-bottom: clamp(22px, 3vw, 36px); }
.sec__no { align-self: end; padding-bottom: clamp(10px, calc(3.7vw - 20px), 24px); font-family: var(--mono); font-size: 13px; letter-spacing: .08em; color: var(--accent); }
.sec__head h2 { font-weight: 800; font-size: clamp(30px, 3.7vw, 44px); line-height: 1; letter-spacing: -.04em; }
.sec__head p { justify-self: end; max-width: 56ch; padding-bottom: 5px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.sec__head p a, .prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.sec__head p a:hover { text-decoration-color: currentColor; }
.sec__head--stack { grid-template-columns: auto minmax(0, 1fr); margin-bottom: 18px; }
.sec__link { --c: #4285f4; justify-self: end; align-self: end; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); font-size: 15px; font-weight: 800; transition: border-color .2s, background .2s; }
.sec__link:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 11%, var(--surface)); }
.sec__link .i { font-size: 16px; color: var(--ink-3); }
.sec__link .i:first-child { font-size: 19px; color: var(--c); }
[data-theme="dark"] .sec__link { --c: #6ea8ff; }

/* ---------- Research ---------- */
.feature { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.feature__fig { display: grid; place-items: center; padding: clamp(14px, 2vw, 26px); border-right: 1px solid var(--line); overflow: hidden; }
.feature__fig img { width: 100%; transition: transform .6s var(--ease); }
.feature__fig:hover img { transform: scale(1.02); }
.feature__body { display: flex; flex-direction: column; gap: 14px; padding: clamp(18px, 2.4vw, 30px); }
.feature h3 { font-size: clamp(20px, 2.1vw, 26px); font-weight: 800; line-height: 1.2; letter-spacing: -.018em; }
.feature h3 .no { display: block; margin-bottom: 6px; }
.feature__body > p { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.feature__cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stats > div { padding: 10px 12px 11px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: clamp(19px, 1.9vw, 23px); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; white-space: nowrap; }
.stats dt small { margin-left: 1px; font-size: .62em; color: var(--ink-3); }
.stats dd { margin-top: 5px; font-size: 14.5px; line-height: 1.4; color: var(--ink-2); }
.stats--wide dd { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); } /* the modal's six stats still carry a full sentence */
.stats--wide { gap: 1px; background: var(--line); }
.stats--wide > div { background: var(--surface); border: 0 !important; padding: 12px 14px; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card__fig { position: relative; display: block; aspect-ratio: 16 / 10; border-bottom: 1px solid var(--line); }
.card__fig img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; }
.card__body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 13px 16px 15px; }
.card__title { font-size: 15.5px; font-weight: 800; line-height: 1.32; letter-spacing: -.01em; }
.card__desc { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.card__tags { margin-top: auto; padding-top: 8px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em; color: var(--ink-3); }

/* ---------- Demo (always dark, to match the console it embeds) ---------- */
.demo { position: relative; isolation: isolate; overflow: hidden; padding: clamp(56px, 8vw, 100px) 0; background: #070a14; color: #e9ecf6; border-block: 1px solid #1a2038; }
.demo::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 70% at 78% 40%, rgba(98, 84, 255, .22), transparent 70%),
    radial-gradient(40% 50% at 8% 90%, rgba(251, 191, 36, .07), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 34px 34px;
}
.demo__in { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); align-items: center; gap: clamp(28px, 4vw, 60px); }
.demo .sec__no { color: #a9a3ff; }
.demo h2 { color: #fff; }
.demo__lead { font-size: clamp(19px, 1.9vw, 24px); line-height: 1.45; letter-spacing: -.01em; color: #dfe3f0; }
.demo__lead b { color: #fff; }
.agents { display: grid; gap: 8px; margin: 20px 0 24px; }
.agents li { display: flex; align-items: flex-start; gap: 12px; padding: 11px 12px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; background: rgba(255, 255, 255, .03); }
.agents__icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; font-size: 16px; }
.agents__icon.a1 { background: rgba(146, 139, 255, .16); color: #aaa4ff; }
.agents__icon.a2 { background: rgba(64, 200, 160, .14); color: #5fd6b0; }
.agents__icon.a3 { background: rgba(251, 191, 36, .14); color: #fbbf24; }
.agents b { display: block; font-size: 14.5px; line-height: 1.3; color: #fff; }
.agents div span { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: #bcc3d6; }
.demo__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.demo__note { margin-left: 4px; font-family: var(--mono); font-size: 12.5px; color: #aab2c8; }

.browser { border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; background: #0d1120; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(88, 76, 240, .6), 0 0 0 1px rgba(255, 255, 255, .03); }
.browser__bar { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; background: #121729; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.browser__dots { display: flex; gap: 6px; }
.browser__dots i { width: 10px; height: 10px; border-radius: 50%; background: #2b3252; }
.browser__url { flex: 1; min-width: 0; padding: 4px 10px; border-radius: 7px; background: #0a0e1b; font-family: var(--mono); font-size: 11.5px; text-align: center; color: #8d96b3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser__open { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-size: 15px; color: #8d96b3; }
.browser__open:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.browser__view { position: relative; aspect-ratio: 1280 / 760; overflow: hidden; background: #0a0d18; }
.browser__view iframe { position: absolute; left: 0; top: 0; width: 1280px; height: 760px; border: 0; transform: scale(var(--s, .5)); transform-origin: 0 0; opacity: 0; transition: opacity .6s; }
.browser.is-loaded iframe { opacity: 1; }
.browser__placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; font-family: var(--mono); font-size: 12px; color: #7d86a2; transition: opacity .4s; }
.browser.is-loaded .browser__placeholder { opacity: 0; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .12); border-top-color: #a9a3ff; animation: spin 1s linear infinite; }
.browser__shield { position: absolute; inset: 0; display: grid; place-items: end center; padding: 0 0 16px; border: 0; background: transparent; }
.browser__shield span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: rgba(9, 12, 23, .8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-size: 13px; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s var(--ease); }
.browser__view:hover .browser__shield span, .browser__shield:focus-visible span { opacity: 1; transform: none; }
.browser.is-live .browser__shield { display: none; }
.browser.is-live { border-color: rgba(146, 139, 255, .6); }
.browser__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
@media (hover: none) { .browser__shield span { opacity: 1; transform: none; } }

/* ---------- Publications ---------- */
.pubs { display: grid; gap: 22px; }
.pubgroup { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 6px 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.pubgroup h3 { padding-top: 11px; font-family: var(--mono); font-size: 14.5px; font-weight: 500; line-height: 1.4; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
.publist { display: grid; gap: 2px; }
.pub { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 12px; margin-inline: -12px; padding: 10px 12px; border-radius: 12px; transition: background .2s; }
.pub:hover { background: var(--surface); }
.pub__year { padding-top: 1px; font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--ink); }
.pub__title { font-size: 16.5px; font-weight: 800; line-height: 1.36; letter-spacing: -.01em; }
.pub__authors { margin-top: 3px; font-size: 14px; color: var(--ink-2); }
.pub__authors b { font-weight: 800; color: var(--ink); background: linear-gradient(transparent 62%, var(--mark) 62%); }
.pub__venue { margin-top: 3px; font-size: 13.5px; font-style: italic; line-height: 1.5; color: var(--ink-2); }
.pub__venue .tag { margin-left: 4px; }
.pub__link { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font-style: normal; font-weight: 550; color: var(--accent); }
.pub__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.publist.is-collapsed [data-more] { display: none; }
.more { grid-column: 2; justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; font-size: 13px; font-weight: 550; color: var(--ink-2); transition: color .2s, border-color .2s, background .2s; }
.more:hover { color: var(--ink); border-color: var(--ink-3); background: var(--surface); }
.more .i { transition: transform .3s var(--ease); }
.more[aria-expanded="true"] .i { transform: rotate(180deg); }

/* ---------- About ---------- */
.cv { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.cvcard { grid-column: span 2; padding: 20px 22px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.cvcard--wide { grid-column: span 3; }
.cvcard h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 18px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.cvcard h3 .i { font-size: 22px; color: var(--accent); }

/* Education & Experience are the headline facts of the page: larger type, accent rail */
.cvcard--key { padding: clamp(22px, 2.4vw, 30px); border-top: 3px solid var(--accent); }
.cvcard--key h3 { margin-bottom: 22px; font-size: 20px; }
.cvcard--key h3 .i { font-size: 25px; }
.timeline { display: grid; gap: 24px; margin-left: 5px; padding-left: 24px; border-left: 2px solid var(--line-2); }
.timeline li { position: relative; display: grid; justify-items: start; gap: 4px; }
.timeline li::before { content: ""; position: absolute; left: -32px; top: 5px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--accent); background: var(--surface); }
.timeline li:first-child::before { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.timeline time { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); font-size: 13.5px; font-weight: 800; color: var(--accent); }
.timeline li:not(:first-child) time { background: var(--hover); color: var(--ink-2); }
.timeline b { margin-top: 4px; font-size: clamp(18px, 1.75vw, 22px); line-height: 1.3; letter-spacing: -.015em; }
.timeline span { font-size: clamp(15.5px, 1.35vw, 17px); line-height: 1.5; color: var(--ink-2); }
.timeline small { font-size: 14px; color: var(--ink-3); }
.cvlist small { font-size: 13px; color: var(--ink-3); }
.cvcard--award { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--amber) 35%, var(--line)); background: linear-gradient(155deg, var(--amber-soft), var(--surface) 72%); }
.cvcard--award h3 { color: var(--amber-ink); }
.award { position: relative; z-index: 1; display: grid; gap: 6px; }
.award b { font-size: 23px; font-weight: 800; line-height: 1.15; letter-spacing: -.03em; }
.award span { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.award small { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--ink-3); }
.award__mark { position: absolute; right: -14px; bottom: -18px; width: 120px; height: 120px; stroke-width: 1; color: var(--amber); opacity: .2; }
.cvlist { display: grid; gap: 14px; }
.cvlist li { display: grid; gap: 2px; }
.cvlist li + li { padding-top: 14px; border-top: 1px dashed var(--line-2); }
.cvlist b { display: flex; align-items: center; gap: 7px; font-size: 16.5px; line-height: 1.35; }
.cvlist span { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.cvlist small { font-family: var(--mono); font-size: 13.5px; }

/* ---------- Footer ---------- */
.foot { padding: 34px 0 40px; border-top: 1px solid var(--line); background: var(--tint); font-size: 13.5px; color: var(--ink-3); }
.foot__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 18px 24px; }
.foot__name { margin-bottom: 4px; font-size: 18px; font-weight: 800; line-height: 1.2; letter-spacing: -.03em; color: var(--ink); }
.foot a:hover { color: var(--ink); }
.social--foot { margin: 0; gap: 6px; }
.social--foot a { justify-content: center; width: 42px; padding: 0; }
.foot__legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; }

/* ---------- Modal ---------- */
.modal { width: min(1000px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 40px 120px -20px rgba(5, 8, 20, .55); overflow: hidden; }
.modal[open] { display: flex; animation: modal-in .32s var(--ease); }
.modal::backdrop { background: rgba(8, 10, 20, .52); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fade .25s; }
.modal__in { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.modal__head h3 { margin: 6px 0 12px; font-weight: 800; font-size: clamp(21px, 2.5vw, 29px); line-height: 1.15; letter-spacing: -.035em; }
.modal__head .eyebrow { color: var(--accent); }
.modal__body { padding: 22px 24px 28px; overflow-y: auto; overscroll-behavior: contain; }
.modal__body > * + * { margin-top: 22px; }
.prose p { max-width: 78ch; font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.prose b { color: var(--ink); }
.fig a { display: block; padding: clamp(10px, 1.6vw, 20px); border: 1px solid var(--line); border-radius: 14px; cursor: zoom-in; overflow: hidden; }
.fig img { width: 100%; }
.fig--narrow a { padding-inline: clamp(10px, 12%, 140px); }
.fig figcaption { margin-top: 9px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.fig figcaption b { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin-right: 6px; }
.refs h4 { margin-bottom: 10px; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.refs ul { display: grid; gap: 8px; }
.refs li { position: relative; padding-left: 16px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.refs li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }
.modal__cta { display: flex; flex-wrap: wrap; gap: 8px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature__fig { border-right: 0; border-bottom: 1px solid var(--line); }
  .demo__in { grid-template-columns: minmax(0, 1fr); }
  .cvcard, .cvcard--wide { grid-column: span 3; }
  .cvcard:last-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .hero__in { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hero__photo { order: -1; width: clamp(150px, 30vw, 200px); }
  .hero__photo::before { inset: 10px -10px -10px 10px; border-radius: 20px; }
  .hero__photo img { border-radius: 20px; }
  .sec__head { grid-template-columns: auto minmax(0, 1fr); }
  .sec__head p, .sec__link { grid-column: 1 / -1; justify-self: start; margin-top: 12px; padding-block: 0; }
  .pubgroup { grid-template-columns: minmax(0, 1fr); }
  .pubgroup h3 { padding-top: 0; }
  .more { grid-column: 1; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 58px; }
  /* phones: logos on their own row that scrolls away (sticky top is negative), links row stays pinned */
  .nav { top: -52px; }
  .nav__in { flex-wrap: wrap; gap: 0 8px; height: auto; }
  .logos { gap: 12px; height: 52px; }
  .logo img { height: 26px; }
  .logo--sdl img { height: 32px; }
  .logos__sep { height: 24px; }
  .nav__tools { height: 52px; margin-left: auto; }
  .nav__links { order: 3; width: 100%; height: 44px; margin-left: 0; align-items: center; justify-content: space-between; }
  .nav__mail, .on-wide { display: none; }
  .on-narrow { display: inline; }
  .nav__links a { padding: 6px 10px; font-size: 14.5px; }
  .nav__home { padding-inline: 9px; }
  .nav__home .i { font-size: 20px; }
  .hero__photo { width: 136px; }
  .chips { gap: 10px; }
  .chips li { height: 33px; padding: 0 13px 0 11px; font-size: 13.5px; }
  .social { gap: 10px; }
  .sec__link { height: 36px; padding: 0 11px 0 9px; font-size: 13.5px; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .card { flex-direction: row; }
  .card__fig { flex: none; width: 112px; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--line); }
  .card__fig img { inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
  .card__body { padding: 11px 13px 12px; gap: 4px; }
  .card__title { font-size: 14.5px; }
  .card__tags { display: none; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stats > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 10px; }
  .stats > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .stats dd { margin: 0; }
  .cvcard, .cvcard--wide { grid-column: 1 / -1; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .social span { display: none; }
  .social li:first-child span { display: inline; font-size: 14px; }
  .social a { padding: 0 13px; }
  .foot__in { grid-template-columns: minmax(0, 1fr); }
  .modal { width: 100vw; max-height: 94dvh; margin-bottom: 0; border-radius: 20px 20px 0 0; border-inline: 0; border-bottom: 0; }
  .modal__head { padding: 18px 16px 14px; }
  .modal__body { padding: 18px 16px 28px; }
  .demo__note { width: 100%; margin: 0; }
}
@media (max-width: 380px) { .nav__links a { padding: 6px 8px; } }
@media (min-width: 601px) { .stats--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .nav, .demo, .more, .modal { display: none !important; }
  .publist.is-collapsed [data-more] { display: grid; }
  body { background: #fff; }
}
