/* Evidence dossier palette — graphite ink on cool paper, one signal blue for
   navigation, one amber reserved exclusively for verified, measured results. */
:root {
  --color-background: #F4F5F3;
  --color-surface: #FFFFFF;
  --color-ink: #14181C;
  --color-navy: #1F3D6B;
  --color-caption: #2E3A44;
  --color-primary: #1F3D6B;
  --color-signal: #3A5D93;
  --color-muted: #5B6670;
  --color-soft-blue: #E7EBEF;
  --color-border: #D7DBDD;
  --color-on-primary: #FFFFFF;
  /* Evidence accent — measured results only (F1, PDR, latency, GPA). Never
     used for navigation, decoration, or anything unverified. */
  --color-evidence: #8A5A22;
  --color-evidence-soft: #F2E8DB;

  /* Back-compat aliases used by existing components */
  --bg: var(--color-background);
  --surface: var(--color-surface);
  --text: var(--color-ink);
  --muted: var(--color-muted);
  --hairline: var(--color-border);
  --section-rule: var(--color-border);
  --accent: var(--color-primary);
  --accent-hi: var(--color-navy);
  --focus: var(--color-navy);
  --code-bg: var(--color-soft-blue);

  /* Legacy semantic aliases */
  --text-primary: var(--text);
  --text-secondary: var(--muted);
  --text-muted: var(--muted);
  --bg-white: var(--bg);
  --border: var(--hairline);
  --border-strong: var(--hairline);
  --border-light: var(--hairline);
  --paper: var(--surface);
  --surface-strong: var(--surface);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 140ms var(--ease);
  --t-med: 180ms var(--ease);
  --t-slow: 200ms var(--ease);

  /* Radius — flat, editorial. 4px is the ceiling everywhere. */
  --radius: 4px;
  --radius-lg: 4px;
  --radius-md: 4px;
  --radius-sm: 4px;

  /* Typography — one family across all three roles (IBM Plex), so display,
     body, and data type share the same structural DNA instead of three
     unrelated fonts pasted together. */
  --font-serif: 'IBM Plex Serif', 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', serif;
  --font-sans: 'IBM Plex Sans', 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  /* Back-compat aliases for the font vars used throughout this file */
  --font-display: var(--font-serif);
  --font-text: var(--font-sans);

  /* Spacing scale — 8px base. Use these instead of ad hoc px values. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Type scale — fixed steps, fluid only at the top two tiers. */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-md: 1.25rem;
  --text-lg: 1.5rem;
  --text-xl: clamp(1.75rem, 2.4vw, 2.25rem);
  --text-2xl: clamp(2.25rem, 3.4vw, 3rem);
  --text-3xl: clamp(2.75rem, 4.6vw, 4rem);
  --text-4xl: clamp(3.25rem, 6.6vw, 5.25rem);

  --h1: var(--text-3xl);
  --h2: var(--text-2xl);
  --body: var(--text-base);
  --line-height-body: 1.65;
  --line-height-heading: 1.15;
}

/* Dark theme — same tokens, attached to the existing [data-theme="dark"] mechanism */
[data-theme="dark"] {
  --color-background: #12161B;
  --color-surface: #181D23;
  --color-ink: #ECEEF0;
  --color-navy: #9FBBE0;
  --color-caption: #C7CED4;
  --color-primary: #8FB1DE;
  --color-signal: #7397C9;
  --color-muted: #98A2AB;
  --color-soft-blue: #202730;
  --color-border: #333B43;
  --color-on-primary: #12161B;
  --color-evidence: #D9A25C;
  --color-evidence-soft: #2B2418;
  --bg: var(--color-background);
  --surface: var(--color-surface);
  --text: var(--color-ink);
  --muted: var(--color-muted);
  --hairline: var(--color-border);
  --section-rule: var(--color-border);
  --accent: var(--color-primary);
  --accent-hi: var(--color-navy);
  --focus: var(--color-navy);
  --code-bg: var(--color-soft-blue);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--body);
  line-height: var(--line-height-body);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

html[lang="ko"] body {
  word-break: keep-all;
  line-break: strict;
}

/* Global media defaults to prevent overflow */
img, video, iframe, canvas {
  max-width: 100%;
  height: auto;
}
iframe { border: none; }

/* Cursor mascot — a pixel-art dachshund that trots after the pointer.
   Decorative, non-blocking, desktop-only (fine pointer + hover capable);
   driven by js/dachshund-cursor.js. Position is set entirely via
   translate3d() through --dash-x/--dash-y; only the active frame <img> and
   the facing-direction flip are toggled here. Sits above ordinary page
   content but well below the nav (z-index 100) and lightboxes (1000+). */
.cursor-dachshund {
  --dash-x: 0px;
  --dash-y: 0px;
  --dash-flip: 1;
  position: fixed;
  z-index: 60;
  left: 0;
  top: 0;
  width: var(--dash-size, 84px);
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transform: translate3d(var(--dash-x), var(--dash-y), 0) scaleX(var(--dash-flip));
  transition: opacity 220ms ease;
  will-change: transform;
  contain: layout paint;
}
.cursor-dachshund.is-visible { opacity: 1; }
.cursor-dachshund img {
  display: none;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  user-select: none;
  -webkit-user-drag: none;
}
.cursor-dachshund img.is-active { display: block; }

@media (max-width: 768px) {
  .cursor-dachshund { --dash-size: 72px; }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* Links */
a { color: var(--accent); text-decoration: none; transition: color var(--t-fast), opacity var(--t-fast); }
a:hover { color: var(--accent-hi); }
a:active { opacity: 0.75; }
button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 1px var(--color-signal); }

/* Body copy should not stretch full width */
p { max-width: 68ch; }

/* --- Utilities --------------------------------------------------------- */
/* Spacing */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-28 { margin-bottom: 28px; }
.mb-32 { margin-bottom: 32px; }
.mb-36 { margin-bottom: 36px; }
.mb-40 { margin-bottom: 40px; }
.mb-48 { margin-bottom: 48px; }

/* Padding */
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }

/* Indent */
.pl-16 { padding-left: 16px; }
.pl-20 { padding-left: 20px; }

/* Text */
.muted { color: var(--muted); }
.caption { color: var(--muted); font-size: 14px; }
.lead { color: var(--muted); font-size: 18px; line-height: 1.8; max-width: 68ch; }

