/* ============================================================
   CUSTOM FONTS
   ============================================================ */
@font-face {
  font-family: 'SHAKA';
  src: url('../fonts/SHAKA.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DhRando';
  src: url('../fonts/Quera.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   RESET & TOKENS
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; cursor: none !important; }

:root {
  /* Brand */
  --indigo: #FF1A1A;
  --coral:  #FF6B6B;
  --green:  #00FF88;

  /* Dark theme (default) */
  --black:          #080808;
  --surface:        #111111;
  --surface-2:      #161616;
  --white:          #EFEFEF;
  --gray:           #666676;
  --card-bg:        #111111;
  --nav-blur:       transparent;
  --section-alt:    #0E0E0E;
  --menu-bg:        rgba(8,8,8,0.98);
  --border-subtle:  rgba(255,255,255,0.06);
  --border-soft:    rgba(255,255,255,0.04);
  --border-medium:  rgba(255,255,255,0.10);
  --input-bg:       rgba(255,255,255,0.03);
  --input-border:   rgba(255,255,255,0.08);
  --footer-dim:     rgba(255,255,255,0.22);
  --footer-dimmer:  rgba(255,255,255,0.10);
  --corner-color:   var(--indigo);

  /* Fonts */
  --mono: 'DhRando', monospace;
  --sans: 'DhRando', sans-serif;
  --display: 'DhRando', sans-serif;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --black:         #F0EDE6;
  --surface:       #E8E5DE;
  --surface-2:     #E0DDD6;
  --white:         #0A0908;
  --gray:          #5A584E;
  --card-bg:       #E4E1DA;
  --nav-blur:      transparent;
  --section-alt:   #E8E5DE;
  --menu-bg:       rgba(240,237,230,0.98);
  --border-subtle: rgba(0,0,0,0.09);
  --border-soft:   rgba(0,0,0,0.06);
  --border-medium: rgba(0,0,0,0.13);
  --input-bg:      rgba(0,0,0,0.03);
  --input-border:  rgba(0,0,0,0.12);
  --footer-dim:    rgba(0,0,0,0.38);
  --footer-dimmer: rgba(0,0,0,0.20);
  --green:         #009944;
  --corner-color:  var(--indigo);
}

/* ===== SMOOTH THEME TRANSITION ===== */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition:
    background-color 0.4s ease,
    color            0.4s ease,
    border-color     0.4s ease,
    box-shadow       0.4s ease !important;
}

html { scroll-behavior: smooth; }

body {
  position: relative;
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

/* ===== UTILITY ===== */
.mono { font-family: var(--mono); }

/* ===== SCANLINES ===== */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.025) 2px,
    rgba(0,0,0,0.025) 4px
  );
  pointer-events: none;
  z-index: 9998;
}
[data-theme="light"] .scanlines { opacity: 0.4; }

/* Grain */
body::before {
  content: '';
  position: fixed;
  inset: 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.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9997;
  opacity: 0.28;
  transition: opacity 0.4s ease;
}
[data-theme="light"] body::before { opacity: 0.12; }

/* ===== STATUS DOTS ===== */
.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.green  { background: var(--green);  box-shadow: 0 0 6px var(--green); }
.dot.indigo { background: var(--indigo); box-shadow: 0 0 6px var(--indigo); }
.dot.coral  { background: var(--coral);  box-shadow: 0 0 6px var(--coral); }

/* ===== CORNER BRACKETS ===== */
.corner, .canvas-corner {
  position: absolute;
  width: 18px; height: 18px;
  pointer-events: none;
}
.corner.tl, .canvas-corner.tl { top: 20px;    left: 20px;    border-top:    1px solid var(--corner-color); border-left:   1px solid var(--corner-color); }
.corner.tr, .canvas-corner.tr { top: 20px;    right: 20px;   border-top:    1px solid var(--corner-color); border-right:  1px solid var(--corner-color); }
.corner.bl, .canvas-corner.bl { bottom: 20px; left: 20px;    border-bottom: 1px solid var(--corner-color); border-left:   1px solid var(--corner-color); }
.corner.br, .canvas-corner.br { bottom: 20px; right: 20px;   border-bottom: 1px solid var(--corner-color); border-right:  1px solid var(--corner-color); }
.canvas-corner { width: 14px; height: 14px; }
.canvas-corner.tl { top: 10px;    left: 10px; }
.canvas-corner.tr { top: 10px;    right: 10px; }
.canvas-corner.bl { bottom: 10px; left: 10px; }
.canvas-corner.br { bottom: 10px; right: 10px; }

