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

:root {
  --dark: #0a0a0a;
  --darker: #050505;
  --accent: #c9a84c;
  --accent-glow: #e8c65a;
  --gold: #c9a84c;
  --gold-dim: #8a7235;
  --text: #e8e8e8;
  --text-dim: #888;
  --font-display: 'Cinzel', serif;
  --font-body: 'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--darker);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: default;
}

/* ==============================
   LOADING SCREEN
   ============================== */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--darker);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

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

.loader-content {
  text-align: center;
}

.skull-loader {
  animation: pulse 1.5s ease-in-out infinite;
  color: var(--accent);
}

.skull-loader svg {
  width: 4rem;
  height: 4rem;
  fill: currentColor;
}

.loader-content p {
  font-family: var(--font-display);
  letter-spacing: 0.3em;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.loader-bar {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  margin: 1.5rem auto 0;
  border-radius: 1px;
  overflow: hidden;
}

.loader-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  animation: load-fill 1.4s ease-in-out forwards;
}

@keyframes load-fill {
  0% { width: 0%; }
  100% { width: 100%; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ==============================
   CANVAS (Three.js background)
   ============================== */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ==============================
   NAVIGATION
   ============================== */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 3rem;
  background: linear-gradient(to bottom, rgba(5,5,5,0.95), transparent);
  transition: background 0.4s ease, padding 0.4s ease, backdrop-filter 0.4s ease;
}

#main-nav.scrolled {
  background: rgba(5,5,5,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.8rem 3rem;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.nav-logo {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.logo-icon {
  width: 4.6rem;
  height: 4.6rem;
  color: var(--accent);
  fill: currentColor;
  filter: drop-shadow(0 0 8px rgba(201,168,76,0.5));
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: 2.2rem;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--accent-glow);
  white-space: nowrap;
}

.logo-sub {
  font-family: var(--font-body);
  font-size: 0.66rem;
  letter-spacing: 0.25em;
  color: #d2d2d2;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  font-weight: 600;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent-glow);
  text-shadow: 0 0 20px rgba(232,198,90,0.3);
}

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

/* Active section gets a persistent gold highlight */
.nav-links a.active {
  color: var(--accent-glow);
}
.nav-links a.active::after {
  width: 100%;
}

/* ==============================
   SECTIONS
   ============================== */
.section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.section:not(#hero)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5,5,5,0.65) 0%,
    rgba(5,5,5,0.4) 50%,
    rgba(5,5,5,0.65) 100%
  );
  z-index: 0;
  pointer-events: none;
}

.section-content {
  max-width: 1200px;
  width: 100%;
  padding: 2rem 4rem;
  position: relative;
  z-index: 1;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}

.accent {
  color: var(--accent);
  text-shadow: 0 0 40px rgba(201,168,76,0.4);
}

/* Accent word ignites just after the title settles */
.section-title .accent {
  transition: text-shadow 0.7s ease 0.35s, color 0.7s ease 0.35s;
}
.reveal-up:not(.revealed) .accent {
  color: var(--gold-dim);
  text-shadow: none;
}

/* ==============================
   HERO SECTION
   ============================== */
.hero-image-wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(0.65) contrast(1.15);
}

.hero-image-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(5,5,5,0.5) 75%),
    linear-gradient(to bottom, rgba(5,5,5,0.15) 0%, transparent 30%, transparent 60%, rgba(5,5,5,0.9) 100%);
}

.hero-content {
  text-align: center;
  z-index: 2;
  position: relative;
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title-line {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0.08em 0.35em 0.32em;
}

.title-line-1,
.title-line-2 {
  font-size: clamp(4.5rem, 12vw, 11rem);
  background: linear-gradient(170deg, #f8ecb8 0%, #ecca63 30%, #d4b257 60%, #ad8c3d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.55)) drop-shadow(0 0 34px rgba(232,198,90,0.4));
}

.title-line-2 {
  margin-top: -0.4em;
}

.title-sub {
  font-family: var(--font-body);
  font-size: clamp(0.82rem, 1.7vw, 1.15rem);
  letter-spacing: 0.5em;
  color: #d2d2d2;
  text-shadow: 0 2px 12px rgba(0,0,0,0.85);
  margin-top: 1.5rem;
  font-weight: 400;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.8vw, 1.2rem);
  color: #ececec;
  text-shadow: 0 2px 12px rgba(0,0,0,0.85);
  margin-top: 2rem;
  letter-spacing: 0.1em;
  font-weight: 400;
}

.scroll-indicator {
  position: absolute;
  bottom: -8rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  animation: bob 2s ease-in-out infinite, fadeHalf 0.8s ease 2.35s both;
}

.scroll-indicator span {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--text-dim);
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 1px solid var(--text-dim);
  border-bottom: 1px solid var(--text-dim);
  transform: rotate(45deg);
}

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* Hero entrance — plays once after the loader clears (~1.6s) */
.title-line,
.title-sub,
.hero-tagline {
  opacity: 0;
  transform: translateY(34px);
}
.title-line-1 { animation: heroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.70s both; }
.title-line-2 { animation: heroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.85s both; }
.title-sub    { animation: heroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 2.00s both; }
.hero-tagline { animation: heroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 2.15s both; }

