:root {
  --paper: #f1ece1; --ink: #1d1b17; --dim: #6b6457; --shade: #a39b8b; --line: #d9d2c3; --acc: #1f6f4a; --warm: #8a4b12;
  --gut: clamp(16px, 4vw, 48px); --bar: 44px;
  /* Motion tokens from SEED Design (daangn/seed-design) */
  --d3: .15s; --d5: .25s; --d6: .3s;
  --ease: cubic-bezier(.35, 0, .35, 1);
  --ease-enter: cubic-bezier(0, 0, .15, 1);
  --ease-enter-expressive: cubic-bezier(.03, .4, .1, 1);
  --ease-exit-expressive: cubic-bezier(.35, 0, .95, .55);
  --s97: .97; --s98: .98;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #14130f; --ink: #ece6d8; --dim: #9a9282; --shade: #55503f; --line: #2e2b25; --acc: #6fcf97; --warm: #e0a060; }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 16px); }
html:has(body.motion-off) { scroll-behavior: auto; }
body { background: var(--paper); color: var(--ink); font-family: "IBM Plex Mono", "Noto Sans KR", ui-monospace, monospace; font-size: 15px; line-height: 1.7; word-break: keep-all; overflow-x: hidden; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.dim { color: var(--dim); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 8px; top: -100px; z-index: 40; padding: 8px 12px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 8px; }
.text-btn { border: 0; background: none; cursor: pointer; }
:is(.text-btn, .bar a, .links a):hover { background: var(--ink); color: var(--paper); }

/* SEED-style pressed feedback: a quick scale-down on every pressable surface */
:is(button, .row, .mail) { transition: transform var(--d3) var(--ease-enter), background-color var(--d3) var(--ease), color var(--d3) var(--ease); }
button:active { transform: scale(var(--s97)); }
.row:active { transform: scale(var(--s98)); }

.bar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; min-height: var(--bar); padding: 8px var(--gut); border-bottom: 1px solid var(--ink); background: var(--paper); font-size: 13px; }
.bar a { text-decoration: none; }
.bar-nav { display: flex; gap: 14px; margin-left: auto; }
.bar-tools { display: flex; gap: 10px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100svh - var(--bar)); }
.art-col { position: sticky; top: var(--bar); height: calc(100svh - var(--bar)); display: flex; flex-direction: column; justify-content: center; padding: var(--gut); border-right: 1px solid var(--ink); }
.art { position: relative; width: 100%; aspect-ratio: 1; container-type: inline-size; cursor: crosshair; user-select: none; touch-action: pan-y; }
/* 84 columns of IBM Plex Mono (0.6em advance) — the same size before and after the art takes over */
.art pre { position: absolute; inset: 0; font: inherit; font-size: calc(100cqw / 50.4); line-height: 1.15; white-space: pre; overflow: hidden; }
.art pre.fallback { display: grid; place-content: center; visibility: hidden; }
.art.is-static pre.fallback { visibility: visible; }
#sh { color: var(--shade); }
#ink { color: var(--ink); font-weight: 600; }
.art pre, .art canvas { transition: opacity var(--d6) var(--ease); }
.art canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
/* Graphic view: only the square is drawn in the GitHub avatar's colors; the panel around it keeps the theme */
.art.is-graphic canvas { opacity: 1; }
.art.is-graphic pre { opacity: 0; }
.art-head { display: flex; justify-content: flex-end; min-height: 1.7em; margin-bottom: 12px; font-size: 13px; }
#art-view[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.cap { margin-top: 16px; display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--dim); }