/* ===== CURSOR ===== */
#cursor-dot {
  position: fixed;
  width: 10px; height: 10px;
  background: #FF0000;
  border: 2px solid transparent;
  box-sizing: border-box;
  border-radius: 0;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%) scale(1);
  box-shadow: 0 0 6px rgba(255,0,0,0.65), 0 0 14px rgba(255,0,0,0.3);
  transition:
    width        0.18s cubic-bezier(0.4,0,0.2,1),
    height       0.18s cubic-bezier(0.4,0,0.2,1),
    background   0.18s ease,
    border-color 0.18s ease,
    box-shadow   0.18s ease,
    transform    0.12s ease;
}
/* Over a clickable element — hollow red box */
#cursor-dot.hand-hover {
  width: 26px; height: 26px;
  background: transparent;
  border-color: #FF0000;
  box-shadow: 0 0 10px rgba(255,0,0,0.65), 0 0 22px rgba(255,0,0,0.28);
}
/* Click burst */
#cursor-dot.clicking {
  transform: translate(-50%, -50%) scale(1.9);
  background: rgba(255,0,0,0.12);
  border-color: #FF4444;
  box-shadow: 0 0 18px rgba(255,0,0,0.9), 0 0 34px rgba(255,0,0,0.4);
}
#cursor-ring { display: none; }

/* ===== TORCH OVERLAY ===== */
#torch-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9995;
  will-change: background, opacity;
  transition: opacity 0.5s ease;
  background: radial-gradient(
    circle 740px at var(--tx, 50%) var(--ty, 50%),
    transparent 0%,
    transparent 44%,
    rgba(0,0,0,0.72) 55%,
    rgba(0,0,0,0.93) 100%
  );
}
[data-theme="light"] #torch-overlay {
  background: radial-gradient(
    circle 340px at var(--tx, 50%) var(--ty, 50%),
    transparent 0%,
    transparent 14%,
    rgba(0,0,0,0.5) 55%,
    rgba(0,0,0,0.20) 100%
  );
}

/* ===== LOADER ===== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  overflow: hidden;
  pointer-events: all;
  background: #060606;
  display: flex;
  align-items: center;
  justify-content: center;
}
#loader.gone { display: none; }

/* Split panels for exit */
.ld-panel {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  background: #060606;
  z-index: 2;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.18, 1);
}
.ld-top { top: 0; }
.ld-bot { bottom: 0; }
#loader.splitting .ld-top { transform: translateY(-100%); }
#loader.splitting .ld-bot { transform: translateY( 100%); }

