/* ============================================================
   JUNG KYU YANG — 4DUX PORTFOLIO 2026
   style.css — Complete Design System
   ============================================================ */

/* All themes: Inter (display + body) + JetBrains Mono (mono) */
/* Font loaded via <link> in HTML for faster rendering (avoids @import blocking) */

/* ============================================================
   1. CSS CUSTOM PROPERTIES — THEME SYSTEM
   ============================================================ */

:root {
  /* Midnight Theme (Default) */
  --bg-primary:      #08080f;
  --bg-secondary:    #0f0f1a;
  --bg-surface:      #14141f;
  --bg-elevated:     #1a1a2e;
  --bg-glass:        rgba(20, 20, 31, 0.7);
  --bg-film:        rgba(20, 20, 31, 0.3);

  --accent-primary:  #4f8ef7;
  --accent-secondary: #7c3aed;
  --accent-glow:     rgba(79, 142, 247, 0.25);
  --accent-warm:     #f59e0b;

  --text-primary:    #eeeef5;
  --text-secondary:  #9898b0;
  --text-muted:      #808098;
  --text-accent:     #4f8ef7;

  --border-subtle:   rgba(255, 255, 255, 0.06);
  --border-medium:   rgba(255, 255, 255, 0.22);
  --border-accent:   rgba(79, 142, 247, 0.3);
  --border-primary:  #eeeef5;

  --shadow-sm:       0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:       0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:       0 24px 64px rgba(0,0,0,0.6);
  --shadow-glow:     0 0 40px rgba(79, 142, 247, 0.15);

  --gradient-hero:   linear-gradient(135deg, #08080f 0%, #0f0f20 50%, #100820 100%);
  --gradient-card:   linear-gradient(145deg, rgba(20,20,31,0.9) 0%, rgba(14,14,24,0.9) 100%);
  --gradient-accent: linear-gradient(135deg, #4f8ef7, #7c3aed);

  --panel-bg:        rgba(10, 10, 20, 0.95);
  --panel-border:    rgba(79, 142, 247, 0.15);

  --ambient: 0; /* 0 = night, 1 = day — controlled by slider */
  --ambient-shift: 0%;

  /* Typography */
  --font-display:    'Inter', system-ui, sans-serif;
  --font-body:       'Inter', system-ui, sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 128px;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   300ms ease;
  --transition-slow:   500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-theme:  400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --max-width:     1440px;
  --content-width: 1200px;
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --radius-full:   9999px;
}

/* Daylight Theme */
[data-theme="daylight"] {
  --bg-primary:      #f4f4f8;
  --bg-secondary:    #ffffff;
  --bg-surface:      #ffffff;
  --bg-elevated:     #f9f9fc;
  --bg-glass:        rgba(255, 255, 255, 0.8);
  --bg-film:        rgba(255, 255, 255, 0.3);

  --accent-primary:  #2563eb;
  --accent-secondary: #7c3aed;
  --accent-glow:     rgba(37, 99, 235, 0.15);
  --accent-warm:     #d97706;

  --text-primary:    #0a0a18;
  --text-secondary:  #15123c;
  --text-muted:      #343434;
  --text-accent:     #2563eb;

  --border-subtle:   rgba(0, 0, 0, 0.06);
  --border-medium:   rgba(0, 0, 0, 0.5);
  --border-accent:   rgba(37, 99, 235, 0.3);
  --border-primary:   #0a0a18; 

  --shadow-sm:       0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:       0 8px 32px rgba(0,0,0,0.12);
  --shadow-lg:       0 24px 64px rgba(0,0,0,0.16);
  --shadow-glow:     0 0 40px rgba(37, 99, 235, 0.1);

  --gradient-hero:   linear-gradient(135deg, #eef0f8 0%, #f0eef8 50%, #f8f0f4 100%);
  --gradient-card:   linear-gradient(145deg, rgba(255,255,255,0.95) 0%, rgba(249,249,252,0.95) 100%);
  --gradient-accent: linear-gradient(135deg, #2563eb, #7c3aed);

  --panel-bg:        rgba(255, 255, 255, 0.97);
  --panel-border:    rgba(37, 99, 235, 0.15);

}

/* Aurora Theme */
[data-theme="aurora"] {
  --bg-primary:      #050d14;
  --bg-secondary:    #091620;
  --bg-surface:      #0d1f2d;
  --bg-elevated:     #122333;
  --bg-glass:        rgba(13, 31, 45, 0.8);
  --bg-film:        rgba(13, 31, 45, 0.3);

  --accent-primary:  #00e5cc;
  --accent-secondary: #9d4edd;
  --accent-glow:     rgba(0, 229, 204, 0.2);
  --accent-warm:     #f472b6;

  --text-primary:    #d8f0ee;
  --text-secondary:  #7aaaa4;
  --text-muted:      #5d9e98;
  --text-accent:     #00e5cc;

  --border-subtle:   rgba(0, 229, 204, 0.06);
  --border-medium:   rgba(0, 229, 204, 0.2);
  --border-accent:   rgba(0, 229, 204, 0.3);

  --shadow-sm:       0 2px 8px rgba(0,0,0,0.5);
  --shadow-md:       0 8px 32px rgba(0,0,0,0.6);
  --shadow-lg:       0 24px 64px rgba(0,0,0,0.7);
  --shadow-glow:     0 0 40px rgba(0, 229, 204, 0.12);

  --gradient-hero:   linear-gradient(135deg, #050d14 0%, #091824 50%, #07121c 100%);
  --gradient-card:   linear-gradient(145deg, rgba(13,31,45,0.9) 0%, rgba(9,22,32,0.9) 100%);
  --gradient-accent: linear-gradient(135deg, #00e5cc, #9d4edd);

  --panel-bg:        rgba(5, 13, 20, 0.95);
  --panel-border:    rgba(0, 229, 204, 0.15);

}

/* Dusk Theme */
[data-theme="dusk"] {
  --bg-primary:      #130a04;
  --bg-secondary:    #1c1008;
  --bg-surface:      #22150a;
  --bg-elevated:     #2a1c0f;
  --bg-glass:        rgba(34, 21, 10, 0.8);
  --bg-film:        rgba(34, 21, 10, 0.3);

  --accent-primary:  #f59e0b;
  --accent-secondary: #ef4444;
  --accent-glow:     rgba(245, 158, 11, 0.2);
  --accent-warm:     #fb923c;

  --text-primary:    #f5ead8;
  --text-secondary:  #a88b6a;
  --text-muted:      #a68060;
  --text-accent:     #f59e0b;

  --border-subtle:   rgba(245, 158, 11, 0.06);
  --border-medium:   rgba(245, 158, 11, .7);
  --border-accent:   rgba(245, 158, 11, 0.3);
  --border-primary:   rgb(255, 255, 255);

  --shadow-sm:       0 2px 8px rgba(0,0,0,0.5);
  --shadow-md:       0 8px 32px rgba(0,0,0,0.6);
  --shadow-lg:       0 24px 64px rgba(0,0,0,0.7);
  --shadow-glow:     0 0 40px rgba(245, 158, 11, 0.12);

  --gradient-hero:   linear-gradient(135deg, #130a04 0%, #1c1008 50%, #200d05 100%);
  --gradient-card:   linear-gradient(145deg, rgba(34,21,10,0.9) 0%, rgba(28,16,8,0.9) 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b, #ef4444);

  --panel-bg:        rgba(19, 10, 4, 0.95);
  --panel-border:    rgba(245, 158, 11, 0.15);

}

/* ============================================================
   2. AMBIENT (DAY/NIGHT) OVERRIDE LAYER
   ============================================================ */

/* Ambient effect is handled by .jky-ambient-overlay in components.js */

/* ============================================================
   3. RESET & BASE
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  background-color: var(--bg-primary);
  transition: background-color var(--transition-theme);
}

body {
  background-color: transparent; /* background lives on html so z-index:-2 video is visible */
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  transition: color var(--transition-theme);
  overflow-x: hidden;
  cursor: auto;
  /* NOTE: NO filter here — filter on body breaks position:fixed for all children */
}

/* ── Full-screen video background (all pages) ── */
#jky-home-video-wrap {
  position: fixed; inset: 0; z-index: -2;
  overflow: hidden; background: #000;
  transition: filter 0.08s linear;
}
#jky-home-video {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
#jky-video-tint {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  transition: background 0.5s ease;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--accent-primary); }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  background: none;
}

ul, ol { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  opacity: 0.5;
}

/* ============================================================
   4. CUSTOM CURSOR
   ============================================================ */

/* Custom cursor ring — decorative glow effect, real cursor always shows */
.cursor-dot {
  display: none; /* Hidden — real cursor already shows the dot */
}

.cursor-ring {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--accent-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition:
    width 0.3s ease,
    height 0.3s ease,
    opacity 0.2s ease,
    border-color 0.3s ease;
  opacity: 0.35;
}

.cursor-ring.is-hovering {
  width: 52px;
  height: 52px;
  opacity: 0.2;
  background: var(--accent-primary);
}

/* ============================================================
   5. NOISE TEXTURE OVERLAY
   ============================================================ */

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
  opacity: 0.4;
}

/* ============================================================
   6. TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
  transition: color var(--transition-theme);
}

/* Magazine editorial: accent-colored word sits at same weight as heading — color does the work */
h1 em, h2 em, h3 em,
.display-xl em, .display-lg em, .display-md em {
  font-style: normal;
  font-weight: inherit;
  color: var(--accent-primary);
}

/* Display scale */
.display-xl {
  font-size: clamp(4rem, 9vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.display-lg {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.0;
}

.display-md {
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

/* Clear weight cascade creates magazine hierarchy */
h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h4 {
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
}

.label {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.label-accent {
  color: var(--accent-primary);
}

.label-sans {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

p {
  font-family: var(--font-body);
  color: var(--text-primary);
  transition: color var(--transition-theme);
}

.lead {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.75;
  color: var(--text-primary);
  max-width: 65ch;
}

/* ============================================================
   7. LAYOUT UTILITIES
   ============================================================ */

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container--wide {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-4xl) 0;
}

.section--sm {
  padding: var(--space-3xl) 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ============================================================
   8. NAVIGATION
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    background var(--transition-base),
    backdrop-filter var(--transition-base),
    border-color var(--transition-theme);
}

/* Slide up when scrolling down, slide back on scroll up */
.nav--hidden {
  transform: translateY(-100%);
}

/* ---- Control panel push layout ---- */
/* When the left panel opens, main content slides right instead of being overlaid */
#jky-page-wrap {
  transition: transform var(--transition-slow);
}
body.panel-is-open #jky-page-wrap {
  transform: translateX(var(--panel-width, 420px));
}
/* Nav (fixed) narrows from left to match panel width */
body.panel-is-open .nav {
  left: var(--panel-width, 420px);
}

.nav.scrolled {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0px solid var(--border-subtle);
}

.nav__logo {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding-bottom: 7px;
  border-bottom: 4px solid var(--accent-primary);
  transition: border-color var(--transition-theme);
}

/* Logo image — theme-aware swap */
.nav__logo-img {
  display: block;
  height: 36px;
  width: auto;
}
.nav__logo-img--day { display: none; }
[data-theme="daylight"] .nav__logo-img--light { display: none; }
[data-theme="daylight"] .nav__logo-img--day   { display: block; }

/* Legacy text spans — kept for fallback, hidden once imgs load */
.nav__logo-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color var(--transition-theme);
}

.nav__logo-brand {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav__link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  position: relative;
  padding-bottom: 2px;
  transition: color var(--transition-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2.5px;
  background: var(--accent-primary);
  transition: width var(--transition-base);
}

.nav__link:hover,
.nav__link.active {
  color: var(--text-primary);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  background: var(--gradient-accent);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.nav__cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: white;
}

/* ---- Hamburger button (mobile only) ---- */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-medium);
  cursor: pointer;
  z-index: 1010;
  flex-shrink: 0;
}

.nav__hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}

.nav__hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Mobile nav overlay ---- */
.nav-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100dvh; /* constrained to viewport — no scroll needed */
  max-height: 100dvh;
  z-index: 999;
  background: var(--bg-primary);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  pointer-events: none;
  transform: translateY(-100%);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.nav-mobile.is-open {
  transform: translateY(0);
  pointer-events: auto;
}

.nav-mobile__link {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.nav-mobile__link:hover { color: var(--accent-primary); }

.nav-mobile__cta {
  margin-top: var(--space-lg);
}

@media (max-width: 768px) {
  .nav__links   { display: none; }
  .nav__hamburger { display: flex; }
  .nav-mobile   { display: flex; }
}

/* ============================================================
   9. LEFT CONTROL PANEL
   ============================================================ */

/* ---- Ambient brightness overlay (sits above page, below UI) ---- */
.jky-ambient-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8000;
  background: transparent;
  transition: background 0.4s ease;
}

/* ---- Panel Handle — always floats on the left ---- */
.panel-handle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  z-index: 9999;
  width: 48px;
  height: 120px;
  background: var(--accent-primary);
  border: none;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition:
    transform var(--transition-slow),
    width var(--transition-base),
    background var(--transition-theme),
    box-shadow var(--transition-base);
  box-shadow: 4px 0 24px var(--accent-glow);
  user-select: none;
}

.panel-handle:hover {
  width: 56px;
  box-shadow: 6px 0 32px var(--accent-glow);
}

/* Slide handle right when panel is open (becomes close button at panel edge) */
.panel-handle.is-open {
  transform: translateY(-50%) translateX(var(--panel-width, 420px));
}

.panel-handle__icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

/* Three bars that morph into an X when open */
.panel-handle__icon span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: white;
  transition:
    transform 0.35s ease,
    opacity 0.25s ease;
  transform-origin: center;
}

.panel-handle.is-open .panel-handle__icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.panel-handle.is-open .panel-handle__icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.panel-handle.is-open .panel-handle__icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.panel-handle__label {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  transition: opacity var(--transition-base);
}

.panel-handle.is-open .panel-handle__label {
  opacity: 0;
}

.control-panel {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: var(--panel-width, 420px);
  background: var(--panel-bg);
  border-right: 1px solid var(--panel-border);
  z-index: 9998;
  transform: translateX(-100%);
  transition:
    transform var(--transition-slow),
    background var(--transition-theme),
    border-color var(--transition-theme);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
  padding-top: calc(var(--space-lg) + var(--space-xl));
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.control-panel.is-open {
  transform: translateX(0);
}

/* ── Mobile close button inside panel ── */
.panel-mobile-close {
  display: none; /* hidden on desktop */
}

@media (max-width: 768px) {
  /* Full-width panel on mobile so content isn't cropped */
  .control-panel {
    width: 100vw;
  }
  body.panel-is-open #jky-page-wrap {
    transform: none; /* don't push content off-screen */
  }
  body.panel-is-open .nav {
    left: 0;
  }
  /* Hide the sliding handle — replaced by in-panel close button */
  .panel-handle.is-open {
    opacity: 0;
    pointer-events: none;
  }
  /* Show the in-panel close button */
  .panel-mobile-close {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: var(--space-lg);
    opacity: 0.75;
    transition: opacity 0.2s;
    justify-content: right;
  }
  .panel-mobile-close:hover { opacity: 1; }
}

.panel-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.panel-close:hover {
  background: var(--border-medium);
  color: var(--text-primary);
}

.panel-section {
  margin-bottom: var(--space-2xl);
}

.panel-section__title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}



