/* ============================================================================
   Portfolio, kusa identity. Warm paper, forest green ink, the four-colour
   dot language, squircle icons, Space Grotesk / JetBrains Mono / Source
   Sans Pro. Self-contained: data.js, CV, logo and fonts live in assets/.
   ========================================================================= */
/* Space Grotesk (300 to 700) for names and headings, as on the brand banner;
   JetBrains Mono for small labels; Source Sans Pro for running text. */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/Space_Grotesk/SpaceGrotesk-VariableFont_wght.ttf') format('truetype');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrains_Mono/JetBrainsMono-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans Pro';
  src: url('../fonts/Source_Sans_Pro/SourceSansPro-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans Pro';
  src: url('../fonts/Source_Sans_Pro/SourceSansPro-Semibold.otf') format('opentype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans Pro';
  src: url('../fonts/Source_Sans_Pro/SourceSansPro-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Brand constants: never flip with the theme. */
  --brand-paper: #f2efe6;
  --brand-ink: #14201a;

  /* Light theme (default). --ink / --ink-2 / --muted are text colours. */
  --paper: #f2efe6;
  --paper-2: #e8e4d8;
  --paper-3: #dcd7c9;
  --surface: #ffffff;
  --ink: #14201a;
  --ink-2: #2b3b32;
  --muted: #6f7d74;
  --line: rgba(20, 32, 26, 0.12);
  --strong: #14201a;
  --strong-hover: #2b3b32;
  --on-strong: #f2efe6;
  --frame: #14201a;
  --switch-bg: #14201a;
  --code-bg: #14201a;
  --header-bg: rgba(242, 239, 230, 0.84);
  --menu-bg: rgba(242, 239, 230, 0.97);
  --warn-bg: #fdf6ef;
  --shadow-rgb: 20, 32, 26;
  --wave-opacity: 0.38;
  --wave-opacity-phone: 0.3;
  color-scheme: light;
  --orange: #f26b4f;
  --yellow: #f2b33d;
  --teal: #3fc2a8;
  --blue: #4f86f2;
  --accent: var(--teal);

  --font: 'Source Sans Pro', 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --gutter: clamp(16px, 3.3vw, 48px);
  --header-h: 64px;
  --radius: 16px;
  --squircle: 36px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Dark theme: the brand's forest ink becomes the page. Applied by
   assets/js/theme.js from the saved choice or the system setting. */
:root[data-theme="dark"] {
  --paper: #14201a;
  --paper-2: #22312a;
  --paper-3: #2d3e35;
  --surface: #1b2821;
  --ink: #ecebe4;
  --ink-2: #c3cbc4;
  --muted: #8d9b92;
  --line: rgba(242, 239, 230, 0.12);
  --strong: #f2efe6;
  --strong-hover: #ffffff;
  --on-strong: #14201a;
  --frame: #0a110d;
  --switch-bg: #0a110d;
  --code-bg: #0b120e;
  --header-bg: rgba(20, 32, 26, 0.82);
  --menu-bg: rgba(20, 32, 26, 0.97);
  --warn-bg: #2b241d;
  --shadow-rgb: 0, 0, 0;
  --wave-opacity: 0.34;
  --wave-opacity-phone: 0.26;
  color-scheme: dark;
}
/* Colours glide when the theme is switched (theme.js sets the class briefly). */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after {
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease) !important;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  /* A stacking context so the fixed dot wave can sit behind every section. */
  position: relative;
  z-index: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video, iframe { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn-accent { background: var(--strong); color: var(--on-strong); }
.btn-accent:hover { background: var(--strong-hover); }
.btn:active { transform: translateY(1px); }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================================
   Header.
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav {
  height: 100%;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-home {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2);
  color: var(--ink);
  transition: background 0.2s var(--ease), transform 0.3s var(--ease);
}
.brand-home svg { width: 18px; height: 18px; }
.brand:hover .brand-home { background: var(--paper-3); }
.brand:active .brand-home { transform: scale(0.94); }
.brand-name { font-family: var(--font-display); font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.brand-role { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-left: 6px; }
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 16px;
  color: var(--ink-2);
}
.nav-links a { transition: color 0.15s var(--ease); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-links .nav-cv { color: var(--on-strong); font-weight: 600; }
.nav-links .nav-cv:hover { color: var(--on-strong); }
.nav-toggle {
  display: none;
  width: 32px; height: 32px;
  flex-direction: column; justify-content: center; gap: 5px;
  margin-left: auto;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin-inline: auto; transition: transform 0.2s var(--ease), opacity 0.2s var(--ease); }
.theme-toggle {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2);
  color: var(--ink);
  transition: background 0.2s var(--ease), transform 0.3s var(--ease);
}
.theme-toggle:hover { background: var(--paper-3); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ============================================================================
   Reel. Lockup above, a dot wave behind, the video in a dark green squircle.
   ========================================================================= */
.reel {
  --reel-w: min(1200px, 86vw, calc((100vh - var(--header-h) - 250px) * 16 / 9));
  position: relative;
  overflow-x: clip;
  padding: 26px 0 8px;
}
.dot-wave {
  /* Pinned to the viewport: the wave stays behind the page while you scroll
     and its phase follows the scroll position. */
  position: fixed;
  left: 50%;
  top: 50%;
  width: max(1600px, 110vw);
  aspect-ratio: 1600 / 440;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
  opacity: var(--wave-opacity);
  /* Opacity only: a transform keyframe would override the centring above. */
  animation: fadeIn 1.4s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } }
.dot-wave svg { width: 100%; height: 100%; }

.reel-stage {
  position: relative;
  z-index: 1;
  width: var(--reel-w);
  margin-inline: auto;
  animation: rise 0.9s 0.08s var(--ease) both;
}
.reel-card {
  position: relative;
  padding: 14px;
  border-radius: var(--squircle);
  background: var(--frame);
  box-shadow: 0 30px 70px rgba(var(--shadow-rgb), 0.28);
  transition: opacity 0.34s var(--ease), transform 0.34s var(--ease);
  animation: cardIn 0.4s var(--ease) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: none; }
}
.reel-card.is-leaving { opacity: 0; transform: scale(0.985); }
.reel-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--squircle) - 14px);
  overflow: hidden;
  background: #000;
}
.reel-iframe, .reel-click-overlay, .reel-still, .reel-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.reel-poster { object-fit: cover; }
.reel-click-overlay, .reel-still {
  pointer-events: none;
  display: grid; place-items: center;
  transition: opacity 0.35s var(--ease);
}
.reel-click-overlay.is-hidden { opacity: 0; }
.play-button {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(242, 239, 230, 0.92);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  display: grid; place-items: center;
  color: var(--brand-ink);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.play-button svg { width: 28px; height: 28px; margin-left: 3px; }
.reel-card:hover .play-button { transform: scale(1.06); background: #fff; }
.reel-empty { padding: 80px var(--gutter); color: var(--muted); text-align: center; }

.reel-fs {
  position: absolute;
  top: 28px; right: 28px;
  z-index: 3;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(20, 32, 26, 0.6);
  border: 1px solid rgba(242, 239, 230, 0.25);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  color: var(--brand-paper);
  opacity: 0;
  transition: opacity 0.2s var(--ease), background 0.2s var(--ease);
}
.reel-fs svg { width: 18px; height: 18px; }
.reel-fs .fs-exit { display: none; }
.reel-card:hover .reel-fs, .reel-fs:focus-visible { opacity: 1; }
.reel-fs:hover { background: rgba(20, 32, 26, 0.85); }
.reel-card:fullscreen {
  width: 100%; height: 100%;
  padding: 0;
  border-radius: 0;
  transform: none;
  background: #000;
}
.reel-card:fullscreen .reel-media { height: 100%; aspect-ratio: auto; border-radius: 0; }
.reel-card:fullscreen .reel-fs { opacity: 1; top: 14px; right: 14px; }
.reel-card:fullscreen .reel-fs .fs-enter { display: none; }
.reel-card:fullscreen .reel-fs .fs-exit { display: block; }

.now-playing {
  display: none;
  position: absolute;
  left: 40px;
  bottom: 96px;
  z-index: 3;
  max-width: min(640px, calc(100% - 80px));
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.8);
}
.reel-card:fullscreen .now-playing:not([hidden]) { display: block; }
.np-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--yellow);
}
.np-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(242, 179, 61, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(242, 179, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 179, 61, 0); }
}
.np-title { margin-top: 6px; font-family: var(--font-display); font-size: 26px; font-weight: 500; line-height: 1.15; }
.np-action { margin-top: 10px; font-size: 15px; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.5); padding-bottom: 2px; }
.np-action:hover { color: var(--yellow); border-color: var(--yellow); }