@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeHalf {
  from { opacity: 0; }
  to { opacity: 0.5; }
}

/* ==============================
   ENGINE SECTION
   ============================== */
.engine-content {
  text-align: center;
}

.engine-desc {
  color: var(--text-dim);
  font-size: 1.1rem;
  font-weight: 300;
  max-width: 600px;
  margin: 0 auto 4rem;
  line-height: 1.8;
}

.engine-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}

.feature {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 3rem 2rem;
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.feature:hover {
  transform: translateY(-5px);
  border-color: rgba(201,168,76,0.4);
  border-left-color: var(--accent-glow);
  box-shadow: 0 20px 60px rgba(201,168,76,0.12), inset 0 0 30px rgba(201,168,76,0.03);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  filter: drop-shadow(0 0 10px rgba(201,168,76,0.3));
}

.feature h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.feature p {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.7;
  font-weight: 300;
}

/* ==============================
   BUILDS SECTION
   ============================== */
.builds-content {
  text-align: center;
}

.builds-desc {
  color: var(--text-dim);
  font-size: 1.1rem;
  font-weight: 300;
  max-width: 500px;
  margin: 0 auto 4rem;
  line-height: 1.8;
}

.builds-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.build-card {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(201,168,76,0.08), transparent 60%),
    linear-gradient(135deg, rgba(30,30,35,0.95), rgba(10,10,12,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
}

.build-card:hover {
  transform: scale(1.03);
  box-shadow: 0 30px 80px rgba(201,168,76,0.15);
  border-color: rgba(201,168,76,0.3);
}

.build-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  filter: brightness(0.92) contrast(1.04) saturate(0.95);
  transition: filter 0.5s ease, transform 0.6s ease;
}

.build-card:hover .build-photo {
  filter: brightness(1) contrast(1.08) saturate(1);
  transform: scale(1.06);
}

.build-card-inner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: linear-gradient(to top, rgba(5,5,5,0.95) 30%, rgba(5,5,5,0.1) 65%, transparent 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 1;
}

.build-number {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 900;
  color: rgba(201,168,76,0.12);
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  line-height: 1;
  text-shadow: 0 0 40px rgba(201,168,76,0.05);
}

.build-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  margin-bottom: 0.8rem;
}

.build-card p {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
  font-weight: 300;
}

/* ==============================
   CONTACT SECTION
   ============================== */
.contact-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-desc {
  color: var(--text-dim);
  font-size: 1.2rem;
  font-weight: 300;
  margin-bottom: 3rem;
}

.cta-button {
  position: relative;
  display: inline-block;
  padding: 1.2rem 4rem;
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.25em;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.4s ease;
  overflow: hidden;
}

.cta-button:hover {
  background: var(--accent);
  box-shadow: 0 0 60px rgba(201,168,76,0.4), 0 0 120px rgba(201,168,76,0.1);
  transform: translateY(-2px);
}

.cta-glow {
  position: absolute;
  inset: -2px;
  background: radial-gradient(ellipse at center, rgba(201,168,76,0.2), transparent 70%);
  animation: glow-pulse 3s ease-in-out infinite;
  pointer-events: none;
}

.contact-phone {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.18em;
}

.contact-phone a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.contact-phone a:hover {
  color: var(--text);
  text-shadow: 0 0 24px rgba(201,168,76,0.45);
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.footer-info {
  margin-top: 6rem;
  opacity: 0.5;
  padding-top: 3rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-info p {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.footer-tagline {
  font-family: var(--font-display);
  margin-top: 0.5rem;
  color: var(--accent);
}

.skull-inline {
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: -0.15em;
}

/* ==============================
   SCROLL REVEAL ANIMATIONS
   ============================== */
.reveal-up {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* ==============================
   CARD 3D TILT (cursor-follow)
   ============================== */
.feature.tilting,
.build-card.tilting {
  transition: transform 0.15s ease-out, border-color 0.4s ease, box-shadow 0.4s ease;
  will-change: transform;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
  #main-nav {
    padding: 0.9rem 1.1rem;
  }

  .nav-links {
    display: none;
  }

  #main-nav.scrolled {
    padding: 0.65rem 1.1rem;
  }

  .nav-logo {
    gap: 0.45rem;
  }

  .logo-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .logo-text {
    font-size: 1.5rem;
  }

  .logo-sub {
    font-size: 0.5rem;
    letter-spacing: 0.16em;
    white-space: nowrap;
  }

  .section-content {
    padding: 2rem 1.5rem;
  }

  .engine-features {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .builds-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .build-card {
    aspect-ratio: 16/9;
  }

}

/* ==============================
   REDUCED MOTION (accessibility)
   ============================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .title-line,
  .title-sub,
  .hero-tagline {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .scroll-indicator {
    animation: none;
    opacity: 0.5;
  }

  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    transition: opacity 0.4s ease;
    transform: none;
  }
}