/* Horizontal scanline sweep */
.ld-scan {
  position: absolute;
  left: 0; right: 0;
  height: 120px;
  top: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(255,26,26,0.04) 40%,
    rgba(255,26,26,0.10) 50%,
    rgba(255,26,26,0.04) 60%,
    transparent 100%
  );
  animation: ldScan 2.6s linear forwards;
  opacity: 0;
}
@keyframes ldScan {
  0%   { top: -120px; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Name wrapper — above panels */
.ld-name-wrap {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  opacity: 0;
  animation: ldNameAppear 0.7s 0.25s cubic-bezier(0.2,0,0,1) forwards;
}
@keyframes ldNameAppear {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Name base */
.ld-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.02em;
  font-family: 'SHAKA', var(--display);
  font-size: clamp(44px, 10.5vw, 138px);
  line-height: 0.88;
  letter-spacing: 0.06em;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

/* Hollow outline layer */
.ld-name-hollow {
  -webkit-text-stroke: 1.5px rgba(255, 26, 26, 0.45);
  color: transparent;
}

/* Filled layer — clips upward */
.ld-name-fill {
  position: absolute;
  top: 0; left: 0; right: 0;
  color: #FF1A1A;
  text-shadow: 0 0 60px rgba(255,26,26,0.35), 0 0 20px rgba(255,26,26,0.2);
  clip-path: inset(100% 0 0 0);
}

/* name fly handled by JS */

/* Corner brackets framing the name */
.ld-bracket {
  position: absolute;
  width: 28px; height: 28px;
  z-index: 4;
  opacity: 0;
  animation: ldBracketIn 0.5s 0.5s ease forwards;
}
@keyframes ldBracketIn {
  from { opacity: 0; transform: scale(1.3); }
  to   { opacity: 1; transform: scale(1); }
}
.ld-br-tl { top: calc(50% - 100px); left: calc(50% - 280px); border-top: 1px solid rgba(255,26,26,0.6); border-left: 1px solid rgba(255,26,26,0.6); }
.ld-br-tr { top: calc(50% - 100px); right: calc(50% - 280px); border-top: 1px solid rgba(255,26,26,0.6); border-right: 1px solid rgba(255,26,26,0.6); }
.ld-br-bl { bottom: calc(50% - 100px); left: calc(50% - 280px); border-bottom: 1px solid rgba(255,26,26,0.6); border-left: 1px solid rgba(255,26,26,0.6); }
.ld-br-br { bottom: calc(50% - 100px); right: calc(50% - 280px); border-bottom: 1px solid rgba(255,26,26,0.6); border-right: 1px solid rgba(255,26,26,0.6); }

/* Corner labels */
.ld-corner-tl {
  position: absolute; top: 22px; left: 24px; z-index: 5;
  font-size: 11px; color: #FF1A1A; letter-spacing: 0.18em;
}
.ld-corner-tr {
  position: absolute; top: 16px; right: 24px; z-index: 5;
  font-size: 10px; color: rgba(255,255,255,0.35); letter-spacing: 0.2em;
  padding: 5px 14px; border: 1px solid rgba(255,255,255,0.12);
}

/* Bottom footer */
.ld-footer {
  position: absolute;
  bottom: 44px; left: 50%; transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 260px;
}
.ld-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.3);
}
.ld-bar-wrap {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  border-radius: 1px;
}
.ld-bar {
  height: 100%;
  width: 0%;
  background: #FF1A1A;
  box-shadow: 0 0 8px rgba(255,26,26,0.7);
  transition: width 0.05s linear;
}
.ld-pct {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(255,26,26,0.65);
}

/* ===== NAVBAR ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9996;
  background: var(--nav-blur);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  padding: 0 40px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 0;
  transition: background 0.4s, border-color 0.4s;
}
nav.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,0.3); }
.nav-logo {
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--white);
  text-decoration: none;
  margin-right: auto;
  transition: color 0.2s;
}
.nav-logo:hover { color: var(--indigo); }

/* Nav logo: full name shrinks → SSS on scroll */
.nav-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 28px;
  overflow: visible;
  text-decoration: none;
  margin-right: auto;
}
.nl-full {
  font-family: 'SHAKA', var(--display);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--white);
  white-space: nowrap;
  display: block;
  opacity: 1;
  transform: scale(1);
  transform-origin: left center;
  transition: opacity 0.4s cubic-bezier(0.4,0,0.2,1),
              transform 0.4s cubic-bezier(0.4,0,0.2,1);
}
.nl-short {
  font-family: 'SHAKA', var(--display);
  position: absolute;
  left: 0;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--white);
  white-space: nowrap;
  opacity: 0;
  transform: scale(1.4);
  transform-origin: left center;
  transition: opacity 0.4s cubic-bezier(0.4,0,0.2,1),
              transform 0.4s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}
/* Scrolled: full name shrinks to nothing, SSS grows in */
.nav-logo.is-short .nl-full {
  opacity: 0;
  transform: scale(0.3);
}
.nav-logo.is-short .nl-short {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.nav-logo:hover .nl-full,
.nav-logo:hover .nl-short { color: var(--indigo); }

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  margin-right: 36px;
}
.nav-links a {
  color: var(--gray);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--sans);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--indigo);
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
}
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { width: 100%; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--gray);
}

/* Theme toggle */
.theme-toggle {
  width: 32px; height: 32px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray);
  flex-shrink: 0;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.theme-toggle:hover { border-color: var(--indigo); color: var(--indigo); background: rgba(255,26,26,0.07); }
.theme-toggle svg { display: block; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--white);
  border-radius: 1px;
  transition: all 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px); }

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--menu-bg);
  z-index: 9997;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--display);
  font-size: clamp(36px, 10vw, 64px);
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.15em;
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--indigo); }

