/*
 * FabCube – World Class UI System (v3.1)
 * Paradigm: 2026 Nature Distilled + Kinetic Tech
 */

:root {
  /* Phase 10: Spatial Pure Palette */
  --brand-bg: 11 11 13;
  /* Deep Matte Charcoal (Not Pitch Black) */
  --brand-card: 22 22 24;
  /* Solid Matte Surface */

  /* Accent: Sophisticated White Blue (Not Neon) */
  --brand-cyan: 230 240 255;
  /* Ice White */
  --brand-accent: 50 100 255;
  /* International Klein Blue (Point Color) */

  --brand-surface: 255 255 255;

  /* Text Colors */
  --text-primary: 250 250 250;
  /* Pure White */
  --text-secondary: 140 140 145;
  /* Muted Metal */

  --radius-lg: 24px;
  /* Apple-like curvature */
  --radius-md: 12px;

  /* Animation Timing */
  --ease-elastic: cubic-bezier(0.25, 1, 0.5, 1);
  /* Apple "Breathe" ease */
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  background-color: rgb(var(--brand-bg));
  color: rgb(var(--text-primary));
  font-family: 'Pretendard', 'Inter', system-ui, -apple-system, sans-serif;
  letter-spacing: normal;
  /* Phase 9: Readability */
  overflow-x: hidden;
  line-height: 1.6;
}

/* Point 25: Custom Selection Colors */
::selection {
  background: rgba(var(--brand-cyan), 0.3);
  color: white;
}

/* Phase 10: Clean Atmosphere (No Blobs) */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Subtle Vignette + Grain only */
  background: radial-gradient(circle at 50% 0%, rgba(50, 60, 80, 0.15), transparent 60%);
  z-index: -2;
  pointer-events: none;
}

/* Scrollbar Polish */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--brand-cyan), 0.5);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Space Grotesk', 'Pretendard', sans-serif;
  letter-spacing: -0.03em;
  /* Tighter headings for massive look */
  font-weight: 700;
}

.font-tech,
.counter,
.date,
.price {
  font-family: 'Space Grotesk', monospace;
}

/* =========================================
   COMPONENTS - 2026 FROSTED TOUCH
   ========================================= */

/* Phase 10: Solid Frost (Spatial UI) */
.glass-tech {
  background: rgba(30, 30, 33, 0.6);
  /* Darker, more solid */
  border: 1px solid rgba(255, 255, 255, 0.06);
  /* Ultra thin clean border */
  border-radius: var(--radius-lg);
  backdrop-filter: blur(40px);
  /* Heavy Blur (Apple Style) */
  -webkit-backdrop-filter: blur(40px);
  box-shadow:
    0 10px 40px -10px rgba(0, 0, 0, 0.5);
  /* Deep shadow, no glow */
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

/* Remove Noise Texture from Cards for Cleaner look */
.glass-tech::after {
  display: none;
}

.glass-tech:hover {
  background: rgba(40, 40, 45, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.6);
}

.curtain-reveal {
  animation: slideUp 0.8s cubic-bezier(0.87, 0, 0.13, 1) forwards;
}

@keyframes slideUp {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-100%);
  }
}

/* Buttons */
/* Phase 10: Refined Buttons */
.btn-primary {
  /* Minimalist Pill */
  background-color: white;
  color: black;
  font-weight: 600;
  /* Lighter weight */
  padding: 0.8rem 2rem;
  border-radius: 99px;
  /* Pill shape */
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: 'Inter', system-ui, sans-serif;
  /* Cleaner font */
  letter-spacing: 0;
  z-index: 10;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
  border: 1px solid transparent;
}

.btn-primary:hover::after {
  left: 100%;
}

.btn-primary::after {
  display: none;
}

/* Remove sweep effect for cleaner look */

