:root {
  --bg: #000000;
  --text-main: #ffffff;
  --text-dim: #9ca3af;
  --primary: #a855f7;
  --primary-glow: rgba(168, 85, 247, 0.5);
  --secondary: #6366f1;

  --card-bg: #111827;
  --card-border: #374151;

  --font-heading: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-heading);
  overflow-x: hidden;
  user-select: none;
  cursor: none;
}

/* ========= Signature Canvas ========= */
/* ========= Signature Canvas & Ambient Field ========= */
.signature-canvas,
#pixel-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  /* bottom */
  pointer-events: none;
  /* never blocks drag/click */
  opacity: 0.85;
  /* global; JS controls per-stroke alpha */
}

/* ========= Background enhancement ========= */
/* ========= Background enhancement ========= */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(1000px 1000px at 50% 0%, rgba(139, 92, 246, 0.03), transparent 70%),
    radial-gradient(800px 800px at 80% 80%, rgba(99, 102, 241, 0.03), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
  mix-blend-mode: normal;
  opacity: 1;
}

.hidden {
  display: none !important;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.ambient-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 800px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.04) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
}

/* ========= Top-left intro ========= */
.corner-intro {
  position: fixed;
  top: 18px;
  left: 22px;
  z-index: 25;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0.92;
}

.corner-name {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(17, 24, 39, 0.8);
  text-shadow: none;
}

.corner-role {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(107, 114, 128, 0.8);
}

/* =========================================
   NAVIGATION
   ========================================= */
.nav-shell {
  position: fixed;
  top: 24px;
  width: 100%;
  z-index: 2000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  animation: slideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.85);
  /* Increased opacity for solid contrast */
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.nav-inner a {
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  /* Bolder text for readability */
  color: #4b5563;
  /* Darker gray for better contrast */
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.nav-inner a:hover {
  color: #111827;
  background: rgba(0, 0, 0, 0.03);
}

.nav-inner a.active {
  background: #ffffff;
  color: #111827;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* =========================================
   LOADING
   ========================================= */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease;
}

.loader-content {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.loader-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.loader-track {
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.loader-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
  transition: width 0.2s linear;
}

.loader-glitch {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 16px;
  background: rgba(255, 255, 255, 0.8);
  filter: blur(4px);
  transform: translateX(-50%);
}

.loader-log {
  height: 24px;
  text-align: center;
}

.loader-log p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #c084fc;
  margin: 0;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .5;
  }
}

/* =========================================
   MAIN INTERFACE
   ========================================= */
