/* ==========================================================================
   Gunārs Dejus — portfolio
   ========================================================================== */

:root {
  --bg: #0a0a0b;
  --bg-1: #111113;
  --bg-2: #19191c;
  --line: rgba(242, 239, 233, 0.12);
  --line-2: rgba(242, 239, 233, 0.24);
  --fg: #f2efe9;
  --fg-2: #b8b4ac;
  --fg-3: #87847d;
  --accent: #3fd9c4;
  --accent-ink: #03211d;
  --accent-soft: rgba(63, 217, 196, 0.08);

  /* CV "paper" */
  --paper: #f7f5f0;
  --ink: #16181a;
  --ink-2: #545a5e;
  --teal: #0f8585;

  --font-display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1680px;
  --radius: 6px;
  --header-h: 72px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
svg { width: 1.1em; height: 1.1em; flex: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

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

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

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

/* ---------- type helpers ---------- */
.kicker {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline;
  font: 500 12px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2);
}
.kicker .num { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--fg); color: var(--bg);
  font: 600 15px/1 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.btn:active { transform: scale(0.98); }
.btn-ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.btn-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--line); font: 500 11px/1 var(--font-mono);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s, border-color 0.35s, backdrop-filter 0.35s;
}
.site-header.is-scrolled, .page-cv .site-header {
  background: rgba(10, 10, 11, 0.74);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-color: var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--header-h); display: flex; align-items: center; gap: clamp(16px, 2.5vw, 36px);
}
.brand {
  margin-right: auto; text-decoration: none;
  font: 800 15px/1 var(--font-display); font-stretch: 125%; letter-spacing: 0.02em; text-transform: uppercase;
}
.nav ul { display: flex; gap: clamp(18px, 2.4vw, 34px); }
.nav a {
  position: relative; text-decoration: none; font-size: 14px; color: var(--fg-2); transition: color 0.2s;
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.nav a:hover, .nav a[aria-current='page'] { color: var(--fg); }
.nav a:hover::after, .nav a[aria-current='page']::after { transform: scaleX(1); }

.lang-switch {
  display: flex; align-items: center; gap: 2px; padding: 4px 6px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font: 500 12px/1 var(--font-mono); color: var(--fg-3);
}
.lang-switch a { padding: 5px 6px; border-radius: 999px; text-decoration: none; color: var(--fg-3); transition: color 0.2s, background-color 0.2s; }
.lang-switch a:hover { color: var(--fg); }
.lang-switch a[aria-current='page'] { color: var(--accent-ink); background: var(--accent); }

.menu-toggle {
  display: none; align-items: center; gap: 10px; height: 40px; padding: 0 4px 0 12px;
  background: none; border: 0; cursor: pointer; font: 500 13px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em;
}
.menu-toggle-icon { position: relative; width: 22px; height: 10px; }
.menu-toggle-icon::before, .menu-toggle-icon::after {
  content: ''; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.menu-toggle-icon::before { top: 0; }
.menu-toggle-icon::after { top: 8.5px; }
.menu-open .menu-toggle-icon::before { top: 4.25px; transform: rotate(45deg); }
.menu-open .menu-toggle-icon::after { top: 4.25px; transform: rotate(-45deg); }

@media (max-width: 820px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: 0; z-index: -1; display: flex; align-items: center; justify-content: center;
    background: var(--bg); opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease), visibility 0.35s;
  }
  .menu-open .nav { opacity: 1; visibility: visible; }
  .menu-open .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .menu-open body { overflow: hidden; }
  .nav ul { flex-direction: column; align-items: center; gap: 10px; }
  .nav a { font: 800 clamp(36px, 11vw, 56px)/1.1 var(--font-display); font-stretch: 125%; text-transform: uppercase; color: var(--fg); }
  .nav a::after { display: none; }
  .brand { font-size: 13px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--header-h) + 40px) var(--gutter) clamp(24px, 4vw, 48px);
}
.hero-media { position: absolute; inset: 0; z-index: -2; background: var(--bg-1); }
.hero-media img, .hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-video { opacity: 0; transition: opacity 1s ease; }
.hero-video.is-playing { opacity: 1; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 10, 11, 0.75) 0%, rgba(10, 10, 11, 0) 24%),
    linear-gradient(0deg, rgba(10, 10, 11, 0.97) 0%, rgba(10, 10, 11, 0.78) 30%, rgba(10, 10, 11, 0.35) 62%, rgba(10, 10, 11, 0.2) 100%);
}
@media (prefers-reduced-motion: reduce) { .hero-video { display: none; } }

