/* ==========================================================================
   Portfolio — design system
   --------------------------------------------------------------------------
   1. Tokens (light / dark)      5. Hero
   2. Reset & base               6. Sections (work, experience, stack, about)
   3. Layout & utilities         7. Contact & footer
   4. Components                 8. Command palette, case study, motion
   ========================================================================== */

/* 1. Tokens --------------------------------------------------------------- */
:root {
  color-scheme: light;

  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f2f2ed;
  --surface-3: #e9e9e3;
  --text: #111110;
  --text-2: #3b3b37;
  --muted: #6a6a63;
  --border: #e3e3dc;
  --border-strong: #cfcfc6;
  --accent: #ff5b1f;
  --accent-ink: #c2410c;           /* accessible accent for text on light */
  --accent-soft: rgba(255, 91, 31, 0.1);
  --ok: #16a34a;
  --shadow-sm: 0 1px 2px rgba(17, 17, 16, 0.05);
  --shadow-md: 0 1px 2px rgba(17, 17, 16, 0.04), 0 8px 24px -8px rgba(17, 17, 16, 0.12);
  --shadow-lg: 0 2px 4px rgba(17, 17, 16, 0.04), 0 24px 64px -16px rgba(17, 17, 16, 0.22);
  --grid-line: rgba(17, 17, 16, 0.045);

  --font-sans: "Geist", "Pretendard Variable", Pretendard, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(80px, 12vw, 152px);
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0b0a;
    --surface: #131312;
    --surface-2: #1a1a18;
    --surface-3: #232320;
    --text: #efefea;
    --text-2: #c9c9c2;
    --muted: #9a9a91;
    --border: #252522;
    --border-strong: #34342f;
    --accent: #ff6a33;
    --accent-ink: #ff8a5c;
    --accent-soft: rgba(255, 106, 51, 0.12);
    --ok: #4ade80;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 64px -16px rgba(0, 0, 0, 0.8);
    --grid-line: rgba(255, 255, 255, 0.04);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0a;
  --surface: #131312;
  --surface-2: #1a1a18;
  --surface-3: #232320;
  --text: #efefea;
  --text-2: #c9c9c2;
  --muted: #9a9a91;
  --border: #252522;
  --border-strong: #34342f;
  --accent: #ff6a33;
  --accent-ink: #ff8a5c;
  --accent-soft: rgba(255, 106, 51, 0.12);
  --ok: #4ade80;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 64px -16px rgba(0, 0, 0, 0.8);
  --grid-line: rgba(255, 255, 255, 0.04);
}

/* 2. Reset & base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
img, svg, video { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* 3. Layout & utilities --------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); position: relative; }
.section + .section { border-top: 1px solid var(--border); }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
@media (min-width: 900px) {
  .section-head { grid-template-columns: 1fr 1fr; align-items: end; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .num { color: var(--accent-ink); }
.eyebrow::after {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--border-strong);
}

.section-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  letter-spacing: -0.035em;
  margin-top: 16px;
}
.section-title em, .display em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.section-lede {
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  max-width: 46ch;
}

.mono { font-family: var(--font-mono); }

/* 4. Components ----------------------------------------------------------- */

/* Buttons */
.btn {
  --btn-h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; flex: none; transition: transform 0.25s var(--ease); }
.btn:hover svg.arrow { transform: translateX(3px); }

.btn-primary { background: var(--text); color: var(--bg); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent); color: #fff; }

.btn-ghost { border: 1px solid var(--border-strong); background: var(--surface); }
.btn-ghost:hover { border-color: var(--text); }

.btn-sm { --btn-h: 36px; padding: 0 14px; font-size: 14px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
}