.main-interface {
  position: relative;
  width: 100%;
  min-height: 100vh;
  z-index: 10;
  display: flex;
  flex-direction: column;
  animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

/* HERO */
/* HERO */
.hero {
  position: relative;
  z-index: 20;
  padding: 120px 24px 60px;
  /* More top padding */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.hero-text {
  pointer-events: auto;
  animation: slideUp .8s cubic-bezier(.16, 1, .3, 1) forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  display: flex;
  justify-content: center;
  margin: 0 0 16px 0;
  cursor: default;
}

.hero-title span {
  font-family: 'Roboto Flex', var(--font-heading);
  font-size: 86px;
  /* Massive */
  font-variation-settings: "wdth" 25, "wght" 100;
  letter-spacing: normal;
  line-height: 0.95;
  color: #111827;
  transition: font-variation-settings 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
}

.hero-title span:hover {
  font-variation-settings: "wdth" 120, "wght" 800;
  color: #7D9CB8;
}

.hero-title span:hover+span,
.hero-title span:has(+ span:hover) {
  font-variation-settings: "wdth" 70, "wght" 400;
  color: #5A7E9D;
}

.hero-subtitle {
  font-family: var(--font-heading);
  /* Switch to Inter for cleaner look */
  font-size: 18px;
  font-weight: 400;
  color: #6b7280;
  max-width: 600px;
  margin: 0;
  opacity: 0;
  animation: slideUp .8s cubic-bezier(.16, 1, .3, 1) .1s forwards;
}

.hero-tags {
  display: flex;
  gap: 12px;
  margin-top: 0px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  opacity: 0;
  animation: slideUp .8s cubic-bezier(.16, 1, .3, 1) .1s forwards;
}

.hero-tag {
  padding: 6px 16px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
}


.btn-profile {
  position: absolute;
  top: 32px;
  right: 48px;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: #374151;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all .3s ease;
  opacity: 0;
  animation: slideUp .8s cubic-bezier(.16, 1, .3, 1) .2s forwards;
}

.btn-profile:hover {
  color: #111827;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  transition: box-shadow .3s;
}

.btn-profile:hover .status-dot {
  box-shadow: 0 0 10px var(--primary);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* WORK DECK */
.work-deck {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 700px;
  padding-bottom: 80px;
  perspective: 1000px;
  z-index: 15;
}

.deck-hint {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

/* CARD (same as your upgraded version, kept) */
.card-item {
  position: absolute;
  width: 320px;
  /* Slightly wider */
  height: auto;
  min-height: 280px;
  padding: 12px;
  border-radius: 24px;
  /* Softer corners */
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.04),
    /* Deep soft ambient */
    0 5px 10px rgba(0, 0, 0, 0.02),
    /* Close ambient */
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  /* Inner highlight */
  cursor: grab;
  will-change: transform;
  touch-action: none;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Removed card-item::before for cleaner look */

.card-item:hover {
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  transform: translateY(-8px) scale(1.02);
}

.card-item.dragging {
  cursor: grabbing;
  border-color: #8b5cf6;
  box-shadow: 0 20px 50px rgba(139, 92, 246, 0.25);
  z-index: 1000 !important;
  transform: scale(1.05);
}

.card-inner {
  width: 100%;
  height: auto;
  min-height: 244px;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.card-inner::before {
  content: "";
  position: absolute;
  inset: -30% -30%;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.10) 48%, transparent 62%);
  transform: rotate(-8deg);
  opacity: 0.55;
  pointer-events: none;
  z-index: 1;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

.card-thumb {
  width: 100%;
  position: relative;
  z-index: 2;
  display: flex;
}

.card-thumb img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  opacity: 0.95;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  /* slight shadow directly on image */
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.card-header,
.card-footer,
.card-thumb {
  position: relative;
  z-index: 2;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #1f2937;
  /* Dark gray for readability on light backgrounds */
}

.card-icon {
  opacity: 0;
  transition: opacity .25s;
  color: rgba(0, 0, 0, 0.4);
}

.card-item:hover .card-icon {
  opacity: 1;
}

.card-footer {
  margin-top: auto;
}

.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.7);
  padding: 4px 8px;
  border-radius: 6px;
  backdrop-filter: blur(6px);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-view-project {
  margin-top: 12px;
  width: 100%;
  height: 40px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(99, 102, 241, 0.05));
  color: #4b5563;
  font-family: var(--font-heading);
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.btn-view-project::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -40%;
  width: 60%;
  height: 180%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: rotate(12deg) translateX(-120%);
  opacity: 0;
  transition: transform .65s ease, opacity .25s ease;
}

.btn-view-project:hover {
  transform: translateY(-1px);
  border-color: rgba(216, 180, 254, 0.85);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.btn-view-project:hover::after {
  transform: rotate(12deg) translateX(220%);
  opacity: 1;
}

.btn-view-project:active {
  transform: translateY(0);
}

.card-item.dragging .btn-view-project {
  pointer-events: none;
}

@keyframes microFloat {

  0%,
  100% {
    transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) rotate(var(--tr, 0deg));
  }

  50% {
    transform: translate3d(var(--tx, 0px), calc(var(--ty, 0px) - 2px), 0) rotate(var(--tr, 0deg));
  }
}

.card-item.floaty {
  animation: microFloat 5.8s ease-in-out infinite;
}

/* READER */
.reader-unit {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 390px;
  height: 160px;
  /* Reduced from 215px */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  pointer-events: none;
  z-index: 60;
}

.reader-unit::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -40px;
  transform: translateX(-50%);
  width: 920px;
  height: 520px;
  background:
    radial-gradient(closest-side at 50% 70%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(closest-side at 50% 70%, rgba(99, 102, 241, 0.08), transparent 62%);
  filter: blur(26px);
  opacity: 0.8;
  pointer-events: none;
  z-index: 10;
}

.reader-beam {
  position: absolute;
  bottom: 60px;
  /* Adjusted down */
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 70vh;
  background: linear-gradient(to top, rgba(168, 85, 247, 0.24), rgba(99, 102, 241, 0.06), transparent);
  filter: blur(24px);
  transition: opacity .35s ease;
  opacity: 0.16;
  z-index: 12;
}

.reader-unit.active .reader-beam {
  opacity: 1;
}

.reader-back {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100px;
  /* Reduced from 140px */
  background: #f3f4f6;
  border-top: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 16px 16px 0 0;
  transform: scaleX(0.95) translateY(8px);
  z-index: 30;
}

.reader-slot {
  position: absolute;
  bottom: 85px;
  /* Adjusted down relative to height */
  width: 280px;
  height: 4px;
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.15), rgba(250, 204, 21, 0.75), rgba(250, 204, 21, 0.15));
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.55);
  border-radius: 999px;
  z-index: 35;
  transition: transform .25s ease, opacity .25s ease;
  opacity: 0.45;
}