.term { padding: var(--gut); container-type: inline-size; }
.blk { margin-bottom: clamp(56px, 9vw, 110px); }
.cmd { margin-bottom: 14px; min-height: 1.7em; }
.ps { color: var(--acc); font-weight: 600; }
.caret { display: inline-block; width: .6em; height: 1.1em; margin-left: 2px; vertical-align: -.2em; background: var(--ink); animation: blink 1s steps(1) infinite; }
.blk.done .caret { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.out { transition: opacity .5s var(--ease-enter), transform .5s var(--ease-enter); }
.blk.pending .out, html.js .blk:not(.done) .out { opacity: 0; transform: translateY(8px); }

/* SEED landing-style word reveal: each word lifts out of its own mask */
.w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.w > span { display: inline-block; transition: transform .7s var(--ease-enter-expressive) calc(var(--i, 0) * 18ms); }
.blk.pending .w > span { transform: translateY(105%); }

/* "차성겸" in Noto Sans KR 700, rasterized once into the same ink ramp as the CSK art: 87 cols × 16 rows */
.name-art { display: block; font-size: calc(min(100cqw, 460px) / (87 * .6)); font-weight: 600; line-height: 1.15; white-space: pre; }
.role { margin-top: 14px; font-size: 13px; }
.lead { margin-top: 18px; max-width: 34em; font-family: "Noto Sans KR", sans-serif; font-size: 16px; line-height: 1.8; }
.meta { margin-top: 14px; font-size: 13px; }

.ls-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 14px; }
.seg { position: relative; display: inline-flex; border: 1px solid var(--ink); }
.seg button { position: relative; z-index: 1; padding: 3px 12px; border: 0; background: none; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { color: var(--paper); }
.seg .count { color: inherit; opacity: .6; }
.seg-ind { position: absolute; inset: 0 auto 0 0; width: var(--w, 0); transform: translateX(var(--x, 0)); background: var(--ink); transition: transform var(--d5) var(--ease), width var(--d5) var(--ease); }
.grep { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 200px; border-bottom: 1px solid var(--ink); font-size: 13px; }
.grep:focus-within { box-shadow: 0 1px 0 var(--acc); border-color: var(--acc); }
.grep input, .palette-row input { flex: 1; min-width: 0; padding: 5px 0; border: 0; background: none; outline: none; appearance: none; }

.ls { list-style: none; font-size: 14px; border-top: 1px dashed var(--line); }
.row { display: grid; grid-template-columns: 10ch 4ch minmax(0, 24ch) minmax(0, 1fr); gap: 0 14px; align-items: baseline; width: 100%; padding: 10px 8px; border: 0; border-bottom: 1px dashed var(--line); background: none; text-align: left; text-decoration: none; cursor: pointer; }
.row:hover, .row:focus-visible { background: var(--ink); color: var(--paper); }
.row:hover :is(.perm, .ds, .when, .st), .row:focus-visible :is(.perm, .ds, .when, .st) { color: var(--paper); }
.perm, .when { color: var(--dim); }
.st { color: var(--dim); }
.st.is-live { color: var(--acc); }
.nm { font-weight: 600; overflow-wrap: anywhere; }
.ds { font-family: "Noto Sans KR", sans-serif; font-size: 13px; color: var(--dim); }
.repo { grid-template-columns: 2ch minmax(0, 1fr) 11ch 5ch 9ch; }
.repo .dot { color: var(--line); }
.repo .dot.is-fresh { color: var(--acc); }
.empty { padding: 12px 8px; color: var(--dim); }
.total { margin-top: 10px; font-size: 13px; }
@container (max-width: 620px) {
  .row { grid-template-columns: 4ch minmax(0, 1fr); }
  .perm { display: none; }
  .ds { grid-column: 2; }
  .repo { grid-template-columns: 2ch minmax(0, 1fr) 5ch 9ch; }
  .repo .lang { display: none; }
}

.md { max-width: 36em; font-family: "Noto Sans KR", sans-serif; }
.md :is(h2, h3) { margin: 18px 0 6px; font-family: "IBM Plex Mono", monospace; font-size: 15px; color: var(--acc); }
.md h2 { margin-top: 0; }
.md p + p { margin-top: 12px; }
.md ul { list-style: none; }
.md li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.md li > strong:first-child { display: inline-block; min-width: 7em; }
.md code { font-family: "IBM Plex Mono", monospace; font-size: .9em; }
.json { font: inherit; font-size: 14px; white-space: pre-wrap; }
.json .k { color: var(--acc); }
.json .s { color: var(--warm); }
.mail { display: inline-block; border-bottom: 3px solid var(--ink); font-size: clamp(24px, 3.6vw, 44px); font-weight: 600; line-height: 1.2; text-decoration: none; overflow-wrap: anywhere; }
.mail:hover { background: var(--ink); color: var(--paper); }
.contact-copy { margin-top: 16px; font-family: "Noto Sans KR", sans-serif; }
.links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 18px; }
.links a { text-decoration: none; }
.foot { padding: 24px 0 10vh; border-top: 1px solid var(--ink); font-size: 12px; }

