/* website/assets/site.css — ispaik06.github.io. Dark by default, light on request. */
:root {
  --bg: #0b0b0d; --bg-soft: #141416; --bg-code: #151518;
  --ink: #f2f2f0; --ink-2: #d0d0d4; --muted: #9a9aa0; --faint: #6c6c73;
  --rule: #26262b; --rule-2: #3a3a40; --link-line: #5a5a60;
  --co-note: #6f9cff; --co-tip: #3fc9c1; --co-success: #5fcf86; --co-question: #e0a44a; --co-warning: #f08a3e;
  --co-danger: #f06a6a; --co-example: #a993ff; --co-quote: #9a9aa2; --co-abstract: #5fc7ba; --co-mix: 13%;
  --figure-bg: #fff; --figure-pad: .6em;
  --display: "Instrument Serif", "Times New Roman", Times, serif;
  --serif: "Source Serif 4", "Charter", Georgia, serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs: 17px; --measure: 44rem; --rail: 15rem; --gutter: clamp(16px, 4vw, 56px); --header-h: 72px;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f7f7f5; --bg-soft: #ededea; --bg-code: #ececea;
  --ink: #111113; --ink-2: #3a3a3e; --muted: #6b6b72; --faint: #8a8a90;
  --rule: #e2e2de; --rule-2: #cfcfca; --link-line: #b5b5b0;
  --co-note: #3a6fd8; --co-tip: #0f8f8a; --co-success: #2f9e5c; --co-question: #b9761a; --co-warning: #d6701c;
  --co-danger: #cf3b3b; --co-example: #7a5bd6; --co-quote: #7a7a80; --co-abstract: #2a9d8f; --co-mix: 8%;
  --figure-bg: transparent; --figure-pad: 0;
  color-scheme: light;
}

/* ---- base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: var(--fs); line-height: 1.7; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; word-break: keep-all; overflow-wrap: anywhere; }
body.no-scroll { overflow: hidden; }
[hidden] { display: none !important; }
::selection { background: rgba(242, 242, 240, .18); }
html[data-theme="light"] ::selection { background: rgba(17, 17, 19, .14); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--link-line); text-decoration-thickness: 1px; text-underline-offset: .2em; transition: color .15s, text-decoration-color .15s; }
a:hover { text-decoration-color: var(--ink); }
button { font: inherit; color: inherit; }
img { max-width: 100%; height: auto; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.display { font-family: var(--display); font-weight: 400; }
.muted { color: var(--muted); }
.sep { margin: 0 .5em; opacity: .55; }
.label, .section-head, .eyebrow, .role, .frame-top, .rail-title, .note-meta, .pager-label, .tl-when, .links-row { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }

/* ---- header -------------------------------------------------------------- */
.site-header { max-width: 1440px; margin: 0 auto; height: var(--header-h); padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { font-size: 15px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: 6px; }
.site-nav a:hover, .site-nav a.active { color: var(--ink); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; margin-left: 2px; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--ink); background: var(--bg-soft); }
.i-sun { display: none; }
html[data-theme="light"] .i-sun { display: block; }
html[data-theme="light"] .i-moon { display: none; }

