/* ============================================
   OHM — Minimal, 3D protagonista
   Inspiracion: 5Solidos (cincosolidos.com)
   ============================================ */

:root {
  --bg: #0a0a0a;
  --bg-elev: #141414;
  --bg-panel: #161616;

  --fg: #f4f4f2;
  --fg-muted: rgba(244, 244, 242, 0.55);
  --fg-faint: rgba(244, 244, 242, 0.32);

  --miel: #d4a574;
  --lima: #a8c970;

  --border: rgba(244, 244, 242, 0.08);
  --border-hover: rgba(244, 244, 242, 0.18);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-swift: cubic-bezier(0.4, 0, 0.2, 1);

  --pad: clamp(20px, 2.6vw, 40px);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
}

::selection {
  background: var(--lima);
  color: var(--bg);
}

button, a {
  font-family: inherit;
  color: inherit;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
}

/* ============================================
   HEADER — minimalista, 5Solidos style
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 22px var(--pad);
  z-index: 20;
  gap: 40px;
}

.logo {
  display: inline-flex;
  align-items: center;
  color: var(--fg);
  transition: opacity 0.3s var(--ease-swift);
}

.logo svg {
  width: 88px;
  height: auto;
  display: block;
}

.logo:hover {
  opacity: 0.7;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 36px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  position: relative;
  padding: 4px 0;
  transition: color 0.3s var(--ease-swift);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--fg);
  transition: width 0.35s var(--ease-out);
}

.nav-link:hover::after {
  width: 100%;
}

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  width: 28px;
  height: 28px;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.3s var(--ease-swift);
}

.menu-toggle span {
  display: block;
  height: 1.5px;
  background: var(--fg);
  transition: width 0.3s var(--ease-out);
}

.menu-toggle span:first-child {
  width: 22px;
}

.menu-toggle span:last-child {
  width: 14px;
}

.menu-toggle:hover span:last-child {
  width: 22px;
}

/* ============================================
   STAGE — visor fullscreen
   ============================================ */
.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 55%, #1a1b17 0%, #070707 85%);
}

#viewer {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(7, 7, 7, 0.55) 100%),
    linear-gradient(180deg, rgba(7, 7, 7, 0.4) 0%, transparent 14%, transparent 82%, rgba(7, 7, 7, 0.55) 100%);
}

/* ============================================
   CONTROLS — super sutiles, centro abajo
   ============================================ */
.controls {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 5;
  animation: fade-in 1.2s var(--ease-out) 0.6s both;
}

.module-dots {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: rgba(10, 10, 10, 0.38);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--fg-muted);
  transition: all 0.3s var(--ease-swift);
}

.dot:hover {
  color: var(--fg);
}

.dot-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.dot.is-active {
  background: var(--fg);
  color: var(--bg);
}

.dot.is-active .dot-label {
  font-weight: 600;
}

.module-name {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: opacity 0.35s var(--ease-swift);
}

/* ============================================
   CTA GHOST — super discreto, bottom right
   ============================================ */
.cta-ghost {
  position: absolute;
  bottom: 44px;
  right: var(--pad);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 14px;
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.3s var(--ease-out);
  z-index: 6;
  animation: fade-in 1.2s var(--ease-out) 0.9s both;
}

.cta-ghost:hover {
  border-color: var(--lima);
  background: rgba(168, 201, 112, 0.1);
  transform: translateY(-1px);
}

.cta-ghost-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lima);
  box-shadow: 0 0 0 3px rgba(168, 201, 112, 0.2);
  animation: cta-pulse 2s ease-in-out infinite;
}

/* HD toggle (oculto - path tracing requiere three r164+) */
.hd-toggle {
  display: none;
  position: absolute;
  top: 90px;
  right: var(--pad);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(12px);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: all 0.3s var(--ease-out);
  z-index: 6;
}

.hd-toggle:hover {
  border-color: var(--border-hover);
  color: var(--fg);
}

.hd-toggle.is-active {
  background: var(--miel);
  color: var(--bg);
  border-color: var(--miel);
}

.hd-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-muted);
  transition: background 0.3s;
}

.hd-toggle.is-active .hd-dot {
  background: var(--bg);
  animation: cta-pulse 1.5s ease-in-out infinite;
}

@keyframes cta-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(168, 201, 112, 0.2); }
  50% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(168, 201, 112, 0); }
}

/* ============================================
   LOADING
   ============================================ */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  transition: opacity 0.4s var(--ease-swift);
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-bar {
  width: 80px;
  height: 1px;
  background: rgba(244, 244, 242, 0.08);
  overflow: hidden;
}

.loading-fill {
  width: 30%;
  height: 100%;
  background: var(--fg);
  animation: loading-slide 1.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes loading-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(340%); }
}

/* ============================================
   HOTSPOTS — 3D overlays
   ============================================ */
.hotspot {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(244, 244, 242, 0.1);
  border: 1px solid rgba(244, 244, 242, 0.7);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all 0.3s var(--ease-out);
  pointer-events: auto;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hotspot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 0 0 rgba(244, 244, 242, 0.35);
  animation: hotspot-pulse 2.4s var(--ease-out) infinite;
}

@keyframes hotspot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 244, 242, 0.4); }
  50% { box-shadow: 0 0 0 5px rgba(244, 244, 242, 0); }
}

.hotspot:hover {
  transform: translate(-50%, -50%) scale(1.2);
  background: var(--fg);
  border-color: var(--fg);
}

.hotspot:hover::before {
  background: var(--bg);
}

/* ============================================
   SIDE PANEL
   ============================================ */
.panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 92vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  box-shadow: -30px 0 60px rgba(0, 0, 0, 0.5);
  z-index: 30;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease-out);
  overflow-y: auto;
}

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

.panel-inner {
  padding: 72px 40px 40px;
}

.panel-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-swift);
}

.panel-close:hover {
  border-color: var(--border-hover);
  color: var(--fg);
  transform: rotate(90deg);
}

.panel-eyebrow {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 500;
  margin-bottom: 18px;
}

.panel-title {
  font-size: clamp(1.6rem, 1.4rem + 0.8vw, 2rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 32px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.spec-row:first-child {
  padding-top: 0;
}

.spec-row .spec-k {
  color: var(--fg-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.spec-row .spec-v {
  color: var(--fg);
  font-weight: 500;
  text-align: right;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fade-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .header {
    grid-template-columns: auto 1fr;
    gap: 20px;
  }

  .nav {
    display: none;
  }

  .logo svg {
    width: 72px;
  }

  .controls {
    bottom: 100px;
  }

  .dot {
    width: 34px;
    height: 34px;
  }

  .cta-ghost {
    bottom: 24px;
    right: 50%;
    transform: translateX(50%);
  }

  .cta-ghost:hover {
    transform: translateX(50%) translateY(-1px);
  }

  .panel {
    width: 100vw;
  }

  .panel-inner {
    padding: 72px 28px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