/* Inline links row */
.inline-links { display: inline-flex; align-items: center; gap: 12px; }

/* Flat bordered surface utility (formerly a glass/blur effect) */
.glass {
  background: var(--surface);
  border: 1px solid var(--hairline);
}

/* Ledger pattern — mono metadata column + content column */
.ledger {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
}
.ledger-meta {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  color: var(--muted);
}
.ledger-content { min-width: 0; }
@media (max-width: 768px) {
  .ledger { grid-template-columns: 1fr; gap: 8px; }
}

/* Top Navigation — sits flat on --bg, single hairline bottom border */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
  /* Respect iOS safe areas */
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
  transition: border-color var(--t-med);
  min-height: 50px;
}
.top-nav.scrolled {
  border-bottom-color: var(--color-caption);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
  position: relative;
}
/* Add horizontal safe-area padding on notch devices */
.nav-container {
  padding-left: calc(20px + env(safe-area-inset-left));
  padding-right: calc(20px + env(safe-area-inset-right));
}

.nav-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-sans);
}

.nav-name a {
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  text-decoration: none;
  position: relative;
  transition: opacity var(--t-fast), transform var(--t-fast), color var(--t-fast);
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav-links a:hover {
  color: var(--accent);
}
.nav-links a:active {
  opacity: 0.9;
}

/* Mobile nav toggle button (hamburger) */
.nav-toggle {
  display: none;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  transition: border-color var(--t-fast);
}
.nav-toggle:hover {
  border-color: var(--accent);
}
.nav-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 1px var(--color-signal); }

/* Theme toggle button */
.theme-toggle {
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  transition: border-color var(--t-fast);
}

.theme-toggle:hover {
  border-color: var(--accent);
}
.theme-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 1px var(--color-signal); }

.nav-links a.active {
  position: relative;
  opacity: 1;
  color: var(--accent);
}

.nav-links a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; margin: 0 auto; width: 20px; height: 2px; background: var(--color-signal); }

/* Focus styles and skip link */
.nav-links a:focus-visible,
.skip-link:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--color-signal);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 16px;
  top: 12px;
  width: auto;
  height: auto;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  z-index: 200;
}

/* Page Sections */
.page-section { padding: var(--space-8) 0; scroll-margin-top: 80px; }

.page-section:first-of-type {
  padding-top: clamp(32px, 4vw, 52px);
  border-top: 2px solid var(--text);
}

.page-title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 500;
  color: var(--text);
  margin: 0 0 var(--space-4) 0;
  text-align: left;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.section-header {
  margin-bottom: var(--space-7);
}

.back-link {
  margin: 0 0 12px 0;
}

.back-link a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.back-link a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.content-wrapper {
  max-width: 1100px;
  margin: 0 auto;
}

/* Container — a plain shell, not a boxed card. Content sits directly on the
   page background, same as the home page, instead of floating inside a
   bordered white sheet. */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
  content-visibility: auto;
  contain-intrinsic-size: 1000px;
}

/* Hero — sits directly on --bg, no container/card wrapper */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px 64px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 20px 0;
}

.hero-name {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: var(--h1);
  color: var(--text);
  margin: 0 0 20px 0;
}

.hero-tagline {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 16px 0;
  max-width: 46ch;
}

.hero-photo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column-reverse;
    gap: 24px;
    padding: 32px 16px 40px;
  }
  .hero-photo { width: 120px; height: 120px; }
}

/* Selected Work — .ledger rows linking to project detail pages */
.work-list {
  display: flex;
  flex-direction: column;
}

.work-item {
  display: block;
  padding: 28px 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
  transition: opacity var(--t-fast);
}
.work-item:first-child { padding-top: 0; }
.work-item:last-child { border-bottom: none; }
.work-item:hover { opacity: 0.85; }
.work-item:hover .work-title { color: var(--accent); }

.work-year { display: block; }
.work-type { display: block; margin-top: 4px; }

.work-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 8px 0;
  transition: color var(--t-fast);
}

.work-description {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 8px 0;
}

.work-result {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.work-stack {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
}

/* Plain one-line list for de-emphasized projects */
.other-projects-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.other-projects-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.other-projects-list li:last-child { border-bottom: none; }
.other-projects-list a { color: var(--text); font-weight: 500; }
.other-projects-list a:hover { color: var(--accent); }
.other-projects-list .other-project-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-left: 8px;
}

/* Main Layout - Two Column */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

.content-column {
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.photo-column {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header Section */
.header { margin-bottom: 0; }

.name-header {
  margin-bottom: 0;
}

.name {
  font-family: var(--font-serif);
  font-size: var(--h1);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.name-subtitle {
  font-size: 19px;
  color: var(--text);
  margin: 0 0 8px 0;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.name-affiliation {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
  font-weight: 400;
}

.contact-header {
  margin-bottom: 28px;
  font-size: var(--body);
  line-height: 1.7;
  color: var(--muted);
  word-break: break-word;
}

.intro-text {
  margin: 40px 0 40px 0;
}

.intro-text p:first-child {
  font-weight: 500;
  color: var(--text);
}

.contact-item-inline {
  color: var(--text);
}

.contact-item-inline a {
  color: var(--accent);
}

.contact-item-inline a:hover {
  color: var(--accent-hi);
  text-decoration: underline;
}

.contact-separator {
  margin: 0 8px;
  color: var(--muted);
}

/* Contact Icons */
.contact-icons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  margin-top: 24px;
  width: 100%;
}

.contact-icon {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--muted);
  transition: color var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
  text-decoration: none;
  border-radius: var(--radius);
  background-color: transparent;
  border: 1px solid var(--hairline);
  width: 100%;
  box-sizing: border-box;
  will-change: transform, border-color;
}

.contact-icon:hover {
  color: var(--accent);
  transform: translateX(5px);
  text-decoration: none;
  border-color: var(--accent);
}

.contact-icon:active {
  transform: translateX(2px);
}

.contact-icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.contact-icon-label {
  font-size: 15px;
  font-weight: 500;
  color: inherit;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
  hyphens: auto;
}

.affiliation-list,
.contact-list,
.info-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
}

.affiliation-list li,
.contact-list li,
.info-list li {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  position: relative;
}

/* Top-level CV bullets: bold, minimal indent, square marker */
.info-list > li {
  padding-left: 18px; /* minimal indent */
  font-weight: 600;   /* emphasize role/position */
}

.info-list > li::before {
  content: "▪"; /* square marker distinct from second-level */
  position: absolute;
  left: 0;
  top: 0.45em;
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
}

/* Ensure descriptions under roles are normal weight */
.info-list > li .sub-list li { font-weight: 400; color: var(--muted); }

/* Info Grid for AT A GLANCE */
.info-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 32px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  background: transparent;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  transition: background var(--t-fast), transform var(--t-fast);
}