.hero-content { width: 100%; max-width: var(--maxw); margin: 0 auto; }
.hero-eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  font: 500 12px/1.4 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}
.hero-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(63, 217, 196, 0.18); }
.hero-eyebrow .sep { color: var(--fg-2); }
.hero-name {
  margin-top: 18px;
  font: 800 clamp(30px, 8.4vw, 150px)/0.9 var(--font-display); font-stretch: 125%;
  letter-spacing: -0.035em; text-transform: uppercase; white-space: nowrap;
}
.hero-name span { display: inline-block; }
.hero-name, .hero-intro { text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25); }
.hero-foot {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px 48px; align-items: end;
  margin-top: clamp(24px, 3.5vw, 44px); padding-top: clamp(20px, 2.5vw, 28px); border-top: 1px solid var(--line-2);
}
.hero-intro { max-width: 46ch; font-size: clamp(17px, 1.35vw, 21px); line-height: 1.5; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero-stats { display: flex; justify-content: flex-end; gap: clamp(20px, 3vw, 52px); }
.hero-stats li { display: grid; gap: 6px; }
.stat-value { font: 700 clamp(30px, 3.2vw, 50px)/1 var(--font-display); font-stretch: 112%; letter-spacing: -0.02em; }
.stat-label { max-width: 17ch; font-size: 13px; line-height: 1.4; color: var(--fg-2); }

.motion-toggle {
  position: absolute; right: var(--gutter); top: calc(var(--header-h) + 16px);
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--line-2); border-radius: 999px; background: rgba(10, 10, 11, 0.4);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font: 500 11px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.motion-toggle:hover { color: var(--fg); border-color: var(--fg-2); }
.motion-toggle svg { width: 12px; height: 12px; }
.no-js .motion-toggle { display: none; }

@media (max-width: 900px) {
  .hero-foot { grid-template-columns: 1fr; }
  .hero-stats { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .hero-name { font-stretch: 112%; }
  .hero-stats { gap: 18px; }
  .stat-label { font-size: 12px; }
  .hero-ctas .btn { flex: 1 1 auto; }
}

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden; padding: 20px 0; border-block: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 70s linear infinite; }
.marquee-list {
  display: flex; align-items: center; gap: 44px; padding-right: 44px;
  font: 600 clamp(17px, 1.8vw, 24px)/1 var(--font-display); font-stretch: 112%; text-transform: uppercase; color: var(--fg-2); white-space: nowrap;
}
.marquee-list li { display: flex; align-items: center; gap: 44px; }
.marquee-list li::after { content: '✦'; font-size: 0.55em; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }
.motion-paused .marquee-track, .marquee:hover .marquee-track { animation-play-state: paused; }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding-top: clamp(80px, 11vw, 168px); }
.section-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px clamp(14px, 2vw, 28px); align-items: start;
  margin-bottom: clamp(36px, 5vw, 80px); padding-bottom: clamp(18px, 2vw, 26px); border-bottom: 1px solid var(--line);
}
.section-num { padding-top: 0.6em; font: 500 13px/1 var(--font-mono); color: var(--accent); }
.section-title {
  font: 800 clamp(34px, 6.4vw, 108px)/0.88 var(--font-display); font-stretch: 125%;
  letter-spacing: -0.03em; text-transform: uppercase; overflow-wrap: break-word;
}
.section-sub { grid-column: 2; max-width: 52ch; color: var(--fg-2); font-size: clamp(15px, 1.1vw, 17px); }
@media (max-width: 600px) { .section-title { font-stretch: 105%; } }

