/* ==========================================================================
   Fai Cheng Interactive Portfolio — Material & Tactile Design System
   Inspired by ikeacrisp.com · Tailored for Senior Producer & AI / FDE (HK)
   Themes: Light (Studio Alabaster) · Dark (UV Control Room) · Retro (CRT)
   ========================================================================== */

@font-face {
  font-family: "MD Thermochrome";
  src: url("./fonts/MDThermochrome0.4-Regular-Trial.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MD Thermochrome";
  src: url("./fonts/MDThermochrome0.4-Medium-Trial.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MD Thermochrome";
  src: url("./fonts/MDThermochrome0.4-Semibold-Trial.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PP Supply Mono";
  src: url("./fonts/PPSupplyMono-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: oklch(96.6% 0.004 245);
  --bg-elevated: oklch(98.5% 0.003 245);
  --surface: oklch(93.8% 0.006 245);
  --surface-hover: oklch(91.5% 0.008 246);
  --text: oklch(17.5% 0.014 250);
  --muted: oklch(48.5% 0.013 248);
  --line: oklch(18% 0.015 250 / 0.1);
  --line-strong: oklch(18% 0.015 250 / 0.22);
  --accent: oklch(61% 0.125 206);
  --accent-soft: oklch(61% 0.125 206 / 0.14);
  --status-live: oklch(56% 0.135 152);
  --selection-bg: oklch(84% 0.12 195 / 0.45);
  --selection-text: oklch(16% 0.014 250);

  --font-sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
  --font-mono: "Azeret Mono", ui-monospace, SFMono-Regular, monospace;
  --font-retro: "Silkscreen", "Azeret Mono", monospace;

  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snappy: cubic-bezier(0.2, 0, 0, 1);
}

[data-theme="dark"] {
  --bg: oklch(13.5% 0.011 255);
  --bg-elevated: oklch(17.5% 0.012 255);
  --surface: oklch(20.5% 0.013 255);
  --surface-hover: oklch(24% 0.015 255);
  --text: oklch(94.5% 0.006 245);
  --muted: oklch(63% 0.011 250);
  --line: oklch(95% 0.006 245 / 0.1);
  --line-strong: oklch(95% 0.006 245 / 0.22);
  --accent: oklch(76% 0.13 200);
  --accent-soft: oklch(76% 0.13 200 / 0.14);
  --status-live: oklch(72% 0.15 152);
  --selection-bg: oklch(76% 0.14 200 / 0.35);
  --selection-text: oklch(96% 0.005 245);
}

[data-theme="retro"] {
  --bg: #080a16;
  --bg-elevated: #0e1326;
  --surface: rgba(0, 246, 255, 0.07);
  --surface-hover: rgba(0, 246, 255, 0.14);
  --text: #00f6ff;
  --muted: rgba(186, 248, 255, 0.72);
  --line: rgba(0, 246, 255, 0.2);
  --line-strong: rgba(0, 246, 255, 0.45);
  --accent: #00ff86;
  --accent-soft: rgba(0, 255, 134, 0.14);
  --status-live: #00ff86;
  --selection-bg: rgba(206, 127, 255, 0.42);
  --selection-text: #f5f9ff;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

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

html {
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 280ms ease, color 220ms ease;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: var(--text);
  background: transparent;
  min-height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
}

body.page-404 {
  overflow-y: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Retro CRT Broadcast Monitor Atmosphere
   ========================================================================== */
[data-theme="retro"] {
  background-color: #080a16;
  background-image:
    radial-gradient(rgba(0, 246, 255, 0.14) 1px, transparent 1px),
    radial-gradient(rgba(0, 255, 134, 0.08) 1px, transparent 1px);
  background-size: 28px 28px, 56px 56px;
  background-position: 0 0, 14px 14px;
}

[data-theme="retro"] body {
  font-family: var(--font-mono);
  font-size: 13px;
  text-shadow: 0 0 8px rgba(0, 246, 255, 0.28), 0 0 2px rgba(0, 246, 255, 0.14);
}

[data-theme="retro"] *,
[data-theme="retro"] *::before,
[data-theme="retro"] *::after {
  border-radius: 0 !important;
}

[data-theme="retro"] body::before,
[data-theme="retro"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

[data-theme="retro"] body::before {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 20, 34, 0.24) 3px,
    rgba(0, 20, 34, 0.24) 4px
  );
}

[data-theme="retro"] body::after {
  background: radial-gradient(circle at 50% 50%, transparent 62%, rgba(0, 0, 0, 0.42) 100%);
}

/* ==========================================================================
   Top Floating Chrome: Brand Logo, Segmented Nav, Theme Switcher
   ========================================================================== */
.scroll-fade {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  z-index: 15;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--bg), transparent);
}

.site-logo {
  position: fixed;
  top: 20px;
  left: 20px;
  height: 34px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg-elevated) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

[data-theme="retro"] .site-logo {
  color: var(--accent);
}

.site-logo:hover {
  border-color: var(--line-strong);
}

.site-logo-mark {
  display: block;
  flex: none;
}

.site-logo-text {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}

.v2-header {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 34px;
  z-index: 45;
  pointer-events: none;
}

.v2-header-nav {
  position: absolute;
  inset: 0;
}

.v2-toggle--sections {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
}

.v2-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: color-mix(in oklch, var(--bg-elevated) 78%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.v2-toggle-pill {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  border-radius: 7px;
  background: var(--bg-elevated);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 0.5px var(--line);
  pointer-events: none;
  transition: transform 340ms var(--ease-out-expo), width 340ms var(--ease-out-expo);
  z-index: 0;
}

[data-theme="dark"] .v2-toggle-pill {
  background: oklch(26% 0.014 255);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 0.5px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="retro"] .v2-toggle-pill {
  background: rgba(0, 246, 255, 0.18);
  box-shadow: inset 0 0 0 1px #00f6ff;
}

.v2-toggle-btn {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 0 11px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.v2-toggle-btn--icon {
  padding: 0 8px;
}

.v2-toggle-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.v2-toggle-btn:hover,
.v2-toggle-btn[aria-pressed="true"] {
  color: var(--text);
}

[data-theme="retro"] .v2-toggle-btn[aria-pressed="true"] {
  color: #00ff86;
}

/* Right Theme Switch + Retro Audio */
.v2-header-theme {
  position: absolute;
  top: 0;
  right: 0;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.retro-audio-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  transition: border-color 180ms ease, color 180ms ease, transform 120ms ease;
}

[data-theme="retro"] .retro-audio-btn {
  display: inline-flex;
}

.retro-audio-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.retro-audio-btn:active {
  transform: scale(0.94);
}

.retro-audio-btn .icon-vol-on {
  display: none;
}

.retro-audio-btn[aria-pressed="true"] .icon-vol-off {
  display: none;
}

.retro-audio-btn[aria-pressed="true"] .icon-vol-on {
  display: block;
  color: var(--accent);
}

.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg-elevated) 72%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.theme-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--bg-elevated);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
  transition: transform 300ms var(--ease-out-expo);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .theme-switch-knob {
  background: oklch(28% 0.016 255);
}

[data-theme="retro"] .theme-switch-knob {
  background: rgba(0, 246, 255, 0.22);
  box-shadow: inset 0 0 0 1px #00f6ff;
}

.theme-switch-slot {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 180ms ease;
}

.theme-switch-slot:hover,
.theme-switch-slot.is-active {
  color: var(--text);
}

[data-theme="retro"] .theme-switch-slot.is-active {
  color: #00ff86;
}

/* ==========================================================================
   Main Stage & Vertical Slides
   ========================================================================== */
.v2-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  transition:
    filter 480ms var(--ease-snappy),
    transform 480ms var(--ease-snappy),
    opacity 480ms var(--ease-snappy);
  will-change: transform, filter, opacity;
}

.v2-stage--behind {
  filter: blur(18px);
  transform: scale(0.92);
  opacity: 0.52;
  pointer-events: none;
}

.v2-stack {
  height: 100%;
  transition: transform 620ms var(--ease-out-expo);
  will-change: transform;
}

.v2-slide {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  padding: 96px 0 88px;
}

.v2-slide::-webkit-scrollbar {
  display: none;
}

.v2-slide-inner {
  margin: auto;
  width: min(540px, calc(100vw - 2rem));
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   SLIDE 0: 3D Polycarbonate Identity Card + UV Torch + Illustrated Stamps
   (Faithful ikeacrisp polycarbonate & metallic foil rendering)
   ========================================================================== */
.v2-slide--card {
  position: relative;
  overflow: hidden;
  padding: 108px 0;
}

/* Dark Mode UV Torch Backdrop over uv-backdrop.jpg */
.uv-bg {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

[data-theme="dark"] .uv-bg {
  display: block;
}

.uv-bg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.uv-bg-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 480px;
  opacity: 0;
  transform: translate3d(-9999px, -9999px, 0);
  will-change: transform, opacity;
  -webkit-mask-image: radial-gradient(
    circle 240px at 50% 50%,
    #000 0,
    rgba(0, 0, 0, 0.6) 40%,
    rgba(0, 0, 0, 0.18) 70%,
    transparent 100%
  );
  mask-image: radial-gradient(
    circle 240px at 50% 50%,
    #000 0,
    rgba(0, 0, 0, 0.6) 40%,
    rgba(0, 0, 0, 0.18) 70%,
    transparent 100%
  );
}

.uv-bg-glow-inner {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.uv-bg-bloom,
.uv-bg-lines {
  position: absolute;
  inset: 0;
  background: url("./id-card/uv-backdrop.jpg") 50% / cover no-repeat;
  will-change: transform;
}

.uv-bg-lines {
  filter: url(#uv-glow) saturate(1.2);
}

.uv-bg-bloom {
  filter: url(#uv-glow-bloom) blur(6px);
  opacity: 1;
}

.v2-card {
  width: min(100%, calc((100svh - 216px - 68px) * 350.179 / 206.378));
  margin: 0 auto;
}

.idc-enter {
  opacity: 0;
  transform: translateY(-64px) scale(0.88);
  transition: opacity 560ms cubic-bezier(0.33, 1, 0.68, 1), transform 880ms cubic-bezier(0.33, 1, 0.68, 1);
}

.idc-enter.is-ready {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.idc-wrap {
  container-type: inline-size;
  perspective: 800px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.idc-card {
  position: relative;
  width: 100%;
  aspect-ratio: 350.179 / 206.378;
  font-size: calc(100cqw / 350.179);
  cursor: pointer;
  will-change: transform;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.idc-card:focus-visible .idc-face-clip {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.idc-face {
  position: absolute;
  inset: 0;
  border-radius: 17.487em;
  user-select: none;
  -webkit-user-select: none;
}

.idc-face-back {
  transform: rotateY(180deg);
}

.idc-shadow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: var(--idc-shadow-a, 1);
  will-change: opacity;
  box-shadow:
    0 0.8cqw 1.2cqw -0.2cqw rgba(0, 0, 0, 0.16),
    0 2.6cqw 4cqw -1cqw rgba(0, 0, 0, 0.13),
    0 5.5cqw 8cqw -2.5cqw rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .idc-shadow {
  box-shadow:
    0 0.8cqw 1.2cqw -0.2cqw rgba(0, 0, 0, 0.55),
    0 2.6cqw 4cqw -1cqw rgba(0, 0, 0, 0.5),
    0 5.5cqw 8cqw -2.5cqw rgba(0, 0, 0, 0.45);
}

[data-theme="retro"] .idc-shadow {
  box-shadow: 0 0 0 2px #00f6ff, 0 12px 36px rgba(0, 246, 255, 0.18);
}

.idc-face-clip {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  clip-path: inset(0 round 17.487em);
  -webkit-clip-path: inset(0 round 17.487em);
  isolation: isolate;
}

.idc-cut {
  position: absolute;
  inset: 0;
}

.idc-face-front .idc-cut,
.idc-face-front .passport-foil {
  -webkit-mask: url("./id-card/mask/cut-front.svg") 0 0 / 100% 100% no-repeat;
  mask: url("./id-card/mask/cut-front.svg") 0 0 / 100% 100% no-repeat;
}

.idc-face-back .idc-cut,
.idc-face-back .passport-foil {
  -webkit-mask: url("./id-card/mask/cut-back.svg") 0 0 / 100% 100% no-repeat;
  mask: url("./id-card/mask/cut-back.svg") 0 0 / 100% 100% no-repeat;
}

.idc-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(116.5577deg, rgba(76, 224, 209, 0.32), rgba(76, 224, 209, 0) 56.916%),
    radial-gradient(264.84em 156.08em at 175.09em 147.33em, #dcf7ff 0, #e9eeef 100%);
}

.idc-mirror {
  position: absolute;
  inset: 0;
  transform: scaleX(-1);
}

.idc-frame4 {
  position: absolute;
  left: -217.73em;
  top: -84.79em;
  width: 779.814em;
  height: 373.205em;
  opacity: 0.2;
}

.idc-l {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.idc-i {
  position: relative;
  flex: none;
}

.idc-a {
  position: absolute;
  display: block;
}

.idc-a img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
}

.idc-glare-wrap {
  pointer-events: none;
  overflow: hidden;
  mix-blend-mode: plus-lighter;
  opacity: var(--idc-glare-a, 0);
  will-change: opacity;
  z-index: 8;
}

.idc-glare {
  position: absolute;
  inset: -10% -30%;
  transform: translateX(var(--idc-glare-x, -110%));
  background:
    linear-gradient(
      105deg,
      transparent 44%,
      hsla(0, 0%, 100%, 0.22) 48.5%,
      hsla(0, 0%, 100%, 0.36) 50%,
      hsla(0, 0%, 100%, 0.22) 51.5%,
      transparent 56%
    ),
    linear-gradient(105deg, transparent 34%, hsla(0, 0%, 100%, 0.1) 50%, transparent 66%);
  will-change: transform;
}

[data-theme="dark"] .idc-glare {
  background:
    linear-gradient(
      105deg,
      transparent 44%,
      rgba(170, 205, 255, 0.24) 48.5%,
      rgba(205, 225, 255, 0.4) 50%,
      rgba(170, 205, 255, 0.24) 51.5%,
      transparent 56%
    ),
    linear-gradient(105deg, transparent 34%, rgba(150, 190, 255, 0.1) 50%, transparent 66%);
}

.idc-edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 9;
  box-shadow: inset 0 1em 1.9em 0 hsla(0, 0%, 100%, 0.1);
}

.idc-tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
  background: #7faed7;
  mix-blend-mode: multiply;
}

[data-theme="dark"] .idc-tint {
  display: block;
}

/* UV Glow & Lines */
.idc-uv {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.003;
  will-change: opacity, filter;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  z-index: 4;
}

.idc-uv-glow,
.idc-uv-lines {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.idc-uv-glow {
  filter: blur(1.6em) brightness(1.2) saturate(1.4);
  opacity: 0.7;
}

.idc-uv-lines {
  filter: brightness(1.08) saturate(1.2);
}

[data-theme="dark"] .idc-uv-glow {
  filter: blur(0.8em) brightness(1.1) saturate(2.2);
  opacity: 0.55;
}

[data-theme="dark"] .idc-uv-lines {
  filter: saturate(2.2) contrast(1.2) brightness(1.15);
}

/* Real Micro-Scratch Texture Base + Dynamic Catch-Light */
.idc-scratch {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.idc-scratch-base,
.idc-scratch-catch {
  position: absolute;
  inset: 0;
  z-index: 6;
}

.idc-scratch-tex::before {
  position: absolute;
  inset: 0;
  content: "";
  background: url("./id-card/scratches.jpg") 50% / cover no-repeat;
}

.idc-face-back .idc-scratch-tex::before {
  transform: rotate(180deg);
}

.idc-scratch-base {
  mix-blend-mode: multiply;
  opacity: 0.4;
}

.idc-scratch-base .idc-scratch-tex::before {
  filter: invert(1) contrast(1.3);
}

.idc-scratch-catch {
  mix-blend-mode: screen;
  filter: brightness(2.4) contrast(1.25);
  opacity: 0.003;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
}

[data-theme="dark"] .idc-scratch-base {
  mix-blend-mode: screen;
  opacity: 0.4;
}

[data-theme="dark"] .idc-scratch-base .idc-scratch-tex::before {
  filter: none;
}

[data-theme="dark"] .idc-scratch-catch {
  filter: brightness(2.1) contrast(1.25);
}

/* Holographic Face Foil + Emboss Drop Shadows */
.idc-foil-glint,
.idc-foil-spec {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.idc-foil-spec {
  width: 300%;
  height: 300%;
  transform: translate(
    calc(var(--foil-sx, 0.5) * -66.667%),
    calc(var(--foil-sy, 0.5) * -66.667%)
  );
}

.idc-face-foil {
  position: absolute;
  left: 37.453em;
  top: 58.06em;
  width: 98.204em;
  height: 90.258em;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.003;
  mask: url("./id-card/fc-portrait.svg") 0 0 / 100% 100% no-repeat;
  -webkit-mask: url("./id-card/fc-portrait.svg") 0 0 / 100% 100% no-repeat;
}

.idc-face-foil .idc-foil-spec {
  background: linear-gradient(
    125deg,
    #0a6fa8,
    #3fb6ff 12%,
    #9fe4ff 24%,
    #1fb8b0 36%,
    #6ff2e0 48%,
    #0e8c9a 60%,
    #5cc8ff 72%,
    #1d5fd1 84%,
    #4fe3d0
  );
}

.idc-face-foil .idc-foil-glint {
  width: 260%;
  height: 260%;
  transform: translate(
    calc(var(--foil-gx, 0.5) * -61.538%),
    calc(var(--foil-gy, 0.5) * -61.538%)
  );
  background: linear-gradient(
    115deg,
    transparent 36%,
    rgba(30, 90, 220, 0.85) 45%,
    #0b2a86 49%,
    #061a5c 50%,
    #0b2a86 51%,
    rgba(30, 90, 220, 0.85) 55%,
    transparent 64%
  );
}

[data-theme="dark"] .idc-face-foil {
  filter: saturate(1.2) brightness(1.05);
}

.idc-emboss-face img {
  --hl: 0.57em;
  --dk: 0.65em;
  filter:
    drop-shadow(calc(var(--emb-cx, 0.707) * var(--hl)) calc(var(--emb-cy, 0.707) * var(--hl)) 0.12em rgba(255, 255, 255, 0.7))
    drop-shadow(calc(var(--emb-cx, 0.707) * var(--dk) * -1) calc(var(--emb-cy, 0.707) * var(--dk) * -1) 0.12em rgba(0, 45, 55, 0.38));
}

.idc-emboss-logo img {
  --hl: 0.99em;
  --dk: 1.17em;
  filter:
    drop-shadow(calc(var(--emb-cx, 0.707) * var(--hl)) calc(var(--emb-cy, 0.707) * var(--hl)) 0.15em rgba(255, 255, 255, 0.8))
    drop-shadow(calc(var(--emb-cx, 0.707) * var(--dk) * -1) calc(var(--emb-cy, 0.707) * var(--dk) * -1) 0.2em rgba(20, 55, 120, 0.22));
}

.idc-emboss-mirrored img {
  filter:
    drop-shadow(calc(var(--emb-cx, 0.707) * var(--hl) * -1) calc(var(--emb-cy, 0.707) * var(--hl)) 0.15em rgba(255, 255, 255, 0.8))
    drop-shadow(calc(var(--emb-cx, 0.707) * var(--dk)) calc(var(--emb-cy, 0.707) * var(--dk) * -1) 0.2em rgba(20, 55, 120, 0.22));
}

/* Front Identity Typography (Exact MD Thermochrome + PP Supply Mono) */
.idc-front-text {
  position: absolute;
  left: 150.48em;
  top: 19.01em;
  width: 170em;
  display: flex;
  flex-direction: column;
  gap: 20em;
  line-height: normal;
  pointer-events: none;
}

.idc-front-head {
  display: flex;
  align-items: center;
  gap: 38em;
  white-space: nowrap;
}

.idc-face-back p,
.idc-front-text dd,
.idc-front-text dl,
.idc-front-text p {
  margin: 0;
  line-height: normal;
  opacity: 1;
}

.idc-title {
  font-family: "MD Thermochrome", var(--font-display), sans-serif;
  font-weight: 600;
  font-size: 12em;
  letter-spacing: 0.06em;
  color: #0087ac;
  text-box: trim-both cap alphabetic;
}

.idc-fields,
.idc-handle p,
.idc-number p,
.idc-serial {
  font-family: "PP Supply Mono", var(--font-mono), monospace;
  font-weight: 400;
}

.idc-serial {
  font-size: 8em;
  color: #68adb7;
}

.idc-fields {
  display: flex;
  flex-direction: column;
  gap: 6em;
  width: 120em;
}

.idc-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  white-space: nowrap;
}

.idc-field dt {
  font-size: 8em;
  margin-bottom: -0.25em;
  color: #0087ac;
}

.idc-field dd {
  font-size: 12em;
  color: #00424c;
}

/* Back Face: Unmirrored Grid, PASS, Handle, Number & Dual-Layer Illustrated Stamps */
.idc-unmirror {
  position: absolute;
  transform: scaleX(-1);
}

.idc-grid-wrap {
  left: 20.46em;
  top: 20.068em;
}

.idc-grid {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 176.242em;
  opacity: 0.4;
  border-top: 1.102em solid #3ac4d9;
  border-left: 1.102em solid #3ac4d9;
}

.idc-grid-cell {
  aspect-ratio: 1;
  border-right: 1.102em solid #3ac4d9;
  border-bottom: 1.102em solid #3ac4d9;
}

.idc-pass {
  left: 278.18em;
  top: 20em;
}

.idc-face-back .idc-pass p {
  font-family: "MD Thermochrome", var(--font-display), sans-serif;
  font-weight: 500;
  font-size: 26em;
  color: #00424c;
  opacity: 0.62;
  white-space: nowrap;
  text-box: trim-both cap alphabetic;
}

.idc-handle {
  left: 261.18em;
  top: 176.878em;
}

.idc-number {
  right: 279.18em;
  top: 176.878em;
}

.idc-face-back .idc-handle p,
.idc-face-back .idc-number p {
  font-size: 14em;
  color: #00424c;
  opacity: 0.46;
  white-space: nowrap;
  text-box: trim-both cap alphabetic;
}

.idc-face-back .idc-handle p {
  letter-spacing: -0.06em;
  text-transform: uppercase;
}

/* 9 Illustrated Stamps (Print + Dark Mode Metallic Foil) */
.idc-stamps {
  left: 20.18em;
  top: 20.31em;
  width: 175em;
  height: 132em;
}

.idc-stamps > div {
  position: relative;
  width: 100%;
  height: 100%;
}

.idc-stamp {
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: scale 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.idc-face-back:not(.idc-stamped) .idc-stamp {
  opacity: 0.003;
}

.idc-stamped .idc-stamp {
  animation: idcStampIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(0.35s + var(--stamp-i, 0) * 0.08s);
}

@keyframes idcStampIn {
  0% {
    opacity: 0.003;
    scale: 0.85;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

.idc-stamp:active,
.idc-stamp:hover {
  scale: 1.06;
}

.idc-stamps-foil,
.idc-stamps-foil .idc-stamp {
  pointer-events: none;
}

.idc-stamps-foil {
  display: none;
}

[data-theme="dark"] .idc-stamps-foil {
  display: block;
}

.idc-stamps-print {
  mix-blend-mode: multiply;
}

[data-theme="dark"] .idc-stamps-print {
  mix-blend-mode: normal;
}

.idc-stamp-foil {
  overflow: hidden;
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  opacity: calc(0.8 * var(--idc-foil-a, 0));
}

.idc-stamp-foil .idc-foil-spec {
  background: linear-gradient(
    125deg,
    var(--f-deep) 0,
    var(--f-mid) 12%,
    var(--f-pale) 24%,
    var(--f-light) 36%,
    var(--f-pale) 48%,
    var(--f-deep) 60%,
    var(--f-mid) 72%,
    var(--f-dark) 84%,
    var(--f-light) 100%
  );
}

.idc-stamp-foil .idc-foil-glint {
  width: 525em;
  height: 396em;
  left: calc(-175em - var(--sx, 0em));
  top: calc(-132em - var(--sy, 0em));
  transform: translate(var(--idc-glint-x, 0), var(--idc-glint-y, 0));
  background: linear-gradient(
    115deg,
    transparent 44.5%,
    var(--f-glint) 47.6%,
    var(--f-dark) 49.6%,
    var(--f-darkest) 50%,
    var(--f-dark) 50.4%,
    var(--f-glint) 52.4%,
    transparent 55.5%
  );
}

[data-theme="dark"] .idc-stamp-foil {
  filter: saturate(1.2) brightness(1.05);
}

.idc-face-back:has(.idc-stamps-print .idc-stamp:nth-child(1):is(:hover, :active)) .idc-stamps-foil .idc-stamp:nth-child(1),
.idc-face-back:has(.idc-stamps-print .idc-stamp:nth-child(2):is(:hover, :active)) .idc-stamps-foil .idc-stamp:nth-child(2),
.idc-face-back:has(.idc-stamps-print .idc-stamp:nth-child(3):is(:hover, :active)) .idc-stamps-foil .idc-stamp:nth-child(3),
.idc-face-back:has(.idc-stamps-print .idc-stamp:nth-child(4):is(:hover, :active)) .idc-stamps-foil .idc-stamp:nth-child(4),
.idc-face-back:has(.idc-stamps-print .idc-stamp:nth-child(5):is(:hover, :active)) .idc-stamps-foil .idc-stamp:nth-child(5),
.idc-face-back:has(.idc-stamps-print .idc-stamp:nth-child(6):is(:hover, :active)) .idc-stamps-foil .idc-stamp:nth-child(6),
.idc-face-back:has(.idc-stamps-print .idc-stamp:nth-child(7):is(:hover, :active)) .idc-stamps-foil .idc-stamp:nth-child(7),
.idc-face-back:has(.idc-stamps-print .idc-stamp:nth-child(8):is(:hover, :active)) .idc-stamps-foil .idc-stamp:nth-child(8),
.idc-face-back:has(.idc-stamps-print .idc-stamp:nth-child(9):is(:hover, :active)) .idc-stamps-foil .idc-stamp:nth-child(9) {
  scale: 1.06;
}

/* WebGL Iridescent Foil Overlay */
.passport-foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  z-index: 5;
  mix-blend-mode: overlay;
  opacity: 0.6;
}

[data-theme="dark"] .passport-foil {
  mix-blend-mode: screen;
  opacity: 0.5;
}

[data-theme="retro"] .passport-foil {
  display: none;
}

/* Flip Button + Hint */
.idc-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

.idc-flip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #6b6b6b;
  font-size: 14px;
  font-weight: 500;
  transition: color 160ms ease, background-color 160ms ease, transform 120ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .idc-flip-btn {
  background: hsla(0, 0%, 100%, 0.08);
  color: #9e9e9e;
}

[data-theme="retro"] .idc-flip-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.idc-flip-btn img {
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
}

[data-theme="dark"] .idc-flip-btn img,
[data-theme="retro"] .idc-flip-btn img {
  filter: invert(0.8);
}

.idc-flip-btn:hover {
  color: var(--text);
}

.idc-flip-btn:active {
  transform: scale(0.96);
}

.idc-hint {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.68;
  text-align: center;
}

.v2-card-footer {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 2;
  width: min(640px, calc(100vw - 40px));
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0.72;
}

.v2-card-footer-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-bottom: 5px;
}

/* ==========================================================================
   SLIDE 1: SELECTED WORK GALLERY (Exact ikeacrisp full-bleed masonry style)
   ========================================================================== */
.v2-slide--work {
  padding: calc(52px + 18px) 0 24px;
}

.v2-slide--work .v2-slide-inner {
  width: calc(100vw - 24px);
  margin: 0 auto;
  align-self: flex-start;
}

.wg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.wg-col {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.wg-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.wg-media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  background: #f2f2f2;
}

[data-theme="dark"] .wg-media {
  background: #1b1b1c;
}

[data-theme="retro"] .wg-media {
  border: 1px solid var(--line);
}

.wg-media > img,
.wg-media > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) {
  .wg-card:hover .wg-media > img,
  .wg-card:hover .wg-media > video,
  .wg-card:hover .wg-slate {
    transform: scale(1.02);
  }
}

.wg-card:focus-visible {
  outline: none;
}

.wg-card:focus-visible .wg-media {
  outline: 1px solid var(--text);
  outline-offset: 2px;
}

/* Minimal Editorial Slates (for Showreel, Live TV, AI/FDE tiles) */
.wg-slate {
  position: relative;
  width: 100%;
  height: 100%;
  padding: clamp(16px, 2vw, 26px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 82% 18%, rgba(18, 211, 211, 0.14), transparent 54%),
    linear-gradient(155deg, #16181e 0%, #0d0f13 100%);
  color: #edf1f5;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.wg-slate--reel {
  background:
    radial-gradient(circle at 20% 82%, rgba(0, 218, 218, 0.16), transparent 52%),
    radial-gradient(circle at 84% 16%, rgba(86, 152, 255, 0.14), transparent 50%),
    linear-gradient(155deg, #141720 0%, #0b0d12 100%);
}

.wg-slate--games {
  background:
    radial-gradient(circle at 80% 24%, rgba(255, 110, 148, 0.15), transparent 52%),
    linear-gradient(155deg, #19161f 0%, #0e0e13 100%);
}

.wg-slate--fde {
  background:
    radial-gradient(circle at 78% 22%, rgba(58, 224, 168, 0.16), transparent 54%),
    linear-gradient(155deg, #111b1e 0%, #0b1014 100%);
}

.wg-slate-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: "PP Supply Mono", var(--font-mono), monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(235, 242, 248, 0.56);
}

.wg-slate-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--status-live);
}

.wg-slate-mid {
  margin-block: auto;
  padding-block: 14px;
}

.wg-slate-headline {
  display: block;
  font-family: "MD Thermochrome", var(--font-display), sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 2.1rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: 0.03em;
  color: #f3f6f9;
}

.wg-slate-sub {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  color: rgba(235, 242, 248, 0.62);
}

.wg-slate-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "PP Supply Mono", var(--font-mono), monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(235, 242, 248, 0.45);
  font-variant-numeric: tabular-nums;
}

.wg-caption {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.25;
}

.wg-title {
  color: var(--text);
  font-weight: 460;
}

.wg-meta {
  color: var(--muted);
}

/* ==========================================================================
   INDEX OVERLAY DRAWER (Full CV & Dossier)
   ========================================================================== */
.v2-info-fill {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 480ms var(--ease-snappy);
}

.v2-info-fill.is-open {
  opacity: 0.76;
}

.v2-info {
  position: fixed;
  inset: 0;
  z-index: 35;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 108px 0 112px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 440ms var(--ease-snappy), visibility 0s linear 440ms;
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 44px,
    #000 96px,
    #000 calc(100% - 56px),
    transparent
  );
  mask-image: linear-gradient(
    180deg,
    transparent 44px,
    #000 96px,
    #000 calc(100% - 56px),
    transparent
  );
}

.v2-info::-webkit-scrollbar {
  display: none;
}

.v2-info.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 440ms var(--ease-snappy), visibility 0s;
}

.v2-info-inner {
  width: min(560px, calc(100vw - 2.5rem));
  margin: 0 auto;
  transform: translateY(14px);
  transition: transform 480ms var(--ease-out-expo);
}

.v2-info.is-open .v2-info-inner {
  transform: translateY(0);
}

.v2-info-block + .v2-info-block {
  margin-top: 76px;
}

.v2-info-block > h3,
.writing-head-row h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
}

/* Identity Header & Flippable Avatar */
.v2-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.header-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-identity h1 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.header-identity h2 {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--muted);
}

.fc-avatar-flip {
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  background: none;
  perspective: 600px;
  flex-shrink: 0;
}

.fc-avatar-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 520ms cubic-bezier(0.175, 0.885, 0.32, 1.25);
}

.fc-avatar-inner.is-flipped {
  transform: rotateY(180deg);
}

.fc-avatar-face {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--text);
}

.fc-avatar-monogram {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 0.92;
  letter-spacing: 0.06em;
}

.fc-avatar-sub {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.fc-avatar-back {
  transform: rotateY(180deg);
  background: var(--surface);
  color: var(--accent);
}

.v2-socials {
  display: flex;
  align-items: center;
  gap: 10px;
}

.v2-socials a,
.v2-social-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--muted);
  padding: 4px;
  transition: color 160ms ease;
}

.v2-socials a[hidden] {
  display: none;
}

.v2-socials a:hover,
.v2-social-btn:hover {
  color: var(--text);
}

.v2-social-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.v2-social-btn.is-copied .v2-social-tooltip,
.v2-social-btn:hover .v2-social-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.v2-cv-pill {
  font-family: var(--font-mono);
  font-size: 11px !important;
  padding: 4px 8px !important;
  border-radius: 6px;
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}

.v2-cv-pill:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* Bio Entries */
.bio-headline {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 22px;
}

.bio-entries {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}

.bio-entry {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.bio-num {
  flex-shrink: 0;
  width: 26px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.9;
  color: var(--muted);
}

.bio-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.bio-closing {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 22px;
}

.bio-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.bio-fact dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.bio-fact dd {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.45;
}

/* Experience Table (Spring Highlight + Expandable Accordion Rows) */
.writing-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.writing-head-row h3 {
  margin-bottom: 0;
}

.exp-filter-pills {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.exp-filter-pill {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.exp-filter-pill:hover {
  color: var(--text);
}

.exp-filter-pill.is-active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

.writing-subhint {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.72;
  margin-bottom: 14px;
}

.writing-table {
  position: relative;
  margin-inline: -8px;
}

.writing-highlight {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  border-radius: 8px;
  background: var(--surface);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  will-change: transform, height, opacity;
}

.writing-table--hovering .writing-row-item:not(.is-hovered) .writing-row {
  opacity: 0.52;
}

.writing-row-item.is-hidden {
  display: none;
}

.writing-row {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  transition: opacity 180ms ease, transform 140ms var(--ease-out-expo);
}

.writing-row:active {
  transform: scale(0.99);
}

.writing-year {
  flex-shrink: 0;
  width: 96px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.writing-badge {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text);
}

.writing-title {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.writing-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--status-live);
  flex-shrink: 0;
}

.writing-desc {
  flex-shrink: 0;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  opacity: 0.72;
  transition: opacity 160ms ease;
}

.writing-row-item.is-hovered .writing-desc,
.writing-row-item.is-expanded .writing-desc {
  opacity: 1;
}

.writing-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 260ms var(--ease-out-expo);
}

.writing-row-item.is-expanded .writing-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

/* Smooth CSS Grid Accordion for Role Highlights */
.writing-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 340ms var(--ease-out-expo);
}

.writing-row-item.is-expanded .writing-drawer {
  grid-template-rows: 1fr;
}

.writing-drawer-inner {
  overflow: hidden;
}

.writing-highlights {
  list-style: none;
  padding: 4px 10px 14px 136px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.writing-highlight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.writing-sector-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.writing-bullet {
  position: relative;
  font-size: 13.2px;
  line-height: 1.58;
  color: var(--muted);
}

.writing-bullet::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-left: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-bottom-left-radius: 4px;
}

/* AI & FDE Section */
.fde-intro {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.fde-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fde-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg-elevated) 65%, transparent);
}

.fde-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  padding-top: 2px;
}