/* ===== HERO ===== */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: 56px;
}
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Meta strips */
.hero-meta-top,
.hero-meta-bottom {
  position: absolute;
  left: 32px; right: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: rgba(108,99,255,0.55);
  z-index: 2;
}
.hero-meta-top    { top: 72px; }
.hero-meta-bottom { bottom: 28px; }

/* Main content */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 40px;
  max-width: 1100px;
  width: 100%;
}
.hero-eyebrow {
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--indigo);
  margin-bottom: 40px;
  min-height: 1.4em;
}
.hero-name {
  font-size: clamp(48px, 9vw, 110px);
  line-height: 0.88;
  letter-spacing: 0.02em;
  margin-bottom: 52px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18em;
  text-align: center;
}
.hn-line {
  display: block;
  opacity: 0;
  transform: translateY(60px);
  animation: slideUp 0.7s cubic-bezier(0.2,0,0,1) forwards;
  font-family: 'SHAKA', var(--display);
}
.hn-line:nth-child(2) {
  animation-delay: 0.1s;
}
.hn-alt {
  font-feature-settings: "salt" 1, "calt" 1, "ss01" 1, "ss02" 1, "ss03" 1;
  font-variant-alternates: stylistic-alt;
}
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }

/* Light: gradient on name */
[data-theme="light"] .hero-name { color: var(--white); }

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 42px;
  opacity: 0;
  animation: fadeUp 0.6s 1.4s ease forwards;
  justify-content: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gray);
  background: rgba(255,255,255,0.02);
}
[data-theme="light"] .badge { background: rgba(0,0,0,0.03); }

.hero-tagline {
  font-size: clamp(13px, 1.5vw, 16px);
  font-weight: 300;
  color: var(--gray);
  letter-spacing: 0.03em;
  font-style: italic;
  margin-bottom: 56px;
  opacity: 0;
  animation: fadeUp 0.6s 1.6s ease forwards;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 28px;
  border: 1px solid var(--indigo);
  border-radius: 2px;
  color: var(--white);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.22em;
  opacity: 0;
  animation: fadeUp 0.6s 1.8s ease forwards;
  position: relative;
  overflow: hidden;
  transition: color 0.3s, box-shadow 0.3s;
}
.hero-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--indigo);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
  z-index: -1;
}
.hero-cta:hover::before { transform: scaleX(1); }
.hero-cta:hover { box-shadow: 0 0 24px rgba(108,99,255,0.35); color: #fff; }
.cta-arr { transition: transform 0.3s; }
.hero-cta:hover .cta-arr { transform: translateX(4px); }

/* Scroll hint */
.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.scroll-hint span { font-size: 9px; letter-spacing: 0.25em; }
.scroll-arrow {
  width: 1px; height: 32px;
  background: linear-gradient(to bottom, rgba(108,99,255,0.6), transparent);
  animation: scrollPulse 2s infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ===== SCROLL PATH ===== */
#scroll-path-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 2;
}
#scroll-path-svg {
  display: block;
  width: 100%;
  overflow: visible;
}

/* ===== SECTION SHARED ===== */
section { padding: 110px 0; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 40px; }

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 64px;
}
.section-num {
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--indigo);
  flex-shrink: 0;
}
.section-label {
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--gray);
  flex-shrink: 0;
}
.section-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.2,0,0,1), transform 0.7s cubic-bezier(0.2,0,0,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== ABOUT ===== */
#about { background: var(--black); border-top: 1px solid var(--border-subtle); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 64px;
  align-items: start;
}
.about-cube-wrap {
  position: relative;
  height: 380px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface);
}
#about-canvas { width: 100%; height: 100%; }

/* Profile metadata */
.profile-meta { display: flex; flex-direction: column; margin-bottom: 28px; }
.meta-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.meta-row:first-child { border-top: 1px solid var(--border-soft); }
.meta-key {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gray);
  white-space: nowrap;
}
.meta-val {
  font-size: 15px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
}

.bio-divider { height: 1px; background: var(--border-subtle); margin: 24px 0; }
.bio-text { font-size: 16px; color: var(--gray); font-weight: 300; line-height: 1.85; margin-bottom: 14px; }
.about-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag {
  padding: 5px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--gray);
  transition: border-color 0.2s, color 0.2s;
}
.tag:hover { border-color: var(--indigo); color: var(--indigo); }

