/* ============================================
   Alamo Crafting Forge — Minimal Dark Theme
   ============================================ */

:root {
  --bg: #0a0a0b;
  --bg-elevated: #111113;
  --bg-card: #161618;
  --bg-card-hover: #1c1c1f;
  --border: #222225;
  --border-light: #2a2a2e;
  --text: #f0f0f2;
  --text-secondary: #8a8a96;
  --text-muted: #8e8e9a;
  --accent: #4169E1;
  --accent-light: #5A80F0;
  --accent-glow: rgba(65, 105, 225, 0.15);
  --accent-glow-strong: rgba(65, 105, 225, 0.3);
  --success: #34d399;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Skip Link — visible only on keyboard focus */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 200;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* Honeypot — hidden from users, visible to bots */
.hp-field {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}


img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3 { font-family: var(--font-display); font-weight: 300; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 200; }
h1 em { font-style: italic; color: var(--accent-light); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.25rem; font-weight: 400; }

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 100px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card-hover);
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover {
  border-color: transparent;
  color: var(--accent-light);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-outline:hover {
  border-color: transparent;
  background: rgba(255,255,255,0.03);
}

.btn-nav {
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
}
.btn-nav:hover { background: var(--accent-light); }

.btn-lg { padding: 16px 36px; font-size: 1rem; }

.btn-submit {
  width: 100%;
  justify-content: center;
  padding: 18px 36px;
  font-size: 1.05rem;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a:not(.btn) {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.nav-links a:not(.btn):hover { color: var(--text); }

/* ============================================
   Hero
   ============================================ */

.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: flex-start;
  padding-top: 144px;
  padding-bottom: 64px;
  overflow: visible;
}

/* Shader canvas — fills hero, behind content */
.hero-shader-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  background: var(--bg);
  /* Entrance animation */
  opacity: 0;
  filter: blur(20px) hue-rotate(-45deg);
  transform: scale(1.1);
  transition: opacity 1.5s cubic-bezier(0.22, 1, 0.36, 1),
              filter 1.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1.5s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: 0.3s;
}

.hero-shader-canvas.revealed {
  opacity: 1;
  filter: blur(0px) hue-rotate(-45deg);
  transform: scale(1);
}

/* Gradient overlays on top of shader */
.hero-shader-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 10%, transparent 100%);
}

.hero-shader-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

/* Fallback gradient (visible while shader loads or if WebGL fails) */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-gradient {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.6;
}

.hero-grid {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 816px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
  backdrop-filter: blur(8px);
}

.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: rgba(255, 255, 255, 0.75);
  font-weight: 300;
  margin-top: 20px;
  max-width: 520px;
  line-height: 1.7;
  letter-spacing: -0.01em;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Floating dice visual */
.hero-dice-visual {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  opacity: 0.12;
}

.floating-dice svg {
  width: 400px;
  height: 400px;
  color: var(--accent-light);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(3deg); }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  z-index: 3;
  pointer-events: none;
}

.scroll-indicator span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.scroll-line {
  width: 1px;
  height: 32px;
  background: var(--text);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.3); }
}

@media (max-width: 1024px) {
  .hero-dice-visual { display: none; }
}

@media (max-width: 640px) {
  .hero-actions {
    flex-wrap: nowrap;
  }
  .hero-actions .btn-lg {
    padding: 14px 24px;
    font-size: 0.9rem;
  }
  .hero-stats { gap: 24px; }
}

/* ============================================
   Sections
   ============================================ */

.section {
  padding: 120px 0;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 64px;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-secondary);
  margin-top: 16px;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ============================================
   Products
   ============================================ */

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .product-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
}

.product-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
}

.product-card:hover {
  border-color: transparent;
  background: var(--bg-card-hover);
  transform: translateY(-4px);
}

.product-card.featured {
  border-color: transparent;
}
.product-card.featured:hover {
  border-color: transparent;
}

.product-badge {
  position: absolute;
  top: -12px;
  left: 32px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--bg-card);
}

.product-visual {
  margin-bottom: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
}

