/* Jake Choi — resume + portfolio
   Neutral personal system. Light/dark via prefers-color-scheme + manual override. */

:root {
  --display: "Inter Tight", "Noto Sans KR", system-ui, sans-serif;
  --sans: "Inter", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  --kr: "Noto Sans KR", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --hw: 600; --ht: -0.03em; --h1w: 600; --h1t: -0.035em;
  --bg: #FAFAF8; --bg-2: #F1F1EE; --surface: #FFFFFF;
  --line: rgba(20, 20, 18, 0.10); --line-2: rgba(20, 20, 18, 0.18);
  --text: #141413; --text-2: #5A5A56; --text-3: #8B8B86;
  --accent: #2748D6; --accent-wash: rgba(39, 72, 214, 0.08);
  --r: 12px; --r-sm: 8px; --card-shadow: none; --max: 1040px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111110; --bg-2: #181816; --surface: #1C1C1A;
    --line: rgba(236, 236, 232, 0.10); --line-2: rgba(236, 236, 232, 0.20);
    --text: #ECECE8; --text-2: #A5A5A0; --text-3: #737370;
    --accent: #7D95FF; --accent-wash: rgba(125, 149, 255, 0.12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111110; --bg-2: #181816; --surface: #1C1C1A;
  --line: rgba(236, 236, 232, 0.10); --line-2: rgba(236, 236, 232, 0.20);
  --text: #ECECE8; --text-2: #A5A5A0; --text-3: #737370;
  --accent: #7D95FF; --accent-wash: rgba(125, 149, 255, 0.12);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  word-break: keep-all; overflow-wrap: anywhere;
}
html[data-lang="ko"] body { font-size: 15.5px; line-height: 1.75; }