.info-item:hover {
  background: var(--code-bg);
}

.info-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.info-value {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  font-weight: 400;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 32px;
}

.skill-category {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 22px;
  background: transparent;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.skill-category:hover {
  border-color: var(--accent);
}

.skill-category-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  display: inline-block;
  padding: 6px 12px;
  background: var(--code-bg);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  transition: border-color 0.2s ease;
}

.skill-tag:hover {
  border-color: var(--accent);
}

/* Quick Links Grid */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.quick-link-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-med), transform var(--t-med);
  will-change: transform, border-color;
  content-visibility: auto;
  contain-intrinsic-size: 120px;
}

.quick-link-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.quick-link-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.quick-link-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.quick-link-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-bottom: 2px;
}

.quick-link-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.contact-list li {
  margin-bottom: 4px;
}

.sub-list {
  list-style: none;
  padding-left: 16px; /* indent sub-bullets */
  margin-top: 12px;
  margin-bottom: 0;
}

.sub-list li {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.7;
  position: relative;
  padding-left: 18px;
}

/* Second-level bullets: en dash, normal weight, distinct from top-level */
.sub-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  top: 0.1em;
  color: var(--muted);
  font-weight: 500;
  font-size: 16px;
}

/* Project list — an editorial ledger row (matches the home page's featured-work
   pattern), not a bordered, shadowed, hover-lifting SaaS card. */
.project-card {
  display: flex;
  gap: var(--space-6);
  margin: 0;
  padding: var(--space-6) 0;
  border-top: 1px solid var(--hairline);
  transition: opacity var(--t-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: 260px;
}
.content-wrapper > .project-card:first-child { border-top: 2px solid var(--text); }
.project-card:hover { opacity: 0.82; }
.project-card:hover .project-card-title { color: var(--accent); }

.project-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.project-card-visual {
  flex: 0 0 auto;
  width: clamp(140px, 20vw, 200px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--code-bg);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--hairline);
  transition: border-color var(--t-med);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 1 / 1) {
  .project-card-visual {
    position: relative;
    height: 0;
    padding-bottom: 75%; /* 4:3 ratio */
  }
  .project-card-visual > img,
  .project-card-visual > picture,
  .project-card-visual > picture > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 4 / 3;
  }
}

.project-card:hover .project-card-visual { border-color: var(--accent); }

.project-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 4 / 3;
}

.project-card-content {
  flex: 1;
  min-width: 0;
}

.project-card-category {
  display: block;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  margin-bottom: var(--space-2);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
}

.project-card-title {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: var(--space-2);
  line-height: 1.3;
  letter-spacing: -0.015em;
  transition: color var(--t-fast);
}

.project-card-description {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: var(--space-3);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.project-card-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 4px;
  margin-top: var(--space-1);
  transition: transform var(--t-fast), color var(--t-fast), text-decoration-color var(--t-fast);
}

/* Project metrics (pills) — legitimate for short tech-stack tags, kept
   visually quiet: a flat label, not a shadowed badge. */
.project-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-1) 0 var(--space-3);
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--code-bg);
}

.project-card:hover .project-card-read-more {
  transform: translateX(3px);
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Project detail page styles */
.project-item {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--hairline);
}

.project-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.project-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.4;
}

.project-description {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 32px;
  max-width: 68ch;
}

.project-description p {
  margin-bottom: 16px;
}

.project-description p:last-child {
  margin-bottom: 0;
}

.project-description ul {
  margin: 16px 0;
  padding-left: 24px;
}

.project-description ul li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.project-description ul li strong {
  color: var(--text);
  font-weight: 600;
}

.project-links {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.project-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--hairline);
  transition: border-color var(--t-fast), color var(--t-fast);
  font-weight: 500;
}

.project-links a:hover {
  color: var(--accent-hi);
  border-color: var(--accent);
}

.project-links a:active {
  opacity: 0.9;
}

.project-tech {
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--code-bg);
  border-left: 2px solid var(--accent);
  border-radius: 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  font-family: var(--font-sans);
}

/* Project layout with presentation PDF */
.project-content-wrapper {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-direction: row-reverse; /* 설명을 오른쪽, PDF를 왼쪽에 */
}

.project-main {
  flex: 2;
  min-width: 0;
}

.project-presentation {
  flex: 1;
  flex-shrink: 0;
  min-width: 0;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hairline);
}

.project-presentation:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.project-presentation iframe {
  width: 100%;
  /* Prefer ratio-responsive height */
  aspect-ratio: 4 / 3;
  height: auto;
  max-height: min(70vh, 720px);
  border: none;
  pointer-events: none;
  display: block;
}

/* Full-width presentation at top */
.project-presentation-full {
  width: 100%;
  margin-bottom: 40px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.project-presentation-full[role="button"]:focus-visible,
.project-presentation[role="button"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.project-presentation-full:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.project-presentation-full iframe {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  max-height: min(85vh, 900px);
  border: none;
  pointer-events: none;
  display: block;
}

.project-main-full {
  width: 100%;
}

/* Project media section (video, presentation) */
.project-media-section {
  width: 100%;
  margin-top: 40px;
}

.project-video-wrapper {
  margin-bottom: 32px;
}

.project-video-wrapper video {
  width: 100%;
  /* Keep within viewport and preserve ratio */
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: min(60vh, 500px);
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.youtube-embed-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.youtube-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius);
}

.project-presentation-wrapper {
  margin-top: 32px;
}

.project-presentation-label {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
}

/* Certificate styles */
.project-certificate-wrapper {
  margin-top: 32px;
}

.project-certificate {
  width: 100%;
  margin-top: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hairline);
  transition: border-color 0.3s ease;
}

