@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #0a0b0e;
  --bg-alt: #0d0f13;
  --surface: #121419;
  --surface-2: #171a20;
  --surface-3: #1e2129;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --line-3: rgba(255, 255, 255, 0.24);
  --text: #eceef2;
  --muted: #a3a9b5;
  --subtle: #8a909c;
  --accent: #5fd4bf;
  --accent-hover: #86e3d2;
  --accent-ink: #04241e;
  --accent-line: rgba(95, 212, 191, 0.32);
  --accent-glow: rgba(95, 212, 191, 0.18);
  --tint: rgba(255, 255, 255, 0.03);
  --tint-hover: rgba(255, 255, 255, 0.07);
  --selection: rgba(95, 212, 191, 0.32);
  --selection-text: #fff;
  --header-bg: rgba(10, 11, 14, 0.78);
  --pill-bg: rgba(18, 20, 25, 0.6);
  --glass: rgba(10, 11, 14, 0.74);
  --glass-line: rgba(255, 255, 255, 0.16);
  --glass-text: #eceef2;
  --scrim-top: rgba(10, 11, 14, 0.38);
  --scrim-bottom: rgba(10, 11, 14, 0.3);
  --hero-glow: rgba(95, 212, 191, 0.13);
  --hero-glow-2: rgba(95, 212, 191, 0.05);
  --footer-glow: rgba(95, 212, 191, 0.07);
  --contour-major: rgba(95, 212, 191, 0.42);
  --contour-minor: rgba(150, 190, 200, 0.14);
  --pressed-count: #4a505c;
  --scrollbar: #2a2e36;
  --backdrop: rgba(4, 5, 7, 0.76);
  --modal-head-bg: rgba(18, 20, 25, 0.92);
  --shadow-card: 0 30px 60px -28px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(95, 212, 191, 0.06);
  --shadow-modal: 0 50px 120px rgba(0, 0, 0, 0.65);
  --shadow-menu: 0 24px 40px -12px rgba(0, 0, 0, 0.7);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Light theme: data-theme is set by assets/js/theme.js before the first paint. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --bg-alt: #eceff3;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e6e9ee;
  --line: rgba(17, 24, 39, 0.1);
  --line-2: rgba(17, 24, 39, 0.17);
  --line-3: rgba(17, 24, 39, 0.3);
  --text: #111418;
  --muted: #464d58;
  --subtle: #5a616d;
  --accent: #086f61;
  --accent-hover: #065a4f;
  --accent-ink: #ffffff;
  --accent-line: rgba(8, 111, 97, 0.36);
  --accent-glow: rgba(8, 111, 97, 0.16);
  --tint: rgba(17, 24, 39, 0.02);
  --tint-hover: rgba(17, 24, 39, 0.06);
  --selection: rgba(8, 111, 97, 0.2);
  --selection-text: #111418;
  --header-bg: rgba(245, 246, 248, 0.84);
  --pill-bg: rgba(255, 255, 255, 0.72);
  --glass: rgba(255, 255, 255, 0.92);
  --glass-line: rgba(17, 24, 39, 0.1);
  --glass-text: #111418;
  --scrim-top: rgba(17, 24, 39, 0.14);
  --scrim-bottom: rgba(17, 24, 39, 0.08);
  --hero-glow: rgba(8, 111, 97, 0.11);
  --hero-glow-2: rgba(8, 111, 97, 0.05);
  --footer-glow: rgba(8, 111, 97, 0.06);
  --contour-major: rgba(8, 111, 97, 0.34);
  --contour-minor: rgba(36, 60, 80, 0.12);
  --pressed-count: #b4bac4;
  --scrollbar: #c3c8d0;
  --backdrop: rgba(17, 24, 39, 0.5);
  --modal-head-bg: rgba(255, 255, 255, 0.94);
  --shadow-card: 0 26px 50px -28px rgba(17, 24, 39, 0.32), 0 0 0 1px rgba(8, 111, 97, 0.06);
  --shadow-modal: 0 40px 100px rgba(17, 24, 39, 0.3);
  --shadow-menu: 0 24px 40px -18px rgba(17, 24, 39, 0.24);
}
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  scrollbar-gutter: stable;
  scrollbar-color: var(--scrollbar) var(--bg);
  background: var(--bg);
}
html.modal-open { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, canvas, svg { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
button { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.nowrap { white-space: nowrap; }
.t-part { display: inline-block; }
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: fixed; left: 16px; top: -64px; z-index: 100; padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.005em; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.3s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform 0.3s var(--ease); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:hover svg { transform: translateY(2px); }
.btn-outline { border-color: var(--line-2); color: var(--text); background: var(--tint); }
.btn-outline:hover { border-color: var(--line-3); background: var(--tint-hover); }
.btn-outline:hover svg { transform: translate(2px, -2px); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.site-header.is-scrolled, .site-header.is-open {
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  backdrop-filter: saturate(150%) blur(16px);
  border-bottom-color: var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 600; letter-spacing: -0.015em; white-space: nowrap; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--accent-ink); font-size: 0.8125rem; font-weight: 750; letter-spacing: -0.03em;
}
.brand-name { font-size: 1rem; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a {
  padding: 8px 12px; border-radius: 999px; color: var(--muted); font-size: 0.9375rem; font-weight: 500;
  text-decoration: none; white-space: nowrap; transition: color 0.2s, background-color 0.2s;
}
.nav a:hover { color: var(--text); background: var(--tint-hover); }
.nav a[aria-current="true"] { color: var(--text); }
.nav .nav-resume { display: none; }
.menu-toggle {
  display: none; width: 44px; height: 44px; margin-left: auto; place-items: center; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--tint); cursor: pointer;
}
.menu-toggle svg { width: 20px; height: 20px; }
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--tint); color: var(--muted); cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-3); background: var(--tint-hover); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon, :root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Hero */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(100svh, 940px); display: flex; align-items: center;
  padding: calc(var(--header-h) + 56px) 0 96px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 560px at 78% 30%, var(--hero-glow), transparent 65%),
    radial-gradient(700px 500px at 10% 100%, var(--hero-glow-2), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 220px; z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.hero-canvas {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  -webkit-mask-image: radial-gradient(115% 95% at 78% 38%, #000 22%, rgba(0, 0, 0, 0.35) 58%, transparent 82%);
  mask-image: radial-gradient(115% 95% at 78% 38%, #000 22%, rgba(0, 0, 0, 0.35) 58%, transparent 82%);
}
.hero-inner { position: relative; }
.hero-inner > * { animation: rise 0.9s var(--ease) both; }
.hero-inner > :nth-child(2) { animation-delay: 0.06s; }
.hero-inner > :nth-child(3) { animation-delay: 0.14s; }
.hero-inner > :nth-child(4) { animation-delay: 0.22s; }
.hero-inner > :nth-child(5) { animation-delay: 0.3s; }
.hero-place {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--pill-bg);
  color: var(--muted); font-size: 0.875rem; font-weight: 500;
}
.hero-place svg { width: 16px; height: 16px; color: var(--accent); }
.hero-title { margin-top: 28px; }
.hero-name {
  display: block; font-size: clamp(3rem, 1.4rem + 6.4vw, 6.5rem); font-weight: 650;
  letter-spacing: -0.045em; line-height: 0.95;
}
.hero-role {
  display: block; margin-top: 0.4em; font-size: clamp(1.375rem, 0.95rem + 1.7vw, 2.375rem);
  font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; color: var(--accent);
}
.hero-tagline { margin-top: 24px; max-width: 34ch; font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem); line-height: 1.5; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 32px; }
.hero-links a {
  display: inline-flex; align-items: center; gap: 9px; padding: 4px 0;
  color: var(--muted); font-size: 0.9375rem; text-decoration: none; transition: color 0.2s;
}
.hero-links a:hover { color: var(--text); }
.hero-links svg { width: 18px; height: 18px; flex: none; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* Sections */
.section { padding: clamp(80px, 10vw, 136px) 0; }
.section-alt { background: linear-gradient(to bottom, var(--bg), var(--bg-alt) 18%, var(--bg-alt) 82%, var(--bg)); }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.eyebrow {
  display: flex; align-items: center; gap: 12px; color: var(--subtle);
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
}
.eyebrow-num { color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.eyebrow-num::after { content: ""; display: inline-block; width: 28px; height: 1px; margin-left: 12px; vertical-align: middle; background: var(--line-3); }
.section-title { margin-top: 16px; font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem); letter-spacing: -0.035em; line-height: 1.05; }
.section-lede { margin-top: 16px; color: var(--muted); font-size: 1.125rem; }
.noscript { color: var(--muted); }

/* Reveal (JS adds .reveal-pending only to elements below the fold) */
[data-reveal].reveal-pending { opacity: 0; transform: translateY(18px); }
[data-reveal].reveal-in { transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }

/* Chips and badges */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 3px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--tint);
  color: var(--muted); font-size: 0.8125rem; line-height: 1.3;
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--glass-line); background: var(--glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--glass-text); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
}
.badge svg { width: 14px; height: 14px; flex: none; }
.badge-ai svg { color: var(--accent); }

