/* Navy ink and signal amber, carried over from the LinkedIn banner.
   One family (Archivo) in three widths: condensed for display, normal for text, expanded for meta. */
:root {
  --paper: #f4f6f9;
  --sheet: #ffffff;
  --ink: #0f1b2d;
  --muted: #536276;
  --rule: #d5dce5;
  --amber: #8f5600;
  --mark: #e9a825;
  --wide: 82rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c1522;
    --sheet: #132033;
    --ink: #e8edf3;
    --muted: #97a7bc;
    --rule: #23354d;
    --amber: #f2b544;
    --mark: #f2b544;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0c1522;
  --sheet: #132033;
  --ink: #e8edf3;
  --muted: #97a7bc;
  --rule: #23354d;
  --amber: #f2b544;
  --mark: #f2b544;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 "Archivo", system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--wide); margin-inline: auto; padding-inline: max(16px, 4vw); }
@media (min-width: 1360px) { .wrap { padding-inline: 48px; } }

.skip { position: absolute; left: 16px; top: -48px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 2; }
.skip:focus { top: 12px; }

/* Header */
.top {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px; padding-block: 20px;
  font-stretch: 112%; font-size: 15px; font-weight: 500;
}
.brand { text-decoration: none; font-weight: 650; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--amber); }

/* Hero: the name is the one loud thing on the page */
.hero { padding-top: clamp(24px, 5vw, 72px); }
.name {
  margin: 0;
  font-stretch: 68%;
  font-weight: 820;
  font-size: clamp(68px, 15vw, 196px);
  line-height: .84;
  letter-spacing: -.012em;
}
.name span { display: inline-block; white-space: nowrap; }
.name-ko { margin: 14px 0 0; color: var(--muted); font-size: 18px; letter-spacing: .04em; }
.hero-grid {
  display: grid; gap: 32px 56px;
  margin-top: clamp(32px, 5vw, 56px);
}
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); align-items: start; } }
.thesis {
  margin: 0;
  font-size: clamp(24px, 2.9vw, 36px);
  line-height: 1.25;
  font-weight: 450;
  max-width: 28ch;
  text-wrap: balance;
}
.thesis sup { font-size: .5em; line-height: 0; vertical-align: .9em; margin-left: .04em; font-weight: 650; }
.thesis sup a { color: var(--amber); text-decoration: none; }
.notes {
  margin: 22px 0 0; padding: 14px 0 0 1.4em;
  border-top: 1px solid var(--rule);
  max-width: 52ch; font-size: 15px; color: var(--muted);
}
.notes li { margin: 4px 0; padding-left: .2em; }
.notes li::marker { color: var(--amber); font-weight: 650; }
.notes li:target { color: var(--ink); }
.notes a { color: var(--ink); }

.facts { margin: 0; display: grid; gap: 18px; }
.facts div { display: grid; gap: 2px; }
.facts dt { font-stretch: 112%; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; font-size: 16px; line-height: 1.5; }

/* Sections */
.section { padding-top: clamp(64px, 9vw, 128px); }
.section > h2 {
  margin: 0 0 clamp(20px, 3vw, 36px);
  font-stretch: 70%; font-weight: 800;
  font-size: clamp(40px, 6vw, 72px); line-height: .95; letter-spacing: -.01em;
}

/* Project entries: meta column on the left, write-up and figure on the right */
.project {
  display: grid; gap: 14px 40px;
  padding-block: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--rule);
}
@media (min-width: 880px) { .project { grid-template-columns: 13.5rem minmax(0, 1fr); } }
.meta {
  display: flex; flex-direction: column; gap: 4px;
  font-stretch: 110%; font-size: 14.5px; line-height: 1.45; color: var(--muted);
}
.meta p { margin: 0; }
.result { color: var(--ink); font-weight: 600; }
.award::before {
  content: ""; display: inline-block; width: .5em; height: .5em;
  margin-right: .5em; vertical-align: .1em;
  background: var(--mark); transform: rotate(45deg);
}
.links { margin-top: 8px !important; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink); font-weight: 600; }
.private { display: inline-flex; align-items: center; gap: .5em; color: var(--muted); font-weight: 500; white-space: nowrap; }
.bar { display: inline-block; flex: none; width: 2.2em; height: .8em; background: var(--ink); border-radius: 1px; }