/* ===== WORK ===== */
#work { background: var(--section-alt); border-top: 1px solid var(--border-subtle); }

/* Slider wrapper */
.case-slider-wrap {
  display: flex;
  align-items: stretch;
  gap: 12px;
}
.case-slider {
  flex: 1;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
}
.case-track {
  display: flex;
  will-change: transform;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slide arrow buttons */
.slider-btn {
  width: 44px;
  flex-shrink: 0;
  border: 1px solid var(--border-medium);
  background: var(--surface);
  color: var(--gray);
  font-size: 18px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
  letter-spacing: 0;
}
.slider-btn:hover {
  border-color: var(--indigo);
  color: var(--indigo);
  background: rgba(255,26,26,0.08);
}
.slider-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

/* Footer: counter + dots */
.slider-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 0 56px;
}
.slider-counter {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gray);
}
.slider-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.slider-dot {
  width: 6px; height: 6px;
  border-radius: 1px;
  background: var(--border-medium);
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.3s, width 0.3s;
}
.slider-dot.active {
  background: var(--indigo);
  width: 22px;
}

/* Individual cards inside track */
.case-file {
  flex: 0 0 100%;
  width: 100%;
  background: var(--card-bg);
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
}
.case-file:hover { background: var(--surface-2); }
[data-theme="light"] .case-file:hover { background: var(--surface); }

.case-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.case-num    { font-size: 12px; letter-spacing: 0.18em; color: var(--indigo); flex: 1; }
.case-status { font-size: 11px; letter-spacing: 0.15em; color: var(--gray); }
.case-year   { font-size: 11px; letter-spacing: 0.1em;  color: var(--gray); }

.case-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
}
.case-thumb .thumb-art {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.case-file:hover .thumb-art { opacity: 1; }

.thumb-1 { background: linear-gradient(135deg, #1a0a2e, #0f3460); }
.thumb-2 { background: linear-gradient(135deg, #1a0014, #0d001a); }
.thumb-3 { background: linear-gradient(135deg, #001a1a, #004444); }
.thumb-4 { background: linear-gradient(135deg, #1a1a00, #0a1000); }
.thumb-5 { background: linear-gradient(135deg, #1a0a00, #3a1000); }

.case-body { padding: 20px; }
.case-category {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--coral);
  display: block;
  margin-bottom: 8px;
}
.case-title {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.06em;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 10px;
}
.case-desc { font-size: 14px; color: var(--gray); line-height: 1.7; margin-bottom: 16px; }
.case-cta {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--indigo);
  text-decoration: none;
  transition: letter-spacing 0.3s, color 0.2s;
}
.case-file:hover .case-cta { letter-spacing: 0.3em; }

/* 3D tilt (applied via JS) */
.case-file { transform-style: preserve-3d; transition: transform 0.08s ease, background 0.2s; }

/* ===== CERTIFICATES ===== */
#certs { background: var(--section-alt); border-top: 1px solid var(--border-subtle); }
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
}
.cert-card {
  background: var(--card-bg);
  transition: background 0.2s;
}
.cert-card:hover { background: var(--surface-2); }
[data-theme="light"] .cert-card:hover { background: var(--surface); }

.cert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-subtle);
}
.cert-num  { font-size: 12px; letter-spacing: 0.18em; color: var(--indigo); }
.cert-date { font-size: 11px; letter-spacing: 0.12em; color: var(--gray); }

.cert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0 8px;
  opacity: 0.75;
  transition: opacity 0.3s;
}
.cert-card:hover .cert-icon { opacity: 1; }

.cert-body { padding: 8px 22px 28px; }
.cert-issuer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--gray);
  margin-bottom: 12px;
}
.cert-title {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 0.05em;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 14px;
}
.cert-desc {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.8;
  font-weight: 300;
  margin-bottom: 20px;
}
.cert-cta {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--coral);
  text-decoration: none;
  transition: letter-spacing 0.3s, color 0.2s;
}
.cert-card:hover .cert-cta { letter-spacing: 0.3em; color: var(--white); }

/* ===== SKILLS ===== */
#skills { background: var(--black); border-top: 1px solid var(--border-subtle); }
.skills-list { display: flex; flex-direction: column; gap: 0; }
.skill-row {
  display: grid;
  grid-template-columns: 140px 1fr 52px;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-soft);
}
.skill-row:first-child { border-top: 1px solid var(--border-soft); }
.skill-name {
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--gray);
  white-space: nowrap;
}
.skill-bar-wrap {
  height: 2px;
  background: var(--border-subtle);
  border-radius: 1px;
  overflow: hidden;
}
.skill-bar {
  height: 100%;
  width: 0%;
  border-radius: 1px;
  transition: width 1.2s cubic-bezier(0.2,0,0,1);
}
.skill-pct {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--indigo);
  text-align: right;
  white-space: nowrap;
}