.fde-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.fde-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.fde-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

.fde-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* Stack List */
.v2-stack-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v2-stack-row {
  display: flex;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.8px;
}

.v2-stack-row:last-child {
  border-bottom: none;
}

.v2-stack-row dt {
  flex: none;
  width: 104px;
  color: var(--muted);
  font-size: 13px;
}

.v2-stack-row dd {
  flex: 1;
  color: var(--text);
  line-height: 1.6;
}

/* Education */
.edu-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
}

.edu-period {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  padding-top: 2px;
}

.edu-school {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.edu-degree {
  font-size: 13.5px;
  color: var(--text);
  margin-top: 2px;
}

.edu-note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 5px;
}

/* End Row */
.v2-info-end {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.v2-info-end-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.v2-lost-link {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  transition: opacity 150ms ease;
}

.v2-lost-link:hover {
  opacity: 0.72;
}

/* Left Fixed Section Spy Nav */
.v2-info-index {
  position: fixed;
  top: 112px;
  left: 22px;
  z-index: 36;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms var(--ease-snappy), visibility 0s linear 420ms;
}

.v2-info-index.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 420ms var(--ease-snappy), visibility 0s;
}

.v2-info-index-btn {
  padding: 0;
  border: none;
  background: none;
  font-size: 13.5px;
  color: var(--text);
  opacity: 0.45;
  transition: opacity 160ms ease, transform 160ms ease;
}