.reader-unit.active .reader-slot {
  opacity: 1;
  transform: scaleX(1.12);
}

.reader-front {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100px;
  /* Reduced from 140px */
  background: linear-gradient(to bottom, #ffffff, #f9fafb);
  border-top: 4px solid rgba(139, 92, 246, 0.4);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 44px rgba(0, 0, 0, 0.1);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.reader-front::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08), transparent);
  opacity: 0.55;
}

.reader-texture {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image: radial-gradient(circle at 50% 0%, #8b5cf6 2px, transparent 2px);
  background-size: 32px 32px;
}

.reader-logo {
  position: relative;
  padding: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(139, 92, 246, 0.3);
  transition: all .35s ease;
  margin-bottom: 12px;
  color: #7c3aed;
}

.reader-unit.active .reader-logo {
  box-shadow: 0 0 34px rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.6);
  transform: scale(1.1);
  color: #6d28d9;
}

.reader-status {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 55;
}

#reader-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: rgba(139, 92, 246, 0.7);
  transition: color .25s ease, text-shadow .25s ease;
}

.reader-unit.active #reader-text {
  color: #7c3aed;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.status-icon {
  width: 12px;
  height: 12px;
  color: #facc15;
  opacity: 0;
  transition: opacity .2s ease;
}

.reader-unit.active .status-icon {
  opacity: 1;
  animation: pulse 1s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .card-item.floaty {
    animation: none !important;
  }

  .btn-view-project::after {
    transition: none !important;
  }
}

/* Custom Cursor Spotlight */
#cursor-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: difference;
  z-index: 9999;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease-out;
  opacity: 0;
}

body.has-cursor #cursor-spotlight {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
    cursor: auto !important;
    height: auto;
    min-height: 100vh;
  }

  a,
  button,
  input,
  textarea,
  select,
  .studio-card,
  .project-item,
  .other-card,
  .sfx-hover,
  .sfx-click {
    cursor: auto !important;
  }

  #cursor-spotlight,
  body.has-cursor #cursor-spotlight,
  .signature-canvas {
    display: none !important;
  }

  .hero {
    padding-top: 140px;
    padding-bottom: 20px;
  }

  .hero-title span {
    font-size: 11vw;
  }

  .work-deck {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 20px 20px 80px;
    height: auto;
  }

  .deck-hint {
    display: none !important;
  }

  .card-item {
    position: relative !important;
    width: 100% !important;
    max-width: 360px;
    margin: 0 !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    animation: none !important;
    touch-action: pan-y !important;
  }

  .card-item:hover {
    transform: translateY(-4px) !important;
  }

  .card-item.dragging {
    transform: scale(1.02) !important;
  }

  .reader-unit {
    display: none !important;
  }

  .nav-shell {
    position: fixed !important;
    top: 16px !important;
    z-index: 9999 !important;
  }

  /* Make homepage footer visible on light mobile background */
  .global-footer a,
  .global-footer p {
    color: var(--text-dim) !important;
  }

  .global-footer a:hover {
    color: var(--text-main) !important;
  }

  .global-footer img {
    filter: grayscale(100%) contrast(1.2) invert(0) !important;
  }
}