/* ==========================================================
   오영제 (Y. J. Oh) — Portfolio
   Plain CSS, no framework. Accent taken from the AI Education Lab logo.
   ========================================================== */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f3f2f8;
  --ink: #17151f;
  --ink-2: #4a4658;
  --muted: #7a7589;
  --line: #e6e3ee;
  --accent: #6b4bb0;
  --accent-ink: #4d3290;
  --accent-soft: #efe9fb;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 21, 31, .04), 0 8px 24px rgba(23, 21, 31, .06);
  --shadow-hover: 0 2px 4px rgba(23, 21, 31, .06), 0 16px 40px rgba(23, 21, 31, .10);
  --max: 1120px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111017;
    --surface: #18171f;
    --surface-2: #201e29;
    --ink: #f2f0f7;
    --ink-2: #c4bfd2;
    --muted: #8e889e;
    --line: #2c2a37;
    --accent: #a98bf0;
    --accent-ink: #c6b2ff;
    --accent-soft: #2a2340;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; font-size: 15px; color: var(--ink-2);
  padding: 8px 12px; border-radius: 999px; transition: background .15s, color .15s;
}
.nav-links a:hover, .nav-links a.active { background: var(--surface-2); color: var(--ink); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; border-radius: var(--radius-sm); padding: 12px; }
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; }
.hero .hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); padding: 6px 12px; border-radius: 999px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  font-size: clamp(40px, 6vw, 64px); line-height: 1.12; letter-spacing: -.03em;
  margin: 20px 0 8px; font-weight: 800;
}
.hero h1 .en { display: block; font-size: .42em; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 10px; }
.hero .lead { font-size: clamp(18px, 2.1vw, 21px); color: var(--ink-2); max-width: 36em; margin: 24px 0 32px; }
.hero .lead strong { color: var(--ink); font-weight: 700; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  padding: 12px 20px; border-radius: 999px; transition: transform .15s, background .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); }
.btn-ghost:hover { box-shadow: var(--shadow); }
.btn svg { width: 16px; height: 16px; }

.portrait {
  position: relative; border-radius: 28px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 20%; }
.portrait .badge {
  position: absolute; left: 16px; bottom: 16px; right: 16px;
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, .9); color: #17151f;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.35;
}
.portrait .badge img { width: 44px; height: 32px; object-fit: contain; flex: none; }
.portrait .badge b { display: block; font-size: 15px; }