.dice-set-preview {
  padding: 16px;
}

.dice-illustration {
  width: 100%;
  height: auto;
  color: var(--text-secondary);
}

.product-card h3 {
  margin-bottom: 8px;
}

.product-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  flex-grow: 1;
}

.product-details {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 20px 0;
}

.product-price {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 300;
}

.product-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.product-card .btn {
  width: 100%;
  justify-content: center;
}

/* Add-ons */
.addons {
  margin-top: 64px;
  padding: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.addons h3 {
  margin-bottom: 24px;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.addon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.addon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.addon-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.addon-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.addon-price {
  font-weight: 600;
  color: var(--accent-light);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ============================================
   Process
   ============================================ */

.process {
  background: var(--bg-elevated);
}

.process .tracing-beam-wrapper {
  max-width: 700px;
  margin: 0 auto;
}

.process-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.process-step {
  display: flex;
  gap: 32px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.process-step:last-child { border-bottom: none; }

.step-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
  flex-shrink: 0;
  width: 64px;
}

.step-content h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .process-step { flex-direction: column; gap: 12px; }
  .step-number { font-size: 1.5rem; }
}

/* ============================================
   About
   ============================================ */

.about {
  background: var(--bg-elevated);
}

.about-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.about-photo-illustration {
  width: 280px;
  height: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--text-secondary);
}

.about-photo-illustration svg {
  width: 100%;
  height: auto;
}

.about-content .section-tag {
  margin-bottom: 16px;
}

.about-content h2 {
  margin-bottom: 24px;
}

.about-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-content p:last-of-type {
  margin-bottom: 32px;
}

.about-details {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .about-photo-illustration {
    margin: 0 auto;
    width: 220px;
    height: 260px;
  }
  .about-details {
    justify-content: center;
  }
}

.about-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.about-detail svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* ============================================
   Gallery
   ============================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 20px;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.gallery-item:hover {
  border-color: transparent;
  transform: translateY(-2px);
}

.gallery-item.large {
  grid-row: span 2;
}

.gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  height: 100%;
  min-height: 240px;
  color: var(--text-muted);
}

.gallery-placeholder svg {
  width: 100%;
  max-width: 250px;
  height: auto;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.gallery-item:hover .gallery-placeholder svg { opacity: 0.7; }

.gallery-caption {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
  .gallery-item.large {
    grid-column: span 2;
    grid-row: span 1;
  }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item.large { grid-column: span 1; }
}

/* ============================================
   Quote Form
   ============================================ */

.quote {
  background: var(--bg);
}

/* Quote layout — side-by-side on desktop */
.quote-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}

/* 3D Preview Pane */
.dice-preview-pane {
  position: sticky;
  top: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

@media (max-width: 1024px) {
  .quote-layout {
    grid-template-columns: 1fr;
    max-width: 720px;
  }
  .dice-preview-pane {
    position: static;
  }
}

.preview-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 40%, var(--bg-card-hover), var(--bg));
}

.preview-canvas-wrap canvas {
  display: block;
}

.preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.preview-loading.hidden {
  display: none;
}

.preview-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.preview-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.preview-label {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1rem;
  color: var(--text);
}

.preview-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-export-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.preview-export-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.preview-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.quote-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
}