/* Day/Night Slider */
.ambient-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.ambient-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ambient-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ambient-label svg {
  width: 16px;
  height: 16px;
}


input[type="range"].ambient-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--bg-elevated) 0%,
    var(--accent-primary) calc(var(--ambient) * 100%),
    var(--border-medium) calc(var(--ambient) * 100%)
  );
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

input[type="range"].ambient-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-primary);
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

input[type="range"].ambient-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Theme Switcher */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.theme-option {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  aspect-ratio: 2 / 1;
}

.theme-option:hover { transform: scale(1.03); }

.theme-option.active {
  border-color: var(--accent-primary);
}

.theme-option__preview {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.theme-option__bar {
  height: 40%;
  display: flex;
  align-items: center;
  padding: 4px 8px;
  gap: 4px;
}

.theme-option__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.theme-option__content {
  flex: 1;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.theme-option__line {
  height: 2px;
  border-radius: 1px;
  opacity: 0.6;
}

/* Midnight preview */
.theme-midnight .theme-option__bar { background: #0f0f1a; }
.theme-midnight .theme-option__dot:nth-child(1) { background: #4f8ef7; }
.theme-midnight .theme-option__dot:nth-child(2) { background: #7c3aed; }
.theme-midnight .theme-option__content { background: #08080f; }
.theme-midnight .theme-option__line { background: #4f8ef7; }

/* Daylight preview */
.theme-daylight .theme-option__bar { background: #e8e8f0; }
.theme-daylight .theme-option__dot:nth-child(1) { background: #2563eb; }
.theme-daylight .theme-option__dot:nth-child(2) { background: #7c3aed; }
.theme-daylight .theme-option__content { background: #f4f4f8; }
.theme-daylight .theme-option__line { background: #2563eb; }

/* Aurora preview */
.theme-aurora .theme-option__bar { background: #0d1f2d; }
.theme-aurora .theme-option__dot:nth-child(1) { background: #00e5cc; }
.theme-aurora .theme-option__dot:nth-child(2) { background: #9d4edd; }
.theme-aurora .theme-option__content { background: #050d14; }
.theme-aurora .theme-option__line { background: #00e5cc; }

/* Dusk preview */
.theme-dusk .theme-option__bar { background: #22150a; }
.theme-dusk .theme-option__dot:nth-child(1) { background: #f59e0b; }
.theme-dusk .theme-option__dot:nth-child(2) { background: #ef4444; }
.theme-dusk .theme-option__content { background: #130a04; }
.theme-dusk .theme-option__line { background: #f59e0b; }

.theme-option__name {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-align: center;
  padding: 4px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  transition: color var(--transition-theme);
}

/* Panel divider */
.panel-divider {
  height: 1px;
  background: var(--border-subtle);
  margin-bottom: var(--space-lg);
}

/* ============================================================
   10. HERO SECTION
   ============================================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  padding: var(--space-4xl) 0;
  transition: background var(--transition-theme);
}

.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.hero__orb--1 {
  width: 600px;
  height: 600px;
  background: var(--accent-glow);
  top: -200px;
  right: -100px;
  opacity: 0.4;
  animation: orbFloat1 8s ease-in-out infinite;
}

.hero__orb--2 {
  width: 400px;
  height: 400px;
  background: rgba(124, 58, 237, 0.15);
  bottom: -100px;
  left: 200px;
  animation: orbFloat2 12s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 30px) scale(1.05); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -20px) scale(0.95); }
}

.hero__content {
  position: relative;
  z-index: 2;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  animation: fadeSlideUp 0.8s ease 0.2s both;
}

.hero__eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero__title {
  font-size: clamp(3.5rem, 9vw, 8.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: var(--space-lg);
  animation: fadeSlideUp 0.8s ease 0.3s both;
  text-shadow: 0 1px 20px rgba(0,0,0,0.35);
}

.hero__title em {
  font-style: normal;
  font-weight: 800;
  color: var(--accent-primary);
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  max-width: 55ch;
  line-height: 1.7;
  margin-bottom: var(--space-2xl);
  animation: fadeSlideUp 0.8s ease 0.4s both;
  text-shadow: 0 1px 12px rgba(0,0,0,0.4);
}

/* Daylight: replace dark drop-shadows with a soft white glow */
[data-theme="daylight"] .hero__title {
  text-shadow:
    0 0 52px rgba(255,255,255,0.3),
    0 0 52px rgba(255,255,255,0.3);
}
[data-theme="daylight"] .hero__subtitle {
  text-shadow:
    0 0 53px rgba(255,255,255,0.6),
    0 1px 4px rgba(255,255,255,0.4);
}
[data-theme="daylight"] h1,
[data-theme="daylight"] h2,
[data-theme="daylight"] h3 {
  
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  animation: fadeSlideUp 0.8s ease 0.5s both;
}

.hero__scroll-indicator {
  position: absolute;
  bottom: -80px;
  left: 0%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  z-index: 2;
  animation: fadeSlideUp 0.8s ease 0.8s both;
}

.hero__scroll-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.scroll-arrow {
  width: 20px;
  height: 30px;
  border: 1.5px solid var(--border-medium);
  border-radius: 10px;
  position: relative;
  animation: bounceY 2s ease-in-out infinite;
}

.scroll-arrow::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--accent-primary);
  border-radius: 50%;
  transform: translateX(-50%);
  animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollDot {
  0% { top: 5px; opacity: 1; }
  100% { top: 18px; opacity: 0; }
}

@keyframes bounceY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ============================================================
   11. BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 12px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition:
    transform var(--transition-fast),
    opacity var(--transition-fast),
    box-shadow var(--transition-fast);
  cursor: pointer;
  min-width: 155px;
  justify-content: center;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn--primary:hover {
  box-shadow: 0 8px 32px var(--accent-glow);
  color: white;
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  min-width: 150px;
  justify-content: center;
}

.btn--outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  text-align: center;
}

.btn--ghost {
  background: transparent;
  color: var(--text-accent);
  padding: 14px 0;
}

.btn--ghost:hover { color: var(--text-primary); }

.btn__arrow {
  display: inline-block;
  transition: transform var(--transition-base);
}

.btn:hover .btn__arrow { transform: translateX(4px); }

/* ============================================================
   12. PROJECT CARDS
   ============================================================ */

.projects-section {
  padding: var(--space-4xl) 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-xl);
}

.section-header__text {}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-lg);
}

.project-card {
  position: relative;
  background: var(--bg-surface);
  border: 0px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition:
    border-color var(--transition-base),
    transform var(--transition-slow),
    box-shadow var(--transition-slow),
    background var(--transition-theme);
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
}

/* Grid layout for first 2 featured cards */
.project-card--featured {
  grid-column: span 6;
}

.project-card--standard {
  grid-column: span 4;
}

/* Ensure last row works well */
@media (min-width: 1024px) {
  .projects-grid .project-card:nth-child(3),
  .projects-grid .project-card:nth-child(4),
  .projects-grid .project-card:nth-child(5) {
    grid-column: span 4;
  }

  .projects-grid .project-card:nth-child(6),
  .projects-grid .project-card:nth-child(7),
  .projects-grid .project-card:nth-child(8) {
    grid-column: span 4;
  }
}

.project-card__image {
  width: 100%;
  aspect-ratio: 1 / .7;
  overflow: hidden;
  position: relative;
}

.project-card--featured .project-card__image {
  aspect-ratio: 4 / 3;
}

.project-card__image-inner {
  width: 100%;
  height: 100%;
  background-color: var(--bg-elevated);
  transition: transform var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.project-card:hover .project-card__image-inner {
  transform: scale(1.04);
}

/* Case study images — contain so the full image is always visible */
.img-bw      { background-image: url('../assets/img/thumb-BW.png');                background-size: contain; background-repeat: no-repeat; background-position: center; }
.img-diyai   { background-image: url('../assets/img/thumb-DIYAI.png');             background-size: contain; background-repeat: no-repeat; background-position: center; }
.img-robust  { background-image: url('../assets/img/thumb-robust.png'); background-size: contain; background-repeat: no-repeat; background-position: center; }
.img-bwmobile{ background-image: url('../assets/img/thumb-BW-app.png');           background-size: contain; background-repeat: no-repeat; background-position: center; }
.img-boost   { background-image: url('../assets/img/thumb-loyaltyProgram.png');        background-size: contain; background-repeat: no-repeat; background-position: center; }
.img-unspike { background-image: url('../assets/img/thumb-unspike.png');        background-size: contain; background-repeat: no-repeat; background-position: center; }
.img-aha     { background-image: url('../assets/img/thumb-AHA.png');                background-size: contain; background-repeat: no-repeat; background-position: center; }
.img-belgard { background-image: url('../assets/img/thumb-belgard.png');       background-size: contain; background-repeat: no-repeat; background-position: center; }

.project-card__image-label {
  position: absolute;
  bottom: var(--space-md);
  left: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}

.project-card__body {
  padding: var(--space-lg);
}

.project-card__category {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
  transition: color var(--transition-theme);
}

.project-card__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  transition: color var(--transition-theme);
}

.project-card__desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  transition: color var(--transition-theme);
}

.project-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent-primary);
  transition: gap var(--transition-base);
}

.project-card:hover .project-card__link { gap: 10px; }

/* ============================================================
   13. CLIENTS SECTION
   ============================================================ */

.clients-section {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.30);
  transition: border-color var(--transition-theme), background var(--transition-theme);
  position: relative;
}

[data-theme="daylight"] .clients-section {
  background: rgba(255, 255, 255, 0.70);
}

.clients-section::before,
.clients-section::after {
  content: '';
  position: absolute;
  top: 0;
  width: 150px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.clients-section::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-primary), transparent);
}

.clients-section::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-primary), transparent);
}

.clients-marquee-wrap {
  overflow: hidden;
  position: relative;
}

.clients-marquee {
  display: flex;
  gap: var(--space-3xl);
  width: max-content;
  animation: marquee 30s linear infinite;
}

.clients-marquee:hover { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.client-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.client-logo img {
  height: 65px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.55;
  transition: opacity var(--transition-fast), filter var(--transition-theme);
}

.client-logo img:hover { opacity: 0.9; }

/* In Daylight theme logos appear dark */
[data-theme="daylight"] .client-logo img {
  filter: brightness(0);
  opacity: 0.40;
}
[data-theme="daylight"] .client-logo img:hover { opacity: 0.70; }

.client-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.client-name:hover { color: var(--text-secondary); }

/* ============================================================
   14. TESTIMONIALS
   ============================================================ */

.testimonials-section {
  padding: var(--space-4xl) 0;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.testimonial-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition:
    border-color var(--transition-base),
    background var(--transition-theme),
    transform var(--transition-slow);
}

.testimonial-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.testimonial-card:first-child {
  grid-column: span 2;
}

.testimonial-quote {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  font-style: italic;
  transition: color var(--transition-theme);
}

.testimonial-quote::before {
  content: '"';
  font-size: 3rem;
  color: var(--accent-primary);
  display: block;
  line-height: 1;
  margin-bottom: var(--space-sm);
  font-style: normal;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.testimonial-author__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: color var(--transition-theme);
}

.testimonial-author__role {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition-theme);
}

/* ============================================================
   15. STATS / NUMBERS
   ============================================================ */

.stats-section {
  padding: var(--space-3xl) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.stat-card {
  background: transparent;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  transition:
    background var(--transition-theme),
    border-color var(--transition-theme);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: var(--space-sm);
  transition: color var(--transition-theme);
}

.stat-label {
  font-size: 1rem;
  color: var(--text-primary);
  transition: color var(--transition-theme);
  font-weight: 800;11
}

/* ============================================================
   16. ABOUT PAGE
   ============================================================ */

.about-hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  background: var(--gradient-hero);
  padding-top: 120px;
  transition: background var(--transition-theme);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-2xl);
  align-items: start;
}

.about-portrait {
  position: relative;
}

.about-portrait__frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  align-items: center;
  justify-content: center;
  margin-top: 4rem;
  transition: border-color var(--transition-theme);
}

.about-portrait__initials {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 300;
  color: var(--border-medium);
  letter-spacing: -0.05em;
  transition: color var(--transition-theme);
}

.about-portrait__badge {
  position: absolute;
  bottom: var(--space-lg);
  left: var(--space-lg);
  right: var(--space-lg);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.about-portrait__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.about-portrait__badge-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: color var(--transition-theme);
}

.skills-section {
  padding: var(--space-4xl) 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.skill-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition:
    background var(--transition-theme),
    border-color var(--transition-base);
}

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

.skill-card__icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.skill-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  transition: color var(--transition-theme);
}

.skill-card__items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition:
    background var(--transition-theme),
    border-color var(--transition-theme),
    color var(--transition-theme);
}

/* Experience Timeline */
.timeline {
  position: relative;
  padding-left: 32px;
  margin-top: var(--space-2xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle);
  transition: background var(--transition-theme);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-2xl);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -36px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-primary);
  transition: background var(--transition-theme);
}

.timeline-item__year {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-primary);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
  transition: color var(--transition-theme);
}

.timeline-item__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  transition: color var(--transition-theme);
}

