/* ── Local fonts ─────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ── CSS custom properties (dark default, light via [data-theme='light']) ─── */
:root {
  --background: 0 0% 6%;
  --foreground: 0 0% 96%;
  --card: 0 0% 9%;
  --card-foreground: 0 0% 96%;
  --popover: 0 0% 8%;
  --popover-foreground: 0 0% 96%;
  --primary: 0 0% 96%;
  --primary-foreground: 0 0% 8%;
  --secondary: 0 0% 13%;
  --secondary-foreground: 0 0% 96%;
  --muted: 0 0% 12%;
  --muted-foreground: 0 0% 65%;
  --accent: 0 0% 85%;
  --accent-foreground: 0 0% 8%;
  --destructive: 0 75% 55%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 18%;
  --input: 0 0% 14%;
  --ring: 0 0% 70%;
  --radius: 0.85rem;
  --gradient-primary: linear-gradient(135deg, hsl(0 0% 96%), hsl(0 0% 70%));
  --gradient-hero: radial-gradient(ellipse at top, hsl(0 0% 100% / 0.08), transparent 60%);
  --shadow-glow: 0 20px 60px -15px hsl(0 0% 100% / 0.15);
  --shadow-card: 0 10px 30px -10px hsl(0 0% 0% / 0.6);
  --grid-color: 0 0% 100%;
}

[data-theme='light'] {
  --background: 0 0% 99%;
  --foreground: 0 0% 8%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 8%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 8%;
  --primary: 0 0% 9%;
  --primary-foreground: 0 0% 98%;
  --secondary: 0 0% 95%;
  --secondary-foreground: 0 0% 9%;
  --muted: 0 0% 94%;
  --muted-foreground: 0 0% 38%;
  --accent: 0 0% 20%;
  --accent-foreground: 0 0% 98%;
  --border: 0 0% 88%;
  --input: 0 0% 92%;
  --ring: 0 0% 25%;
  --gradient-primary: linear-gradient(135deg, hsl(0 0% 9%), hsl(0 0% 35%));
  --gradient-hero: radial-gradient(ellipse at top, hsl(0 0% 0% / 0.06), transparent 60%);
  --shadow-glow: 0 20px 60px -15px hsl(0 0% 0% / 0.18);
  --shadow-card: 0 10px 30px -10px hsl(0 0% 0% / 0.12);
  --grid-color: 0 0% 0%;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; border-color: hsl(var(--border)); }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
}
html::-webkit-scrollbar { display: none; } /* Chrome / Safari / Edge */
body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
  transition: background-color 0.4s ease, color 0.4s ease;
  margin: 0;
}
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  background-color: hsl(var(--input));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}
label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  display: block;
  margin-bottom: 0.375rem;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Custom utilities ────────────────────────────────────────────────────── */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bg-gradient-primary { background: var(--gradient-primary); }
.bg-gradient-hero    { background: var(--gradient-hero); }
.shadow-glow         { box-shadow: var(--shadow-glow); }
.shadow-card         { box-shadow: var(--shadow-card); }

