:root {
  /* Default: Dark Theme */
  --bg-color: #0b0e14;
  --surface-color: #1b2a4a;
  --surface-glass: rgba(27, 42, 74, 0.4);
  --text-primary: #f0ece4;
  --text-secondary: #c2dff0;
  --accent-gold: #c9a84c;
  --accent-blue: #2563eb;
  --accent-amber: #f59e0b;
  --border-color: rgba(255, 255, 255, 0.08);
  --map-stroke: rgba(201, 168, 76, 0.15);
  --map-fill: rgba(27, 42, 74, 0.1);
}

:root[data-theme="light"] {
  --bg-color: #faf9f7;
  --surface-color: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.8);
  --text-primary: #1c1c1c;
  --text-secondary: #4a4a4a;
  --accent-gold: #b08d33;
  --accent-blue: #1d4ed8;
  --accent-amber: #d97706;
  --border-color: rgba(0, 0, 0, 0.08);
  --map-stroke: rgba(176, 141, 51, 0.2);
  --map-fill: rgba(27, 42, 74, 0.03);
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
}

/* Background Map styling */
#bg-map-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#bg-map-container svg {
  width: 150vw;
  height: auto;
  opacity: 0.6;
  stroke: var(--map-stroke);
  fill: var(--map-fill);
  stroke-width: 1.5;
  transition: all 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Page states for morphing map */
body.page-home #bg-map-container svg {
  transform: scale(1) translate(0, 0);
  opacity: 0.4;
}

body.page-flywheel #bg-map-container svg {
  transform: scale(1.3) translate(-10%, -10%);
  opacity: 0.2;
}

body.page-products #bg-map-container svg {
  transform: scale(1.1) translate(10%, 5%);
  opacity: 0.3;
}

body.page-about #bg-map-container svg {
  transform: scale(1.5) translate(0, 20%);
  opacity: 0.15;
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

header {
  position: sticky;
  top: 0;
  width: 100%;
  padding: 1.5rem 0;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-gold);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 0.4rem 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Main Content */
main {
  padding-top: 3rem;
  padding-bottom: 4rem;
  min-height: 100vh;
}

.hero {
  text-align: center;
  padding: 4rem 0;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-block;
  background: var(--accent-gold);
  color: #0b0e14; /* Always dark text for gold button */
  padding: 0.8rem 1.8rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, background 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  background: #deb853;
}

.card {
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.card h2 {
  margin-bottom: 1rem;
  color: var(--accent-gold);
}

footer {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

@media (max-width: 900px) {
  header {
    padding: 1rem 0;
  }
  nav {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }
  .brand {
    font-size: 1.1rem;
    white-space: normal;
  }
}

figure[data-slot]:empty { display: none !important; }

/* Utility classes from refactor */
.mt-2 { margin-top: 0.5rem; }
.text-secondary { color: var(--text-secondary); }
.text-gold { color: var(--accent-gold); }
.util-1 { text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 1rem; }
.util-2 { margin-top: 1.5rem; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.text-center mt-12 { text-align: center; margin-top: 3rem; }
.text-blue { color: var(--accent-blue); }
.text-amber { color: var(--accent-amber); }
.mt-4 { margin-top: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mr-4 { margin-right: 1rem; }
.util-3 { margin-top: 3rem; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.util-4 { list-style: none; color: var(--text-secondary); line-height: 2; }
.col-full { grid-column: 1 / -1; }
.mb-4 { margin-bottom: 1rem; }
.util-5 { margin-left: 2rem; color: var(--text-secondary); line-height: 1.8; }
.util-6 { margin-top: 2rem; padding: 1.5rem; background: var(--surface-glass); border-left: 4px solid var(--accent-gold); border-radius: 4px; }
.util-7 { font-weight: 600; color: var(--accent-gold); font-size: 1.1rem; }
.util-8 { margin-top: 2rem; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.util-9 { margin-top: 1rem; padding-left: 1.5rem; color: var(--text-secondary); line-height: 1.8; }
.text-xl { font-size: 1.5rem; }
.util-10 { color: var(--text-primary); text-decoration: none; }
.util-11 { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }
.util-12 { color: var(--accent-blue); text-decoration: none; font-weight: 500; display: inline-block; margin-top: 1rem; }
.util-13 { color: var(--text-secondary); grid-column: 1 / -1; text-align: center; padding: 2rem; }
.text-center mb-12 { margin-bottom: 3rem; text-align: center; }
.util-14 { font-size: 1.1rem; line-height: 1.8; }