.timeline-item__company {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  transition: color var(--transition-theme);
}

.timeline-item__desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  transition: color var(--transition-theme);
}

/* ============================================================
   17. WORK PAGE
   ============================================================ */

.work-hero {
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  padding-top: 120px;
  padding-bottom: var(--space-3xl);
  background: var(--gradient-hero);
  transition: background var(--transition-theme);
}

.work-filters {
  display: none;
  gap: var(--space-sm);
  margin-bottom: var(--space-3xl);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

/* ============================================================
   18. PROJECT DETAIL PAGES
   ============================================================ */

.project-hero {
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  padding-top: 140px;
  padding-bottom: var(--space-3xl);
  position: relative;
  overflow: hidden;
  transition: background var(--transition-theme);
}

.project-hero__bg {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  transition: opacity var(--transition-base);
}

.project-hero__content {
  position: relative;
  z-index: 2;
}

.project-hero__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  transition: color var(--transition-fast);
}

.project-hero__back:hover { color: var(--text-primary); }

.project-hero__back svg {
  transition: transform var(--transition-base);
}

.project-hero__back:hover svg { transform: translateX(-4px); }

.project-meta {
  display: flex;
  gap: var(--space-2xl);
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.project-meta__item {}

.project-meta__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.project-meta__value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: color var(--transition-theme);
}

