/* Tokens follow the DesignMD "cursor" system: warm cream canvas, warm ink,
   display weight 400 with negative tracking, hairline-only depth, a single
   orange accent kept scarce. Pretendard stands in for CursorGothic (Korean).
   Monospace is reserved for code. */
:root {
  --primary: #f54e00;
  --ink: #26251e;
  --body: #5a5852;
  --muted: #807d72;
  --hairline: #e6e5e0;
  --hairline-soft: #efeee8;
  --hairline-strong: #cfcdc4;
  --canvas: #f7f7f4;
  --canvas-soft: #fafaf7;
  --surface-card: #ffffff;

  --font-sans: 'Pretendard Variable', Pretendard, system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --r-xs: 4px; --r-md: 8px; --r-lg: 12px;
  --s-xxs: 4px; --s-xs: 8px; --s-sm: 12px; --s-base: 16px;
  --s-lg: 24px; --s-xl: 32px; --s-xxl: 48px; --s-section: 80px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #ff6a24;
    --ink: #edebe4;
    --body: #b9b6ac;
    --muted: #8f8b80;
    --hairline: #2f2d27;
    --hairline-soft: #262520;
    --hairline-strong: #403d35;
    --canvas: #161512;
    --canvas-soft: #1b1a16;
    --surface-card: #1e1d19;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #ff6a24;
  --ink: #edebe4;
  --body: #b9b6ac;
  --muted: #8f8b80;
  --hairline: #2f2d27;
  --hairline-soft: #262520;
  --hairline-strong: #403d35;
  --canvas: #161512;
  --canvas-soft: #1b1a16;
  --surface-card: #1e1d19;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; height: auto; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--hairline-strong); transition: text-decoration-color .15s ease, color .15s ease; }
a:hover { text-decoration-color: var(--ink); }
strong { color: var(--ink); font-weight: 600; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 400; margin: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-xs); }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding-left: var(--s-lg); padding-right: var(--s-lg); }
.wrap-narrow { width: 100%; max-width: 760px; margin: 0 auto; padding-left: var(--s-lg); padding-right: var(--s-lg); }