.project-certificate:hover {
  border-color: var(--accent);
}

.project-certificate img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  background: var(--surface);
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
}

/* PDF Lightbox */
.pdf-lightbox-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 0;
}

.pdf-lightbox-backdrop.active {
  display: flex;
}

.pdf-lightbox-content {
  width: 98vw;
  /* Use dynamic viewport units on mobile to avoid URL bar issues */
  height: 98vh;
  height: 98svh;
  height: 98dvh;
  max-width: 98vw;
  max-height: 98vh;
  max-height: 98svh;
  max-height: 98dvh;
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pdf-lightbox-iframe {
  width: 100%;
  height: 100%;
  flex: 1;
  border: none;
  display: block;
}

.pdf-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #ffffff;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius);
  z-index: 1001;
  transition: background 0.2s ease;
}

.pdf-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* Section labels — mono metadata eyebrow, not a display heading */
.section-title {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  margin: 64px 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--section-rule);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  position: relative;
}
.section-title:first-of-type { margin-top: 0; }

/* Profile Photo */
.profile-photo {
  width: 100%;
  max-width: 280px;
  /* Show original aspect ratio without cropping */
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  transition: border-color var(--t-med);
}
.profile-photo:hover {
  border-color: var(--accent);
}

/* Footer */
.footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* Interest chips (hero emphasis) */
.interest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--code-bg);
  border: 1px solid var(--hairline);
  transition: border-color var(--t-fast);
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--accent);
}

@media (max-width: 480px) {
  .chip { font-size: 0.7rem; padding: 5px 8px; }
}

/* Responsive Design */
@media (max-width: 968px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .photo-column {
    position: static;
    order: -1;
    text-align: center;
  }

  .profile-photo {
    max-width: 240px;
    margin: 0 auto;
  }

  .contact-icons {
    width: 100%;
    max-width: 280px;
    margin: 24px auto 0;
  }

  .quick-links-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    gap: 16px;
  }

  .skills-grid {
    gap: 16px;
  }
}

/* Below tablet width the thumbnail is dropped rather than squeezed or
   stacked full-width — a plain text row reads better than a cramped image. */
@media (max-width: 640px) {
  .project-card { gap: var(--space-4); padding: var(--space-5) 0; }
  .project-card-visual { display: none; }
}