.link-underline {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease);
}
.link-underline:hover { background-size: 100% 1px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--border);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.25s var(--ease), transform 0.4s var(--ease);
}
.brand:hover .brand-mark { background: var(--accent); color: #fff; transform: rotate(-8deg); }

.nav { display: none; }
.nav ul { display: flex; gap: 4px; }
.nav a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="true"] { color: var(--text); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.cmdk-trigger {
  display: none;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.cmdk-trigger:hover { border-color: var(--border-strong); color: var(--text); }
.cmdk-trigger svg { width: 14px; height: 14px; }

.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.menu-toggle { display: inline-grid; }
.header-cta { display: none; }

@media (min-width: 900px) {
  .nav { display: block; }
  .menu-toggle { display: none; }
  .cmdk-trigger { display: inline-flex; }
  .header-cta { display: inline-flex; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 49;
  background: var(--bg);
  padding: 24px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.mobile-menu ul { display: grid; gap: 4px; }
.mobile-menu a.mobile-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.mobile-menu a.mobile-link span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
@media (min-width: 900px) { .mobile-menu { display: none; } }

/* 5. Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: clamp(56px, 10vw, 128px);
  padding-bottom: clamp(64px, 9vw, 112px);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
}
.hero-glow {
  position: absolute;
  z-index: -1;
  top: -240px;
  right: -160px;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  color: var(--text-2);
}
.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--ok);
  opacity: 0;
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
  0% { transform: scale(0.6); opacity: 0.7; }
  80%, 100% { transform: scale(1.6); opacity: 0; }
}

.display {
  margin-top: 28px;
  font-size: clamp(2.75rem, 8.2vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 600;
  max-width: 15ch;
}
.display em { color: var(--accent-ink); padding-right: 0.04em; }

.hero-lede {
  margin-top: 28px;
  max-width: 56ch;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--muted);
  line-height: 1.55;
}
.hero-lede strong { color: var(--text); font-weight: 500; }

.hero-ctas { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; }

.hero-meta {
  margin-top: clamp(56px, 8vw, 96px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}
.hero-meta > div {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.hero-meta > div:nth-child(odd) { padding-right: 16px; }
.hero-meta > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--border); }
.hero-meta dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-meta dd { margin-top: 6px; font-size: 15px; font-weight: 500; }
@media (min-width: 900px) {
  .hero-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-meta > div { border-bottom: 0; padding: 24px 24px 0 !important; border-left: 1px solid var(--border); }
  .hero-meta > div:first-child { padding-left: 0 !important; border-left: 0; }
}

/* Metrics strip */
.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.metric { background: var(--surface); padding: clamp(20px, 3vw, 32px); }
.metric-value {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric-value sup { font-size: 0.5em; color: var(--accent-ink); vertical-align: 0.6em; margin-left: 2px; }
.metric-label { margin-top: 10px; color: var(--muted); font-size: 14px; }
@media (min-width: 900px) { .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 6. Work ----------------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.filter {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  color: var(--muted);
  transition: all 0.2s var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.filter .count { font-family: var(--font-mono); font-size: 11px; opacity: 0.6; margin-left: 4px; }

.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 900px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .project.is-featured { grid-column: 1 / -1; }
}

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.4s var(--ease);
}
.project:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.project[hidden] { display: none; }

@media (min-width: 900px) {
  .project.is-featured { display: grid; grid-template-columns: 1.15fr 1fr; }
  .project.is-featured .project-media { aspect-ratio: auto; min-height: 420px; border-bottom: 0; border-right: 1px solid var(--border); }
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 40px);
}
.project-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.project-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(22px, 3vw, 32px);
  flex: 1;
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.project-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.project-title { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.03em; }
.project.is-featured .project-title { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.project-desc { color: var(--muted); }
.project-outcome {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--text-2);
  font-size: 14px;
}
.project-outcome svg { width: 18px; height: 18px; color: var(--accent-ink); flex: none; margin-top: 2px; }
.project-outcome strong { color: var(--text); font-weight: 600; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project-links {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Project visuals — CSS mock UIs used until real screenshots are added */
.mock {
  width: 100%;
  max-width: 560px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: transform 0.6s var(--ease);
}
.project:hover .mock { transform: translateY(-4px) scale(1.01); }
.mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.mock-bar .mock-url {
  margin-left: 10px;
  height: 16px;
  flex: 1;
  max-width: 200px;
  border-radius: 4px;
  background: var(--surface-3);
}
.mock-body { padding: 16px; display: grid; gap: 10px; }
.sk { height: 10px; border-radius: 4px; background: var(--surface-3); }
.sk.accent { background: var(--accent); opacity: 0.85; }
.sk.w30 { width: 30%; } .sk.w40 { width: 40%; } .sk.w50 { width: 50%; } .sk.w60 { width: 60%; } .sk.w80 { width: 80%; }
.sk.h-lg { height: 16px; }

.mock-dash { display: grid; grid-template-columns: 70px 1fr; gap: 14px; }
.mock-side { display: grid; gap: 8px; align-content: start; }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mock-kpi { padding: 10px; border-radius: 8px; border: 1px solid var(--border); display: grid; gap: 6px; }
.mock-chart {
  height: 120px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 12px;
}
.mock-chart span { flex: 1; border-radius: 3px 3px 0 0; background: var(--surface-3); }
.mock-chart span.hi { background: var(--accent); }

.mock-term { background: #0f0f0e; border-color: #2a2a26; }
.mock-term .mock-bar { background: #181816; border-color: #2a2a26; }
.mock-term .mock-bar i { background: #3a3a35; }
.mock-term .mock-body { font-family: var(--font-mono); font-size: 12px; line-height: 1.7; color: #a3a39b; gap: 0; }
.mock-term .c-acc { color: #ff8a5c; }
.mock-term .c-ok { color: #4ade80; }
.mock-term .c-dim { color: #5f5f58; }

.mock-phones { display: flex; gap: 16px; justify-content: center; align-items: flex-end; }
.phone {
  width: 128px;
  aspect-ratio: 9 / 19;
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 10px 8px;
  display: grid;
  align-content: start;
  gap: 8px;
  transition: transform 0.6s var(--ease);
}
.phone:nth-child(2) { transform: translateY(-18px); }
.project:hover .phone:nth-child(1) { transform: translateY(-4px) rotate(-2deg); }
.project:hover .phone:nth-child(2) { transform: translateY(-24px); }
.phone .notch { width: 36px; height: 8px; border-radius: 99px; background: var(--surface-3); margin: 0 auto 4px; }
.phone .card { height: 54px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.phone .card.accent { background: var(--accent-soft); border-color: transparent; }

.mock-graph { position: relative; width: 100%; max-width: 520px; aspect-ratio: 16 / 10; }
.mock-graph svg { width: 100%; height: 100%; }

/* Experience */
.timeline { display: grid; border-top: 1px solid var(--border); }
.job {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 40px;
  padding: clamp(28px, 4vw, 40px) 0;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 900px) { .job { grid-template-columns: 220px 1fr; } }
.job-when { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.job-when .now {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.job-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.job-role { font-size: clamp(1.25rem, 2vw, 1.5rem); letter-spacing: -0.02em; }
.job-company { color: var(--muted); font-size: 1.0625rem; }
.job-company a { color: var(--text); }
.job-summary { margin-top: 10px; color: var(--text-2); max-width: 70ch; }
.job-points { margin-top: 16px; display: grid; gap: 10px; max-width: 72ch; }
.job-points li { position: relative; padding-left: 22px; color: var(--muted); }
.job-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}
.job-points strong { color: var(--text); font-weight: 500; }
.job-tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }

/* Stack */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (min-width: 700px) { .stack-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .stack-grid { grid-template-columns: repeat(3, 1fr); } }
.stack-cell { background: var(--surface); padding: clamp(22px, 3vw, 32px); display: grid; gap: 16px; align-content: start; }
.stack-cell-head { display: flex; align-items: center; gap: 12px; }
.stack-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent-ink);
}
.stack-icon svg { width: 18px; height: 18px; }
.stack-cell h3 { font-size: 1.0625rem; letter-spacing: -0.01em; }
.stack-cell p { color: var(--muted); font-size: 14px; }
.stack-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr; gap: clamp(40px, 6vw, 80px); }
@media (min-width: 900px) { .about-grid { grid-template-columns: 0.85fr 1.15fr; } }
.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 55%),
    var(--surface-2);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.portrait > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait-initials {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(6rem, 14vw, 10rem);
  line-height: 1;
  color: var(--text);
  opacity: 0.9;
}
.portrait-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  font-size: 13px;
}
.portrait-caption .mono { color: var(--muted); font-size: 12px; }

.about-body .prose { display: grid; gap: 18px; font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); color: var(--text-2); max-width: 60ch; }
.about-body .prose p:first-child { font-size: clamp(1.375rem, 2.3vw, 1.75rem); color: var(--text); line-height: 1.35; letter-spacing: -0.015em; }

.principles { margin-top: 48px; display: grid; gap: 12px; }
@media (min-width: 700px) { .principles { grid-template-columns: repeat(3, 1fr); } }
.principle { padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.principle .num { font-family: var(--font-mono); font-size: 12px; color: var(--accent-ink); }
.principle h3 { margin-top: 12px; font-size: 1rem; letter-spacing: -0.01em; }
.principle p { margin-top: 6px; font-size: 14px; color: var(--muted); }

/* 7. Contact & footer ----------------------------------------------------- */
.contact { text-align: left; }
.contact-card {
  position: relative;
  border-radius: calc(var(--radius-lg) + 6px);
  background: var(--text);
  color: var(--bg);
  padding: clamp(32px, 7vw, 88px);
  overflow: hidden;
  isolation: isolate;
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(color-mix(in srgb, var(--bg) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--bg) 7%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 80% at 100% 0%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 100% 0%, #000 20%, transparent 70%);
}
.contact-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -120px;
  top: -160px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 91, 31, 0.35), transparent 65%);
}
.contact-card .eyebrow { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.contact-card .eyebrow::after { background: color-mix(in srgb, var(--bg) 25%, transparent); }
.contact-card .eyebrow .num { color: var(--accent); }
.contact-title {
  margin-top: 20px;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
  max-width: 14ch;
}
.contact-title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent); }
.contact-text { margin-top: 24px; max-width: 52ch; color: color-mix(in srgb, var(--bg) 65%, transparent); font-size: clamp(1rem, 1.5vw, 1.125rem); }

.email-row { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.email-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 8px 0 24px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 500;
  max-width: 100%;
  transition: transform 0.2s var(--ease);
}
.email-btn:hover { transform: translateY(-1px); }
.email-btn .addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-btn .go {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  flex: none;
}
.email-btn .go svg { width: 16px; height: 16px; }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--bg) 22%, transparent);
  color: var(--bg);
  font-size: 15px;
  transition: border-color 0.2s var(--ease);
}
.copy-btn:hover { border-color: color-mix(in srgb, var(--bg) 60%, transparent); }
.copy-btn svg { width: 16px; height: 16px; }

.socials {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid color-mix(in srgb, var(--bg) 14%, transparent);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
}
@media (min-width: 700px) { .socials { grid-template-columns: repeat(4, 1fr); } }
.socials a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  color: color-mix(in srgb, var(--bg) 70%, transparent);
  font-size: 15px;
  transition: color 0.2s var(--ease);
}
.socials a:hover { color: var(--bg); }
.socials a svg { width: 14px; height: 14px; transition: transform 0.25s var(--ease); }
.socials a:hover svg { transform: translate(2px, -2px); }

.site-footer { padding: 40px 0 48px; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.footer-inner a:hover { color: var(--text); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translate(-50%, 20px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; color: var(--ok); }

/* 8. Command palette ------------------------------------------------------ */
.cmdk {
  width: min(600px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cmdk[open] { display: flex; flex-direction: column; animation: cmdk-in 0.22s var(--ease); }
.cmdk::backdrop { background: rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.cmdk-search { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.cmdk-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.cmdk-search input { flex: 1; height: 56px; border: 0; background: transparent; outline: none; font-size: 16px; }
.cmdk-search input::placeholder { color: var(--muted); }
.cmdk-list { overflow-y: auto; padding: 8px; }
.cmdk-group { padding: 10px 10px 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  font-size: 15px;
  color: var(--text-2);
}
.cmdk-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.cmdk-item .hint { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.cmdk-item[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.cmdk-item[aria-selected="true"] svg { color: var(--accent-ink); }
.cmdk-empty { padding: 32px; text-align: center; color: var(--muted); font-size: 14px; }
.cmdk-foot {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
}
.cmdk-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* Case study page --------------------------------------------------------- */
.cs-hero { padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(40px, 6vw, 64px); }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--text); }
.back-link svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.back-link:hover svg { transform: translateX(-3px); }
.cs-title { margin-top: 28px; font-size: clamp(2.5rem, 7vw, 5rem); letter-spacing: -0.045em; line-height: 1; max-width: 16ch; }
.cs-title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent-ink); }
.cs-lede { margin-top: 24px; max-width: 60ch; color: var(--muted); font-size: clamp(1.0625rem, 1.6vw, 1.25rem); }
.cs-facts {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 900px) { .cs-facts { grid-template-columns: repeat(4, 1fr); } }
.cs-facts > div { background: var(--surface); padding: 18px 20px; }
.cs-facts dt { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.cs-facts dd { margin-top: 6px; font-weight: 500; }
.cs-cover {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-2);
  aspect-ratio: 16 / 8;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 64px);
  overflow: hidden;
}
.cs-layout { display: grid; grid-template-columns: 1fr; gap: 48px; padding-block: clamp(56px, 8vw, 96px); }
@media (min-width: 1000px) { .cs-layout { grid-template-columns: 220px 1fr; gap: 80px; } }
.cs-toc { display: none; }
@media (min-width: 1000px) {
  .cs-toc { display: block; position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
}
.cs-toc ol { display: grid; gap: 4px; border-left: 1px solid var(--border); }
.cs-toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); font-size: 14px; }
.cs-toc a:hover { color: var(--text); }
.cs-toc a[aria-current="true"] { color: var(--text); border-left-color: var(--accent); }
.cs-content { max-width: 72ch; display: grid; gap: 72px; }
.cs-content section { display: grid; gap: 18px; }
.cs-content h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.03em; }
.cs-content p, .cs-content li { color: var(--text-2); font-size: 1.0625rem; }
.cs-content ul.bullets { display: grid; gap: 10px; }
.cs-content ul.bullets li { position: relative; padding-left: 22px; }
.cs-content ul.bullets li::before { content: ""; position: absolute; left: 2px; top: 0.75em; width: 8px; height: 1px; background: var(--accent); }
.cs-quote {
  padding: 24px 28px;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  line-height: 1.35;
  color: var(--text);
}
.cs-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .cs-results { grid-template-columns: repeat(3, 1fr); } }
.cs-result { padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.cs-result b { display: block; font-size: clamp(1.75rem, 3.4vw, 2.5rem); letter-spacing: -0.04em; line-height: 1; }
.cs-result span { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); }
.cs-diagram {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}
.cs-diagram svg { min-width: 560px; width: 100%; height: auto; }
.cs-next {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: clamp(28px, 4vw, 40px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}
.cs-next h3 { font-size: clamp(1.375rem, 2.4vw, 1.75rem); letter-spacing: -0.02em; }

/* 404 */
.notfound { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; text-align: center; padding: 64px var(--gutter); }
.notfound .code { font-family: var(--font-serif); font-style: italic; font-size: clamp(7rem, 22vw, 14rem); line-height: 1; color: var(--accent-ink); }
.notfound h1 { margin-top: 8px; font-size: clamp(1.75rem, 4vw, 2.5rem); }
.notfound p { margin: 14px auto 32px; max-width: 42ch; color: var(--muted); }

/* Motion ------------------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .mobile-menu, .hero-bg, .hero-glow, .filters, .cmdk, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 32px; }
  .reveal { opacity: 1; transform: none; }
}

/* Above-the-fold intro: pure CSS so first paint never waits on JS */
.intro { animation: intro 0.9s var(--ease) both; }
.intro[data-delay="1"] { animation-delay: 0.08s; }
.intro[data-delay="2"] { animation-delay: 0.16s; }
.intro[data-delay="3"] { animation-delay: 0.24s; }
.intro[data-delay="4"] { animation-delay: 0.32s; }
@keyframes intro { from { opacity: 0; transform: translateY(16px); } }


/* ==========================================================================
   Bilingual (EN / KO) + profile additions
   ========================================================================== */

/* Language switch */
.lang-switch {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}
.lang-switch a {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="true"] { background: var(--text); color: var(--bg); }

/* Brand: shorten on small phones */
@media (max-width: 479px) { .brand-last { display: none; } }

/* Hero identity row */
.hero-id { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 40%;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-sm);
  background: var(--surface-2);
}
.avatar-lg { width: 44px; height: 44px; }
.portrait-caption .who { display: flex; align-items: center; gap: 10px; }
.portrait-caption .who strong { display: block; font-weight: 600; }
.portrait-caption .who span { display: block; color: var(--muted); font-size: 12px; }

/* Project grid: three columns for the non-featured row on wide screens */
@media (min-width: 1100px) {
  .projects.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .projects.cols-3 .project-title { font-size: 1.5rem; }
}

/* Waveform mock (DubEval) */
.mock-wave { display: grid; gap: 10px; }
.wave-row { display: grid; grid-template-columns: 54px 1fr 42px; align-items: center; gap: 10px; }
.wave-row .lbl { height: 10px; border-radius: 4px; background: var(--surface-3); }
.wave { display: flex; align-items: center; gap: 2px; height: 34px; }
.wave i { flex: 1; border-radius: 2px; background: var(--border-strong); }
.wave-row.is-best .wave i { background: var(--accent); }
.score {
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.wave-row.is-best .score { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }

/* Education details */
.edu-facts { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.award {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 500;
}
.award svg { width: 14px; height: 14px; }

/* Spoken languages */
.spoken { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px; }
.spoken li {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
}
.spoken li span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Korean typography
   - keep-all prevents Hangul words from breaking mid-word
   - Instrument Serif has no Hangul, so emphasis uses colour instead of italics */
:lang(ko) body, body:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; line-height: 1.7; }
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3 { letter-spacing: -0.025em; line-height: 1.2; }
:lang(ko) .display { letter-spacing: -0.035em; line-height: 1.12; max-width: 17ch; }
:lang(ko) .contact-title, :lang(ko) .cs-title { letter-spacing: -0.035em; line-height: 1.15; }
:lang(ko) .display em, :lang(ko) .section-title em, :lang(ko) .contact-title em, :lang(ko) .cs-title em {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: inherit;
  letter-spacing: inherit;
}
:lang(ko) .section-title em { color: var(--accent-ink); }
:lang(ko) .eyebrow, :lang(ko) .project-meta, :lang(ko) .hero-meta dt { letter-spacing: 0.02em; }

/* ==========================================================================
   v2 interface: hero photo, profile card, footer, résumé page
   ========================================================================== */

/* Hero with portrait (desktop) */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; align-items: center; }
.hero-photo { display: none; }
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) clamp(300px, 28vw, 380px); gap: clamp(40px, 5vw, 80px); }
  .hero .display { font-size: clamp(3.25rem, 6.4vw, 5.75rem); }
  .hero-id .avatar { display: none; }
  .hero-photo {
    display: block;
    position: relative;
    margin: 0;
    transform: rotate(2deg);
    transition: transform 0.6s var(--ease);
  }
  .hero-photo:hover { transform: rotate(0deg) translateY(-4px); }
  .hero-photo picture, .hero-photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 28px;
  }
  .hero-photo picture {
    border-radius: 28px;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    background: var(--surface-2);
    overflow: hidden;
  }
}
.hero-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text);
}
.hero-chip svg { width: 15px; height: 15px; color: var(--accent-ink); }
.hero-chip.chip-top { top: 24px; left: -36px; transform: rotate(-2deg); }
.hero-chip.chip-bottom { bottom: 28px; right: -28px; transform: rotate(-2deg); }