/* Top nav */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--canvas); border-bottom: 1px solid var(--hairline); }
.topbar-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: var(--s-base); }
.wordmark { font-weight: 500; font-size: 15px; text-decoration: none; color: var(--ink); }
.topnav { display: flex; align-items: center; gap: var(--s-lg); }
.topnav a, .theme-toggle { font-size: 14px; font-weight: 500; text-decoration: none; color: var(--body); }
.topnav a:hover, .theme-toggle:hover { color: var(--ink); }
.theme-toggle { font-family: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.theme-toggle .to-light { display: none; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .to-dark { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .to-light { display: inline; }
}

/* Hero */
.hero {
  display: grid; grid-template-columns: 1fr 200px; gap: var(--s-xxl); align-items: start;
  padding-top: var(--s-section); padding-bottom: var(--s-xxl);
}
.hero h1 { font-size: 64px; line-height: 1.1; letter-spacing: -0.03em; }
.hero-role { margin: var(--s-xs) 0 0; font-size: 22px; letter-spacing: -0.01em; color: var(--muted); }
.quote { margin: var(--s-xl) 0 0; padding: 0; }
.quote p { margin: 0; font-size: 20px; line-height: 1.5; color: var(--ink); max-width: 30ch; }
.quote cite { display: block; margin-top: var(--s-xs); font-style: normal; font-size: 14px; color: var(--muted); }
.intro { margin: var(--s-base) 0 0; max-width: 46ch; }
.contacts { list-style: none; margin: var(--s-xl) 0 0; padding: 0; display: grid; gap: var(--s-xxs); }
.contacts li { display: grid; grid-template-columns: 80px 1fr; align-items: baseline; font-size: 15px; }
.contacts .label { font-size: 14px; color: var(--muted); }
.portrait {
  width: 200px; aspect-ratio: 250 / 313; object-fit: cover;
  border-radius: var(--r-lg); background: var(--surface-card);
}

/* Sections */
.section { padding-top: var(--s-xxl); padding-bottom: var(--s-xxl); border-top: 1px solid var(--hairline); }
.section-title { font-size: 26px; line-height: 1.25; letter-spacing: -0.015em; margin-bottom: var(--s-xl); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-xxl); }

/* Skills: label column + plain list, no pills */
.skills { display: grid; gap: var(--s-base); }
.skill-group { display: grid; grid-template-columns: 240px 1fr; gap: var(--s-lg); padding-bottom: var(--s-base); border-bottom: 1px solid var(--hairline-soft); }
.skill-group:last-child { border-bottom: 0; padding-bottom: 0; }
.skill-group h3 { font-size: 16px; font-weight: 600; line-height: 1.65; }
.skill-group p { margin: 0; color: var(--ink); }

/* Experience */
.job { display: grid; grid-template-columns: 160px 1fr; gap: var(--s-xl); padding: var(--s-xl) 0; border-bottom: 1px solid var(--hairline-soft); }
.job:first-child { padding-top: 0; }
.job:last-child { border-bottom: 0; }
.job-meta { display: flex; flex-direction: column; gap: var(--s-sm); }
.logo { width: 48px; height: 48px; border-radius: var(--r-md); object-fit: cover; background: #fff; }
.period { font-size: 14px; color: var(--muted); margin: 0; }
.job h3, .edu h3 { font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; }
.role { font-size: 15px; letter-spacing: 0; color: var(--muted); margin-left: var(--s-xs); }
.summary { margin: var(--s-xs) 0 0; max-width: 62ch; }
.highlights { margin: var(--s-base) 0 0; padding-left: 1.2em; display: grid; gap: var(--s-xxs); }
.highlights li { padding-left: 2px; }
.highlights li::marker { color: var(--muted); }
.more { display: inline-block; margin-top: var(--s-base); font-size: 15px; }

/* Activity cards: one surface each, no nested boxes */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-lg); }
.card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--surface-card); border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden;
  transition: border-color .15s ease;
}
.card:hover { border-color: var(--hairline-strong); }
.card-cover { aspect-ratio: 16 / 9; background: var(--canvas-soft); border-bottom: 1px solid var(--hairline); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-cover-text { display: grid; place-items: center; height: 100%; font-size: 26px; letter-spacing: -0.015em; color: var(--muted); }
.card-body { padding: var(--s-base) var(--s-lg) var(--s-lg); }
.card h3 { font-size: 20px; letter-spacing: -0.01em; }
.card-meta { margin: var(--s-xxs) 0 0; font-size: 14px; color: var(--muted); }
.card-summary { margin: var(--s-xs) 0 0; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.stack { margin: var(--s-xs) 0 0; font-size: 14px; color: var(--muted); }

.edu .period { margin-top: var(--s-xxs); }
.plain { margin: 0; padding-left: 1.2em; display: grid; gap: var(--s-xxs); color: var(--ink); }

/* Detail pages */
.detail { padding-top: var(--s-xxl); padding-bottom: var(--s-section); }
.back { font-size: 14px; color: var(--muted); }
.detail-head { display: flex; align-items: center; gap: var(--s-base); margin-top: var(--s-xl); }
.detail-head .logo { width: 56px; height: 56px; }
.detail-head h1 { font-size: 44px; line-height: 1.15; letter-spacing: -0.03em; }
.detail-meta { margin: var(--s-xxs) 0 0; font-size: 15px; color: var(--muted); }
.lede { font-size: 19px; line-height: 1.6; color: var(--ink); margin: var(--s-xl) 0 0; }
.detail > .stack { margin-top: var(--s-sm); }

.prose { margin-top: var(--s-xxl); border-top: 1px solid var(--hairline); }
.prose > :first-child { margin-top: var(--s-xl); }
.prose h2 { font-size: 26px; line-height: 1.3; letter-spacing: -0.015em; margin: var(--s-xxl) 0 var(--s-base); }
.prose h3 { font-size: 21px; line-height: 1.35; letter-spacing: -0.01em; margin: var(--s-xl) 0 var(--s-xs); }
.prose h4 { font-size: 16px; font-weight: 600; margin: var(--s-lg) 0 var(--s-xxs); }
.prose h5 { font-size: 15px; font-weight: 600; color: var(--ink); margin: var(--s-base) 0 var(--s-xxs); }
.prose p { margin: var(--s-xs) 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: var(--s-xs) 0; }
.prose li { margin: 2px 0; }
.prose li::marker { color: var(--muted); }
.prose img { display: block; margin: var(--s-lg) auto; border-radius: var(--r-lg); max-height: 640px; width: auto; }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: var(--s-xxl) 0 0; }
.prose blockquote { margin: var(--s-base) 0; padding-left: var(--s-base); border-left: 1px solid var(--hairline-strong); color: var(--ink); }
.prose code { font-family: var(--font-mono); font-size: 0.86em; padding: 1px 5px; background: var(--surface-card); border-radius: var(--r-xs); }
.prose pre { font-family: var(--font-mono); font-size: 13px; line-height: 1.6; overflow-x: auto; padding: var(--s-base); background: var(--surface-card); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.prose pre code { padding: 0; background: none; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: var(--s-base) 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.prose th { color: var(--ink); font-weight: 600; }
/* Notion callouts render as plain body text; the box added nothing. */
.prose .callout > :first-child { margin-top: 0; }
.prose .gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-sm); align-items: start; margin: var(--s-lg) 0; }
.prose .gallery p { margin: 0; display: contents; }
.prose .gallery img { margin: 0; width: 100%; max-height: 520px; object-fit: contain; }
.prose details { margin: 0; border-top: 1px solid var(--hairline); }
.prose details:last-of-type { border-bottom: 1px solid var(--hairline); }
.prose summary { cursor: pointer; padding: var(--s-sm) 0; color: var(--ink); font-weight: 500; }
.prose details[open] { padding-bottom: var(--s-base); }
.muted { color: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: var(--s-lg); margin-top: var(--s-section); padding-top: var(--s-lg); border-top: 1px solid var(--hairline); }
.pager a { display: grid; gap: 2px; text-decoration: none; color: var(--ink); font-size: 17px; }
.pager a:hover { text-decoration: underline; text-decoration-color: var(--ink); }
.pager .next { text-align: right; margin-left: auto; }
.pager .label { font-size: 13px; color: var(--muted); }

/* Footer */
.footer { border-top: 1px solid var(--hairline); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-base); padding-top: var(--s-xl); padding-bottom: var(--s-xl); font-size: 14px; color: var(--muted); }
.footer-links { display: flex; gap: var(--s-lg); flex-wrap: wrap; }
.footer-links a { color: var(--body); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* Responsive */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: var(--s-xl); padding-top: var(--s-xxl); }
  .portrait { grid-row: 1; width: 120px; }
  .hero h1 { font-size: 44px; }
  .quote p { font-size: 18px; }
  .cards, .split { grid-template-columns: 1fr; }
  .skill-group { grid-template-columns: 1fr; gap: var(--s-xxs); }
  .job { grid-template-columns: 1fr; gap: var(--s-sm); }
  .job-meta { flex-direction: row; align-items: center; }
}
@media (max-width: 560px) {
  .wrap, .wrap-narrow { padding-left: var(--s-base); padding-right: var(--s-base); }
  .topnav { gap: var(--s-base); }
  .section-title { font-size: 22px; }
  .job h3 { font-size: 20px; }
  .role { display: block; margin: 2px 0 0; }
  .detail-head h1 { font-size: 32px; }
  .contacts li { grid-template-columns: 76px 1fr; font-size: 14px; }
  .pager { flex-direction: column; }
  .pager .next { text-align: left; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Print: the resume should print cleanly on A4 */
@media print {
  :root { --canvas: #fff; --surface-card: #fff; }
  .topbar, .footer, .theme-toggle, .more, .pager, .back { display: none !important; }
  body { font-size: 11pt; }
  .section { padding: 18pt 0; }
  .job, .card { break-inside: avoid; }
  .hero { padding-top: 0; }
  a { text-decoration: none; }
}