b, strong { font-weight: 600; }

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
  }

  /* Prevent horizontal scrolling */
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Ensure all containers respect viewport */
  .main-layout,
  .content-wrapper,
  .content-column {
    max-width: 100%;
    overflow-x: hidden;
  }

  .page-section {
    padding: 40px 0;
    scroll-margin-top: 50px;
  }

  .page-section:first-of-type {
    padding-top: 20px;
  }

  .page-title {
    font-size: 24px;
    padding: 0 10px;
  }

  .nav-container {
    padding: 0 15px;
    flex-wrap: nowrap;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
  }

  .nav-name {
    font-size: 16px;
    margin-bottom: 0;
    font-weight: 700;
    flex-shrink: 0;
  }

  /* Enhanced visibility for mobile buttons */
  .nav-toggle {
    flex-shrink: 0;
    order: 2;
  }

  /* Collapsible nav: hidden by default on mobile */
  .nav-toggle {
    display: inline-flex !important;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    flex-direction: column;
    gap: 0;
    font-size: 13px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    background: var(--bg);
    border-top: 1px solid var(--hairline);
    z-index: 99;
  }

  .nav-container.is-open .nav-links {
    max-height: 500px;
    padding: 8px 0;
  }

  .nav-links a {
    padding: 12px 20px;
    min-height: 44px;
    display: flex;
    align-items: center;
    border-radius: 0;
    background: transparent;
    width: 100%;
    box-sizing: border-box;
  }

  .nav-links a:hover {
    background: var(--code-bg);
  }

  /* Ensure nav name and toggle are always visible */
  .nav-name {
    order: 1;
    flex: 1;
  }

  .name {
    font-size: clamp(28px, 8vw, 40px);
    word-break: keep-all;
    overflow-wrap: break-word;
  }

  /* Ensure all text elements wrap properly on mobile */
  p, span, a, div, li {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }

  /* Fix for inline styles in introduction text */
  .content-column p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }

  .section-title {
    font-size: 0.75rem;
    margin: 32px 0 16px 0;
  }

  .content-wrapper {
    padding: 0 5px;
  }

  .sub-list {
    padding-left: 16px;
  }

  .sub-list li {
    font-size: 13px;
    margin-bottom: 4px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 14px;
    width: 100%;
    overflow-x: hidden;
  }

  /* Additional mobile fixes for text and media */
  p, span, a, div, li, h1, h2, h3, h4, h5, h6 {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  img, video, iframe {
    max-width: 100%;
    height: auto;
  }

  /* Fix for skill tags and info values on mobile */
  .skill-tag,
  .info-value,
  .quick-link-title,
  .quick-link-desc {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }

  .nav-container {
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
  }

  .nav-name {
    font-size: 16px;
    margin-bottom: 0;
    width: auto;
    font-weight: 700;
    flex: 1;
    order: 1;
  }

  .nav-toggle {
    order: 2;
    flex-shrink: 0;
  }

  .nav-links {
    gap: 0;
    top: 100%;
  }

  .nav-links a {
    font-size: 13px;
    min-height: 44px;
    font-weight: 600;
  }

  .name {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 12px;
  }

  .project-item {
    margin-bottom: 32px;
    padding-bottom: 24px;
  }

  .project-title {
    font-size: 16px;
  }

  .project-description {
    font-size: 16px;
  }

  .project-links a {
    font-size: 13px;
    margin-right: 12px;
  }

  .project-content-wrapper {
    flex-direction: column;
    gap: 24px;
  }

  .project-presentation {
    width: 100%;
    max-width: 100%;
  }

  .project-presentation iframe {
    height: auto;
    max-height: 60vh;
    aspect-ratio: 4 / 3;
  }

  .project-presentation-full {
    margin-bottom: 24px;
  }

  .project-presentation-full iframe {
    height: auto;
    max-height: 70vh;
    aspect-ratio: 4 / 3;
  }

  .pdf-lightbox-content {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .contact-header {
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 20px;
  }

  .contact-item-inline {
    display: inline-block;
    margin: 2px 0;
  }

  .contact-separator {
    margin: 0 6px;
    display: inline-block;
  }

  .contact-icons {
    gap: 16px;
  }

  .contact-icon {
    width: 100%;
    min-width: 0;
    flex-shrink: 1;
  }

  .contact-icon-label {
    font-size: 12px;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .contact-icon svg {
    width: 22px;
    height: 22px;
  }

  .affiliation-list li,
  .contact-list li,
  .info-list li {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
    word-break: keep-all;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .info-list > li {
    padding-left: 18px; /* keep minimal indent on mobile */
  }

  .info-list > li::before {
    left: 0;
    top: 0.45em;
  }

  .sub-list li {
    padding-left: 18px;
  }

  .sub-list li::before {
    left: 0;
  }

  .profile-photo {
    max-width: 150px;
    width: 100%;
  }

  .section-title {
    font-size: 0.7rem;
    margin: 28px 0 12px 0;
  }

  .project-card-title {
    font-size: 1.15rem;
  }

  .project-card-category {
    font-size: 0.65rem;
  }

  .project-description {
    font-size: 16px;
    line-height: 1.7;
  }

  .project-links {
    flex-direction: column;
    gap: 10px;
  }

  .project-links a {
    width: 100%;
    justify-content: center;
  }

  .page-title {
    font-size: 20px;
    padding: 0 5px;
    margin-bottom: 20px;
  }

  .sub-list {
    padding-left: 14px; /* slight indent retained on very small screens */
    margin-top: 6px;
  }

  .sub-list li {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 6px;
    padding-left: 16px;
  }

  .sub-list li::before {
    left: 0;
  }

  .content-wrapper {
    padding: 0;
  }

  .page-section {
    padding: 30px 0;
  }

  .page-section:first-of-type {
    padding-top: 15px;
  }

.gallery-intro {
    font-size: 14px;
    padding: 0 5px;
  }
}

/* Orientation-aware tweaks for better ratio fit */
@media (orientation: landscape) and (max-height: 600px) {
  .page-section { padding: 48px 0; }
  .project-presentation iframe,
  .project-presentation-full iframe { max-height: 70vh; }
}

/* Utility: full-bleed image for content */
.full-bleed-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 200;
  transition: border-color var(--t-fast), opacity var(--t-fast);
}
.back-to-top:hover { border-color: var(--accent); }
.back-to-top:active { opacity: 0.9; }
.back-to-top.visible { display: inline-flex; }

/* Gallery Section */
.gallery-intro {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 30px;
  text-align: center;
}

/* Buttons — outline style; accent never fills a large area */
.external-link-button,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.external-link-button:hover,
.btn-primary:hover { background: var(--code-bg); border-color: var(--accent-hi); color: var(--accent-hi); }
.external-link-button:active,
.btn-primary:active { opacity: 0.9; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.gallery-item {
  display: flex;
  flex-direction: column;
}

.gallery-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.gallery-image:hover {
  border-color: var(--accent);
}

.gallery-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--code-bg);
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.gallery-placeholder:hover {
  border-color: var(--accent);
}

.gallery-placeholder span {
  color: var(--muted);
  font-size: 13px;
}

.gallery-caption {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.gallery-note {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 20px;
  text-align: center;
}

.gallery-note code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: var(--radius);
  font-size: 11px;
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Lightbox Modal */
.lightbox-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  cursor: pointer;
}

.lightbox-backdrop.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  cursor: default;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
}

.lightbox-caption {
  color: #ffffff;
  font-size: 16px;
  padding: 12px 0;
  text-align: center;
  margin-top: 12px;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #ffffff;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.5);
  transition: background 0.2s;
  z-index: 1001;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.lightbox-close:active {
  opacity: 0.9;
}

.lightbox-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Home — evidence-led editorial portfolio */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reusable evidence-led project case study */
.case-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.58fr);
  gap: clamp(32px, 6vw, 72px);
  padding: 28px 0 38px;
  margin-bottom: 48px;
  border-top: 2px solid var(--text);
  border-bottom: 1px solid var(--hairline);
}

.case-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}

.case-overview h2 {
  margin: 0 0 12px;
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 600;
  color: var(--color-navy);
}

.case-overview > div > p:last-child { margin: 0; color: var(--muted); line-height: 1.7; }
.case-facts { margin: 0; }
.case-facts > div { padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.case-facts > div:first-child { padding-top: 0; }
.case-facts dt { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.case-facts dd { margin: 3px 0 0; font-size: 0.86rem; line-height: 1.5; }

.architecture-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  max-width: 900px;
  margin: 0 0 38px;
}

.architecture-flow > div {
  min-width: 0;
  min-height: 104px;
  padding: 17px;
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--hairline);
  background: var(--code-bg);
}

.architecture-flow strong,
.architecture-flow span { display: block; }
.architecture-flow strong { font-size: 0.9rem; }
.architecture-flow div span { margin-top: 7px; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.architecture-flow > span { color: var(--muted); }

@media (max-width: 768px) {
  .case-overview { grid-template-columns: 1fr; gap: 24px; margin-bottom: 34px; }
  .architecture-flow { grid-template-columns: 1fr; gap: 8px; }
  .architecture-flow > div { min-height: 0; }
  .architecture-flow > span { transform: rotate(90deg); text-align: center; }
}

.home-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.home-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 64px) 0 0;
  border-bottom: 2px solid var(--section-rule);
  scroll-margin-top: 72px;
}

/* Signature: a small multi-hop graph — root query node fanning out to
   first-hop entities, each with their own second-hop neighbors. It's not
   decoration; it's a literal (very quiet) diagram of the retrieval work in
   "Selected Experience" and "KG-RAG" below. One appearance only, in the
   hero, bleeding past the shell's right edge. */
.hero-graph {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: -8%;
  width: min(56%, 760px);
  height: auto;
  transform: translateY(-46%);
  pointer-events: none;
}
.hg-edges line { stroke: var(--color-primary); stroke-width: 1.1; opacity: 0.15; }
.hg-node { fill: var(--color-primary); opacity: 0.38; }
.hg-node--root { opacity: 0.6; }

@media (max-width: 900px) {
  .hero-graph { display: none; }
}