/* ===== CONTACT ===== */
#contact { background: var(--section-alt); border-top: 1px solid var(--border-subtle); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 80px; align-items: start; }
.contact-intro { font-size: 16px; color: var(--gray); line-height: 1.9; font-weight: 300; margin-bottom: 40px; }
.social-links { display: flex; flex-direction: column; }
.social-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--gray);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
  position: relative;
}
.social-link::before {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 0; height: 1px;
  background: linear-gradient(90deg, var(--indigo), var(--coral));
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}
.social-link:hover { color: var(--white); }
.social-link:hover::before { width: 100%; }
.social-icon {
  width: 32px; height: 32px;
  border: 1px solid var(--border-medium);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  border-radius: 2px;
  flex-shrink: 0;
  transition: border-color 0.3s, color 0.3s;
}
.social-link:hover .social-icon { border-color: var(--indigo); color: var(--indigo); }
.social-arrow { margin-left: auto; opacity: 0; transition: opacity 0.2s, transform 0.2s; }
.social-link:hover .social-arrow { opacity: 1; transform: translateX(4px); }

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gray);
}
.form-group input,
.form-group textarea {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 2px;
  padding: 12px 14px;
  color: var(--white);
  font-family: var(--sans);
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  resize: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 16px rgba(255,26,26,0.12);
  background: rgba(108,99,255,0.03);
}
.form-group textarea { height: 120px; }
.form-status {
  min-height: 1.2em;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gray);
}
.form-status.is-error { color: #ff6b6b; }
.form-status.is-success { color: var(--green); }
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 32px;
  background: transparent;
  border: 1px solid var(--indigo);
  border-radius: 2px;
  color: var(--indigo);
  font-size: 13px;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
  align-self: flex-start;
}
.btn-submit:hover {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 0 24px rgba(108,99,255,0.4);
}
.btn-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

/* ===== FOOTER ===== */
footer {
  padding: 28px 40px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--black);
  position: relative;
  z-index: 9996;
}
.footer-logo   { font-size: 13px; letter-spacing: 0.25em; color: var(--gray); }
.footer-copy   { font-size: 12px; color: var(--footer-dim); letter-spacing: 0.12em; }
.footer-copy-dimmer { font-size: 12px; color: var(--footer-dimmer); letter-spacing: 0.12em; }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-status { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-cube-wrap { height: 260px; }
  .slider-footer { padding: 0 56px; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  footer { flex-direction: column; gap: 12px; text-align: center; }
}
@media (max-width: 620px) {
  nav { padding: 0 20px; }
  .container { padding: 0 20px; }
  section { padding: 80px 0; }
  .hero-content { padding: 0 20px; }
  .hero-meta-top, .hero-meta-bottom { left: 20px; right: 20px; }
  .slider-btn { width: 36px; }
  .slider-footer { padding: 0 48px; }
  .cert-grid { grid-template-columns: 1fr; }
  .skill-row { grid-template-columns: 110px 1fr 44px; gap: 14px; }
  footer { padding: 24px 20px; }
  .section-header { margin-bottom: 40px; }
}
@media (max-width: 480px) {
  section { padding: 64px 0; }
  .about-cube-wrap { height: 200px; }
  .hero-meta-bottom .mono:first-child { display: none; }
  .meta-row { grid-template-columns: 100px 1fr; gap: 10px; }
  .skill-row { grid-template-columns: 90px 1fr 40px; gap: 10px; }
  .skill-name { font-size: 11px; }
  .slider-footer { padding: 0 40px; }
  .hero-badges { gap: 6px; }
  .badge { font-size: 9px; padding: 4px 9px; }
  .section-header { gap: 12px; }
  .contact-intro { font-size: 14px; }
}

/* ===== TOUCH DEVICES ===== */
@media (pointer: coarse) {
  *, *::before, *::after { cursor: auto !important; }
  body { cursor: auto; }
  #cursor-dot, #cursor-ring { display: none !important; }
  #torch-overlay { display: none; }
  .roaming-cat { display: none; }
  .form-group input,
  .form-group textarea { font-size: 16px; }
}

/* ============================================================
   ROAMING CATS — pixel art edition
   ============================================================ */
.roaming-cat {
  position: fixed;
  z-index: 9990;
  pointer-events: auto;
  user-select: none;
  width: 60px;
}

/* Pixel-art SVG: sharp, no anti-aliasing */
.cat-svg {
  display: block;
  width: 60px;
  height: 50px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.35));
  transition: filter 0.15s;
}
.roaming-cat:hover .cat-svg {
  filter: drop-shadow(0 4px 0 rgba(0,0,0,0.5)) brightness(1.15);
}