.v2-info-index-btn:hover,
.v2-info-index-btn[aria-current="true"] {
  opacity: 1;
}

/* Bottom-left Mascot & Hong Kong Live Clock */
.v2-info-foot {
  position: fixed;
  left: 22px;
  bottom: 28px;
  z-index: 36;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms var(--ease-snappy), visibility 0s linear 420ms;
}

.v2-info-foot.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 420ms var(--ease-snappy), visibility 0s;
}

.v2-info-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.mascot-wrap {
  position: relative;
  border: none;
  background: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  color: var(--text);
}

.mascot-bob {
  display: inline-flex;
  animation: mascotBob 3s ease-in-out infinite;
}

@keyframes mascotBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.cat-eyes-sleep,
.cat-eyes-happy {
  display: none;
}

.mascot-wrap[data-mood="blink"] .cat-eyes-awake,
.mascot-wrap[data-mood="sleep"] .cat-eyes-awake {
  display: none;
}

.mascot-wrap[data-mood="blink"] .cat-eyes-sleep,
.mascot-wrap[data-mood="sleep"] .cat-eyes-sleep {
  display: block;
}

.mascot-wrap[data-mood="happy"] .cat-eyes-awake {
  display: none;
}

.mascot-wrap[data-mood="happy"] .cat-eyes-happy {
  display: block;
}