.hero-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: clamp(48px, 7vw, 96px);
  align-items: start;
  padding-bottom: clamp(32px, 4vw, 52px);
}

.hero-identity { min-width: 0; }

.hero-identity .hero-eyebrow {
  margin-bottom: clamp(14px, 2vw, 22px);
  color: var(--accent);
  font-weight: 600;
}

.hero-identity .hero-name {
  font-size: clamp(3.25rem, 6.8vw, 6.25rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin-bottom: clamp(20px, 3vw, 30px);
}

.hero-identity .hero-tagline {
  font-family: var(--font-sans);
  font-size: clamp(1.35rem, 2.25vw, 2rem);
  font-weight: 500;
  line-height: 1.35;
  max-width: 34ch;
  margin-bottom: 28px;
}

.hero-actions,
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.action-primary,
.action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.action-primary {
  color: var(--color-on-primary);
  background: var(--accent);
}

.action-primary:hover {
  color: var(--color-on-primary);
  background: var(--accent-hi);
  border-color: var(--accent-hi);
}

.action-secondary {
  color: var(--accent);
  background: transparent;
}

.action-secondary:hover { background: var(--code-bg); }

.hero-social {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 18px;
}

.hero-social a,
.work-links a,
.research-links a,
.section-more a,
.capability-grid a,
.contact-links > a:not(.action-primary) {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 4px;
}

.hero-social a,
.work-links a,
.research-links a,
.section-more a,
.capability-grid a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.hero-social a:hover,
.work-links a:hover,
.research-links a:hover,
.section-more a:hover,
.capability-grid a:hover,
.contact-links > a:not(.action-primary):hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.experience-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--text);
}

.experience-heading-row h2 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Profile photo — full frame, not circle-cropped, sized to be the dominant
   visual in the hero's right column rather than a small avatar icon. */
.selected-experience > .hero-photo {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 var(--space-5);
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
}

.experience-summary {
  padding: 0;
  margin: 0;
  list-style: none;
}

.experience-summary-item {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: 16px;
  padding: 15px 0 15px 22px;
  border-bottom: 1px solid var(--hairline);
}

.experience-summary-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--muted);
  border-radius: 50%;
}

.experience-summary-item.is-current::before {
  background: var(--accent);
  border-color: var(--accent);
}

.experience-date,
.work-status,
.research-type,
.education-date,
.career-meta,
.section-kicker,
.current-marker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.4;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.experience-date { grid-row: 1 / span 3; margin: 2px 0 0; }
.experience-summary-item.is-current .experience-date { color: var(--accent); font-weight: 600; }
.experience-summary-item h3 { margin: 0 0 2px; font-size: 1rem; line-height: 1.35; }
.experience-org { margin: 0; color: var(--text); font-size: 0.95rem; line-height: 1.45; }
.experience-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }

.evidence-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--color-signal);
}

.evidence-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 92px;
  padding: 19px 24px 18px 0;
  color: var(--text);
  border-right: 1px solid var(--hairline);
}

.evidence-item + .evidence-item { padding-left: 24px; }
.evidence-item:last-child { border-right: 0; }
.evidence-item:hover { color: var(--accent); }
.evidence-label { font-family: var(--font-mono); font-size: 0.67rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.evidence-value { margin-top: 6px; font-size: clamp(0.83rem, 1.2vw, 0.95rem); font-weight: 600; line-height: 1.45; }

.home-section {
  padding: clamp(72px, 9vw, 124px) 0;
  border-bottom: 2px solid var(--section-rule);
  scroll-margin-top: 72px;
}

#selected-work,
#research,
#education {
  background: var(--surface);
}