/* Profile card (About) */
.profile-card {
  display: grid;
  gap: 22px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
@media (min-width: 900px) { .profile-card { position: sticky; top: calc(var(--header-h) + 28px); } }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .avatar { width: 64px; height: 64px; }
.profile-head strong { display: block; font-size: 1.125rem; letter-spacing: -0.01em; }
.profile-head span { display: block; color: var(--muted); font-size: 14px; }
.profile-facts { display: grid; border-top: 1px solid var(--border); }
.profile-facts > div {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.profile-facts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.profile-facts dd { color: var(--text); overflow-wrap: anywhere; }
.profile-facts a { color: var(--accent-ink); }
.profile-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 44px; }
.footer-inner { display: grid; gap: 28px; }
@media (min-width: 800px) { .footer-inner { grid-template-columns: 1fr auto; align-items: center; } }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand strong { display: block; color: var(--text); font-weight: 600; }
.footer-brand span { display: block; font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--text-2); font-size: 14px; }
.footer-links a:hover { color: var(--accent-ink); }
.footer-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; }
.footer-meta a:hover { color: var(--text); }

/* Résumé page */
.resume-wrap { padding-top: clamp(32px, 5vw, 56px); padding-bottom: clamp(56px, 8vw, 96px); max-width: calc(880px + var(--gutter) * 2); }
.resume-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.resume-actions .group { display: flex; flex-wrap: wrap; gap: 8px; }
.resume-sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(24px, 5vw, 56px);
  display: grid;
  gap: 30px;
}
.rs-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 24px; border-bottom: 2px solid var(--text); }
.rs-head h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -0.03em; }
.rs-title { margin-top: 4px; font-size: 1.0625rem; color: var(--accent-ink); font-weight: 500; }
.rs-contact { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--text-2); }
.rs-contact a:hover { color: var(--accent-ink); }
.rs-photo { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; border: 1px solid var(--border); flex: none; }
.resume-sheet section { display: grid; gap: 14px; }
.resume-sheet h2 { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); }
.resume-sheet p, .resume-sheet li, .resume-sheet dd { color: var(--text-2); font-size: 15px; line-height: 1.6; }
.rs-item { display: grid; gap: 6px; }
.rs-item + .rs-item { padding-top: 16px; border-top: 1px dashed var(--border); }
.rs-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.rs-row h3 { font-size: 1.0625rem; letter-spacing: -0.01em; }
.rs-row span { font-family: var(--font-mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.rs-sub { font-size: 14px !important; color: var(--muted) !important; }
.rs-item ul { display: grid; gap: 6px; margin-top: 4px; }
.rs-item li { position: relative; padding-left: 18px; }
.rs-item li::before { content: ""; position: absolute; left: 2px; top: 0.75em; width: 7px; height: 1px; background: var(--accent); }
.rs-skills { display: grid; gap: 8px; }
.rs-skills > div { display: grid; grid-template-columns: 1fr; gap: 2px; }
@media (min-width: 640px) { .rs-skills > div { grid-template-columns: 150px 1fr; gap: 16px; } }
.rs-skills dt { font-weight: 600; font-size: 14px; }
.rs-note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 16px; }

@media print {
  :root, :root[data-theme] {
    --bg: #fff; --surface: #fff; --surface-2: #f4f4f4; --text: #111; --text-2: #222; --muted: #555;
    --border: #d4d4d4; --border-strong: #bbb; --accent: #c2410c; --accent-ink: #c2410c;
  }
  @page { size: A4; margin: 13mm 14mm; }
  .site-footer, .resume-actions, .rs-note, .skip-link, .cmdk { display: none !important; }
  .resume-wrap { padding: 0; max-width: none; }
  .resume-sheet { border: 0; box-shadow: none; padding: 0; gap: 18px; border-radius: 0; }
  .resume-sheet p, .resume-sheet li, .resume-sheet dd { font-size: 10.5pt; line-height: 1.45; }
  .rs-item { break-inside: avoid; }
  a { text-decoration: none; }
}
.hero-photo { animation: photo-in 1s var(--ease) 0.15s both; }
@keyframes photo-in { from { opacity: 0; } }
.hero-photo picture img { width: 100%; height: 100%; border-radius: 0; }
.profile-card { align-self: start; align-content: start; }
@media (max-width: 899px) { .about-grid > .profile-card { order: 2; } }

/* Brand avatar (replaces the "SO" monogram) */
.brand-photo {
  padding: 0;
  object-fit: cover;
  object-position: 50% 35%;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--border-strong);
  transition: box-shadow 0.25s var(--ease), transform 0.4s var(--ease);
}
.brand:hover .brand-photo { background: var(--surface-2); box-shadow: 0 0 0 2px var(--accent); transform: rotate(-6deg); }
.footer-brand .brand-photo { width: 40px; height: 40px; }
/* The header now shows the photo, so the hero pill doesn't repeat it */
.hero-id .avatar { display: none; }