.btn-primary:hover {
  transform: scale(1.02);
  background-color: #f0f0f0;
  box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.btn-outline {
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-weight: 700;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  transition: all 0.3s;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-outline:hover {
  background-color: white;
  color: black;
  border-color: white;
}

.input-field {
  width: 100%;
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.05);
  /* Fallback */
  border-radius: 0.75rem;
  color: white;
  outline: none;
  transition: all 0.3s;
  font-family: 'Space Grotesk', monospace;
  font-weight: 700;
  backdrop-filter: blur(10px);
  background-color: rgba(20, 20, 20, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.input-field::placeholder {
  color: #6b7280;
}

.input-field:focus {
  border-color: rgb(var(--brand-cyan));
  box-shadow: 0 0 0 1px rgba(0, 190, 255, 0.5);
  background-color: rgba(30, 30, 35, 1) !important;
}

/* Form Labels - High Contrast */
label {
  color: #a1a1aa !important;
  margin-bottom: 0.5rem;
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.timeline-line {
  height: 0;
  transition: height 1.5s ease-out;
}

.timeline-line.active {
  height: 100%;
}

details>summary {
  list-style: none;
}

details>summary::-webkit-details-marker {
  display: none;
}

details[open] summary~* {
  animation: sweep .3s ease-in-out;
}

@keyframes sweep {
  0% {
    opacity: 0;
    transform: translateY(-10px)
  }

  100% {
    opacity: 1;
    transform: translateY(0)
  }
}

.lightbox-active {
  overflow: hidden;
}

/* =========================================
   UTILITIES
   ========================================= */

.text-shadow-glow {
  text-shadow: 0 0 20px rgba(var(--brand-cyan), 0.5);
}

.text-gradient {
  background: linear-gradient(to right, #fff, rgb(var(--brand-cyan)));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.nav-link.active {
  color: rgb(var(--brand-cyan));
  font-weight: 700;
}

.nav-link.active span {
  width: 100%;
  height: 2px;
}

.drag-active {
  border-color: rgb(var(--brand-cyan));
  background-color: rgba(var(--brand-cyan), 0.2);
}

/* 2026 Bento Grid System (12-col) */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
  grid-auto-rows: min-content;
  grid-auto-flow: dense;
}

/* Default spans for mobile (full width) */
.bento-grid>* {
  grid-column: span 12;
  container-type: inline-size;
  /* Enable container queries for children */
}

@media (min-width: 768px) {

  /* Tablet Spans */
  .bento-grid>* {
    grid-column: span 6;
  }

  .bento-wide {
    grid-column: span 12;
  }

  .bento-large {
    grid-column: span 8;
    grid-row: span 2;
  }

  .bento-tall {
    grid-column: span 4;
    grid-row: span 2;
  }
}

@media (min-width: 1200px) {

  /* Desktop Spans (Precision 12-col) */
  .bento-grid>* {
    grid-column: span 4;
  }

  /* Standard 1/3 card */
  .bento-wide {
    grid-column: span 8;
  }

  .bento-large {
    grid-column: span 8;
    grid-row: span 2;
  }

  .bento-tall {
    grid-column: span 4;
    grid-row: span 2;
  }

  .bento-hero {
    grid-column: span 12;
    grid-row: span 2;
  }
}

/* Container Queries for Responsive Bento Content */
@container (width < 350px) {
  .card-glow-content {
    padding: 1.5rem;
  }

  h3 {
    font-size: 1.25rem !important;
  }
}

/* V4: Lenis Recommended CSS */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* V4: Active Border / Glow Effects */
.card-glow-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  padding: 1px;
  /* The border width */
  overflow: hidden;
  height: 100%;
  /* Ensure card takes full height in grid */
}

.card-glow-content {
  background: rgba(10, 10, 12, 0.95);
  /* Slightly more opaque for readability */
  border-radius: var(--radius-lg);
  height: 100%;
  position: relative;
  z-index: 2;
  transform: translateZ(0);
  /* Fix for Safari flickering */
}

.card-glow-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0),
      rgba(var(--brand-cyan), 0.3),
      transparent 40%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.card-glow-wrapper:hover .card-glow-bg {
  opacity: 1;
}

/* V4: Text Reveal */
.reveal-text {
  background-image: linear-gradient(90deg, #fff 0%, #fff 0%, #333 0%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  background-position: 100% 50%;
  transition: background-position 1s ease-out;
}

.reveal-text.visible {
  background-position: 0% 50%;
}

/* =========================================
   V5: "BEST IN CLASS" UPGRADES (20 Recommendations)
   ========================================= */

/* Rec 9: Custom Cursor */
/* Hide default cursor only on desktops */
@media (min-width: 1024px) {
  body {
    cursor: none;
  }

  a,
  button,
  input,
  textarea,
  .cursor-pointer {
    cursor: none;
  }
}

#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s;
  mix-blend-mode: difference;
}

#cursor-blur {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  background: rgba(0, 190, 255, 0.4);
  filter: blur(20px);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9998;
  transition: width 0.3s, height 0.3s;
  opacity: 0.15;
  /* Phase 9: Less distracting */
}

/* Hover State */
body.hovering #cursor {
  width: 60px;
  height: 60px;
  background-color: white;
  border-color: transparent;
  mix-blend-mode: difference;
}

body.hovering #cursor-blur {
  width: 100px;
  height: 100px;
  background: rgba(120, 110, 250, 0.6);
}

/* Rec 8: Static Noise Overlay (Phase 9 Polish) */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.03;
  /* Subtler */
  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)' opacity='1'/%3E%3C/svg%3E");
  /* animation: noise 0.5s steps(5) infinite; Removed for comfort */
}

/* @keyframes noise Removed */

/* Rec 4: Glitch Effect */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--brand-bg);
  /* Match bg to hide original */
}

.glitch::before {
  left: 2px;
  text-shadow: -1px 0 #ff00c1;
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -1px 0 #00fff9;
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% {
    clip: rect(30px, 9999px, 10px, 0);
  }

  5% {
    clip: rect(70px, 9999px, 90px, 0);
  }

  10% {
    clip: rect(40px, 9999px, 15px, 0);
  }

  15% {
    clip: rect(10px, 9999px, 60px, 0);
  }

  20% {
    clip: rect(80px, 9999px, 5px, 0);
  }

  100% {
    clip: rect(10px, 9999px, 80px, 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip: rect(10px, 9999px, 80px, 0);
  }

  5% {
    clip: rect(40px, 9999px, 10px, 0);
  }

  10% {
    clip: rect(80px, 9999px, 5px, 0);
  }

  15% {
    clip: rect(30px, 9999px, 90px, 0);
  }

  20% {
    clip: rect(10px, 9999px, 30px, 0);
  }

  100% {
    clip: rect(60px, 9999px, 20px, 0);
  }
}

/* Rec 7: Chromatic Aberration on Glass Hover */
.glass-tech:hover {
  /* Existing styles overriden/extended */
  box-shadow:
    -2px 0 10px rgba(0, 255, 255, 0.2),
    2px 0 10px rgba(255, 0, 255, 0.2),
    0 10px 40px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.4);
}