/* language switching: blocks tagged data-l="en" / data-l="ko" */
html[data-lang="en"] [data-l="ko"] { display: none !important; }
html[data-lang="ko"] [data-l="en"] { display: none !important; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
p a, li a, dd a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
p a:hover { text-decoration-color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: var(--hw); letter-spacing: var(--ht); line-height: 1.12; margin: 0; text-wrap: balance; }
html[data-lang="ko"] h1, html[data-lang="ko"] h2, html[data-lang="ko"] h3, html[data-lang="ko"] h4 { font-family: var(--kr); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0 0 1em; }
.muted { color: var(--text-2); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; color: var(--text-2); }
.nav-links a:hover { color: var(--text); }
.controls { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.seg button {
  appearance: none; border: 0; background: transparent; color: var(--text-2);
  font: 600 12px var(--mono); letter-spacing: 0.06em; padding: 5px 10px; border-radius: 999px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.icon-btn {
  appearance: none; border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  width: 32px; height: 32px; border-radius: 999px; cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-3); }
.icon-btn svg { width: 15px; height: 15px; }
@media (max-width: 640px) { .nav-links { display: none; } }

/* hero */
.hero { padding: clamp(56px, 10vw, 112px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.hero h1 { font-size: clamp(38px, 6.5vw, 76px); font-weight: var(--h1w); letter-spacing: var(--h1t); line-height: 1.02; max-width: 16ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: clamp(17px, 2vw, 20px); color: var(--text-2); max-width: 60ch; margin-top: 24px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 32px; font-size: 14px; color: var(--text-2); }
.hero .meta a { color: var(--text); border-bottom: 1px solid var(--line-2); }
.hero .meta a:hover { color: var(--accent); border-color: var(--accent); }

/* sections */
section { padding: clamp(48px, 7vw, 88px) 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: clamp(24px, 4vw, 40px); }
.sec-head h2 { font-size: clamp(26px, 3.6vw, 36px); }
.sec-head .mono { flex-shrink: 0; }

/* work cards */
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--card-shadow);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--text-3); transform: translateY(-2px); color: inherit; }
.card .thumb { aspect-ratio: 16/9; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.card h3 { font-size: 22px; }
.card p { color: var(--text-2); font-size: 15px; margin: 0; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag { font: 500 12px var(--mono); letter-spacing: 0.03em; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px; }
.card .cta { color: var(--accent); font-size: 14px; font-weight: 500; }

/* experience */
.xp { display: grid; grid-template-columns: 180px 1fr; gap: 12px 32px; padding: 28px 0; border-top: 1px solid var(--line); }
.xp:first-of-type { border-top: 0; padding-top: 0; }
.xp .when { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); letter-spacing: 0.03em; padding-top: 6px; }
.xp .when span { display: block; margin-top: 4px; }
.xp h3 { font-size: 22px; }
.xp .role { color: var(--text-2); margin: 2px 0 12px; font-size: 15px; }
.xp .role a { color: var(--text-3); }
.xp .blurb { color: var(--text-2); font-size: 15px; }
.xp ul { margin: 10px 0 0; padding-left: 18px; color: var(--text); font-size: 15px; }
.xp li { margin: 5px 0; }
.xp li::marker { color: var(--text-3); }
.xp h4 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin: 16px 0 4px; }
@media (max-width: 640px) { .xp { grid-template-columns: 1fr; gap: 6px; } }

/* awards + misc */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
dl { margin: 0; }
dl div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
dt { font-weight: 500; white-space: nowrap; }
dd { margin: 0; color: var(--text-2); text-align: right; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat { border-top: 2px solid var(--text); padding-top: 12px; }
.stat b { display: block; font-family: var(--display); font-size: 34px; font-weight: var(--hw); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; font-size: 13.5px; color: var(--text-2); }

footer { padding: 40px 0 56px; color: var(--text-3); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* case study pages */
.case-hero { padding: clamp(40px, 7vw, 80px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.case-hero .crumbs { font-size: 14px; color: var(--text-3); margin-bottom: 20px; }
.case-hero .crumbs a:hover { color: var(--accent); }
.case-hero h1 { font-size: clamp(32px, 5vw, 56px); font-weight: var(--h1w); letter-spacing: var(--h1t); line-height: 1.05; max-width: 22ch; }
.case-hero .lede { font-size: clamp(17px, 2vw, 20px); color: var(--text-2); max-width: 64ch; margin-top: 18px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 24px; margin-top: 28px; font-size: 14px; }
.facts .k { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; }
.prose { max-width: 700px; }
.wrap.prose { max-width: var(--max); }
.wrap.prose > * { max-width: 700px; }
.wrap.prose > .facts { max-width: 760px; }
.prose h2 { font-size: clamp(24px, 3vw, 30px); margin: 0 0 14px; }
.prose h3 { font-size: 20px; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--text-2); font-size: 16px; }
html[data-lang="ko"] .prose p, html[data-lang="ko"] .prose li { font-size: 15.5px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--text); font-weight: 600; }
.figure { margin: 28px 0; }
.figure .frame { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #0B0E0C; }
.figure figcaption { margin-top: 10px; font-size: 13.5px; color: var(--text-3); }
.figure figcaption b { color: var(--text-2); font-weight: 500; }
.callout { border-left: 2px solid var(--accent); background: var(--accent-wash); padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 20px 0; }
.callout p { margin: 0; color: var(--text); }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 20px 0; counter-reset: step; }
.flow div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); font-size: 14px; }
.flow div::before { counter-increment: step; content: counter(step, decimal-leading-zero); display: block; font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-bottom: 6px; }
.flow div b { display: block; font-weight: 600; margin-bottom: 2px; }
.flow div span { color: var(--text-2); font-size: 13px; }
.decision { display: grid; grid-template-columns: 110px 1fr; gap: 8px 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.decision:last-child { border-bottom: 1px solid var(--line); }
.decision .k { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding-top: 5px; }
.decision h3 { margin: 0 0 4px; font-size: 18px; }
.decision p { margin: 0; }
@media (max-width: 560px) { .decision { grid-template-columns: 1fr; gap: 2px; } }
.pager { display: flex; justify-content: space-between; gap: 16px; padding: 32px 0 0; font-size: 15px; }
.pager a { color: var(--text-2); }
.pager a:hover { color: var(--accent); }
.note { font-size: 13.5px; color: var(--text-3); }

/* phone screenshot grids */
.phones { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; margin: 28px 0; }
.phones figure { margin: 0; }
.phones img { width: 100%; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.phones figcaption { margin-top: 8px; font-size: 13px; color: var(--text-3); }
.phones figcaption b { color: var(--text-2); font-weight: 500; }
.phones.dark img { background: #111; }

/* ---- feature bands (home) ---- */
#work { padding-bottom: 0; }
#work .sec-head { margin-bottom: clamp(20px, 3vw, 32px); }
.features { display: block; }
.feature {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  min-height: clamp(420px, 62vh, 620px); color: #fff;
  border-top: 1px solid var(--line);
}
.feature-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; background: #0e0f10; }
.feature-bg img {
  position: absolute; top: 50%; left: 0; height: 100%; width: auto; max-width: none; min-width: 100%;
  transform: translate(var(--pan-from), -50%) scale(1.04);
  filter: blur(4px) saturate(1.15) brightness(1.15);
  animation: pan 38s ease-in-out infinite alternate;
  will-change: transform;
}
.feature-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(8,9,10,.78) 0%, rgba(8,9,10,.5) 45%, rgba(8,9,10,.08) 100%),
    linear-gradient(180deg, rgba(8,9,10,.1), rgba(8,9,10,.35));
}
.feature.light { color: #14151a; }
.feature.light .feature-bg { background: #f2f2f5; }
.feature.light .feature-shade {
  background:
    linear-gradient(90deg, rgba(246,246,248,.9) 0%, rgba(246,246,248,.74) 42%, rgba(246,246,248,.3) 100%),
    linear-gradient(180deg, rgba(246,246,248,.2), rgba(246,246,248,.5));
}
.feature-body {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 14px;
  min-height: inherit; padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(40px, 7vw, 80px); max-width: var(--max);
}
.feature-body > * { max-width: 560px; }
.feature .mono { color: inherit; opacity: .7; }
.feature h3 { font-size: clamp(30px, 4.6vw, 52px); letter-spacing: var(--h1t); line-height: 1.02; }
.feature p:not(.mono) { font-size: clamp(15.5px, 1.6vw, 18px); line-height: 1.55; opacity: .9; margin: 0; }
.feature .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.feature .tag { color: inherit; border-color: currentColor; opacity: .75; }
.feature .cta { font-weight: 600; font-size: 15px; color: inherit; margin-top: 6px; transition: gap .2s; }
.feature:hover, .feature:focus-visible { color: #fff; }
.feature.light:hover, .feature.light:focus-visible { color: #14151a; }
.feature:hover .feature-bg img { filter: blur(2px) saturate(1.2) brightness(1.2); }
.feature:hover .cta { text-decoration: underline; text-underline-offset: 4px; }
@keyframes pan { from { transform: translate(var(--pan-from), -50%) scale(1.04); } to { transform: translate(var(--pan-to), -50%) scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .feature-bg img { animation: none; transform: translate(calc((var(--pan-from) + var(--pan-to)) / 2), -50%) scale(1.04); } }
@media (max-width: 640px) {
  .feature { min-height: 460px; }
  .feature-bg img { filter: blur(4px) saturate(1.1); }
  .feature-shade { background: linear-gradient(180deg, rgba(8,9,10,.35) 0%, rgba(8,9,10,.82) 60%, rgba(8,9,10,.9) 100%); }
  .feature.light .feature-shade { background: linear-gradient(180deg, rgba(246,246,248,.4) 0%, rgba(246,246,248,.86) 60%, rgba(246,246,248,.94) 100%); }
  .feature-body { justify-content: flex-end; }
}

/* ---- case-study tabs (details/summary) ---- */
.tabs { padding-top: clamp(24px, 4vw, 40px); padding-bottom: clamp(48px, 7vw, 88px); }
.tab { border-bottom: 1px solid var(--line-2); }
.tabs > .tab:first-child { border-top: 1px solid var(--line-2); }
.tab > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 18px;
  padding: clamp(18px, 3vw, 28px) 0; font-family: var(--display); font-weight: var(--hw);
  font-size: clamp(24px, 3.4vw, 34px); letter-spacing: var(--ht); user-select: none;
}
html[data-lang="ko"] .tab > summary { font-family: var(--kr); font-weight: 700; letter-spacing: -0.01em; }
.tab > summary::-webkit-details-marker { display: none; }
.tab > summary:hover { color: var(--accent); }
.tab > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.tab-n { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; color: var(--text-3); font-weight: 500; }
.tab-toggle { margin-left: auto; width: 28px; height: 28px; position: relative; flex-shrink: 0; }
.tab-toggle::before, .tab-toggle::after { content: ""; position: absolute; background: currentColor; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tab-toggle::before { width: 16px; height: 2px; }
.tab-toggle::after { width: 2px; height: 16px; transition: transform .2s; }
.tab[open] > .tab-toggle::after, .tab[open] > summary .tab-toggle::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }
.tab-body { padding-bottom: clamp(16px, 3vw, 28px); }
.tab-body > section { border-bottom: 0; padding: clamp(24px, 4vw, 44px) 0 0; }
.tab-body > section:first-child { padding-top: 0; }
.tab-body .prose h2 { margin-bottom: 10px; }
.tab-body .prose .mono { margin-bottom: 6px; }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.box .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.box h3 { font-size: 17px; }
.box p { margin: 0; font-size: 14.5px; color: var(--text-2); line-height: 1.5; }

.stages { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 20px; }
.stage-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stage-head h3 { font-size: 19px; }
.pill { font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.qfd { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 820px) { .qfd { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.qfd dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.qfd dt.dk { color: var(--accent); }
.qfd dd { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.qfd dd.q { color: var(--text); font-weight: 500; }

ol.uisteps { list-style: none; margin: 18px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
ol.uisteps li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); align-items: start; }
ol.uisteps li:last-child { border-bottom: 0; }
ol.uisteps .pill { justify-self: start; }
ol.uisteps h3 { font-size: 16px; margin-bottom: 2px; }
ol.uisteps p { margin: 0; font-size: 14.5px; color: var(--text-2); line-height: 1.5; }
@media (max-width: 560px) { ol.uisteps li { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 24px; }
.compare .figure { margin: 0; }
.compare figcaption { font-size: 13.5px; }

/* result diagram: map the artifact's classes onto site tokens */
.figure.diagram .plate { padding: 18px 16px; overflow-x: auto; background: var(--surface); }
.figure.diagram svg { display: block; width: 100%; min-width: 660px; height: auto; color: var(--text); }
.figure.diagram .f-surface { fill: var(--bg-2); }
.figure.diagram .f-sunk { fill: var(--bg); }
.figure.diagram .f-well { fill: var(--accent-wash); }
.figure.diagram .f-green { fill: var(--accent); }
.figure.diagram .f-muted { fill: var(--text-3); }
.figure.diagram .f-dim { fill: var(--text-2); }
.figure.diagram .f-red { fill: #D64545; }
.figure.diagram .s-green { stroke: var(--accent); }
.figure.diagram .s-red { stroke: #D64545; }
.figure.diagram .t-mono { font-family: var(--mono); }
.figure.diagram text { font-family: var(--sans); }
.qfd > div { display: block; padding: 0; border-bottom: 0; }
.qfd dd { text-align: left; }
.stat b .u { display: inline; font-size: 18px; font-weight: 500; color: var(--text-2); margin-left: 4px; letter-spacing: 0; }

/* link rows that sit alongside the collapsible sections */
.tab-link {
  display: flex; align-items: center; gap: 18px; color: inherit;
  padding: clamp(18px, 3vw, 28px) 0; font-family: var(--display); font-weight: var(--hw);
  font-size: clamp(24px, 3.4vw, 34px); letter-spacing: var(--ht);
}
html[data-lang="ko"] .tab-link { font-family: var(--kr); font-weight: 700; letter-spacing: -0.01em; }
.tab-link:hover { color: var(--accent); }
.tab-arrow { margin-left: auto; font-size: 0.8em; color: var(--text-3); transition: transform .2s, color .2s; }
.tab-link:hover .tab-arrow { color: var(--accent); transform: translateX(4px); }