.section-intro {
  display: grid;
  grid-template-columns: minmax(120px, 0.34fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-bottom: clamp(40px, 5vw, 66px);
}

/* Bracketed index — reads like a citation/footnote mark rather than a
   generic "01 —" editorial eyebrow, since the numbering here really is
   this page's own reference order (section 1 of 6, in a document sense). */
.section-kicker {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 9px 0 0;
  color: var(--muted);
  font-weight: 600;
}
.section-kicker-index {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.home-section-title { margin: 0; font-family: var(--font-sans); font-size: clamp(2.2rem, 4.5vw, 4rem); font-weight: 600; line-height: 1.05; letter-spacing: -0.04em; color: var(--color-navy); }
.section-intro > div > p { margin: 12px 0 0; color: var(--muted); font-size: 1rem; }

.featured-work { display: grid; grid-template-columns: 84px 1fr; gap: 28px; padding: 34px 0 40px; border-top: 2px solid var(--section-rule); }
.featured-work:first-child { border-top-color: var(--text); }
.featured-work-body { transition: transform var(--t-med); }
.featured-work:hover .featured-work-body { transform: translateX(5px); }
.featured-work:hover h3 { color: var(--accent); }
.featured-work-index { font-family: var(--font-mono); font-size: 1.4rem; color: var(--color-caption); font-variant-numeric: tabular-nums; }
.featured-work-heading { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; }
.work-status { margin: 0 0 7px; }
.featured-work h3 { margin: 0; font-family: var(--font-sans); font-size: clamp(1.75rem, 3vw, 2.7rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.025em; color: var(--color-navy); transition: color var(--t-fast); }
.work-date,
.work-heading-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.work-heading-meta { display: grid; gap: 5px; text-align: right; }
.work-heading-meta strong { color: var(--color-evidence); font-size: 0.76rem; font-weight: 600; }
.work-problem { margin: 18px 0 22px; font-size: clamp(1rem, 1.6vw, 1.16rem); line-height: 1.65; }
.work-evidence { margin: 0; border-top: 1px solid var(--hairline); }
.work-evidence > div { display: grid; grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1fr); gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.work-evidence dt { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.work-evidence dd { margin: 0; font-size: 0.95rem; line-height: 1.55; }
.work-links, .research-links { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 18px; }
.section-more { margin: 28px 0 0 auto; text-align: right; }

.career-list { border-top: 1px solid var(--text); }
.career-item { display: grid; grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr); gap: 32px; padding: 32px 0 38px; border-bottom: 1px solid var(--hairline); }
.career-item:first-child {
  margin-inline: -24px;
  padding-inline: 21px 24px;
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--code-bg), transparent 72%);
}
.career-meta p { margin: 0 0 5px; }
.career-meta p + p { text-transform: none; letter-spacing: 0; }
.career-body h3 { margin: 0 0 3px; font-family: var(--font-sans); font-size: clamp(1.45rem, 2.5vw, 2rem); font-weight: 600; color: var(--color-navy); }
.career-org { margin: 0 0 16px; color: var(--muted); font-size: 0.9rem; }
.atio-project-focus {
  margin: 20px 0 22px;
  padding: 18px 20px 18px 22px;
  border-left: 3px solid var(--color-signal);
  background: color-mix(in srgb, var(--code-bg) 72%, transparent);
}
.atio-project-label {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.atio-project-focus h4 {
  margin: 0 0 12px;
  font-family: var(--font-sans);
  font-size: clamp(1.18rem, 2vw, 1.45rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-navy);
}
.atio-project-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--color-signal);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--color-primary);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.atio-project-cta span { transition: transform var(--t-fast); }
.atio-project-cta:hover {
  border-color: var(--accent-hi);
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.atio-project-cta:hover span { transform: translate(2px, -2px); }
.atio-project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.career-body .atio-project-tags li {
  margin: 0;
  padding: 4px 7px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
}
.role-summary { margin: 0 0 16px; max-width: 68ch; color: var(--color-caption); font-size: 0.96rem; line-height: 1.65; }
.role-title { font-size: 1.125rem; color: var(--text); font-weight: 600; }
.role-meta { color: var(--muted); font-size: var(--text-sm); font-weight: 400; }
.career-body ul { margin: 0; padding-left: 1.1rem; max-width: 68ch; }
.career-body li { margin: 7px 0; padding-left: 5px; line-height: 1.65; }
.current-marker { display: inline-block; margin: 0 0 9px; padding: 3px 8px; border: 1px solid var(--accent); color: var(--color-on-primary); background: var(--accent); }
.confidential-note { margin: 15px 0 0; color: var(--muted); font-size: 0.8rem; font-style: italic; }

.research-list { border-top: 1px solid var(--text); }
.research-item { display: grid; grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr); gap: 32px; padding: 30px 0 34px; border-bottom: 1px solid var(--hairline); }
.research-item h3 { margin: 0; font-family: var(--font-sans); font-size: clamp(1.25rem, 2.2vw, 1.7rem); font-weight: 600; line-height: 1.3; color: var(--color-navy); }
.citation { margin: 10px 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
.publication-authors { color: var(--muted); }
.publication-meta { color: var(--color-caption); font-size: 0.88rem; font-variant-numeric: tabular-nums; }

/* No sequence numbering here — these six domains are not ordered, so a
   decorative 01–06 counter would encode a ranking that doesn't exist. */
.capability-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--text); border-left: 1px solid var(--hairline); }
.capability-grid article { position: relative; display: flex; flex-direction: column; min-height: 220px; padding: var(--space-5); border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); border-top: 2px solid transparent; transition: border-top-color var(--t-med); }
.capability-grid article:hover { border-top-color: var(--accent); }
.capability-grid h3 { margin: 0; font-family: var(--font-sans); font-size: 1.3rem; font-weight: 600; line-height: 1.3; color: var(--color-navy); }
.capability-grid p { margin: 14px 0 22px; color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
.capability-grid a { margin-top: auto; }
.capability-grid a span,
.work-links a span,
.section-more a span { transition: transform var(--t-fast); }
.capability-grid a:hover span,
.work-links a:hover span,
.section-more a:hover span { transform: translateX(4px); }

.education-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--text); }
.education-grid article { min-width: 0; padding: 28px 28px 28px 0; border-right: 1px solid var(--hairline); }
.education-grid article + article { padding-left: 28px; }
.education-grid article:nth-child(2n) { border-right: 0; }
.education-grid article:nth-child(n+3) { border-top: 1px solid var(--hairline); }
.education-grid article:nth-child(3) { padding-left: 0; }
.education-grid h3 { margin: 8px 0 7px; font-family: var(--font-sans); font-size: 1.35rem; font-weight: 600; line-height: 1.3; color: var(--color-navy); }
.education-grid p { margin: 0 0 9px; font-size: 0.95rem; line-height: 1.55; }
.education-grid .education-detail { color: var(--muted); }

.contact-section { padding: clamp(72px, 9vw, 120px) 0; scroll-margin-top: 72px; }
.contact-inner { display: grid; grid-template-columns: minmax(120px, 0.34fr) minmax(0, 1fr); gap: 32px; }
.contact-inner h2 { margin: 0; font-family: var(--font-sans); font-size: clamp(2.3rem, 5vw, 4.6rem); font-weight: 600; line-height: 1; letter-spacing: -0.04em; color: var(--color-navy); }
.contact-inner > div > p { margin: 17px 0 26px; color: var(--muted); }
.contact-links { gap: 20px; }
.contact-links .action-primary { color: var(--color-on-primary); text-decoration: none; }

@media (max-width: 900px) {
  .hero-intro { grid-template-columns: minmax(0, 1fr); gap: 52px; }
  .capability-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .home-shell { width: min(100% - 32px, 680px); }
  .home-hero { padding-top: 30px; }
  .hero-intro { gap: 42px; padding-bottom: 30px; }
  .hero-identity .hero-name { font-size: clamp(2.8rem, 13vw, 5rem); }
  .hero-identity .hero-tagline { font-size: clamp(1.25rem, 6vw, 1.65rem); }
  .evidence-strip { grid-template-columns: 1fr; }
  .evidence-item, .evidence-item + .evidence-item { min-height: 0; padding: 16px 0; border-right: 0; border-bottom: 1px solid var(--hairline); }
  .evidence-item:last-child { border-bottom: 0; }
  .experience-summary-item { grid-template-columns: 1fr; gap: 3px; }
  .experience-date { grid-row: auto; margin-bottom: 4px; }
  .section-intro, .contact-inner { grid-template-columns: 1fr; gap: 13px; }
  .section-kicker { margin-top: 0; }
  .featured-work { grid-template-columns: 44px 1fr; gap: 14px; }
  .featured-work-index { font-size: 1.35rem; }
  .career-item, .research-item { grid-template-columns: 1fr; gap: 14px; }
  .career-item:first-child { margin-inline: -12px; padding-inline: 9px 12px; }
  .career-meta { display: flex; justify-content: space-between; gap: 18px; }
  .atio-project-focus { margin-top: 18px; padding: 16px; }
  .capability-grid { grid-template-columns: 1fr; }
  .capability-grid article { min-height: 0; }
  .education-grid { grid-template-columns: 1fr; }
  .education-grid article, .education-grid article + article, .education-grid article:nth-child(3), .education-grid article:last-child { grid-column: auto; padding: 24px 0; border-right: 0; border-top: 0; border-bottom: 1px solid var(--hairline); }
}