.project-content {
  padding: var(--space-4xl) 0;
}

.project-body {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: var(--space-3xl);
}

.project-sidebar {}

.project-sidebar__title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

.project-sidebar__title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.project-sidebar__value {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  transition: color var(--transition-theme);
}

.project-main h2 {
  font-size: 2rem;
  margin-bottom: var(--space-lg);
  margin-top: var(--space-3xl);
}

.project-main h2:first-child { margin-top: 0; }

.project-main p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  max-width: 72ch;
}

.project-main ul {
  list-style: none;
  margin-bottom: var(--space-xl);
}

.project-main ul li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.project-main ul li::before {
  content: '→';
  color: var(--accent-primary);
  flex-shrink: 0;
  margin-top: 2px;
  transition: color var(--transition-theme);
}

.outcome-highlight {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
  transition:
    background var(--transition-theme),
    border-color var(--transition-theme);
}

.outcome-highlight__number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 300;
  color: var(--accent-primary);
  letter-spacing: -0.04em;
  transition: color var(--transition-theme);
}

.outcome-highlight__label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.project-image-block {
  margin: var(--space-2xl) 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.project-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-image-placeholder span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* ============================================================
   19. CONTACT SECTION
   ============================================================ */

.contact-section {
  padding: var(--space-4xl) 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  transition:
    background var(--transition-theme),
    border-color var(--transition-theme);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-3xl);
}