.sleep-zs {
  position: absolute;
  left: 100%;
  top: -4px;
  display: none;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  pointer-events: none;
}

.mascot-wrap[data-mood="sleep"] .sleep-zs {
  display: inline-flex;
}

.sleep-zs span {
  animation: zFloat 2.2s ease-in-out infinite;
}

.sleep-zs span:nth-child(2) {
  animation-delay: 0.7s;
}

@keyframes zFloat {
  0% { opacity: 0; transform: translateY(4px) scale(0.75); }
  40% { opacity: 0.9; transform: translateY(-2px) scale(1); }
  100% { opacity: 0; transform: translateY(-9px) scale(1.1); }
}

.mascot-greeting {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.mascot-greeting.is-show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   WORK LIGHTBOX MODAL (Exact ikeacrisp frosted-glass minimalism)
   ========================================================================== */
.wg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  animation: lbFade 240ms ease both;
}

.wg-lightbox[hidden] {
  display: none;
}

@keyframes lbFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wg-lb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wg-lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.wg-lb-media {
  position: relative;
  width: min(80vw, 1120px, calc((100svh - 190px) * var(--ar, 1.777)));
  max-height: calc(100svh - 190px);
  aspect-ratio: var(--ar, 16 / 9);
  overflow: hidden;
  border-radius: 6px;
  background: #1b1b1c;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 12px 32px rgba(0, 0, 0, 0.32);
}