.glass {
  background: hsl(var(--card) / 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ── Animated grid background ────────────────────────────────────────────── */
.bg-grid {
  background-image:
    linear-gradient(to right,  hsl(var(--grid-color) / 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, hsl(var(--grid-color) / 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
[data-theme='light'] .bg-grid {
  background-image:
    linear-gradient(to right,  hsl(var(--grid-color) / 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, hsl(var(--grid-color) / 0.08) 1px, transparent 1px);
}

/* ── Reveal on scroll ────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Active nav link ─────────────────────────────────────────────────────── */
#main-nav button[data-active="true"] {
  color: hsl(var(--foreground));
}

/* ── Nav underline hover ─────────────────────────────────────────────────── */
.story-link { position: relative; display: inline-block; }
.story-link::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: hsl(var(--foreground));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s ease;
}
.story-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ── Keyframes ───────────────────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-10px); }
}
@keyframes blob {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(30px,-20px) scale(1.05); }
  66%     { transform: translate(-25px,15px) scale(0.95); }
}
@keyframes grid-pan {
  0%   { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%     { opacity: 0; }
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.animate-fade-up { animation: fade-up   0.7s ease-out both; }
.animate-float   { animation: float     6s ease-in-out infinite; }
.animate-blob    { animation: blob      18s ease-in-out infinite; }
.animate-grid    { animation: grid-pan  20s linear infinite; }
.animate-blink   { animation: blink     1s step-end infinite; }
.animate-pulse   { animation: pulse-ring 2s cubic-bezier(0.4,0,0.6,1) infinite; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { opacity: 0.9; }
.btn-outline {
  background: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}
.btn-outline:hover { border-color: hsl(var(--foreground)); }
.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
}
.btn-ghost:hover { background: hsl(var(--secondary)); }
.btn-icon {
  padding: 0.5rem;
  border-radius: 50%;
}
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

/* ── Tabs (admin) ────────────────────────────────────────────────────────── */
.tabs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  padding: 0.25rem;
}
.tab-trigger {
  padding: 0.375rem 0.875rem;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: transparent;
  border: none;
  transition: all 0.2s;
}
.tab-trigger.active, .tab-trigger:hover {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Toast notifications ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  animation: fade-up 0.3s ease both;
  backdrop-filter: blur(14px);
}
.toast-success { background: hsl(var(--foreground)); color: hsl(var(--background)); }
.toast-error   { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }

/* ── Mobile cart bar ─────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  #mobile-cart-bar { display: none !important; }
}

/* ── Back to top button ──────────────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 50;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border) / 0.6);
  background: hsl(var(--card) / 0.8);
  color: hsl(var(--foreground));
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#back-to-top:hover {
  background: hsl(var(--secondary));
  border-color: hsl(var(--foreground) / 0.4);
}

/* ── Quote builder specifics ─────────────────────────────────────────────── */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}
.quote-type-card {
  background: hsl(var(--card) / 0.6);
  backdrop-filter: blur(14px);
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}
.quote-type-card:hover { transform: translateY(-2px); border-color: hsl(var(--foreground) / 0.4); }
.quote-type-card.selected { border-color: hsl(var(--foreground)); box-shadow: var(--shadow-glow); }
.quote-addon-row {
  background: hsl(var(--card) / 0.6);
  backdrop-filter: blur(14px);
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color 0.2s;
}
.quote-addon-row.selected { border-color: hsl(var(--foreground) / 0.5); }

/* ── How it works timeline ───────────────────────────────────────────────── */
.hiw-track {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 0;
  position: relative;
}
@media (min-width: 1024px) {
  .hiw-track {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }
}
.hiw-step {
  position: relative;
  padding-right: 2rem;
}
.hiw-step:last-child { padding-right: 0; }
.hiw-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.hiw-line {
  position: absolute;
  top: 1.25rem;
  left: 2.5rem;
  right: 0;
  height: 1px;
  background: hsl(var(--border) / 0.7);
}
.hiw-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.4rem;
}
.hiw-desc {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.55;
  max-width: 18ch;
}
@media (max-width: 1023px) {
  .hiw-line { display: none; }
  .hiw-step { padding-right: 0; }
  .hiw-desc { max-width: none; }
}
@media (max-width: 767px) {
  .hiw-track { grid-template-columns: 1fr; gap: 0; }
  .hiw-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.75rem;
  }
  .hiw-step:last-child { padding-bottom: 0; }
  .hiw-badge { margin-bottom: 0; flex-shrink: 0; }
}
.quote-sidebar {
  background: hsl(var(--card) / 0.6);
  backdrop-filter: blur(14px);
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 6rem;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: hsl(0 0% 0% / 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-box {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 540px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-up, .animate-float, .animate-blob,
  .animate-grid, .animate-blink, .animate-pulse {
    animation: none !important;
  }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Force-hide mobile nav on desktop (overrides JS inline style) ───────── */
@media (min-width: 768px) {
  #mobile-menu,
  #mobile-toggle { display: none !important; }
}

/* ── Admin tabs — horizontal scroll on mobile ────────────────────────────── */
@media (max-width: 767px) {
  .tabs-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs-list::-webkit-scrollbar { display: none; }
  .tab-trigger { white-space: nowrap; flex-shrink: 0; }
}