.contact-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}

.contact-icon-btn:hover {
  opacity: 1;
  transform: scale(1.08);
}

.contact-icon-btn img {
  height: 55px;
  width: auto;
  display: block;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  border-bottom:1px dashed var(--border-medium);
}

.contact-item__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 0px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition-theme);
}

.contact-item__text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color var(--transition-theme);
}

/* ============================================================
   20. FOOTER
   ============================================================ */

footer {
  display: block;
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-sm);
  border-top: 0px solid var(--border-subtle);
  transition: border-color var(--transition-theme);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  transition: color var(--transition-theme);
}

.footer-links {
  display: flex;
  gap: var(--space-xl);
}

.footer-link {
  font-size: 0.82rem;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.footer-link:hover { color: var(--text-primary); }

/* ============================================================
   21. ASK JUNG MODAL
   ============================================================ */

.ask-jung-fab {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 800;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--accent-glow), var(--shadow-md);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  animation: fabEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1s both;
}

@keyframes fabEntrance {
  from { transform: scale(0) rotate(-180deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.ask-jung-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px var(--accent-glow), var(--shadow-lg);
}

.ask-jung-fab:active {
  transform: scale(0.96);
}

/* FAB on home: cancel entrance animation, keep hidden until pill leaves viewport */
body.is-home .ask-jung-fab {
  animation: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(0.4) rotate(-120deg) !important;
  transition:
    opacity 0.35s ease,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow var(--transition-fast);
}
/* Pill is fully out of view — FAB spins in */
body.is-home.pill-offscreen .ask-jung-fab {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: scale(1) rotate(0deg) !important;
}

/* ── Home page (pill visible): modal grows upward, bottom input aligns with pill ── */
body.is-home:not(.pill-offscreen) .ask-jung-modal {
  /* JS sets left / width / bottom at open time — these are fallback defaults */
  bottom: auto;
  right: auto;
  width: 540px;
  /* Fully rounded — modal floats above the pill */
  border-radius: var(--radius-xl) !important;
  /* Grow from the bottom upward */
  transform-origin: bottom center;
  transform: scaleY(0);
  clip-path: none !important;
  opacity: 0;
  transition:
    transform 0.42s cubic-bezier(0.34, 1.15, 0.64, 1),
    opacity 0.18s ease !important;
}
body.is-home:not(.pill-offscreen) .ask-jung-modal.is-open {
  transform: scaleY(1);
  clip-path: none !important;
  opacity: 1;
}
/* ── Home page (pill offscreen / FAB mode): modal uses standard clip-path from bottom-right ── */
body.is-home.pill-offscreen .ask-jung-modal {
  transform: none !important;
}

/* Pill stays normal when chat is open — modal floats above it */
.hero-ask__pill.chat-is-open {
  background: var(--bg-elevated);
  z-index: 9101;
  position: relative;
}

/* ── Ask Jung backdrop ── */
#jky-jung-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    backdrop-filter 0.35s ease,
    -webkit-backdrop-filter 0.35s ease;
}

#jky-jung-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ── Hero Ask Jung pill ── */
.hero-ask {
  margin-top: var(--space-xl);
  width: 100%;
  max-width:840px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.hero-ask__pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-glass);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 6px 14px 6px 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background var(--transition-theme);
  cursor: text;
}