@media (max-width: 860px) {
  .hero { padding: 40px 0 32px; }
  .hero .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .portrait { max-width: 360px; aspect-ratio: 1 / 1; }
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 56px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px;
}
.stat .num { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat .num small { font-size: .5em; font-weight: 700; color: var(--accent); margin-left: 2px; }
.stat .label { color: var(--muted); font-size: 14px; margin-top: 6px; }
.stats-note { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Sections ---------- */
section { padding: 88px 0 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head .kicker { font-size: 14px; font-weight: 700; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.025em; line-height: 1.2; margin: 6px 0 0; }
.section-head p { color: var(--ink-2); margin: 10px 0 0; max-width: 40em; }
.section-head .more { font-size: 15px; font-weight: 600; color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
.section-head .more:hover { text-decoration: underline; }

/* ---------- Expertise ---------- */
.expertise { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.exp-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}
.exp-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; margin-bottom: 16px;
}
.exp-icon svg { width: 22px; height: 22px; }
.exp-card h3 { font-size: 19px; margin: 0 0 8px; letter-spacing: -.01em; }
.exp-card p { color: var(--ink-2); font-size: 15px; margin: 0 0 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tags li {
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  background: var(--surface-2); padding: 4px 10px; border-radius: 999px;
}
@media (max-width: 900px) { .expertise { grid-template-columns: 1fr; } }

/* ---------- Courses ---------- */
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.course {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; transition: transform .18s, box-shadow .18s;
}
.course:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.course .cover { aspect-ratio: 1200 / 781; background: var(--surface-2); overflow: hidden; }
.course .cover img { width: 100%; height: 100%; object-fit: cover; }
.course .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course .cat { font-size: 12px; font-weight: 700; color: var(--accent-ink); letter-spacing: .02em; }
.course h3 { font-size: 16px; line-height: 1.45; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.course .meta { margin-top: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.course .new {
  font-size: 11px; font-weight: 700; color: #fff; background: var(--accent);
  padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px;
}

/* ---------- Teaching (organisations) ---------- */
.orgs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.org {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px;
}
.org-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 18px; }
.org h3 { font-size: 20px; margin: 0; letter-spacing: -.01em; line-height: 1.35; }
.org .abbr { color: var(--muted); font-size: 14px; font-weight: 500; display: block; }
.period {
  flex: none; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.period.now { background: var(--accent-soft); color: var(--accent-ink); }
.org ul.lectures { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.org ul.lectures li {
  font-size: 15px; color: var(--ink-2); padding: 7px 0 7px 18px; position: relative;
  border-bottom: 1px dashed var(--line);
}
.org ul.lectures li:last-child { border-bottom: 0; }
.org ul.lectures li::before {
  content: ""; position: absolute; left: 2px; top: 16px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .7;
}
.org .yt { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 15px; font-weight: 600; color: var(--accent-ink); text-decoration: none; }
.org .yt:hover { text-decoration: underline; }
.org .hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
@media (max-width: 860px) { .orgs { grid-template-columns: 1fr; } }

/* ---------- Career ---------- */
.career { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--line);
}
.timeline li { position: relative; padding: 0 0 26px 44px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 4px; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--line);
}
.timeline li.current::before { border-color: var(--accent); background: var(--accent-soft); }
.timeline h3 { font-size: 18px; margin: 0; letter-spacing: -.01em; }
.timeline p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin-bottom: 20px;
}
.panel:last-child { margin-bottom: 0; }
.panel h3 { font-size: 17px; margin: 0 0 14px; }
.projects { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.projects li {
  font-size: 14px; color: var(--ink-2);
  border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px;
}
.creds { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.creds li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.creds .ic {
  width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center;
}
.creds .ic svg { width: 20px; height: 20px; }
.creds b { display: block; font-size: 15px; }
.creds span { color: var(--muted); font-size: 14px; }
@media (max-width: 900px) { .career { grid-template-columns: 1fr; } }

/* ---------- Learning history (collapsible) ---------- */
details.history {
  margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
details.history summary {
  cursor: pointer; list-style: none; padding: 20px 26px; font-weight: 700; font-size: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
details.history summary::-webkit-details-marker { display: none; }
details.history summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--muted); }
details.history[open] summary::after { content: "−"; }
details.history summary span { font-weight: 400; color: var(--muted); font-size: 14px; margin-left: 8px; }
.history-body { padding: 0 26px 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.history-body h4 { font-size: 14px; margin: 0 0 8px; color: var(--accent-ink); }
.history-body ul { list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--ink-2); display: grid; gap: 6px; }
.history-body a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.history-body a:hover { text-decoration-color: var(--accent); }
@media (max-width: 860px) { .history-body { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact {
  margin-top: 0; border-radius: 28px; padding: 56px;
  background: var(--ink); color: var(--bg);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center;
}
.contact h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.025em; line-height: 1.25; margin: 0 0 12px; }
.contact p { margin: 0; opacity: .75; }
.contact-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact-links button {
  width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.contact-links button.copied span { opacity: 1; font-weight: 700; }
.contact-links a, .contact-links button {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  padding: 14px 18px; border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--bg) 14%, transparent);
  transition: background .15s;
}
.contact-links a:hover, .contact-links button:hover { background: color-mix(in srgb, var(--bg) 16%, transparent); }
.contact-links svg { width: 20px; height: 20px; flex: none; opacity: .85; }
.contact-links b { display: block; font-size: 15px; }
.contact-links span { font-size: 13px; opacity: .65; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; padding: 36px 26px; } }

footer { padding: 40px 0 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .course, .btn { transition: none; }
}