.body { display: grid; gap: 28px; min-width: 0; }
@media (min-width: 1180px) {
  .body.has-fig { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start; }
}
.project h3 {
  margin: 0 0 12px;
  font-stretch: 74%; font-weight: 760;
  font-size: clamp(30px, 3.4vw, 40px); line-height: 1.02;
}
.lead { margin: 0 0 12px; font-size: 19px; line-height: 1.5; max-width: 60ch; }
.constraint { margin: 0 0 12px; color: var(--muted); max-width: 60ch; }
.text ul { margin: 0 0 14px; padding-left: 1.1em; max-width: 64ch; }
.text li { margin: 7px 0; padding-left: .2em; }
.text li::marker { color: var(--muted); }
.stack { margin: 0; font-stretch: 110%; font-size: 14px; color: var(--muted); }

figure { margin: 0; min-width: 0; }
figure img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
figcaption { margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--muted); max-width: 60ch; }

/* Takedown request rendered as the email it is */
.notice {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px;
  padding: 20px 22px;
  font: 14px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.notice p { margin: 0 0 10px; }
.notice p:last-child { margin-bottom: 0; }
.notice .hdr { display: flex; align-items: center; gap: 10px; margin: 0; padding-bottom: 6px; color: var(--muted); }
.notice .hdr span:first-child { min-width: 4.8em; }
.notice .hdr:nth-child(2) { color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 12px; margin-bottom: 14px; }
.notice .bar { width: 9em; height: .9em; }

/* SARO flow */
.diagram svg { display: block; width: 100%; height: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 18px 8px 6px; }
.diagram .ln { stroke: var(--muted); stroke-width: 1.5; }
.diagram .dash { stroke: var(--mark); stroke-dasharray: 5 5; }
.diagram .node { fill: var(--sheet); stroke: var(--muted); stroke-width: 2; }
.diagram .node.hot { stroke: var(--mark); }
.diagram .fill { fill: var(--mark); }
.diagram .lb { fill: var(--ink); font: 600 17px "Archivo", sans-serif; font-stretch: 110%; text-anchor: middle; }
.diagram .lb.sub { fill: var(--muted); font-weight: 450; }

/* More projects: a scannable index */
.index { list-style: none; margin: 0; padding: 0; }
.index li {
  display: grid; gap: 4px 32px;
  padding-block: 22px; border-top: 1px solid var(--rule);
}
@media (min-width: 880px) { .index li { grid-template-columns: 13.5rem minmax(0, 1fr) 15rem; align-items: baseline; } }
.index h3 { margin: 0; font-stretch: 80%; font-weight: 720; font-size: 22px; line-height: 1.15; }
.index h3 a { text-decoration-color: var(--rule); }
.index p { margin: 0; max-width: 64ch; }
.ix-meta { font-stretch: 110%; font-size: 14px; line-height: 1.5; color: var(--muted); }
.ix-meta .private { display: flex; margin-top: 4px; }
.ix-meta .result { color: var(--ink); }

/* Research and awards: year column plus text */
.split { display: grid; gap: 24px 56px; }
@media (min-width: 980px) { .split { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); } }
.intro { margin: 0; font-size: 19px; line-height: 1.5; max-width: 40ch; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: 16px; padding-block: 14px; border-top: 1px solid var(--rule); }
.rows .y { font-stretch: 110%; font-size: 14px; color: var(--muted); padding-top: .15em; font-variant-numeric: tabular-nums; }
.rows .t { font-weight: 550; line-height: 1.4; }
.rows .v { display: block; margin-top: 3px; font-weight: 400; font-size: 15px; color: var(--muted); }
.rows .v .result { font-weight: 600; margin-left: .3em; }
.sub-h { margin: 36px 0 8px; font-stretch: 80%; font-weight: 720; font-size: 22px; }
@media (min-width: 980px) { .awards { columns: 2; column-gap: 56px; } .awards li { break-inside: avoid; } }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: clamp(64px, 9vw, 128px); padding-block: 28px 40px;
  border-top: 1px solid var(--rule);
  font-stretch: 110%; font-size: 14px; color: var(--muted);
}
.foot p { margin: 0; display: flex; gap: 20px; }