.hero-ask__pill:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.hero-ask__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.hero-ask__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 8px 0;
  min-width: 0;
  transition: color var(--transition-theme);
}

.hero-ask__input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.hero-ask__go {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: white;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-ask__go:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.hero-ask__go:active {
  transform: scale(0.94);
}

@media (max-width: 600px) {
  .hero-ask { max-width: 100%; }
  .ask-jung-modal {
    right: var(--space-md);
    left: var(--space-md);
    width: auto;
    bottom: var(--space-md);
  }
}

.ask-jung-fab__icon {
  font-size: .7rem;
  color: white;
}

.ask-jung-fab__pulse {
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-full);
  border: 2px solid var(--accent-primary);
  animation: fabPulse 2s ease-out infinite;
  opacity: 0;
}

@keyframes fabPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.ask-jung-modal {
  position: fixed;
  bottom: calc(var(--space-xl) + 70px);
  right: var(--space-xl);
  width: 380px;
  height: 560px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  z-index: 9100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 40px var(--accent-glow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  /* Expand from bottom-right — clip reveals upward */
  clip-path: inset(100% 0 0 100% round var(--radius-xl));
  opacity: 0;
  pointer-events: none;
  transition:
    clip-path 0.42s cubic-bezier(0.34, 1.15, 0.64, 1),
    opacity 0.18s ease;
}

.ask-jung-modal.is-open {
  clip-path: inset(0% 0 0 0% round var(--radius-xl));
  opacity: 1;
  pointer-events: auto;
}

.jung-modal__header {
  padding: var(--space-sm) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  display: flow-root;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg-elevated);
  transition: background var(--transition-theme), border-color var(--transition-theme);
}

.jung-modal__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 6px;
}

.jung-modal__logo {
  width: 100%;
  height: auto;
  display: none;
}

[data-theme="daylight"] .jung-modal__logo--day { display: block; }
[data-theme="midnight"] .jung-modal__logo--light,
[data-theme="aurora"]   .jung-modal__logo--light,
[data-theme="dusk"]     .jung-modal__logo--light { display: block; }

.jung-modal__info {
  display: flex;
}

.jung-modal__name {
  font-size: 1.25rem;
  font-weight: 600;
  width: 100%;
  padding-bottom: var(--space-sm);
  color: var(--text-primary);
  transition: color var(--transition-theme);
}

.jung-modal__status {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-theme);
}

.jung-modal__status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

.jung-modal__controls {
  display: flex;
  gap: var(--space-sm);
  margin-left: auto;
}

.jung-ctrl-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.75rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}

#jky-export-btn {
  padding-bottom: 7px;
}

#jky-voice-btn {
  padding-bottom: 5px;;
}

.jung-ctrl-btn:hover {
  background: var(--border-medium);
  color: var(--text-primary);
}

.jung-ctrl-btn.speaking {
  background: rgba(79, 142, 247, 0.2);
  color: var(--accent-primary);
}