/* ---------- tiles ---------- */
.tile {
  position: relative; display: block; width: 100%; padding: 0; margin: 0; border: 0;
  aspect-ratio: var(--ar, 16 / 9); overflow: hidden; isolation: isolate;
  border-radius: var(--radius); background: var(--bg-2); cursor: pointer; text-align: left;
}
.tile img, .tile video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease), opacity 0.6s ease;
}
.tile video { opacity: 0; }
.tile.is-playing video { opacity: 1; }
.tile::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, transparent 30%, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
  opacity: 0.6; transition: opacity 0.4s;
}
.tile:hover img, .tile:hover video { transform: scale(1.035); }
.tile:hover::after { opacity: 1; }
.tile-cue {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(10, 10, 11, 0.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--fg); opacity: 0; transform: translateY(6px); transition: opacity 0.3s, transform 0.3s var(--ease), background-color 0.2s, color 0.2s;
}
.tile-cue svg { width: 18px; height: 18px; }
.tile:hover .tile-cue, .tile:focus-visible .tile-cue { opacity: 1; transform: none; }
.tile:hover .tile-cue { background: var(--accent); color: var(--accent-ink); }
@media (hover: none) { .tile-cue { opacity: 1; transform: none; } }
.tile-badge svg { width: 10px; height: 10px; }
.tile .tile-cue-lg {
  left: 50%; top: 50%; right: auto; bottom: auto; width: clamp(64px, 7vw, 96px); height: clamp(64px, 7vw, 96px);
  opacity: 1; transform: translate(-50%, -50%); background: rgba(10, 10, 11, 0.45);
}
.tile .tile-cue-lg svg { width: 38%; height: 38%; margin-left: 6%; }
.tile:hover .tile-cue-lg, .tile:focus-visible .tile-cue-lg { transform: translate(-50%, -50%) scale(1.06); }
.lb-media.is-embed { border: 0; }
.tile-badge {
  position: absolute; left: 12px; top: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  background: rgba(10, 10, 11, 0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font: 500 11px/1 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase;
}

/* ---------- featured projects ---------- */
.feature {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 72px); align-items: start;
  padding-block: clamp(40px, 6vw, 88px); border-top: 1px solid var(--line);
}
.feature:first-child { padding-top: 0; border-top: 0; }
.feature:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
.feature:nth-child(even) .feature-media { order: 2; }
.feature-body { position: sticky; top: calc(var(--header-h) + 28px); }
.feature-title {
  margin: 14px 0 20px;
  font: 800 clamp(34px, 4.2vw, 70px)/0.92 var(--font-display); font-stretch: 118%; letter-spacing: -0.025em; text-transform: uppercase;
}
.feature-summary { margin-bottom: 24px; font-size: clamp(16px, 1.1vw, 18px); }
.meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px;
  margin-bottom: 24px; padding-top: 20px; border-top: 1px solid var(--line);
}
.meta .wide { grid-column: 1 / -1; }
.meta dt { margin-bottom: 4px; font: 500 11px/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.meta dd { font-size: 14.5px; line-height: 1.5; color: var(--fg-2); }
.feature-note {
  margin-bottom: 24px; padding: 14px 16px; border-left: 2px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-soft); font-size: 14.5px; line-height: 1.55; color: var(--fg-2);
}
.feature-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.feature-thumbs.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-thumbs.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-thumbs .tile { border-radius: 4px; }
.feature-thumbs .tile-cue { width: 34px; height: 34px; right: 8px; bottom: 8px; }
.feature-extra { margin-top: clamp(36px, 4vw, 56px); padding-top: clamp(24px, 3vw, 36px); border-top: 1px solid var(--line); }
.feature-extra-title { font: 700 clamp(20px, 2vw, 28px)/1.1 var(--font-display); font-stretch: 118%; letter-spacing: -0.01em; text-transform: uppercase; }
.feature-extra-text { max-width: 62ch; margin: 10px 0 18px; font-size: 15px; line-height: 1.55; color: var(--fg-2); }
.feature-extra .feature-thumbs { margin: 0 0 12px; }
.feature-extra-lead { margin-bottom: 12px; }
.feature-extra-highlight .feature-extra-title { font-size: clamp(26px, 2.8vw, 38px); margin-bottom: 18px; }
.feature-extra-location { margin: -10px 0 18px; font: 500 12px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.feature-extras-intro { margin-top: clamp(36px, 4vw, 56px); padding-top: clamp(24px, 3vw, 36px); border-top: 1px solid var(--line); }
.feature-extras-intro .feature-extra-title { font: 500 12px/1.4 var(--font-mono); letter-spacing: 0.08em; color: var(--accent); }
.feature-extras-intro .feature-extra-text { margin-bottom: 0; font-size: 16px; color: var(--fg); }
.feature-extras-intro + .feature-extra { margin-top: clamp(24px, 3vw, 36px); padding-top: 0; border-top: 0; }
.thumb-label { display: block; margin-top: 8px; font: 500 11px/1.4 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
@media (max-width: 1000px) {
  .feature, .feature:nth-child(even) { grid-template-columns: 1fr; }
  .feature:nth-child(even) .feature-media { order: 0; }
  .feature-body { position: static; }
}

/* ---------- cards / masonry ---------- */
.masonry { columns: 3 300px; column-gap: clamp(18px, 2.2vw, 32px); }
.masonry > * { break-inside: avoid; margin-bottom: clamp(32px, 3.4vw, 52px); }
.masonry > .span-all { column-span: all; margin-top: clamp(8px, 1.5vw, 20px); }
.masonry > .span-all:first-child { margin-top: 0; }
.gallery-stack { display: grid; gap: clamp(20px, 2.4vw, 32px); }
.gallery-stack > .masonry { margin-bottom: calc(clamp(20px, 2.4vw, 32px) * -1); }
.gallery-row { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
@media (max-width: 900px) { .gallery-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.masonry-sm { columns: 4 230px; }
.masonry-sm > * { margin-bottom: clamp(20px, 2.4vw, 32px); }
.card-body { padding-top: 16px; }
.card-title { font: 600 18px/1.3 var(--font-body); letter-spacing: -0.01em; }
.card-meta { margin-top: 5px; font: 500 11.5px/1.4 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.card-text { margin-top: 8px; max-width: 62ch; font-size: 14.5px; line-height: 1.55; color: var(--fg-2); }
.card-wide .card-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 4px 32px; }
.card-wide .card-text { margin-top: 0; grid-row: 1 / 3; grid-column: 2; }
@media (max-width: 700px) { .card-wide .card-body { grid-template-columns: 1fr; } .card-wide .card-text { grid-row: auto; grid-column: auto; margin-top: 8px; } }
.card-split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 48px); align-items: end; }
.card-split .card-body { padding: 0 0 4px; }
.card-split .card-title { font: 800 clamp(26px, 2.8vw, 44px)/0.98 var(--font-display); font-stretch: 115%; letter-spacing: -0.02em; text-transform: uppercase; }
.card-split .card-meta { margin-top: 12px; }
.card-split .card-text { margin-top: 14px; font-size: 15.5px; }
.text-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; padding-bottom: 3px;
  border-bottom: 1px solid var(--line-2); text-decoration: none; font-size: 14.5px; font-weight: 500; transition: color 0.2s, border-color 0.2s;
}
.text-link:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 800px) { .card-split { grid-template-columns: 1fr; } .card-split .card-body { padding-top: 12px; } }
.mini-caption { margin-top: 10px; font: 500 11.5px/1.4 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }

/* ---------- social ---------- */
.social-lead {
  max-width: 34ch; margin-bottom: clamp(28px, 3.5vw, 52px);
  font: 600 clamp(22px, 2.4vw, 36px)/1.2 var(--font-display); font-stretch: 105%; letter-spacing: -0.01em;
}
.social-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3vw, 44px) clamp(14px, 2vw, 28px); }
.social-card .card-title { margin-top: 14px; }
.views {
  position: absolute; left: 14px; bottom: 14px; z-index: 2; display: grid; gap: 4px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}
.views-num { font: 800 clamp(30px, 3.4vw, 54px)/0.9 var(--font-display); font-stretch: 112%; letter-spacing: -0.02em; }
.views-label { font: 500 11px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); }
@media (max-width: 900px) and (min-width: 701px) { .social-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .social-grid {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 76%;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 14px; scroll-padding-inline: var(--gutter);
    scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  }
  .social-card { scroll-snap-align: start; }
}

/* ---------- personal ---------- */
.subhead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin: clamp(52px, 6vw, 88px) 0 clamp(20px, 2.4vw, 32px); padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.section-head + .subhead { margin-top: 0; }
.subhead h3 { font: 700 clamp(20px, 2vw, 28px)/1.1 var(--font-display); font-stretch: 118%; text-transform: uppercase; letter-spacing: -0.01em; }
.subhead span { font: 500 12px/1 var(--font-mono); color: var(--accent); }
.subhead-text { max-width: 64ch; margin: -8px 0 clamp(20px, 2.4vw, 32px); font-size: 15px; color: var(--fg-2); }
.gallery-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 32px); align-items: start; }
@media (max-width: 700px) { .gallery-2 { grid-template-columns: 1fr; } }
.scan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); }
@media (max-width: 700px) { .scan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- about ---------- */
.about-grid {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 96px); align-items: start;
}
.facts { border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 13ch minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { font: 500 11px/1.8 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.facts dd { font-size: 15px; line-height: 1.55; color: var(--fg-2); }
.about-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.side-title { margin-bottom: 10px; font: 500 12px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.timeline li { display: grid; grid-template-columns: 17ch minmax(0, 1fr); gap: 2px 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline .period { grid-row: 1 / 3; padding-top: 3px; font: 500 12px/1.4 var(--font-mono); color: var(--accent); }
.timeline .role { font-weight: 600; font-size: 16px; line-height: 1.35; }
.timeline .org { font-size: 14px; color: var(--fg-2); }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .timeline li { grid-template-columns: 1fr; }
  .timeline .period { grid-row: auto; padding-top: 0; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- contact ---------- */
.contact { padding-bottom: clamp(96px, 12vw, 180px); }
.contact-heading {
  max-width: 13ch; margin: 20px 0 28px;
  font: 800 clamp(44px, 8.4vw, 144px)/0.88 var(--font-display); font-stretch: 125%; letter-spacing: -0.035em; text-transform: uppercase;
}
.contact-text { max-width: 52ch; margin-bottom: 36px; font-size: clamp(16px, 1.2vw, 19px); color: var(--fg-2); }
.contact-email {
  display: inline-flex; align-items: center; gap: 0.3em; max-width: 100%;
  padding-bottom: 8px; border-bottom: 2px solid var(--accent); text-decoration: none; overflow-wrap: anywhere;
  font: 600 clamp(22px, 3.6vw, 56px)/1.1 var(--font-display); font-stretch: 105%; letter-spacing: -0.02em;
  transition: color 0.2s;
}
.contact-email svg { width: 0.8em; height: 0.8em; transition: transform 0.3s var(--ease); }
.contact-email:hover { color: var(--accent); }
.contact-email:hover svg { transform: translate(3px, -3px); }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 44px; }
.contact-links a {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-2); text-decoration: none; font-size: 15px; transition: color 0.2s, box-shadow 0.2s;
}
.contact-links a:hover { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px;
  max-width: var(--maxw); margin: 0 auto; padding: 28px var(--gutter) 36px; border-top: 1px solid var(--line);
  font: 400 12.5px/1.5 var(--font-mono); color: var(--fg-3);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--fg); }

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #070708; color: var(--fg);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
}
.lightbox:not([open]) { display: none; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.7); }
.lightbox[open] { animation: lb-in 0.35s var(--ease); }
@keyframes lb-in { from { opacity: 0; } }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--gutter); }
.lb-count { font: 500 12px/1 var(--font-mono); letter-spacing: 0.08em; color: var(--fg-3); }
.lb-close {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.07); cursor: pointer; font: 500 12px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  transition: background-color 0.2s, color 0.2s;
}
.lb-close:hover { background: var(--accent); color: var(--accent-ink); }
.lb-stage { container-type: size; display: grid; place-items: center; min-height: 0; padding: 0 var(--gutter); }
.lb-media {
  width: min(100cqw, 100cqh * var(--ar, 1.7778)); height: auto; aspect-ratio: var(--ar, 1.7778);
  border-radius: 4px; background: #000; object-fit: contain;
}
.lb-media.is-loading { background: var(--bg-2); }
.lb-info {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  max-width: var(--maxw); width: 100%; margin: 0 auto; padding: 16px var(--gutter) max(20px, env(safe-area-inset-bottom));
}
.lb-title { font: 700 clamp(18px, 1.8vw, 24px)/1.2 var(--font-display); font-stretch: 112%; text-transform: uppercase; }
.lb-caption { margin-top: 6px; max-width: 80ch; font-size: 14.5px; line-height: 1.5; color: var(--fg-2); }
.lb-caption:empty { display: none; }
.lb-arrows { display: flex; gap: 8px; flex: none; }
.lb-arrows[hidden] { display: none; }
.lb-nav {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; cursor: pointer; transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.lb-nav:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lb-nav svg { width: 20px; height: 20px; }
html.lb-open { overflow: hidden; }

/* ==========================================================================
   CV page
   ========================================================================== */
.cv-page { max-width: 1120px; margin: 0 auto; padding: calc(var(--header-h) + clamp(24px, 4vw, 56px)) var(--gutter) clamp(64px, 8vw, 120px); }
.cv-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.link-back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 14px; color: var(--fg-2); transition: color 0.2s; }
.link-back:hover { color: var(--accent); }
.cv-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cv-actions .btn { min-height: 42px; padding: 0 18px; font-size: 14px; }

