/* Main page: a cool grey page with no colour of its own; each project card brings its own. */
:root {
  --bg: #e8e9eb;
  --ink: #0b0b0c;
  --muted: #5c5f66;
  --line: #cfd1d5;
  --sans: Archivo, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "D2Coding", "Malgun Gothic", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.page { width: min(100% - 32px, 1120px); margin-inline: auto; padding-block: 64px 80px; }

header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 40px; }
h1 { font-size: clamp(40px, 8vw, 56px); line-height: 1.05; font-weight: 800; letter-spacing: -.04em; }
.links { display: flex; gap: 20px; font-size: 15px; }
.links a { padding-block: 8px; }
.intro { margin-top: 20px; max-width: 900px; font-size: clamp(22px, 3.4vw, 30px); line-height: 1.3; font-weight: 400; letter-spacing: -.015em; }

/* where I have lived: one bar to scale in years, filled left to right once on load */
.lived { position: relative; height: 70px; margin-top: 64px; --fill: 1.8s; }
.lived li { position: absolute; top: 0; left: calc(var(--l) * 1%); width: calc(var(--w) * 1%); }
.lived .year { position: absolute; top: -22px; left: 0; white-space: nowrap; font: 400 12px var(--mono); color: var(--muted); }
.lived .seg { display: block; height: 24px; margin-right: 3px; border-radius: 2px; background: #3a3c42; animation: fill calc(var(--w) * var(--fill) / 100) linear calc(var(--l) * var(--fill) / 100 + .2s) both; }
.lived .now .seg { margin-right: 0; background: var(--ink); }
.lived .name { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 15px; }
.lived li:first-child .name { left: 0; transform: none; }
.lived .now .name { left: auto; right: 0; transform: none; font-weight: 600; }
.lived .now .year { left: auto; right: 0; }
@keyframes fill { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* experience and awards: dated rows */
.cv { margin-top: 48px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; align-items: start; }
.cv h2 { padding-bottom: 10px; border-bottom: 1px solid var(--ink); font-size: 13px; font-weight: 600; }
.cv li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding-block: 13px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 22px; color: var(--muted); }
.cv b { font-weight: 600; color: var(--ink); }
.cv .when { font: 400 13px/22px var(--mono); }

/* project cards: a still picture of the idea behind, name and facts in front */
.projects { margin-top: 48px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { position: relative; display: block; height: 340px; overflow: hidden; border-radius: 6px; background: var(--c-bg); color: var(--c-ink); text-decoration: none; transition: transform .15s ease-out; }
a.card:hover { transform: translateY(-3px); }
.card .bg { position: absolute; inset: 0; color: var(--c-faint); }
.card .dim { color: var(--c-dim); }
.card .acc { color: var(--c-acc); }
.card .text { position: absolute; inset: auto 0 0; padding: 70px 26px 22px; background: linear-gradient(to top, var(--c-bg) 55%, transparent); }
.card h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -.025em; }
a.card h3::after { content: "→"; font-size: 20px; font-weight: 400; color: var(--c-dim); }
.card.wide { grid-column: 1 / -1; }
a.card[href^="http"] h3::after { content: "↗"; }
.card .text p { margin-top: 6px; color: var(--c-muted); }
.card .text p.facts { margin-top: 10px; font: 400 12px var(--mono); color: var(--c-dim); }
.card .text p.facts { display: flex; flex-wrap: wrap; row-gap: 2px; }
.facts span { white-space: nowrap; }
.facts span:not(:last-child)::after { content: "/"; padding-inline: 9px; opacity: .6; }

.c-nunchi { --c-bg: #0d0e11; --c-faint: #474a53; --c-dim: #6c6f78; --c-acc: #ff6b3d; --c-ink: #eceae4; --c-muted: #a5a7ae; --c-line: #2c2e35; }
.c-nunchi .bg { padding: 22px 26px; font: 400 14px/26px var(--mono); white-space: nowrap; transition: opacity .35s; }
/* the animated rows (assets/nunchi-card.js): typed text wiped into the result, row by row, top to bottom */
.c-nunchi .r { position: relative; height: 26px; }
.c-nunchi .r span { position: absolute; inset: 0; overflow: hidden; transition: clip-path .9s cubic-bezier(.5, 0, .2, 1) calc(var(--i) * 70ms); }
.c-nunchi .r .f { clip-path: inset(0 0 0 0); }
.c-nunchi .r .t { clip-path: inset(0 100% 0 0); color: #777a84; }
.c-nunchi .r i { font-style: normal; color: var(--c-acc); }
.c-nunchi .done .r .f { clip-path: inset(0 0 0 100%); }
.c-nunchi .done .r .t { clip-path: inset(0 0 0 0); }
.c-nunchi .bg.out { opacity: 0; }
.c-nunchi .bg.reset, .c-nunchi .reset .r span { transition: none; }

.c-ark { --c-bg: #1f5bd8; --c-faint: #8aa9ef; --c-dim: #bcd0fa; --c-acc: #ffffff; --c-ink: #ffffff; --c-muted: #dbe5fd; --c-line: #4677e2; }
.c-ark .bg { padding: 22px 26px; font: 400 13px/28px var(--mono); white-space: nowrap; }
.c-ark .row, .c-ark .total { display: grid; grid-template-columns: 90px minmax(0, 1fr) 50px 90px; }
.c-ark .row { border-bottom: 1px solid var(--c-line); }
.c-ark .row span:nth-child(n+3) { text-align: right; }
.c-ark .total { margin-top: 6px; color: var(--c-dim); }
.c-ark .total span:first-child { grid-column: 1 / 4; }
.c-ark .total span:last-child { text-align: right; }

.c-duke { --c-bg: #1f1636; --c-faint: #5b4d86; --c-dim: #8a7bbd; --c-acc: #b9a4ff; --c-ink: #f0ecfc; --c-muted: #b6acd8; --c-line: #362a58; }
.c-duke .bg { width: 100%; height: 100%; }
.c-duke .edges line { stroke: var(--c-line); stroke-width: 1.2; }
.c-duke .edges line.acc { stroke: var(--c-acc); }
.c-duke .nodes circle { fill: var(--c-dim); }
.c-duke .nodes circle.acc { fill: var(--c-acc); }
.c-duke .nodes text { font: 400 13px var(--mono); fill: var(--c-faint); }
.c-duke .nodes text.dim { font-size: 12px; fill: var(--c-dim); }

.c-unicon { --c-bg: #ffd23f; --c-faint: #a8861d; --c-dim: #7c6312; --c-acc: #1b2a6b; --c-ink: #1b2a6b; --c-muted: #3c4470; --c-line: #e3b52a; }
.c-unicon .bg { padding: 22px 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.c-unicon .note { padding: 10px 12px; border: 1px solid var(--c-line); border-radius: 8px; font-size: 13px; line-height: 1.4; color: var(--c-faint); }
.c-unicon .note.acc { border-color: var(--c-acc); }
.c-unicon .note span { display: block; font-size: 11px; color: var(--c-dim); }

.c-indicators { --c-bg: #ffffff; --c-faint: #c4c6d6; --c-dim: #8a8ca6; --c-acc: #3fae73; --c-ink: #1d1b4c; --c-muted: #55577a; --c-line: #eceef4; }
.c-indicators .bg { width: 100%; height: 100%; }
.c-indicators .grid line { stroke: var(--c-line); stroke-width: 1; }
.c-indicators polyline { fill: none; stroke-width: 1.6; }
.c-indicators .up { stroke: #4caf7a; stroke-dasharray: 5 4; }
.c-indicators .price { stroke: #e5534b; }
.c-indicators .low { stroke: #4f63d9; stroke-dasharray: 5 4; }
.c-indicators text { font: 400 12px var(--mono); fill: var(--c-dim); }
.c-indicators .buy { fill: var(--c-acc); font-weight: 500; }

.earlier { margin-top: 26px; font-size: 15px; color: var(--muted); }
.earlier b { margin-right: 16px; font-weight: 600; color: var(--ink); }
.earlier a { text-decoration-color: var(--line); }
.earlier a:hover { color: var(--ink); text-decoration-color: currentColor; }

@media (max-width: 760px) {
  .page { padding-block: 40px 56px; }
  .cv, .projects { grid-template-columns: minmax(0, 1fr); }
  .cv li { grid-template-columns: 92px minmax(0, 1fr); gap: 12px; }
  .card { height: 300px; }
  .card .text { padding-inline: 20px; }
  .c-nunchi .bg, .c-ark .bg, .c-unicon .bg { padding-inline: 20px; }
  .earlier b { display: block; margin: 0 0 4px; }
  /* too narrow for every year and name on one line: keep the ends' years, drop the one-year stay's name a line */
  .lived { height: 86px; margin-top: 52px; }
  .lived li:not(:first-child):not(.now) .year { display: none; }
  .lived .name { font-size: 13px; }
  .lived .narrow .name { top: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .lived .seg { animation: none; }
}