.jung-voice-select {
  background: var(--border-subtle);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  padding: 4px 6px;
  cursor: pointer;
  outline: none;
  max-width: 110px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.jung-voice-select:hover {
  background: var(--border-medium);
  color: var(--text-primary);
}

.jung-voice-select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ---- Chat export panel ---- */
.jung-export-panel {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: background var(--transition-theme);
}

.jung-export-panel[aria-hidden="true"] {
  display: none;
}

.jung-export__label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
}

.jung-export__input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.jung-export__input:focus {
  border-color: var(--accent-primary);
}

.jung-export__actions {
  display: flex;
  gap: var(--space-sm);
}

.jung-export__send {
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: var(--gradient-accent);
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity var(--transition-fast);
}

.jung-export__send:hover { opacity: 0.88; }

.jung-export__cancel {
  padding: 9px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.jung-export__cancel:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.jung-export__note {
  font-size: 0.74rem;
  margin: 0;
  min-height: 1em;
  transition: color var(--transition-fast);
}

.jung-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: messageIn 0.3s ease;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message--jung { align-items: flex-start; }
.message--user { align-items: flex-end; }

.message__bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  transition: background var(--transition-theme), color var(--transition-theme);
}

.message--jung .message__bubble {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.message--user .message__bubble {
  background: var(--gradient-accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.message__time {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0 4px;
}

.jung-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.jung-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.2s ease-in-out infinite;
}

.jung-typing span:nth-child(2) { animation-delay: 0.2s; }
.jung-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.jung-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: 0 var(--space-lg) var(--space-md);
}

.suggestion-btn {
  padding: 6px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
  white-space: nowrap;
}

.suggestion-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.jung-input-row {
  padding: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--space-sm);
  background: var(--bg-elevated);
  transition: border-color var(--transition-theme), background var(--transition-theme);
}

.jung-input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 10px var(--space-md);
  font-size: 0.88rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  outline: none;
  transition:
    border-color var(--transition-fast),
    background var(--transition-theme),
    color var(--transition-theme);
}

.jung-input:focus { border-color: var(--accent-primary); }

.jung-input::placeholder { color: var(--text-muted); }

.jung-send {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  flex-shrink: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.jung-send:hover { opacity: 0.9; transform: scale(1.05); }

/* ============================================================
   22. SCROLL REVEAL ANIMATIONS
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stats-grid .reveal.is-visible {
  background: var(--bg-film);
}

.reveal--left {
  opacity: 0;
  transform: translateX(-30px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.reveal--left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal--scale {
  opacity: 0;
  transform: scale(0.95);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.reveal--scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   23. OVERLAY (for panel backdrop)
   ============================================================ */

.panel-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 9990;
  pointer-events: none;
}

.panel-overlay.is-visible {
  pointer-events: auto;
}

/* ============================================================
   24. UTILITY CLASSES
   ============================================================ */

.text-accent { color: var(--accent-primary); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-italic { font-style: italic; }
.text-center { text-align: center; }
/*.mb-sm { margin-bottom: var(--space-sm); }*/
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }
.mb-4xl { margin-bottom: var(--space-4xl); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ============================================================
   25. RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
  .nav {
    padding-left: 8%;
    padding-right: 8%;
  }
  .container,
  .container--wide {
    padding-left: 8%;
    padding-right: 8%;
  }
  .case-study__grid { grid-template-columns: 2fr 1fr; }
}

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

  footer .container {
    max-width: 100%;
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }
}

@media (max-width: 1100px) {
  .projects-grid .project-card--featured { grid-column: span 12; }
  .projects-grid .project-card--standard { grid-column: span 6; }
  .testimonials-grid { grid-template-columns: 1fr 1fr; }
  .testimonial-card:first-child { grid-column: span 2; }
}