.demo-mode-banner {
  background: #92400e;
  color: #fef3c7;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.4;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .quote-form { padding: 28px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: 1; }
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: 2px solid transparent;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a96' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* Radio cards */
.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-card {
  flex: 1;
  min-width: 140px;
  cursor: pointer;
}

.radio-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.radio-card input:focus-visible + .radio-card-inner {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.radio-card-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all var(--transition);
}

.radio-card-inner strong { font-size: 0.9rem; }
.radio-card-inner small { color: var(--text-muted); font-size: 0.8rem; }

.radio-card input:checked + .radio-card-inner {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.radio-card:hover .radio-card-inner {
  border-color: var(--border-light);
}

/* Custom Dice Picker */
.custom-dice-picker {
  animation: fadeSlideIn 0.3s ease-out;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dice-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.dice-pick-card {
  cursor: pointer;
}

.dice-pick-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.dice-pick-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: border-color 0.2s, background 0.2s, opacity 0.2s;
  text-align: center;
}

.dice-pick-inner strong {
  font-size: 0.85rem;
  color: var(--text);
}

.dice-pick-card input:checked + .dice-pick-inner {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.dice-pick-card input:not(:checked) + .dice-pick-inner {
  opacity: 0.5;
}

.dice-pick-card:hover .dice-pick-inner {
  border-color: var(--border-light);
}

.dice-pick-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dpq-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  padding: 0;
  line-height: 1;
}

.dpq-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dpq-val {
  min-width: 16px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* Processing radio group — full-width cards */
.processing-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .processing-group { grid-template-columns: 1fr; }
}

.processing-option {
  position: relative;
}

.processing-option small {
  display: block;
  line-height: 1.4;
}

.processing-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}

/* Checkboxes */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
}

.checkbox-item:hover { border-color: var(--border-light); }
.checkbox-item:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* Quantity stepper */
.qty-stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-stepper input[type="number"] {
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0;
  text-align: center;
  width: 60px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty-stepper input[type="number"]::-webkit-inner-spin-button,
.qty-stepper input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-btn {
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  transition: all var(--transition);
  flex-shrink: 0;
}

.qty-btn:hover {
  background: var(--accent-glow);
  color: var(--accent-light);
}

/* Form validation — shown only after first submit attempt */
.quote-form.submitted .form-group input:invalid,
.quote-form.submitted .form-group select:invalid,
.quote-form.submitted .form-group textarea:invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Upload note */
.upload-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.upload-note svg { flex-shrink: 0; opacity: 0.5; }

/* Estimate bar */
.estimate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  margin: 32px 0 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.estimate-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.estimate-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--accent-light);
}

/* Error banner */
.form-error-banner {
  text-align: center;
  padding: 24px;
  max-width: 480px;
  margin: 0 auto;
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 107, 107, 0.08);
}
.form-error-banner svg {
  margin: 0 auto 8px;
  display: block;
}
.form-error-banner h3 {
  margin-bottom: 8px;
}
.form-error-banner p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Success state */
.form-success {
  display: none;
  text-align: center;
  padding: 80px 40px;
  max-width: 480px;
  margin: 0 auto;
}

.form-success.show {
  display: block;
}

.form-success svg {
  margin: 0 auto 24px;
  color: var(--success);
}

.form-success h3 {
  margin-bottom: 12px;
}

.form-success p {
  color: var(--text-secondary);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text); }

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   FAQ
   ============================================ */

.faq {
  background: var(--bg);
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:first-child {
  border-top: 1px solid var(--border);
}

.faq-question {
  padding: 24px 0;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text);
  transition: color var(--transition);
}

.faq-question:hover {
  color: var(--accent-light);
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::marker {
  content: '';
}

.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item[open] .faq-question::after {
  content: '\2212';
  color: var(--accent);
}

.faq-answer {
  padding: 0 0 24px;
}

.faq-answer p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ============================================
   Resin Swatch
   ============================================ */

.resin-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.resin-select-wrap select {
  flex: 1;
}

.resin-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}