/* Dialogs: centered on desktop, a SEED-style bottom sheet on phones */
dialog { margin: auto; width: 100%; max-width: min(640px, calc(100% - 32px)); max-height: min(86svh, 760px); padding: 0; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog[open] { animation: pop var(--d5) var(--ease-enter); }
dialog[open]::backdrop { animation: fade var(--d5) var(--ease-enter); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(var(--s98)); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-head { position: sticky; top: 0; display: flex; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--ink); background: var(--paper); font-size: 13px; }
#dialog-body { padding: 20px; }
.sheet-title { font-size: clamp(28px, 5vw, 40px); line-height: 1.1; letter-spacing: -.02em; }
.sheet-tagline { margin-top: 6px; color: var(--acc); font-family: "Noto Sans KR", sans-serif; }
.sheet-desc { margin-top: 16px; font-family: "Noto Sans KR", sans-serif; }
.tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--dim); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border: 1px dashed var(--line); }
.metrics div { padding: 10px 12px; }
.metrics div + div { border-left: 1px dashed var(--line); }
.metrics dt { font-size: 12px; color: var(--dim); }
.metrics dd { font-weight: 600; overflow-wrap: anywhere; }
.sheet-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 18px; }
.sheet-links a { text-decoration: none; font-weight: 600; }
.sheet-links a:hover { background: var(--ink); color: var(--paper); }
.sheet-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; }
.sheet-nav button:disabled { opacity: .35; cursor: default; }
@media (max-width: 640px) {
  .sheet { max-width: 100%; max-height: 88svh; margin: auto 0 0; border-width: 1px 0 0; }
  .sheet[open] { animation: sheet-up var(--d6) var(--ease-enter-expressive); }
}

.palette { margin-top: 12vh; max-width: min(560px, calc(100% - 32px)); }
.palette-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--ink); }
.palette-results { max-height: 50svh; overflow-y: auto; }
.palette-results button { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 16px; border: 0; border-bottom: 1px dashed var(--line); background: none; text-align: left; font-size: 14px; cursor: pointer; }
.palette-results button:is(:hover, :focus-visible) { background: var(--ink); color: var(--paper); outline: none; }
.palette-results small { color: inherit; opacity: .6; }
.palette-note { padding: 8px 16px; font-size: 12px; }

.snackbar { position: fixed; left: 50%; bottom: 24px; z-index: 20; max-width: calc(100% - 32px); padding: 10px 16px; background: var(--ink); color: var(--paper); font-size: 13px; transform: translate(-50%, calc(100% + 40px)); transition: transform var(--d5) var(--ease-exit-expressive); }
.snackbar.is-open { transform: translate(-50%, 0); transition: transform var(--d6) var(--ease-enter-expressive); }

/* SEED landing-style cursor, drawn as a terminal caret: block → selection box → labelled tag */
.cursor { position: fixed; left: 0; top: 0; z-index: 30; display: none; align-items: center; justify-content: center; width: 10px; height: 18px; translate: -50% -50%; background: #fff; mix-blend-mode: difference; pointer-events: none; white-space: nowrap; font-size: 13px; font-weight: 600; interpolate-size: allow-keywords; transition: width var(--d6) var(--ease-enter), height var(--d6) var(--ease-enter); }
.cursor span { display: none; padding: 0 12px; }
.cursor[data-mode="ring"] { width: 34px; height: 34px; }
.cursor[data-mode="text"] { width: auto; height: 30px; translate: 14px 10px; background: var(--pill); color: var(--paper); box-shadow: 0 0 0 1px var(--paper); mix-blend-mode: normal; }
.cursor[data-mode="text"] span { display: block; }
.cursor[data-mode="off"] { width: 0; height: 0; }
html.has-cursor body:not(.motion-off):not(:has(dialog[open])) .cursor { display: flex; }
html.has-cursor body:not(.motion-off):not(:has(dialog[open])) * { cursor: none; }
html.has-cursor body:not(.motion-off):not(:has(dialog[open])) input { cursor: text; }

.noscript-note { position: fixed; inset: auto 16px 16px; padding: 12px; background: var(--ink); color: var(--paper); }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .art-col { position: relative; top: 0; height: auto; border-right: 0; border-bottom: 1px solid var(--ink); }
  .art-head, .art, .cap { width: 100%; max-width: 440px; margin-inline: auto; }
}
@media (max-width: 640px) {
  .bar-nav { order: 3; width: 100%; margin-left: 0; }
  .bar-tools { margin-left: auto; }
  #clock { display: none; }
}
body.motion-off *, body.motion-off *::before, body.motion-off *::after { animation: none !important; transition: none !important; }