/* ── Pixel cat colour themes ── */
.cat-red   { --cc: #E53030; --cc-dark: #A01010; --cc-inner: #FF9090; }
.cat-white { --cc: #F0EDE8; --cc-dark: #B8B5B0; --cc-inner: #FFB5C5; }

/* ── Pixel rect fills ── */
.cat-body        { fill: var(--cc); }
.cat-inner-ear   { fill: var(--cc-inner); }
.cat-eye         { fill: #111; }
.cat-nose        { fill: #FF9999; }
.cat-angry-brow  { fill: var(--cc-dark); opacity: 0; }
.cat-blush       { fill: rgba(255,110,110,0.0); }
.cat-tear        { fill: rgba(80,160,255,0); }

/* ── Emotions ── */
.roaming-cat.angry .cat-angry-brow { opacity: 1; }
.roaming-cat.angry .cat-eye        { fill: #990000; }
.roaming-cat.angry .cat-blush      { fill: rgba(220,40,40,0.42); }

.roaming-cat.emotional .cat-eye    { fill: #2233aa; }
.roaming-cat.emotional .cat-tear   { fill: rgba(80,160,255,0.9); }
.roaming-cat.emotional .cat-blush  { fill: rgba(255,170,200,0.42); }

/* ── Pixel walk — snappy 2-frame cycle ── */
@keyframes cat-bounce {
  0%, 49% { transform: translateY(0); }
  50%, 100% { transform: translateY(-5px); }
}
.roaming-cat.walking {
  animation: cat-bounce 0.28s steps(2, end) infinite;
}

/* Alternating paw groups */
@keyframes paw-up {
  0%, 49% { transform: translateY(0); }
  50%, 100% { transform: translateY(-5px); }
}
.roaming-cat.walking .cat-paw-front {
  animation: paw-up 0.28s steps(2, end) infinite;
}
.roaming-cat.walking .cat-paw-back {
  animation: paw-up 0.28s steps(2, end) 0.14s infinite;
}

/* ── Speech bubble (red cat) ── */
.cat-speech {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--indigo);
  color: var(--white);
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s;
}
.cat-speech::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--indigo);
}
.roaming-cat:hover .cat-speech { opacity: 1; }

/* ── Dragging state ── */
.roaming-cat.dragging {
  cursor: grabbing;
  animation: none !important;
  z-index: 9999;
}
.roaming-cat.dragging .cat-svg {
  filter: drop-shadow(0 8px 4px rgba(0,0,0,0.5)) brightness(1.25);
  transform: rotate(-8deg) !important;
}
.roaming-cat.dragging .cat-speech { opacity: 1; }

/* ── Hearts (white cat) ── */
.cat-hearts-area {
  position: absolute;
  bottom: 90%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
}
@keyframes heart-rise {
  0%   { opacity: 0; transform: translateY(0) scale(0.4) rotate(var(--hr, 0deg)); }
  18%  { opacity: 1; }
  82%  { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-64px) scale(1.15) rotate(var(--hr, 0deg)); }
}
.pixel-heart {
  position: absolute;
  bottom: 0;
  animation: heart-rise var(--hd, 0.9s) ease-out forwards;
  pointer-events: none;
  image-rendering: pixelated;
}