.cv-sheet {
  padding: clamp(24px, 5.5vw, 72px); border-radius: 8px;
  background: var(--paper); color: var(--ink); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
  font-size: 15px; line-height: 1.55; color-scheme: light;
}
.cv-sheet a { color: var(--teal); text-decoration: none; }
.cv-sheet a:hover { text-decoration: underline; }
.cv-sheet ::selection { background: var(--teal); color: #fff; }
.cv-name { font: 800 clamp(38px, 6vw, 72px)/0.9 var(--font-display); font-stretch: 120%; letter-spacing: -0.03em; text-transform: uppercase; color: var(--teal); }
.cv-role { margin-top: 12px; font-weight: 600; font-size: 17px; }
.cv-contact { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 12px; font-size: 13.5px; color: var(--ink-2); }
.cv-contact li:not(:last-child)::after { content: '|'; margin: 0 10px; color: #b8bcbe; }
.cv-block h2 {
  margin: 36px 0 16px; padding-bottom: 8px; border-bottom: 1.5px solid var(--teal);
  font: 700 13px/1 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal);
}
.cv-about { font-size: 15.5px; }
.cv-cols { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 0 clamp(28px, 4vw, 56px); }
.cv-job + .cv-job { margin-top: 20px; }
.cv-job h3, .cv-item h3 { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.cv-org { margin-top: 2px; font-size: 13.5px; color: var(--ink-2); }
.cv-sep { margin: 0 6px; color: #b8bcbe; }
.cv-period { color: var(--teal); font-weight: 700; font-size: 13.5px; }
.cv-job ul { margin-top: 8px; padding-left: 18px; list-style: square; }
.cv-job li { margin-bottom: 4px; font-size: 14.5px; }
.cv-job li::marker { color: var(--teal); }
.cv-item + .cv-item { margin-top: 14px; }
.cv-item p { font-size: 14.5px; color: var(--ink); }
.cv-item p.cv-period { margin-bottom: 2px; }
.cv-item h3 + p { color: var(--ink-2); }
.cv-block:first-child h2 { margin-top: 36px; }
@media (max-width: 800px) { .cv-cols { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.nf { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 80px var(--gutter); }

/* ---------- print (CV) — one A4 page, also used by tools/cv-pdf.mjs ---------- */
@media print {
  @page { size: A4; margin: 11mm 12mm; }
  :root { color-scheme: light; }
  html, body { background: #fff !important; color: #000; }
  .site-header, .site-footer, .cv-toolbar, .skip-link { display: none !important; }
  .cv-page { max-width: none; margin: 0; padding: 0; }
  .cv-sheet { padding: 0; border-radius: 0; box-shadow: none; background: #fff; font-size: 8.3pt; line-height: 1.38; }
  .cv-sheet a { color: var(--teal); }
  .cv-name { padding-top: 2pt; font-size: 27pt; line-height: 1; }
  .cv-role { margin-top: 5pt; font-size: 10.5pt; }
  .cv-contact { margin-top: 4pt; font-size: 7.8pt; }
  .cv-contact li:not(:last-child)::after { margin: 0 6pt; }
  .cv-block h2 { margin: 11pt 0 6pt; padding-bottom: 3pt; font-size: 7.8pt; border-bottom-width: 1pt; }
  .cv-block:first-child h2 { margin-top: 11pt; }
  .cv-about { font-size: 8.3pt; }
  .cv-cols { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 0 18pt; }
  .cv-job + .cv-job { margin-top: 7pt; }
  .cv-job h3, .cv-item h3 { font-size: 8.7pt; }
  .cv-org, .cv-period { font-size: 7.8pt; }
  .cv-job ul { margin-top: 2pt; padding-left: 11pt; }
  .cv-job li { margin-bottom: 1pt; font-size: 8.1pt; }
  .cv-item + .cv-item { margin-top: 6pt; }
  .cv-item p { font-size: 8.1pt; }
  .cv-job, .cv-item { break-inside: avoid; }
}