.wg-lb-media iframe,
.wg-lb-media video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
}

.wg-lb-audio-pill {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.56);
  box-shadow: inset 0 0 0 0.5px hsla(0, 0%, 100%, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  transition: background-color 160ms ease;
}

.wg-lb-audio-pill:hover {
  background: rgba(0, 0, 0, 0.78);
}

.wg-lb-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  max-width: min(620px, calc(100vw - 48px));
}

.wg-lb-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 8px;
}

.wg-lb-caption .wg-title {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.wg-lb-caption .wg-meta {
  color: hsla(0, 0%, 100%, 0.52);
  font-size: 14px;
}

.wg-lb-summary {
  font-size: 12.5px;
  line-height: 1.5;
  color: hsla(0, 0%, 100%, 0.65);
}

.wg-lb-ext {
  margin-top: 2px;
  font-size: 12.5px;
  color: #7ee8f2;
  transition: opacity 160ms ease;
}

.wg-lb-ext:hover {
  opacity: 0.78;
}

.wg-lb-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.wg-lb-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: hsla(0, 0%, 100%, 0.28);
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1), background-color 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.wg-lb-dot--on {
  width: 22px;
  background: hsla(0, 0%, 100%, 0.92);
}

.wg-lb-close,
.wg-lb-nav {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: hsla(0, 0%, 100%, 0.08);
  color: hsla(0, 0%, 100%, 0.75);
  transition: color 200ms ease, background-color 200ms ease, transform 200ms ease;
}