/* ---- home: hero ---------------------------------------------------------- */
.home { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter) 3rem; }
.hero { display: grid; grid-template-columns: 232px minmax(0, 600px); gap: 56px; align-items: center; max-width: 888px; margin: 0 auto; padding: 56px 0 52px; }
.hero-text { grid-column: 2; min-width: 0; }
.hero h1 { margin: 0 0 16px; font-size: 48px; line-height: 1.05; letter-spacing: -.025em; font-weight: 600; }
.role { margin: 10px 0 28px; color: var(--muted); }
.intro { font-family: var(--serif); font-size: 25px; font-style: italic; line-height: 1.4; color: var(--ink-2); max-width: 600px; }
.intro p { margin: 0 0 .7em; }
.intro p:last-child { margin-bottom: 0; }
.now { font-family: var(--serif); font-size: 18px; line-height: 1.5; color: var(--muted); max-width: 760px; margin: 22px 0 28px; }
.now .mono { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; margin-right: 10px; color: var(--muted); }
.icons { display: flex; flex-wrap: wrap; gap: 10px; }
.icons a { width: 40px; height: 40px; border: 1px solid var(--rule-2); border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.icons a:hover { background: var(--bg-soft); color: var(--ink); border-color: var(--muted); }
.icons svg { width: 18px; height: 18px; }
.home-icons { gap: 12px; margin-top: 22px; }
.home-icons a { width: 44px; height: 44px; }
.home-icons svg { width: 19px; height: 19px; }
.portrait { grid-column: 1; grid-row: 1; width: 232px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; object-position: center 42%; display: block; box-shadow: 0 0 0 1px var(--rule-2); }
.portrait-empty { border: 1px solid var(--rule-2); background: repeating-linear-gradient(135deg, var(--bg-soft) 0 10px, var(--bg) 10px 20px); }
.home .work > .section-head { padding-top: 40px; }

/* ---- home: work frames --------------------------------------------------- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 72px 0 24px; color: var(--muted); }
.section-head a { text-decoration: none; color: var(--muted); }
.section-head a:hover { color: var(--ink); }
.frame { position: relative; margin: 0 0 24px; border-radius: 4px; overflow: hidden; background: var(--bg-soft); }
.frame-cover { display: block; aspect-ratio: 1328 / 560; overflow: hidden; }
.frame-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.frame:hover .frame-cover img { transform: scale(1.025); }
.frame-top, .frame-bottom { position: absolute; left: 32px; right: 32px; z-index: 2; }
.frame-top { top: 28px; display: flex; justify-content: space-between; align-items: baseline; gap: 24px; color: #f2f2f0; }
.frame-links { display: flex; gap: 20px; }
.frame-links a { color: #f2f2f0; text-decoration: none; border-bottom: 1px solid rgba(242, 242, 240, .45); padding-bottom: 1px; }
.frame-links a:hover { border-bottom-color: #f2f2f0; }
.frame-bottom { bottom: 32px; display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; }
.frame-title { margin: 0; font-family: var(--display); font-size: clamp(30px, 3.8vw, 56px); line-height: 1; font-weight: 400; letter-spacing: -.01em; max-width: 760px; }
.frame-title a { color: #f2f2f0; text-decoration: none; }
.frame-dek { margin: 0; font-size: 15px; line-height: 1.5; color: #d0d0d4; max-width: 340px; }
.frame-stack { display: block; margin-top: 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #9a9aa0; }
.frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 11, 13, .12) 0%, rgba(11, 11, 13, 0) 30%, rgba(11, 11, 13, .1) 55%, rgba(11, 11, 13, .92) 100%); pointer-events: none; z-index: 1; }
@media (max-width: 760px) {
  .frame::after { display: none; }
  .frame-cover { aspect-ratio: 16 / 10; }
  .frame-top, .frame-bottom { position: static; }
  .frame-top { padding: 16px 0 0; color: var(--muted); flex-wrap: wrap; }
  .frame-links a { color: var(--ink); border-bottom-color: var(--link-line); }
  .frame-bottom { flex-direction: column; align-items: flex-start; gap: 10px; padding: 10px 0 20px; }
  .frame-title { font-size: 30px; }
  .frame-title a, .frame-dek { color: var(--ink); }
  .frame-dek { color: var(--ink-2); max-width: none; }
  .frame { background: transparent; }
}

/* ---- home: notes --------------------------------------------------------- */
.notes-home .serif { margin: 0 0 12px; font-size: 18px; color: var(--muted); max-width: 640px; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 14px 0; border-top: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.note-list li:last-child a { border-bottom: 1px solid var(--rule); }
.note-list a:hover .t { text-decoration: underline; text-decoration-color: var(--link-line); text-underline-offset: .2em; }
.note-list .m { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

/* ---- pages: about, work, notes index ------------------------------------- */
.page { max-width: var(--measure); margin: 0 auto; padding: 40px var(--gutter) 4rem; }
.about { max-width: 68rem; }
.page-head { margin: 0 0 2.5rem; }
.page-head .display { margin: 0 0 .5rem; font-size: clamp(44px, 6vw, 76px); line-height: 1; letter-spacing: -.02em; }
.eyebrow { margin: 0 0 16px; color: var(--muted); }
.eyebrow a { text-decoration: none; color: var(--ink); }
.eyebrow a:hover { text-decoration: underline; }
.subtitle { margin: 0; color: var(--muted); }
.lede { font-family: var(--serif); font-size: 22px; line-height: 1.5; color: var(--ink-2); margin: .9rem 0 1.4rem; max-width: 46rem; }
.links-row { display: flex; flex-wrap: wrap; gap: 20px; margin: .5rem 0 0; }
.links-row a { text-decoration: none; border-bottom: 1px solid var(--link-line); }
.cover { width: 100%; border-radius: 4px; margin: 0 0 2.5rem; display: block; }
.about-note { margin: 0 0 1.4rem; color: var(--muted); font-size: 17px; }
.about-head { max-width: 48rem; margin-bottom: 0; padding: 18px 0 42px; border-bottom: 1px solid var(--rule); }
.about-head-copy { min-width: 0; }
.about-head .display { text-wrap: balance; }
.about-head .lede { margin-top: 1.35rem; }
.about-section { margin-top: 1rem; }
.about-section .section-head { padding: 56px 0 20px; }
.focus-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.focus-item { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 18px 0 20px; border-top: 1px solid var(--rule); }
.focus-n { color: var(--muted); font-size: 11px; letter-spacing: .08em; padding-top: 3px; }
.focus-name { font-weight: 650; margin-bottom: 4px; }
.focus-detail { color: var(--muted); font-size: 15px; line-height: 1.55; }
@media (max-width: 760px) {
  .about-head { padding-top: 0; }
}
@media (max-width: 640px) { .focus-grid { grid-template-columns: 1fr; } }
/* timeline: a rail with a dot per entry */
.timeline { position: relative; }
.tl-row { display: grid; grid-template-columns: 150px 24px minmax(0, 1fr); gap: 0 20px; padding: 0 0 36px; position: relative; }
.tl-row::before { content: ""; position: absolute; left: calc(150px + 20px + 11px); top: 10px; bottom: -4px; width: 2px; background: var(--rule-2); }
.tl-row:last-child::before { display: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); margin: 7px 0 0 7px; position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--bg); }
.tl-service .tl-dot { background: var(--bg); border: 2px solid var(--ink); width: 10px; height: 10px; margin-left: 7px; }
.tl-when { color: var(--muted); padding-top: 4px; letter-spacing: .12em; }
.tl-kind { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.tl-title { font-weight: 650; font-size: 19px; line-height: 1.3; }
.tl-title a { text-decoration: none; }
.tl-title a:hover { text-decoration: underline; }
.tl-sub { color: var(--ink-2); font-size: 15px; line-height: 1.5; margin-top: 3px; }
.tl-meta { font-size: 12px; letter-spacing: .1em; color: var(--muted); margin-top: 6px; }
.tl-bullets { margin: 10px 0 0; padding-left: 1.2em; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.tl-bullets li { margin: .25em 0; }
@media (max-width: 640px) {
  .tl-row { grid-template-columns: 24px minmax(0, 1fr); gap: 0 14px; }
  .tl-row::before { left: 11px; }
  .tl-when { grid-column: 2; order: -1; padding: 0 0 4px; }
  .tl-dot { grid-row: 1 / span 2; }
}
/* projects */
.proj-list { display: flex; flex-direction: column; }
.proj { padding: 26px 0; border-top: 1px solid var(--rule); }
.proj:last-child { border-bottom: 1px solid var(--rule); }
.proj-head { display: flex; gap: 18px; align-items: flex-start; }
.proj-n { flex: none; font-size: 12px; letter-spacing: .12em; color: var(--muted); padding-top: 7px; min-width: 2em; }
.proj-title { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 400; line-height: 1.1; letter-spacing: -.01em; }
.proj-when { margin-top: 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.proj-desc { margin: 14px 0 0 calc(2em + 18px); color: var(--ink-2); font-size: 16px; line-height: 1.65; }
.proj-links { display: flex; flex-wrap: wrap; gap: 18px; margin: 12px 0 0 calc(2em + 18px); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.proj-links a { text-decoration: none; border-bottom: 1px solid var(--link-line); }
.proj-links a:hover { border-bottom-color: var(--ink); }
@media (max-width: 640px) { .proj-desc, .proj-links { margin-left: 0; } .proj-title { font-size: 26px; } }
/* stack + contact */
.stack-row, .contact-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 12px 0; border-top: 1px solid var(--rule); }
.stack-row:last-child, .contact-row:last-child { border-bottom: 1px solid var(--rule); }
.stack-area, .contact-label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.stack-tools { color: var(--ink); }
.contact-row a { text-decoration: none; }
.contact-row a:hover { text-decoration: underline; }
@media (max-width: 640px) { .stack-row, .contact-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---- notes landing: shelf + map ------------------------------------------ */
.notes-index { max-width: 1440px; margin: 0 auto; padding: 40px var(--gutter) 4rem; }
.notes-index .page-head { max-width: 46rem; margin-bottom: 0; }
.page-jump { margin: .2rem 0 0; }
.page-jump a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--link-line); }
.page-jump a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.shelf .section-head, .map .section-head { padding: 56px 0 6px; margin: 0; font-weight: 400; }
.shelf-card { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 36px; padding: 28px 0; border-top: 1px solid var(--rule); }
.shelf-card:last-child { border-bottom: 1px solid var(--rule); }
.shelf-fig { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--figure-bg); border: 1px solid var(--rule); padding: 10px; text-decoration: none; }
.shelf-fig img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.shelf-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 14px; background: transparent; border-color: var(--rule-2); }
.shelf-tiles span { border: 1px solid var(--rule-2); border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.shelf-fig-empty { border-style: dashed; background: transparent; }
.shelf-title { margin: 0 0 8px; font-size: 34px; line-height: 1.05; font-weight: 400; letter-spacing: -.01em; }
.shelf-title a { text-decoration: none; }
.shelf-title a:hover { text-decoration: underline; text-decoration-color: var(--link-line); }
.shelf-meta { margin: 0 0 12px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.shelf-desc { margin: 0 0 14px; font-size: 15px; line-height: 1.65; color: var(--ink-2); max-width: 640px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 6px; font-size: 13px; line-height: 1.4; text-decoration: none; color: var(--ink); }
.chip .mono { font-size: 10.5px; color: var(--muted); }
.chip:hover { border-color: var(--rule-2); background: var(--bg-soft); }
.shelf-extra { margin: 12px 0 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.shelf-extra a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--link-line); }
.shelf-extra a:hover { border-bottom-color: var(--ink); }
.shelf .note-list { margin-top: 18px; }
@media (max-width: 760px) { .shelf-card { grid-template-columns: 1fr; gap: 18px; } .shelf-fig { max-width: 360px; } .shelf-title { font-size: 28px; } }
.map-lede { margin: 12px 0 22px; font-size: 18px; color: var(--muted); max-width: 640px; }
.map-scroll { overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.map-svg { display: block; }
.map-lane { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; fill: var(--muted); }
.map-rule { stroke: var(--rule); stroke-width: 1; }
.map-edge { fill: none; stroke: var(--link-line); stroke-width: 1.2; }
.map-edge-cross { stroke-opacity: .75; }
.map-arrow { fill: var(--link-line); }
.map-node rect { fill: var(--bg-soft); stroke: var(--ink); stroke-width: 1; transition: fill .15s, stroke .15s; }
.map-node.planned rect { fill: transparent; stroke: var(--rule-2); stroke-dasharray: 5 5; }
.map-node.external rect { fill: var(--bg); stroke: var(--rule-2); }
.map-label { font-family: var(--sans); font-size: 13px; font-weight: 600; fill: var(--ink); }
.map-node.planned .map-label { fill: var(--muted); }
.map-sub { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; fill: var(--muted); }
a.map-node { outline: none; }
a.map-node:hover rect, a.map-node:focus-visible rect { fill: var(--ink); stroke: var(--ink); }
a.map-node:hover .map-label, a.map-node:hover .map-sub, a.map-node:focus-visible .map-label, a.map-node:focus-visible .map-sub { fill: var(--bg); }
.map-legend { display: flex; flex-wrap: wrap; gap: 22px; margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.map-legend i { display: inline-block; width: 14px; height: 10px; border: 1px solid var(--ink); border-radius: 3px; vertical-align: middle; margin-right: 7px; background: var(--bg-soft); }
.map-legend .lg-planned i { border-color: var(--rule-2); border-style: dashed; background: transparent; }
.map-legend .lg-external i { border-color: var(--rule-2); background: var(--bg); }

/* ---- note layout with rails ---------------------------------------------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); max-width: var(--measure); margin: 0 auto; padding: 40px var(--gutter) 3rem; }
.rail { display: none; }
@media (min-width: 1120px) {
  .layout { max-width: none; grid-template-columns: var(--rail) minmax(0, var(--measure)) var(--rail); column-gap: 3.5rem; justify-content: center; }
  .rail { display: block; position: sticky; top: 28px; align-self: start; max-height: calc(100vh - 56px); overflow-y: auto; scrollbar-width: thin; font-size: .84rem; line-height: 1.5; color: var(--muted); }
}
.rail-title { margin: 0 0 .6em; color: var(--muted); }
.toc-list, .toc-list ol, .series-list { list-style: none; margin: 0; padding: 0; }
.toc-list ol { padding-left: .95em; margin: .05em 0 .35em; }
.toc-list a, .series-list a { display: block; color: inherit; text-decoration: none; padding: .3em .7em; margin-left: -.7em; border-left: 2px solid transparent; }
.toc-list a:hover, .series-list a:hover { color: var(--ink); }
.toc-list a.active { color: var(--ink); border-left-color: var(--ink); }
.series-list a { display: flex; gap: .6em; }
.series-list .n { flex: none; min-width: 1.9em; font-family: var(--mono); font-size: 11px; color: var(--muted); padding-top: .2em; }
.series-list .current > a { color: var(--ink); border-left-color: var(--ink); }
.article .page-head { margin-bottom: 2.2rem; }
.article .page-head .display { font-size: clamp(38px, 5vw, 62px); }
.article .lede { font-size: 20px; margin: 1rem 0 .6rem; }
.article .subtitle { margin: .2rem 0 .6rem; }
.work-nav .n { min-width: 2.9em; }
.note-meta { margin: 0; color: var(--muted); }
.credits { margin: .8rem 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.credits a { color: inherit; }
.note-foot { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { padding: .15em .6em; border: 1px solid var(--rule-2); border-radius: 999px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 2.5rem 0 1rem; }
.pager-link { display: block; padding: 1em 1.1em; border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; color: var(--ink); }
.pager-link:hover { border-color: var(--rule-2); background: var(--bg-soft); }
.pager-link.next { text-align: right; }
.pager-label { display: block; color: var(--muted); margin-bottom: .3em; font-size: 11px; }
.pager-title { display: block; font-family: var(--display); font-size: 22px; line-height: 1.15; }
@media (max-width: 480px) { .pager { grid-template-columns: 1fr; } .pager-link.next { text-align: left; } }

/* ---- prose --------------------------------------------------------------- */
.prose { line-height: 1.8; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose h1, .prose h2, .prose h3, .prose h4 { scroll-margin-top: 1rem; line-height: 1.3; }
.prose h2 { font-size: 1.36em; font-weight: 700; margin: 2.4em 0 .8em; letter-spacing: -.015em; }
.prose h3 { font-size: 1.18em; font-weight: 650; margin: 1.9em 0 .6em; }
.prose h4 { font-size: 1.04em; font-weight: 650; margin: 1.6em 0 .5em; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.6em 0; }
.prose hr + h2 { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.45em; margin: 0 0 1.15em; }
.prose li { margin: .3em 0; }
.prose li > p { margin-bottom: .5em; }
.prose blockquote { margin: 1.4em 0; padding: .15em 0 .15em 1em; border-left: 2px solid var(--rule-2); color: var(--ink-2); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code, .prose kbd, .prose samp { font-family: var(--mono); font-size: .88em; }
.prose :not(pre) > code { background: var(--bg-code); padding: .12em .38em; border-radius: 4px; }
.prose pre { background: var(--bg-code); border-radius: 6px; padding: 1em 1.1em; margin: 1.4em 0; font-size: .86em; line-height: 1.6; overflow-x: auto; tab-size: 4; }
.prose pre code { background: none; padding: 0; font-size: 1em; }
.table-wrap { margin: 1.5em 0; overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: .92em; line-height: 1.6; }
.prose th, .prose td { padding: .6em .75em; border-bottom: 1px solid var(--rule); vertical-align: top; text-align: left; }
.prose th { font-weight: 700; border-bottom-color: var(--rule-2); color: var(--ink-2); font-size: .92em; }
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose th:last-child, .prose td:last-child { padding-right: 0; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td > :last-child, .prose th > :last-child { margin-bottom: 0; }
img.figure { display: block; margin: 1.6em auto; border-radius: 6px; background: var(--figure-bg); padding: var(--figure-pad); }
.fig, .fig-row { margin: 1.8em 0; }
.fig img, .fig-row img { display: block; margin: 0 auto; max-width: 100%; height: auto; border-radius: 6px; }
.fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; align-items: start; }
.fig-row figure { margin: 0; }
figcaption { margin: .7em auto 0; max-width: 40rem; text-align: center; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; line-height: 1.5; color: var(--muted); }
figcaption a { color: inherit; }
.prose .code-name { margin: 2em 0 -1em; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--muted); }
html[data-theme="dark"] .fig img.plate, .fig-row img.plate { background: #fff; padding: .5em; }
.math-block { display: block; margin: 1.3em 0; overflow-x: auto; overflow-y: hidden; padding: .15em 0; scrollbar-width: thin; }
.math-block .katex-display { margin: 0; }
.katex { font-size: 1.05em; }
.wl-embed { display: inline-block; }
.embed-missing { font-family: var(--mono); font-size: .82em; color: var(--muted); }
.footnotes { margin-top: 3em; font-size: .9em; color: var(--ink-2); }
.footnotes-sep { margin: 3em 0 1em; }
/* highlighter pens: dark → coloured underlines, light → real highlighter */
mark { color: inherit; background: none; padding: 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-skip-ink: none; text-decoration-color: rgba(245, 200, 60, .9); }
mark.hl-green { text-decoration-color: rgba(20, 220, 190, .9); }
mark.hl-blue { text-decoration-color: rgba(120, 130, 255, .9); }
mark.hl-red { text-decoration-color: rgba(255, 110, 110, .9); }
html[data-theme="light"] mark { text-decoration: none; padding: .05em .15em; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; background: hsl(52 100% 70%); }
html[data-theme="light"] mark.hl-green { background: hsl(138 68% 74%); }
html[data-theme="light"] mark.hl-blue { background: hsl(202 92% 79%); }
html[data-theme="light"] mark.hl-red { background: hsl(352 92% 84%); }
/* callouts */
.callout { --co: var(--co-note); margin: 1.5em 0; padding: .9em 1.05em .95em 1.1em; border-left: 2px solid var(--co); border-radius: 0 6px 6px 0; background: color-mix(in srgb, var(--co) var(--co-mix), var(--bg)); }
.callout-title { display: flex; align-items: center; gap: .5em; margin: 0 0 .45em; font-weight: 700; color: var(--co); line-height: 1.4; }
.callout-icon { width: 1.1em; height: 1.1em; flex: none; }
summary.callout-title { cursor: pointer; list-style: none; }
summary.callout-title::-webkit-details-marker { display: none; }
details.callout:not([open]) > .callout-title { margin-bottom: 0; }
.callout-body > :first-child { margin-top: 0; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-body p { margin-bottom: .8em; }
.callout-tip, .callout-hint, .callout-important { --co: var(--co-tip); }
.callout-warning, .callout-caution, .callout-attention { --co: var(--co-warning); }
.callout-question, .callout-help, .callout-faq { --co: var(--co-question); }
.callout-success, .callout-check, .callout-done { --co: var(--co-success); }
.callout-failure, .callout-fail, .callout-missing, .callout-danger, .callout-error, .callout-bug { --co: var(--co-danger); }
.callout-example { --co: var(--co-example); }
.callout-quote, .callout-cite { --co: var(--co-quote); }
.callout-abstract, .callout-summary, .callout-tldr { --co: var(--co-abstract); }
/* slides */
.slide { margin: 1.6em 0; }
.slide-open { display: block; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: #fff; text-decoration: none; }
.slide-open img { display: block; width: 100%; height: auto; }
.slide figcaption { margin: .4em 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); text-align: center; }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .94); display: flex; align-items: center; justify-content: center; padding: env(safe-area-inset-top) env(safe-area-inset-right) calc(2.2rem + env(safe-area-inset-bottom)) env(safe-area-inset-left); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox-cap { position: fixed; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom)); text-align: center; color: #cfcfd4; font-size: 11px; letter-spacing: .1em; }

/* ---- search -------------------------------------------------------------- */
.search { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-start; justify-content: center; padding: max(6vh, 12px) var(--gutter); }
.search-panel { width: min(40rem, 100%); background: var(--bg); border-radius: 10px; border: 1px solid var(--rule-2); overflow: hidden; }
#search-input { width: 100%; font: inherit; font-size: 1.05rem; padding: .95em 1.1em; border: 0; outline: 0; background: transparent; color: var(--ink); -webkit-appearance: none; appearance: none; border-radius: 0; }
#search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-results { max-height: min(60vh, 34rem); overflow-y: auto; border-top: 1px solid var(--rule); }
.search-results:empty { display: none; }
.search-results a { display: block; padding: .8em 1.1em; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover { background: var(--bg-soft); }
.sr-title { font-weight: 600; }
.sr-series { color: var(--muted); font-size: .82em; margin-left: .55em; }
.sr-snip { margin: .2em 0 0; color: var(--ink-2); font-size: .88em; line-height: 1.55; }
.sr-snip b { font-weight: 650; text-decoration: underline; text-underline-offset: .15em; }
.sr-empty { margin: 0; padding: .9em 1.1em; color: var(--muted); font-size: .92em; }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 24px; justify-items: center; text-align: center; padding: 32px 0 40px; }
  .hero-text { grid-column: 1; grid-row: 2; }
  .portrait { grid-column: 1; grid-row: 1; width: 156px; }
  .portrait-empty { display: none; }
  .hero h1 { font-size: 36px; }
  .intro { font-size: 23px; line-height: 1.42; }
  .home-icons { justify-content: center; }
}
@media (max-width: 640px) {
  .site-header { gap: 8px; }
  .wordmark { flex: none; white-space: nowrap; font-size: 13px; }
  .site-nav { min-width: 0; gap: 0; justify-content: flex-end; }
  .site-nav a { min-width: 44px; min-height: 44px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; font-size: 10px; letter-spacing: .1em; }
  .icon-btn { width: 44px; height: 44px; margin-left: 0; }
  .icon-btn svg { width: 17px; height: 17px; }
  .home .work > .section-head { padding-top: 28px; }
  .section-head { padding-top: 48px; }
}
@media print {
  .site-header, .site-nav, .rail, .search, .pager, .note-foot { display: none !important; }
  .layout { display: block; max-width: none; padding: 0; }
  a { text-decoration: none; color: inherit; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