.resin-swatch[data-resin="grey_pro"] { background: #8a8a8a; }
.resin-swatch[data-resin="clear"] { background: #d4e4f7; border-color: #aabbcc; }
.resin-swatch[data-resin="black"] { background: #1a1a1e; }
.resin-swatch[data-resin="white"] { background: #eeeeee; }

/* ============================================
   Font Specimen
   ============================================ */

.font-specimen {
  padding: 14px 20px;
  margin-bottom: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition);
}

.specimen-numbers {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.15em;
  color: var(--text);
}

/* ============================================
   Submit Button States
   ============================================ */

.btn-submit {
  position: relative;
}

.btn-submit.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-submit.loading .btn-text,
.btn-submit.loading .btn-arrow {
  display: none;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-loading[hidden] {
  display: none;
}

.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================
   Order Summary (post-submit)
   ============================================ */

.order-summary {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.order-summary h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.order-summary dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 0.9rem;
}

.order-summary dt {
  color: var(--text-muted);
}

.order-summary dd {
  color: var(--text);
  font-weight: 500;
}

/* ============================================
   Footer (expanded)
   ============================================ */

.footer-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 480px) {
  .footer-cols {
    grid-template-columns: 1fr;
  }
}

.footer-nav h4,
.footer-contact h4,
.footer-shipping h4 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-nav .footer-links,
.footer-contact .footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}

.social-link:hover {
  border-color: transparent;
  color: var(--accent-light);
  background: var(--accent-glow);
}

.shipping-info {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.shipping-info li::before {
  content: '\2713  ';
  color: var(--success);
}

/* ============================================
   Why Choose Us
   ============================================ */

.why-us {
  background: var(--bg);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 24px;
}

@media (max-width: 480px) {
  .why-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
}

.why-card {
  padding: 32px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition);
}

.why-card:hover {
  border-color: transparent;
  transform: translateY(-2px);
}

.why-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent-light);
  margin-bottom: 20px;
}

.why-card h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.why-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   Back to Top Button
   ============================================ */

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

@media (max-width: 640px) {
  .back-to-top { bottom: 20px; right: 20px; }
}

/* ============================================
   Turnaround Note
   ============================================ */

.turnaround-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.turnaround-note svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.turnaround-note.rush {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.06);
}

.turnaround-note.rush svg {
  color: var(--success);
}

/* ============================================
   Estimate Breakdown
   ============================================ */

.estimate-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.estimate-breakdown {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   Active Nav Link
   ============================================ */

.nav-links a:not(.btn).active {
  color: var(--text);
}

.nav-links a:not(.btn).active::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin-top: 2px;
}

/* ============================================
   Mobile Preview Aspect Ratio
   ============================================ */

@media (max-width: 1024px) {
  .preview-canvas-wrap {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 640px) {
  .preview-canvas-wrap {
    aspect-ratio: 1;
  }
}

/* ============================================
   Animations — Scroll Reveal
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.35s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.4s; }

.stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Accessibility — Focus Visible
   ============================================ */

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.social-link:focus-visible,
.back-to-top:focus-visible,
.preview-export-btn:focus-visible,
select:focus-visible,
textarea:focus-visible,
input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="number"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

details summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   Accessibility — Fieldset / Legend Reset
   ============================================ */

fieldset.form-group {
  border: none;
  padding: 0;
  margin: 0;
  min-inline-size: auto;
}

fieldset.form-group > legend {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding: 0;
  float: left;
  width: 100%;
}

fieldset.form-group > legend + * {
  clear: both;
}

/* ============================================
   Accessibility — Dice Pick Card Focus
   ============================================ */

.dice-pick-card input:focus-visible + .dice-pick-inner {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   Accessibility — Form Error Messages
   ============================================ */

.form-error {
  display: block;
  font-size: 0.82rem;
  color: #ef4444;
  min-height: 0;
  margin-top: 4px;
}

.form-error:empty {
  display: none;
}

/* ============================================
   Legal Modals
   ============================================ */

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.legal-modal[hidden] {
  display: none;
}

.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.legal-modal-content {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 40px;
}

.legal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.legal-modal-header h2 {
  font-size: 1.5rem;
  font-weight: 300;
}

.legal-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.legal-modal-close:hover {
  color: var(--text);
}

.legal-modal-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.legal-modal-body p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.legal-modal-body a {
  color: var(--accent-light);
}

.footer-legal {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  justify-content: center;
}

.legal-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.legal-link:hover {
  color: var(--text-secondary);
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .stagger > * {
    opacity: 1;
    transform: none;
  }

  .floating-dice svg {
    animation: none;
  }

  .scroll-line {
    animation: none;
  }

  .preview-spinner {
    animation: none;
    border-color: var(--accent);
  }

  .hero-shader-canvas {
    opacity: 1;
    filter: hue-rotate(-45deg);
    transform: none;
    transition: none;
  }
}