@media (max-width: 480px) {
  .home-shell { width: calc(100% - 28px); }
  .hero-actions { align-items: stretch; }
  .hero-actions a { flex: 1 1 100%; }
  .featured-work { grid-template-columns: 1fr; }
  .featured-work-index { display: none; }
  .featured-work-heading { flex-direction: column; gap: 8px; }
  .work-date { order: -1; }
  .work-evidence > div { grid-template-columns: 1fr; gap: 3px; }
  .work-heading-meta { order: -1; text-align: left; }
  .career-meta { display: block; }
  .atio-project-cta { width: 100%; }
  .contact-links { align-items: stretch; }
  .contact-links .action-primary { flex-basis: 100%; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero *, .home-section *, .contact-section * { scroll-behavior: auto; }
  .featured-work:hover .featured-work-body,
  .capability-grid article:hover,
  .capability-grid a:hover span,
  .work-links a:hover span,
  .section-more a:hover span { transform: none; }
}

/* Motion language: graph traversal, measured reveals, and tactile controls. */
@keyframes hero-line-traverse {
  from { stroke-dashoffset: 34; }
  to { stroke-dashoffset: 0; }
}

@keyframes hero-node-breathe {
  0%, 100% { opacity: 0.3; transform: scale(0.82); }
  48% { opacity: 0.75; transform: scale(1.28); }
}

@keyframes hero-enter-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-photo-enter {
  from { opacity: 0; transform: translateY(18px) scale(0.97); filter: saturate(0.7); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: saturate(1); }
}

@keyframes current-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 34%, transparent); }
  50% { box-shadow: 0 0 0 7px transparent; }
}

.motion-enabled .hero-identity > *,
.motion-enabled .selected-experience,
.motion-enabled .evidence-strip {
  opacity: 0;
  animation: hero-enter-up 720ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.motion-enabled .hero-identity > :nth-child(1) { animation-delay: 70ms; }
.motion-enabled .hero-identity > :nth-child(2) { animation-delay: 150ms; }
.motion-enabled .hero-identity > :nth-child(3) { animation-delay: 235ms; }
.motion-enabled .hero-identity > :nth-child(4) { animation-delay: 310ms; }
.motion-enabled .hero-identity > :nth-child(5) { animation-delay: 390ms; }
.motion-enabled .hero-identity > :nth-child(6) { animation-delay: 455ms; }
.motion-enabled .selected-experience {
  animation-name: hero-photo-enter;
  animation-delay: 210ms;
  animation-duration: 900ms;
}
.motion-enabled .evidence-strip { animation-delay: 520ms; }

.hero-graph .hg-edges line {
  stroke-dasharray: 7 10;
  animation: hero-line-traverse 3.8s linear infinite;
}
.hero-graph .hg-edges line:nth-child(2n) { animation-duration: 4.8s; animation-direction: reverse; }
.hero-graph .hg-edges line:nth-child(3n) { animation-delay: -1.4s; }
.hero-graph .hg-node {
  transform-box: fill-box;
  transform-origin: center;
  animation: hero-node-breathe 3.2s ease-in-out infinite;
}
.hero-graph .hg-node:nth-child(2n) { animation-delay: -1.1s; animation-duration: 4.1s; }
.hero-graph .hg-node:nth-child(3n) { animation-delay: -2.2s; }
.hero-graph .hg-node--root { animation-duration: 2.4s; }

.motion-enabled .motion-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 680ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 760ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--motion-order, 0) * 55ms);
}
.motion-enabled .motion-reveal.is-revealed { opacity: 1; transform: translateY(0); }

.experience-summary-item.is-current::before { animation: current-pulse 2.6s ease-out infinite; }

.action-primary,
.action-secondary,
.atio-project-cta {
  position: relative;
  overflow: hidden;
  transition-duration: 280ms;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
.action-primary:hover,
.action-secondary:hover,
.atio-project-cta:hover { transform: translateY(-2px); }
.action-primary:active,
.action-secondary:active,
.atio-project-cta:active { transform: translateY(0) scale(0.98); }

.capability-grid article {
  transition: border-top-color 300ms ease, background-color 300ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
.capability-grid article:hover {
  transform: translateY(-5px);
  background: color-mix(in srgb, var(--code-bg) 58%, transparent);
}

.featured-work-index {
  transition: color 260ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
.featured-work:hover .featured-work-index { color: var(--accent); transform: translateY(-4px) rotate(-3deg); }
.featured-work:hover .featured-work-body { transform: translateX(8px); }

.evidence-item { position: relative; overflow: hidden; }
.evidence-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 25%, color-mix(in srgb, var(--accent) 9%, transparent) 48%, transparent 72%);
  transform: translateX(-115%);
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.evidence-item:hover::after { transform: translateX(115%); }

@media (max-width: 768px) {
  .motion-enabled .motion-reveal { transform: translateY(20px); }
  .capability-grid article:hover,
  .featured-work:hover .featured-work-index { transform: none; }
  .featured-work:hover .featured-work-body { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .motion-enabled .hero-identity > *,
  .motion-enabled .selected-experience,
  .motion-enabled .evidence-strip,
  .motion-enabled .motion-reveal {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
  .hero-graph .hg-edges line,
  .hero-graph .hg-node,
  .experience-summary-item.is-current::before { animation: none; }
  .action-primary:hover,
  .action-secondary:hover,
  .atio-project-cta:hover { transform: none; }
}

[data-theme="dark"] .action-primary,
[data-theme="dark"] .contact-links .action-primary {
  color: var(--color-on-primary);
  background: var(--accent);
}

[data-theme="dark"] .action-primary:hover,
[data-theme="dark"] .contact-links .action-primary:hover {
  color: var(--color-on-primary);
  background: var(--accent-hi);
}