.wg-lb-close {
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
}

.wg-lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
}

.wg-lb-nav--prev { left: 24px; }
.wg-lb-nav--next { right: 24px; }

.wg-lb-close:hover,
.wg-lb-nav:hover {
  background: hsla(0, 0%, 100%, 0.14);
  color: #fff;
}

.wg-lb-nav:active {
  transform: translateY(-50%) scale(0.96);
}

.wg-lb-close:active {
  transform: scale(0.96);
}

/* ==========================================================================
   404 CONNECT-THE-DOTS STUDIO CAT GAME
   ========================================================================== */
.not-found-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px 40px;
}

.dots-game {
  width: min(420px, calc(100vw - 40px));
}

.dots-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  color: var(--text);
}

.draw-stroke {
  stroke: var(--text);
  opacity: 0.42;
  transition: opacity 380ms ease;
}

.draw-stroke--done {
  opacity: 1;
}

.guide-line {
  stroke: var(--accent);
  pointer-events: none;
}

.dot-label {
  fill: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.dot-circle {
  fill: var(--accent);
  pointer-events: none;
  transition: fill 240ms ease, opacity 320ms ease;
}

.dot-circle--clicked {
  fill: var(--text);
}

.dot-circle--done {
  opacity: 0;
}

.dot-pulse-ring {
  stroke: var(--accent);
  stroke-width: 2;
  pointer-events: none;
}

.not-found-text {
  text-align: center;
  margin-top: 18px;
}

.not-found-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.not-found-subtitle {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 18px;
}

.nf-actions {
  display: inline-flex;
  gap: 10px;
}

.nf-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: background-color 160ms ease, color 160ms ease;
}

.nf-btn:hover {
  background: var(--surface-hover);
}

.nf-btn--primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.nf-btn--primary:hover {
  opacity: 0.86;
}

/* ==========================================================================
   Responsive Refinements
   ========================================================================== */
@media (max-width: 860px) {
  .v2-info-index,
  .v2-info-foot {
    display: none;
  }

  .wg-lb-nav {
    display: none;
  }
}

@media (max-width: 719px) {
  .v2-header-nav {
    position: fixed;
    inset: auto;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 50;
  }

  .v2-toggle--sections {
    position: static;
    transform: none;
  }

  .v2-card-footer {
    bottom: 72px;
  }

  .v2-slide--card {
    padding: 72px 0 132px;
  }

  .bio-facts {
    grid-template-columns: 1fr;
  }

  .writing-year {
    width: 76px;
    font-size: 11px;
  }

  .writing-desc {
    display: none;
  }

  .writing-highlights {
    padding-left: 28px;
  }

  .edu-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

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