/* ============================================================
   VILLA ALTAÏR — MODERN ARCHITECTURAL STYLESHEET
   Features:
   - Direct-Manipulation Tactile Interactions
   - Tabular Numbers & Sliding Counter Wheels
   - Glassmorphism & Depth Layers
   - Interactive Spotlight Cards & 3D Tilt
   - Dynamic Scrims & Mesh Fades
   ============================================================ */

/* CSS Reset & Variables */
:root {
  --bg-obsidian: #08090b;
  --bg-surface: #0e1218;
  --gold-glow: rgba(245, 215, 140, 0.4);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(245, 215, 140, 0.35);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-damped: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-obsidian);
  color: #f1f5f9;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Presets */
.font-serif {
  font-family: 'Cinzel', serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Dynamic Scrims & Mesh Fades */
.radial-vignette {
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(8, 9, 11, 0.75) 100%);
}

.bg-blueprint-grid {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Equalizer Bars Animation (Audio Reactive) */
.eq-bar {
  transform-origin: bottom;
  height: 4px;
}

.eq-active .eq-bar:nth-child(1) {
  animation: eq-bounce 0.65s ease-in-out infinite alternate;
}
.eq-active .eq-bar:nth-child(2) {
  animation: eq-bounce 0.45s ease-in-out infinite alternate 0.12s;
}
.eq-active .eq-bar:nth-child(3) {
  animation: eq-bounce 0.58s ease-in-out infinite alternate 0.28s;
}
.eq-active .eq-bar:nth-child(4) {
  animation: eq-bounce 0.72s ease-in-out infinite alternate 0.06s;
}

@keyframes eq-bounce {
  0% { height: 3px; }
  35% { height: 14px; }
  70% { height: 6px; }
  100% { height: 12px; }
}

/* React Bits Style Specular Stats Spotlight */
.stats-spotlight {
  background: radial-gradient(
    280px circle at var(--spot-x, 50%) var(--spot-y, 50%),
    rgba(245, 215, 140, 0.18),
    transparent 70%
  );
}

/* Haute Couture Shimmer Animation for Configure Stay */
.luxe-magnetic-btn {
  will-change: transform, box-shadow;
  transition: transform 0.25s var(--ease-damped), box-shadow 0.4s ease;
}

.luxe-shimmer-sheen {
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 30%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0.4) 70%,
    transparent 100%
  );
  transform: translateX(-150%) skewX(-20deg);
  animation: none;
}

.luxe-magnetic-btn:hover .luxe-shimmer-sheen {
  animation: luxe-sweep 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes luxe-sweep {
  0% { transform: translateX(-150%) skewX(-20deg); }
  100% { transform: translateX(200%) skewX(-20deg); }
}

/* Interactive Spotlight Cards */
.spotlight-grid {
  position: relative;
}

.spotlight-card {
  position: relative;
  border-radius: 24px;
  background-color: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: radial-gradient(
    550px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
    rgba(245, 215, 140, 0.12),
    transparent 40%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.spotlight-card:hover::before {
  opacity: 1;
}

.spotlight-card:hover {
  border-color: rgba(245, 215, 140, 0.25);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(245, 215, 140, 0.05);
}

/* 3D Tilt Effect on Cards */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

/* Draggable Tactile Horizontal Ruler */
.ruler-container {
  touch-action: pan-y;
}

.ruler-tape {
  padding-left: calc(50% - 15px);
  padding-right: calc(50% - 15px);
}

.ruler-tick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  user-select: none;
}

.tick-mark {
  width: 1px;
  background-color: rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.ruler-tick.major .tick-mark {
  height: 28px;
  width: 2px;
  background-color: rgba(245, 215, 140, 0.8);
}

.ruler-tick.minor .tick-mark {
  height: 14px;
}

.tick-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #a1a1aa;
  position: absolute;
  top: -22px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Sliding / Blurred Counter Wheels */
.price-wheel-container {
  display: inline-flex;
  align-items: baseline;
  position: relative;
  line-height: 1;
}

.digit-column {
  display: inline-flex;
  flex-direction: column;
  position: relative;
  height: 1.1em;
  overflow: hidden;
  transition: transform 0.4s var(--ease-damped);
}

.digit-reel {
  display: flex;
  flex-direction: column;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.digit-reel.rolling {
  filter: blur(0.7px);
}

.digit-char {
  height: 1.1em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Domain Radio Indicator */
.domain-card.active {
  background-color: rgba(245, 215, 140, 0.08);
  border-color: rgba(245, 215, 140, 0.5);
}

.domain-card.active .radio-indicator span {
  opacity: 1 !important;
}

/* Blueprint Pins */
.blueprint-pin {
  cursor: pointer;
  z-index: 20;
}

.blueprint-pin:hover .pin-card {
  opacity: 1;
  pointer-events: auto;
}

/* Blueprint Tab Active */
.level-tab-btn.active-tab {
  color: #fef08a;
}

/* Stateful Buttons */
.stateful-btn {
  will-change: transform;
}

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

/* Scroll Bounce Animation */
@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

.animate-scroll-bounce {
  animation: scroll-bounce 1.6s ease-in-out infinite;
}

/* Dynamic Brand Title Frosted Pill when scrolled past hero */
.brand-pill-frosted {
  background-color: rgba(8, 9, 11, 0.72) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55) !important;
}

/* Tailwind-equivalent utility helpers */
.bg-obsidian { background-color: #08090b; }
.max-w-7xl { max-width: 80rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-xl { max-width: 36rem; }
.max-w-md { max-width: 28rem; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .ruler-tape {
    padding-left: calc(50% - 15px);
    padding-right: calc(50% - 15px);
  }
}