/* Segmented control under the card. */
.reel-switch {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 2px;
  width: max-content;
  margin: 0 auto 18px;
  padding: 4px;
  border-radius: 999px;
  background: var(--switch-bg);
  animation: rise 0.9s 0.04s var(--ease) both;
}
.reel-tab {
  padding: 8px 20px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: rgba(242, 239, 230, 0.6);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.reel-tab:hover { color: var(--brand-paper); }
.reel-tab.is-active { background: var(--brand-paper); color: var(--brand-ink); }

/* Chapter row: as wide as the reel; each card carries a palette colour. */
.chapters-strip {
  position: relative;
  z-index: 1;
  padding: 20px 0 12px;
  animation: rise 0.9s 0.2s var(--ease) both;
  transition: opacity 0.34s var(--ease);
}
.chapters-strip.is-leaving { opacity: 0; }
.chapters-inner { width: var(--reel-w); margin-inline: auto; }
.chapters-head { padding: 0; }
.chapters {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 14px 0 24px;
  scrollbar-width: none;
}
.chapters::-webkit-scrollbar { display: none; }
.chapter {
  position: relative;
  flex: 0 0 calc((var(--reel-w) - 4 * 14px) / 5);
  scroll-snap-align: start;
}
.chapter-jump {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
  text-align: left;
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.08), 0 8px 20px rgba(var(--shadow-rgb), 0.08);
  transition: transform 0.45s var(--ease), filter 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.chapter-jump:hover { box-shadow: 0 2px 4px rgba(var(--shadow-rgb), 0.08), 0 14px 32px rgba(var(--shadow-rgb), 0.16); }
.chapters.has-active .chapter:not(.is-active) .chapter-jump { transform: scale(0.88); filter: saturate(0.5) brightness(0.9); opacity: 0.7; }
.chapters.has-active .chapter:not(.is-active):hover .chapter-jump { transform: scale(0.92); opacity: 0.9; }
.chapter.is-active .chapter-jump { box-shadow: 0 0 0 3px var(--dot), 0 16px 34px rgba(var(--shadow-rgb), 0.2); }
.chapter-jump img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.chapter-jump::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 32, 26, 0.85) 0%, rgba(20, 32, 26, 0.1) 55%, rgba(20, 32, 26, 0) 100%);
}
.chapter-jump:hover img { transform: scale(1.04); }
.chapter-time {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(20, 32, 26, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.88);
}
.chapter-title {
  position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 500; line-height: 1.3;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chapter-full {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(242, 239, 230, 0.92);
  font-size: 12px; font-weight: 600;
  color: var(--brand-ink);
  opacity: 0;
  transition: opacity 0.15s var(--ease), background 0.15s var(--ease);
}
.chapter:hover .chapter-full, .chapter.is-active .chapter-full, .chapter-full:focus-visible { opacity: 1; }
.chapter-full:hover { background: #fff; }
@media (hover: none) {
  .chapter-full { opacity: 1; }
}

/* ============================================================================
   Explore: the three sections as app icons, like the plugin row. Each
   squircle holds the section's thumbnail, cropped to the tile.
   ========================================================================= */
.explore-inner { max-width: 1440px; margin-inline: auto; padding: 44px var(--gutter) 88px; }
.apps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px 64px;
}
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 240px;
  text-align: center;
  animation: rise 0.8s calc(0.2s + var(--i, 0) * 0.08s) var(--ease) both;
}
.app-icon {
  width: 168px; height: 168px;
  border-radius: 44px;
  overflow: hidden;
  background: var(--frame);
  margin-bottom: 14px;
  box-shadow: 0 2px 4px rgba(var(--shadow-rgb), 0.1), 0 14px 34px rgba(var(--shadow-rgb), 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease); }