/* Cards */
.case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.film-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden;
  transition: border-color 0.35s, transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-4px); box-shadow: var(--shadow-card); }
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card-media img, .card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-media img { transition: transform 1.1s var(--ease), opacity 0.4s; }
.card:hover .card-media img { transform: scale(1.035); }
.card-media video { opacity: 0; transition: opacity 0.45s; }
.card.is-previewing .card-media video { opacity: 1; }
.card-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, var(--scrim-top), transparent 32%, transparent 70%, var(--scrim-bottom));
}
.card-badges { position: absolute; z-index: 2; left: 14px; top: 14px; right: 14px; }
.card-play {
  position: absolute; z-index: 2; right: 14px; bottom: 14px; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; color: var(--glass-text);
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transform: scale(0.88); transition: opacity 0.3s, transform 0.4s var(--ease), background-color 0.3s, color 0.3s;
}
.card-play svg { width: 18px; height: 18px; margin-left: 2px; }
.card:hover .card-play, .card:focus-within .card-play { opacity: 1; transform: none; }
.card:hover .card-play { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.card-body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 22px 24px 24px; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.card-title { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.card-meta { color: var(--subtle); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.card-line { color: var(--muted); }
.card .chips { margin-top: auto; padding-top: 4px; }
.card-link {
  all: unset; cursor: pointer; text-align: left;
  background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.4s var(--ease);
}
.card:hover .card-link { background-size: 100% 1px; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: var(--radius-lg); }
.card-link:focus-visible::after { box-shadow: inset 0 0 0 2px var(--accent); }

.card-sm { border-radius: var(--radius); }
.card-sm .card-link::after { border-radius: var(--radius); }
.card-sm .card-body { gap: 6px; padding: 16px 18px 18px; }
.card-sm .card-title { font-size: 1.0625rem; letter-spacing: -0.015em; line-height: 1.3; }
.card-sm .card-meta { font-size: 0.8125rem; }
.card-sm .card-play { width: 40px; height: 40px; right: 12px; bottom: 12px; }
.card-sm .card-badges { left: 12px; top: 12px; }
.card-media img.is-missing { visibility: hidden; }

/* Websites (last cards of the work grid) */
.card-host { margin-top: auto; padding-top: 4px; color: var(--accent); font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; }

/* Filters */
.film-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font-size: 0.9375rem; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.filter:hover { color: var(--text); border-color: var(--line-3); }
.filter .count { color: var(--subtle); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.filter[aria-pressed="true"] .count { color: var(--pressed-count); }
.result-count { color: var(--subtle); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

/* Skills */
.section-tight { padding: clamp(64px, 8vw, 104px) 0; }
.section-tight .section-head { margin-bottom: clamp(24px, 3vw, 36px); }
.skills-list { max-width: 900px; border-top: 1px solid var(--line); }
.skill-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 24px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.skill-row dt { color: var(--subtle); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.spoken { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-top: 24px; color: var(--text); }
.spoken span { color: var(--subtle); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }

/* Experience */
.experience-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 172px; top: 10px; bottom: 10px; width: 1px; background: var(--line-2); }
.timeline-item { position: relative; display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 48px; padding-bottom: 36px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: 168px; top: 9px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-3);
}
.timeline-item:first-child::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.timeline-period { color: var(--subtle); font-size: 0.9375rem; font-variant-numeric: tabular-nums; text-align: right; padding-top: 1px; white-space: nowrap; }
.timeline-body h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.timeline-role { margin-top: 4px; color: var(--text); font-size: 0.9375rem; font-weight: 500; }
.timeline-role span { color: var(--subtle); font-weight: 400; }
.timeline-item:first-child .timeline-role { color: var(--accent); }
.timeline-text { margin-top: 8px; color: var(--muted); }
.education { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.education-title { font-size: 1rem; letter-spacing: -0.01em; }
.education dl { display: grid; gap: 18px; margin: 18px 0 24px; }
.education dt { font-weight: 600; line-height: 1.35; }
.education dd { margin-top: 4px; color: var(--subtle); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }

/* Footer / contact */
.site-footer { padding: clamp(80px, 10vw, 128px) 0 36px; border-top: 1px solid var(--line); background: radial-gradient(900px 420px at 50% 0%, var(--footer-glow), transparent 70%), var(--bg); }
.contact { max-width: 860px; }
.contact-mail {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 20px; max-width: 100%;
  color: var(--accent); font-size: clamp(1.25rem, 1rem + 1.4vw, 2rem); font-weight: 600; letter-spacing: -0.02em;
  text-decoration: none; overflow-wrap: anywhere;
}
.contact-mail svg { width: 0.9em; height: 0.9em; flex: none; transition: transform 0.3s var(--ease); }
.contact-mail:hover { color: var(--accent-hover); }
.contact-mail:hover svg { transform: translate(3px, -3px); }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.contact-links a {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text); font-size: 0.9375rem; font-weight: 500; text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}
.contact-links a:hover { border-color: var(--line-3); background: var(--tint-hover); }
.contact-links svg { width: 18px; height: 18px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: clamp(64px, 8vw, 104px);
  padding-top: 24px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 0.875rem;
}

/* Modal */
.modal {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 24px; border: 0;
  background: transparent; color: var(--text); overflow: hidden;
}
.modal[open] { display: grid; place-items: center; }
.modal::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal[open]::backdrop { animation: fade-in 0.3s ease both; }
.modal[open] .modal-panel { animation: modal-in 0.5s var(--ease) both; }
.modal.is-closing::backdrop { animation: fade-out 0.2s ease both; }
.modal.is-closing .modal-panel { animation: modal-out 0.2s ease both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(20px) scale(0.98); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(0.985); } }
.modal-panel {
  position: relative; width: min(1120px, 100%); max-height: calc(100dvh - 48px); overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-modal);
}
.modal-head {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 16px 16px 28px; border-bottom: 1px solid var(--line);
  background: var(--modal-head-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.modal-heading { min-width: 0; }
.modal-heading .eyebrow { font-size: 0.75rem; letter-spacing: 0.12em; }
.modal-title { margin-top: 4px; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); letter-spacing: -0.025em; }
.modal-actions { display: flex; gap: 6px; flex: none; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--tint); color: var(--text);
  transition: background-color 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--tint-hover); border-color: var(--line-3); }
.icon-btn svg { width: 20px; height: 20px; }
.modal-media { position: relative; aspect-ratio: 16 / 9; background: #000; }
.modal-media video, .modal-media img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.modal-media.is-portrait { aspect-ratio: auto; height: min(72vh, 760px); }
.media-flag {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 2;
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 999px;
  width: max-content; max-width: calc(100% - 32px); white-space: nowrap;
  border: 1px solid var(--glass-line); background: var(--glass); color: var(--glass-text);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 0.875rem; font-weight: 600; text-align: center;
}
.media-flag svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.modal-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); padding: 28px 28px 32px; }
.modal-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.modal-main .badges:empty { display: none; }
.modal-main .badge { background: var(--surface-2); border-color: var(--line-2); color: var(--text); -webkit-backdrop-filter: none; backdrop-filter: none; }
.modal-cta:empty, .modal-head-cta:empty { display: none; }
.modal-cta { display: none; }
.modal-head-cta { display: flex; margin-right: 6px; }
.modal-head-cta .btn-visit { min-height: 42px; padding: 0 18px; font-size: 0.9375rem; }
.btn-visit { align-self: flex-start; }
.btn-visit:hover svg { transform: translate(2px, -2px); }
.modal-summary { font-size: 1.125rem; line-height: 1.55; color: var(--text); }
.highlights { display: grid; gap: 10px; }
.highlights:empty { display: none; }
.highlights li { position: relative; padding-left: 26px; color: var(--muted); }
.highlights li::before {
  content: ""; position: absolute; left: 2px; top: 0.6em; width: 12px; height: 7px; transform: rotate(-45deg) translateY(-50%);
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
}
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.facts:empty { display: none; }
.facts div { min-width: 0; }
.facts .wide { grid-column: 1 / -1; }
.facts dt { color: var(--subtle); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.facts dd { margin-top: 4px; font-size: 0.9375rem; }
.facts dd ul { display: grid; gap: 4px; }
.facts-side { grid-template-columns: 1fr; padding-top: 0; border-top: 0; }
.modal-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.stack-title { margin-bottom: 14px; color: var(--subtle); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.stack { display: grid; gap: 14px; }
.stack div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.stack dt { color: var(--muted); font-size: 0.875rem; font-weight: 500; }
.stack .chips { gap: 5px; }
.stack .chip { min-height: 26px; padding: 2px 10px; font-size: 0.8125rem; }
.notes { display: grid; gap: 10px; }
.notes:empty { display: none; }
.notes li { display: flex; gap: 10px; color: var(--subtle); font-size: 0.875rem; line-height: 1.5; }
.notes svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }
.modal-links { display: flex; flex-wrap: wrap; gap: 10px; }
.modal-links:empty { display: none; }

/* Responsive */
@media (max-width: 1080px) {
  .header-inner { gap: 14px; }
  .nav a { padding: 8px 9px; font-size: 0.875rem; }
  .case-grid, .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .experience-layout { grid-template-columns: 1fr; }
  .education { max-width: 560px; }
}

@media (max-width: 860px) {
  :root { --header-h: 60px; }
  .header-inner { gap: 10px; }
  .menu-toggle { display: grid; order: 2; margin-left: 0; }
  .theme-toggle { order: 1; margin-left: auto; width: 44px; height: 44px; border-radius: 12px; }
  .header-resume { display: none; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px var(--gutter) 18px; background: var(--bg); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-menu);
  }
  .site-header.is-open { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-header.is-open .nav { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 12px; font-size: 1.0625rem; }
  .nav .nav-resume { display: block; margin-top: 8px; border: 1px solid var(--line-2); text-align: center; color: var(--text); }
  .case-grid { grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal-panel { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .modal-head { padding: 12px 12px 12px 18px; }
  .modal-head-cta { display: none; }
  .modal-cta:not(:empty) { display: flex; }
  .modal-body { grid-template-columns: 1fr; padding: 22px 18px 32px; }
  .modal-media.is-portrait { height: min(64vh, 620px); }
  .media-flag { bottom: 12px; padding: 8px 13px; font-size: 0.8125rem; }
}

@media (max-width: 640px) {
  .film-grid { grid-template-columns: 1fr; }
  .skill-row { grid-template-columns: 1fr; gap: 10px; padding: 16px 0; }
  .hero { padding-top: calc(var(--header-h) + 36px); padding-bottom: 72px; min-height: auto; }
  .hero-actions .btn { flex: 1 1 auto; }
  .card-body { padding: 18px 18px 20px; }
  .card-title { font-size: 1.25rem; }
  .timeline::before { left: 4px; }
  .timeline-item { grid-template-columns: 1fr; gap: 6px; padding-left: 28px; padding-bottom: 30px; }
  .timeline-item::before { left: 0; top: 7px; }
  .timeline-period { text-align: left; font-size: 0.875rem; }
  .facts { grid-template-columns: 1fr; }
  .stack div { grid-template-columns: 1fr; gap: 6px; }
  .modal-actions .icon-btn { width: 40px; height: 40px; }
}

@media (hover: none) {
  .card:hover { transform: none; box-shadow: none; }
  .card:hover .card-media img { transform: none; }
  .card-play { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  [data-reveal].reveal-pending { opacity: 1; transform: none; }
  .card:hover, .card:hover .card-media img { transform: none; }
}