@media (max-width: 768px) {
  :root {
    --space-xl: 24px;
    --space-2xl: 40px;
    --space-3xl: 60px;
    --space-4xl: 80px;
  }

  .container, .container--wide { padding: 0 var(--space-3xl); }

  .nav__links { display: none; }

  .hero__title { font-size: clamp(3rem, 12vw, 5.5rem); letter-spacing: -0.05em; }

  .projects-grid .project-card--featured,
  .projects-grid .project-card--standard { grid-column: span 12; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  .about-grid { grid-template-columns: 1fr; }
  .project-body { grid-template-columns: 1fr; }

  .testimonials-grid { grid-template-columns: 1fr; }
  .testimonial-card:first-child { grid-column: span 1; }

  .stats-grid { grid-template-columns: 1fr; }

  .contact-grid { grid-template-columns: 1fr; }

  .contact-section {
    padding-left: 8%;
    padding-right: 8%;
  }

  .contact-section .container {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .contact-section footer {
    padding-left: 0;
    padding-right: 0;
  }

  .contact-section h2 {
    font-size: clamp(2.5rem, 9vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
  }

  .contact-info {
    margin-top: 0;
    gap: var(--space-xl);
  }

  .ask-jung-modal {
    width: calc(100vw - 2 * var(--space-md));
    right: var(--space-md);
    bottom: calc(var(--space-xl) + 70px);
  }

  .work-grid { grid-template-columns: 1fr; }

  .cursor-dot, .cursor-ring { display: none; }

  .skills-grid { grid-template-columns: 1fr 1fr; }

  .project-meta { flex-wrap: wrap; gap: var(--space-lg); }

  .footer-inner { flex-direction: column; gap: var(--space-md); text-align: center; }

}


@media (max-width: 480px) {
  .skills-grid { grid-template-columns: 1fr; }
  .ask-jung-modal { height: 480px; }
}

/* ============================================================
   HOVER-SCROLL PROJECT CAROUSEL
   ============================================================ */

.proj-carousel-outer {
  position: relative;
  width: 100%;
  overflow: hidden;
  cursor: none;
  /* Vertical breathing room for the hover zoom (max 1.07) — 60px is plenty */
  padding: 60px 0 60px 0;
}

.proj-carousel-track {
  display: flex;
  /* flex-start prevents stretch from pushing transform-origin off-center */
  align-items: flex-start;
  gap: 24px;
  padding: 0 var(--space-xl);
  overflow: visible;
  will-change: transform;
  width: max-content;
}

/* ---- Card ---- */
.proj-card {
  flex: 0 0 380px;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 0px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  /* transform-origin forced to exact centre both in CSS and JS */
  transform-origin: 50% 50%;
  /* JS drives scale; short CSS transition makes hover zoom smooth */
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              filter  0.28s ease,
              opacity 0.28s ease,
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  will-change: transform, filter, opacity;
  /* Cards have their own stacking context so z-index from JS works */
  position: relative;
}

.proj-card.is-hovered {
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-primary);
  border-color: var(--accent-primary);
}

.proj-card:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* Featured card — slightly wider */
.proj-card--featured {
  flex: 0 0 440px;
}

/* ---- Card image area ---- */
.proj-card__image {
  aspect-ratio: 1 / .7;
  background-color: var(--bg-elevated);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Carousel card images — contain so the full case study image is always visible */
.proj-card__image.img-bw      { background-image: url('../assets/img/thumb-BW.png');                 background-size: contain; background-repeat: no-repeat; background-position: center; }
.proj-card__image.img-diyai   { background-image: url('../assets/img/thumb-DIYAI.png');              background-size: contain; background-repeat: no-repeat; background-position: center; }
.proj-card__image.img-robust  { background-image: url('../assets/img/thumb-robust.png'); background-size: contain; background-repeat: no-repeat; background-position: center; }
.proj-card__image.img-bwmobile{ background-image: url('../assets/img/thumb-BW-app.png');           background-size: contain; background-repeat: no-repeat; background-position: center; }
.proj-card__image.img-boost   { background-image: url('../assets/img/thumb-loyaltyProgram.png');        background-size: contain; background-repeat: no-repeat; background-position: center; }
.proj-card__image.img-unspike { background-image: url('../assets/img/thumb-unspike.png');        background-size: contain; background-repeat: no-repeat; background-position: center; }
.proj-card__image.img-aha     { background-image: url('../assets/img/thumb-AHA.png');                background-size: contain; background-repeat: no-repeat; background-position: center; }
.proj-card__image.img-belgard { background-image: url('../assets/img/thumb-belgard.png');       background-size: contain; background-repeat: no-repeat; background-position: center; }

/* Image zoom removed — hover is handled at the card level by JS scale */

/* Gradient overlay on images */
.proj-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

/* ---- Card body ---- */
.proj-card__body {
  flex: 1;
  padding: var(--space-lg) var(--space-lg) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.proj-card__category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.proj-card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.proj-card__desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  flex: 1;
}

.proj-card__cta {
  display: inline-block;
  margin-top: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  transition: gap 0.2s ease;
}

/* ---- Hover-zone arrows ---- */
.carousel-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  display: flex;
  align-items: center;
  pointer-events: none;       /* JS manages hover via mousemove, not pointer events */
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 2;
}

.carousel-zone--left  { left: 0;  justify-content: flex-start; padding-left: var(--space-lg); background: linear-gradient(to right, rgba(0,0,0,0.18), transparent); }
.carousel-zone--right { right: 0; justify-content: flex-end;   padding-right: var(--space-lg); background: linear-gradient(to left, rgba(0,0,0,0.18), transparent); }

.carousel-zone.is-active { opacity: 1; }

.carousel-arrow {
  font-size: 1.6rem;
  color: var(--text-primary);
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-medium);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .proj-carousel-outer {
    cursor: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .proj-carousel-outer::-webkit-scrollbar { display: none; }
  .proj-carousel-track {
    padding: 0 var(--space-md);
    overflow: visible;
  }
  .proj-card { flex: 0 0 300px; }
  .proj-card--featured { flex: 0 0 320px; }
  .carousel-zone { display: none; }
}

/* ============================================================
   PAGE TRANSITION LOADER
   ============================================================ */
#jky-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg-primary, #08080f);
  opacity: 1;
  pointer-events: all;
  transition: opacity 0.45s ease;
}
#jky-loader.is-hiding {
  opacity: 0;
  pointer-events: none;
}
#jky-loader.is-hidden {
  display: none;
}

.loader-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--border-subtle, rgba(255,255,255,0.06));
  border-top-color: var(--accent-primary, #4f8ef7);
  animation: loaderSpin 0.8s linear infinite;
}
@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

.loader-message {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted, #808098);
  height: 1.2em;
  transition: opacity 0.25s ease;
}

.loader-bar-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-subtle, rgba(255,255,255,0.06));
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary, #4f8ef7), var(--accent-secondary, #7c3aed));
  animation: loaderBarFill 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes loaderBarFill {
  0%   { width: 0%; }
  55%  { width: 70%; }
  100% { width: 92%; }
}

/* ============================================================
   CASE STUDY TWO-COLUMN LAYOUT
   ============================================================ */
.case-study {
  padding: var(--space-3xl) 0 var(--space-4xl);
}

.case-study__title {
  font-size: clamp(1.8rem, 5.5vw, 5.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  line-height: 1;
  transition: color var(--transition-theme);
}

.case-study__client {
  font-size: clamp(1.2rem, 3.5vw, 2.8rem);
  color: var(--accent-primary);
  font-weight: 500;
  margin-bottom: var(--space-2xl);
  margin-top: var(--space-lg);
  transition: color var(--transition-theme);
  line-height: 1;
}

.case-study__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
  padding-top: var(--space-3xl);
}

@keyframes csSlowScroll {
  from { transform: translateY(0); }
  to   { transform: translateY(var(--cs-shift, 0px)); }
}

.case-study__copy {
  align-self: start;
  animation-name: csSlowScroll;
  animation-duration: 1ms;
  animation-timing-function: linear;
  animation-fill-mode: both;
}

.case-study__copy p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  transition: color var(--transition-theme);
}

.case-study__copy p:last-child { margin-bottom: 0; }

/* ── Stat boxes inside case study left column ── */
.case-study__stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  width: 100%;
  min-width: 0;
}

@media (min-width: 1200px) {
  .case-study__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.case-study__stats .stat-number {
  font-size: 3rem;
}

.case-study__stats .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
}

.case-study__images {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.case-study__images img {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-theme);
}

.case-study .container > .flex {
  justify-content: center;
}

@media (max-width: 900px) {
  .case-study__grid { grid-template-columns: 1fr; }
  .case-study__copy {
    animation: none !important;
    transform: none !important;
  }
}