.app:hover .app-icon { transform: translateY(-6px) scale(1.02); box-shadow: 0 4px 8px rgba(var(--shadow-rgb), 0.1), 0 26px 50px rgba(var(--shadow-rgb), 0.24); }
.app:hover .app-icon img { transform: scale(1.06); }
.app-name { font-family: var(--font-display); font-size: 21px; font-weight: 400; letter-spacing: -0.015em; white-space: nowrap; }
.app-sub {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}
.app-sub::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }

/* ============================================================================
   Footer.
   ========================================================================= */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: 1440px;
  margin-inline: auto;
  padding: 32px var(--gutter) 40px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 32px;
  align-items: start;
}
.footer-email { display: block; margin-top: 8px; font-size: 18px; }
.footer-email:hover { color: var(--blue); }
.footer-phone { margin-top: 4px; font-size: 15px; color: var(--muted); }
.footer-social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 15px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.social svg { width: 16px; height: 16px; flex-shrink: 0; }
.social:hover { background: var(--strong); color: var(--on-strong); transform: translateY(-1px); }
.footer-copy { font-size: 14px; color: var(--muted); padding-top: 26px; }

/* ============================================================================
   Section pages: title, filter chips, three-column cards.
   ========================================================================= */
.section { max-width: 1440px; margin-inline: auto; padding: 44px var(--gutter) 80px; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 40px;
  margin-bottom: 36px;
}
.section-head h1 { font-family: var(--font-display); font-size: clamp(36px, 3.6vw, 52px); font-weight: 300; letter-spacing: -0.03em; line-height: 1.02; }
.section-meta { margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500;
  color: var(--ink-2);
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--strong); color: var(--on-strong); border-color: var(--strong); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px 28px;
}
.card[hidden] { display: none; }
.card { transition: transform 0.35s var(--ease); }
.card:hover { transform: translateY(-4px); }
.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
  display: grid; place-items: center;
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.08), 0 10px 26px rgba(var(--shadow-rgb), 0.1);
}
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.card-media.is-playable { cursor: pointer; }
.card-media .play-button { width: 52px; height: 52px; }
.card-media .play-button svg { width: 20px; height: 20px; }
.card-media.is-playable:hover img { transform: scale(1.03); }
.card-title { margin-top: 16px; font-family: var(--font-display); font-size: 20px; font-weight: 500; line-height: 1.25; letter-spacing: -0.015em; }
.card-role { margin-top: 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.card-desc { margin-top: 8px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tags li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  color: var(--ink-2);
}
.tags li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.card-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.card-link { font-size: 15px; font-weight: 600; color: var(--blue); }
.card-link:hover { color: var(--ink); }
:root[data-theme="dark"] .card-link { color: #86aaf7; }

/* ============================================================================
   Video modal.
   ========================================================================= */
.video-modal {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(20, 32, 26, 0.92);
  display: grid; place-items: center;
  padding: var(--gutter);
  animation: fade 0.2s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.video-modal-body { width: min(1200px, 100%); }
.video-modal-title { font-weight: 600; margin-bottom: 12px; color: rgba(242, 239, 230, 0.8); }
.video-modal-frame { aspect-ratio: 16 / 9; width: 100%; background: #000; border-radius: var(--radius); overflow: hidden; }
.video-modal-frame iframe, .video-modal-frame video { width: 100%; height: 100%; }
.video-modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(242, 239, 230, 0.15);
  color: var(--brand-paper);
  display: grid; place-items: center;
}
.video-modal-close svg { width: 20px; height: 20px; }
.video-modal-close:hover { background: rgba(242, 239, 230, 0.3); }
.file-warning { margin: 0; padding: 10px var(--gutter); background: var(--orange); color: #fff; font-size: 14px; text-align: center; }

/* ============================================================================
   Responsive.
   ========================================================================= */
/* Header: the full bar needs about 1,170 px with the role label and about
   950 px without it. Hide the label first, then switch to the menu button. */
@media (max-width: 1199px) {
  .brand-role { display: none; }
}
@media (max-width: 1023px) {
  .nav-toggle { display: flex; margin-left: 4px; }
  .theme-toggle { margin-left: auto; }
  .nav-links {
    position: absolute;
    top: var(--header-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--menu-bg);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-header.is-open .nav-links { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .nav-links .nav-cv { margin-top: 12px; justify-content: center; border-bottom: 0; }
  .site-header.is-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.is-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
@media (max-width: 1023px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 20px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-copy { grid-column: 1 / -1; padding-top: 8px; }
  .apps { gap: 32px 40px; }
  .app { width: 160px; }
  .app-icon { width: 136px; height: 136px; border-radius: 36px; }
}
@media (max-width: 720px) {
  :root { --header-h: 56px; --squircle: 24px; }
  .nav { gap: 12px; }
  .brand-name { font-size: 18px; }
  .brand { gap: 10px; }
  .brand-home { width: 34px; height: 34px; }
  .theme-toggle { width: 34px; height: 34px; }
  .reel { --reel-w: 92vw; padding-top: 16px; }
  .dot-wave { width: 1200px; opacity: var(--wave-opacity-phone); }
  .reel-card { padding: 8px; }
  .reel-media { border-radius: calc(var(--squircle) - 8px); }
  .play-button { width: 56px; height: 56px; }
  .play-button svg { width: 22px; height: 22px; }
  .reel-fs { top: 16px; right: 16px; width: 36px; height: 36px; opacity: 1; }
  .now-playing { left: 20px; bottom: 64px; }
  .np-title { font-size: 18px; }
  .reel-switch { margin: 0 auto 14px; }
  .reel-tab { padding: 7px 16px; font-size: 14px; }
  .chapters-strip { padding-top: 14px; }
  .chapter { flex-basis: calc((var(--reel-w) - 14px) / 2); }
  .chapter-full { padding: 3px 7px; }
  .chapter-full-text { display: none; }
  .chapter-title { font-size: 13px; left: 10px; right: 10px; bottom: 8px; }
  .chapter-time { top: 8px; left: 8px; }
  .explore-inner { padding: 32px var(--gutter) 64px; }
  .apps { gap: 20px 12px; flex-wrap: nowrap; }
  .app { width: calc((100% - 24px) / 3); gap: 2px; }
  .app-icon { width: 92px; height: 92px; border-radius: 26px; margin-bottom: 10px; }
  .app-name { font-size: 15px; line-height: 1.2; white-space: normal; }
  .app-sub { font-size: 10px; }
  .grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
