/* ═══════════════════════════════════════
   BASE & RESET
   ═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', 'Nunito', sans-serif;
  background: var(--bg0);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.6s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════
   OCEAN BACKGROUND & EFFECTS
   ═══════════════════════════════════════ */
.ocean-bg {
  position: fixed; inset: 0; z-index: 0;
  transition: background 0.8s ease;
}

/* Slow-moving gradient orbs — atmosphere without cartoon */
.bg-layer {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0.14;
  animation: drift linear infinite;
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent, #1A4A6B), transparent 70%);
  top: -15%; left: -10%;
  animation-duration: 40s;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(13,58,82,0.8), transparent 70%);
  bottom: -10%; right: -8%;
  animation-duration: 50s; animation-delay: -15s;
}
.orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(26,90,58,0.6), transparent 70%);
  top: 40%; right: 20%;
  animation-duration: 35s; animation-delay: -8s;
  opacity: 0.06;
}
[data-theme="light"] .orb { opacity: 0.08; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -20px) scale(1.04); }
  66%  { transform: translate(-20px, 30px) scale(0.97); }
  100% { transform: translate(0, 0) scale(1); }
}
/* Horizontal scan line — subtle depth */
.scan-line {
  position: fixed; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--card-border) 30%, var(--card-border) 70%, transparent 100%);
  top: 66px; z-index: 99; opacity: 0.5;
}

/* ═══════════════════════════════════════
   NAV
   ═══════════════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(44px, env(safe-area-inset-left)) 0 max(44px, env(safe-area-inset-right));
  height: 66px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  transition: background 0.5s, border-color 0.5s;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo-mark {
  width: 28px; height: 28px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.4s, box-shadow 0.4s;
}
.logo-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text); transition: color 0.4s;
}
.logo-text span { color: var(--accent); transition: color 0.4s; }
.nav-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center;
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a {
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--text-muted);
  text-decoration: none; transition: color 0.2s;
  padding: 4px 0; border-bottom: 1px solid transparent;
}
.nav-links a:hover { color: var(--text); border-color: var(--accent); }

/* Theme toggle button */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 8px;
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.theme-toggle:hover {
  background: var(--toggle-bg); color: var(--text);
  border-color: var(--accent);
}

/* ═══════════════════════════════════════
   HERO
   ═══════════════════════════════════════ */
.hero {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 100px 24px 60px;
}
.hero-label {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.hero-label::before, .hero-label::after {
  content: ''; width: 32px; height: 1px;
  background: var(--accent); opacity: 0.5;
}
.hero-headline, h1.hero-headline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  font-weight: 400; line-height: 1.08;
  text-align: center; color: var(--text);
  letter-spacing: -0.02em; margin-bottom: 20px;
  max-width: 760px; text-shadow: none;
}
.hero-headline em, h1.hero-headline em {
  font-style: italic; color: var(--accent);
}
/* Progress dots */
.progress-dots {
  display: flex; gap: 6px; align-items: center;
  justify-content: center; margin-bottom: 32px;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--card-border); transition: all 0.3s;
}
.dot.active { background: var(--accent); width: 20px; border-radius: 3px; }
.dot.done { background: var(--accent); opacity: 0.4; }
.hero-sub {
  font-size: 1rem; color: var(--text-muted); text-align: center;
  max-width: 440px; line-height: 1.75; font-weight: 300; margin-bottom: 48px;
  transition: color 0.4s;
}

/* ═══════════════════════════════════════
   GLASS CARD (used by app section)
   ═══════════════════════════════════════ */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px; padding: 40px;
  backdrop-filter: blur(28px);
  box-shadow: 0 28px 70px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.04) inset;
  position: relative; overflow: hidden;
  transition: background 0.5s, border-color 0.5s, box-shadow 0.5s;
}
.glass-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5; transition: background 0.5s;
}
.panel-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9rem; letter-spacing: 2px;
  color: var(--text); margin-bottom: 6px;
  transition: color 0.4s;
}
.panel-sub {
  font-size: 0.88rem; color: var(--text-muted); margin-bottom: 28px;
  font-weight: 300; line-height: 1.5; transition: color 0.4s;
}

/* ═══════════════════════════════════════
   BUTTONS (shared)
   ═══════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: var(--btn-text); border: none; border-radius: 12px;
  padding: 14px 32px;
  font-family: 'Nunito', sans-serif; font-size: 0.88rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; transition: all 0.25s;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); filter: brightness(1.08); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--card-border); border-radius: 12px;
  padding: 14px 22px;
  font-family: 'Nunito', sans-serif; font-size: 0.84rem; font-weight: 700;
  letter-spacing: 0.04em; cursor: pointer; transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); background: var(--toggle-bg); }

/* ═══════════════════════════════════════
   3-DOOR WIZARD — Question Label
   ═══════════════════════════════════════ */
.question-label {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-style: italic;
  color: var(--text-muted); text-align: center;
  margin-bottom: 32px; letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════
   3-DOOR WIZARD — Door Cards
   ═══════════════════════════════════════ */
.doors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%; max-width: 900px;
  margin-bottom: 48px;
}

.door {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 36px 32px;
  cursor: pointer;
  position: relative; overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeUp 0.5s cubic-bezier(0,0,0.2,1) both;
}
.door:nth-child(1) { animation-delay: 0.05s; }
.door:nth-child(2) { animation-delay: 0.12s; }
.door:nth-child(3) { animation-delay: 0.19s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Thin accent line at top — appears on hover/select */
.door::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  opacity: 0; transition: opacity 0.3s;
}
.door-livestock::before { background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.door-budget::before    { background: linear-gradient(90deg, transparent, #C4915A, transparent); }
.door-space::before     { background: linear-gradient(90deg, transparent, #7A9EBF, transparent); }
.door:hover::before, .door.selected::before { opacity: 1; }
.door:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}
.door.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 2px 4px rgba(0,0,0,0.5), 0 24px 64px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

/* Door number — top right, subtle */
.door-num {
  position: absolute; top: 20px; right: 24px;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; color: var(--text-muted);
  opacity: 0.4;
}

/* Icon — clean SVG */
.door-icon {
  width: 40px; height: 40px;
  margin-bottom: 24px; opacity: 0.7;
  transition: opacity 0.3s;
  color: var(--accent);
}
.door:hover .door-icon, .door.selected .door-icon { opacity: 1; }
.door-budget .door-icon { color: #C4915A; }
.door-space  .door-icon { color: #7A9EBF; }

.door-tag {
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 10px; color: var(--accent);
}
.door-budget .door-tag { color: #C4915A; }
.door-space  .door-tag { color: #7A9EBF; }

.door-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 600;
  color: var(--text); margin-bottom: 10px;
  line-height: 1.25; letter-spacing: -0.01em;
}
.door-desc {
  font-size: 0.84rem; color: var(--text-muted);
  line-height: 1.65; font-weight: 300;
}

/* Door arrow — appears on hover */
.door-arrow {
  position: absolute; bottom: 28px; right: 28px;
  width: 28px; height: 28px;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateX(-6px);
  transition: opacity 0.25s, transform 0.25s;
  color: var(--text-muted);
}
.door:hover .door-arrow { opacity: 1; transform: translateX(0); }

/* Selected check */
.selected-check {
  position: absolute; top: 14px; left: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--bg0, #020A12);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 900;
  opacity: 0; transform: scale(0.3);
  transition: all 0.3s; z-index: 3;
}
.door.selected .selected-check { opacity: 1; transform: scale(1); }

/* ═══════════════════════════════════════
   3-DOOR WIZARD — Step 2/3 Option Grid
   ═══════════════════════════════════════ */
.options-grid {
  display: grid; gap: 10px;
  width: 100%; max-width: 900px;
  margin-bottom: 28px;
}
.options-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.options-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.options-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.option-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px; padding: 22px 20px;
  cursor: pointer;
  transition: all 0.25s;
  backdrop-filter: blur(8px);
  animation: fadeUp 0.4s cubic-bezier(0,0,0.2,1) both;
}
.option-card:nth-child(1){animation-delay:.04s} .option-card:nth-child(2){animation-delay:.08s}
.option-card:nth-child(3){animation-delay:.12s} .option-card:nth-child(4){animation-delay:.16s}
.option-card:nth-child(5){animation-delay:.20s} .option-card:nth-child(6){animation-delay:.24s}
.option-card:nth-child(7){animation-delay:.28s} .option-card:nth-child(8){animation-delay:.32s}
.option-card:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}
.option-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--toggle-bg);
}
.option-emoji { font-size: 2rem; margin-bottom: 10px; }
.option-label {
  font-size: 0.92rem; font-weight: 500;
  color: var(--text); margin-bottom: 4px;
}
.option-desc {
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; font-weight: 300;
}
/* Budget options — price prominent */
.option-price {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; font-weight: 600;
  color: var(--text); margin-bottom: 4px;
  letter-spacing: -0.02em;
}

/* Step header */
.step-header { text-align: center; margin-bottom: 32px; animation: fadeUp 0.35s cubic-bezier(0,0,0.2,1) both; }
.step-number {
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px; justify-content: center;
}
.step-number::before, .step-number::after {
  content: ''; width: 24px; height: 1px; background: var(--accent); opacity: 0.4;
}
.step-question {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400; color: var(--text);
  letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 8px;
}
.step-sub { font-size: 0.9rem; color: var(--text-muted); font-weight: 300; }

/* Back button for wizard steps */
.wizard-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border: none; background: none;
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-bottom: 28px; padding: 0;
  transition: color 0.2s;
}
.wizard-back-btn:hover { color: var(--text); }

/* Results summary in Step 3 */
.wizard-results {
  width: 100%; max-width: 960px;
  margin-bottom: 28px;
}
.results-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 13px;
}
.result-tile {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px; padding: 16px 18px;
  display: flex; align-items: center; gap: 13px;
  transition: border-color 0.3s, background 0.4s;
}
.result-tile:hover { border-color: var(--accent); }
.r-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--toggle-bg);
  border: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.r-label { font-size:0.66rem; font-weight:800; letter-spacing:0.1em; text-transform:uppercase; color:var(--accent); margin-bottom:3px; opacity:0.75; }
.r-value { font-family:'Playfair Display',serif; font-size:1.35rem; letter-spacing:1px; color:var(--text); margin-bottom:1px; }
.r-note  { font-size:0.72rem; color:var(--text-muted); font-weight:300; }
.cost-banner {
  grid-column: 1 / -1;
  background: var(--cost-grad);
  border: 1px solid var(--card-border);
  border-radius: 16px; padding: 22px 26px;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; overflow: hidden;
}
.cost-banner::before {
  content: ''; position: absolute; top: -60%; left: -5%;
  width: 280px; height: 200%;
  background: radial-gradient(ellipse, var(--accent-glow), transparent 60%);
  pointer-events: none;
}
.cost-label { font-size:0.68rem; font-weight:800; letter-spacing:0.12em; text-transform:uppercase; color:var(--accent); margin-bottom:5px; }
.cost-range { font-family:'Playfair Display',serif; font-size:2.2rem; letter-spacing:2px; color:#fff; text-shadow:0 0 24px var(--accent-glow); line-height:1; }
.cost-note  { font-size:0.76rem; color:rgba(255,255,255,0.6); font-weight:300; margin-top:3px; }

/* ═══════════════════════════════════════
   STATS ROW
   ═══════════════════════════════════════ */
.stats-row {
  display: flex; gap: 0;
  border: 1px solid var(--card-border);
  border-radius: 12px; overflow: hidden;
  position: relative; z-index: 2;
  width: 100%; max-width: 480px;
}
.stat {
  flex: 1; padding: 20px 24px; text-align: center;
  border-right: 1px solid var(--card-border);
}
.stat:last-child { border-right: none; }
.stat-n {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 600;
  color: var(--text); letter-spacing: -0.02em;
  line-height: 1; margin-bottom: 4px;
}
.stat-l {
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */
.step-panel { animation: fadeSlide 0.35s cubic-bezier(0.4,0,0.2,1); }
@keyframes fadeSlide { from{opacity:0;transform:translateX(20px);} to{opacity:1;transform:translateX(0);} }

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

/* Tablet / small desktop */
@media (max-width: 860px) {
  .hero { padding: 90px 20px 50px; }
  .glass-card { padding: 32px 24px; }
  .stats-row { gap: 36px; }
  .doors { max-width: 100%; }
}

/* Large phones / small tablets */
@media (max-width: 700px) {
  /* Nav */
  nav { padding: 0 16px; height: 56px; }
  .nav-links { display: none; }
  .logo { font-size: 1.2rem; letter-spacing: 1.5px; }
  .logo-icon { width: 30px; height: 30px; font-size: 0.95rem; }

  /* Hero */
  .hero { padding: 76px 16px 40px; min-height: auto; }
  .hero-eyebrow { font-size: 0.62rem; padding: 6px 14px; margin-bottom: 18px; }
  .hero-sub { font-size: 0.9rem; margin-bottom: 32px; max-width: 100%; }

  /* Doors — stack vertically */
  .doors { grid-template-columns: 1fr; gap: 14px; }
  .door { min-height: 200px; }
  .door-scene { font-size: 3.5rem; }
  .door-title { font-size: 1.3rem; }

  /* Option grid — 2 columns */
  .options-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .option-card { padding: 16px 12px; }
  .option-emoji { font-size: 1.6rem; margin-bottom: 8px; }

  /* Glass card */
  .glass-card { padding: 24px 18px; border-radius: 18px; }
  .panel-title { font-size: 1.5rem; }
  .panel-sub { font-size: 0.82rem; margin-bottom: 20px; }

  /* Results — stacked */
  .results-grid { grid-template-columns: 1fr; gap: 10px; }
  .result-tile { padding: 14px 16px; border-radius: 12px; }
  .r-icon { width: 38px; height: 38px; font-size: 1.05rem; }
  .r-value { font-size: 1.15rem; }

  /* Cost banner stacked */
  .cost-banner { flex-direction: column; gap: 16px; text-align: center; padding: 20px; border-radius: 14px; }
  .cost-range { font-size: 1.8rem; }

  /* Buttons */
  .btn-primary { padding: 12px 24px; font-size: 0.82rem; border-radius: 10px; }
  .btn-ghost { padding: 12px 18px; font-size: 0.8rem; border-radius: 10px; }

  /* Stats */
  .stats-row { gap: 28px; margin-top: 28px; padding-top: 20px; }
  .stat-n { font-size: 1.5rem; }
  .stat-l { font-size: 0.62rem; }
}

/* Small phones */
@media (max-width: 480px) {
  .hero { padding: 66px 12px 32px; }
  h1 { font-size: clamp(2.2rem, 10vw, 3.5rem); letter-spacing: 1.5px; margin-bottom: 12px; }
  .hero-sub { font-size: 0.85rem; line-height: 1.6; margin-bottom: 28px; }

  .glass-card { padding: 20px 14px; border-radius: 16px; }
  .panel-title { font-size: 1.3rem; letter-spacing: 1.5px; }

  .options-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .option-card { padding: 14px 10px; }
  .option-label { font-size: 0.88rem; }

  .r-value { font-size: 1.1rem; }
  .cost-range { font-size: 1.5rem; }
  .cost-label { font-size: 0.6rem; }
  .cost-note { font-size: 0.68rem; }

  .btn-primary, .btn-ghost { width: 100%; justify-content: center; min-height: 48px; }
  .stats-row { gap: 20px; flex-wrap: wrap; }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 360px) {
  nav { padding: 0 10px; }
  .logo { font-size: 1rem; gap: 6px; }
  .logo-icon { width: 26px; height: 26px; font-size: 0.85rem; border-radius: 6px; }
  .theme-toggle { width: 36px; height: 36px; border-radius: 10px; font-size: 0.95rem; }
  .glass-card { padding: 16px 12px; }
  h1 { font-size: 2rem; }
  .door-scene { font-size: 2.8rem; }
  .door-title { font-size: 1.1rem; }
  .door-desc { font-size: 0.75rem; }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .door, .option-card, .btn-primary, .btn-ghost, .theme-toggle {
    -webkit-tap-highlight-color: transparent;
  }
  .theme-toggle { min-width: 44px; min-height: 44px; }
  .btn-primary, .btn-ghost { min-height: 48px; }
  .door:hover { transform: none; }
  .option-card:hover { transform: none; }
  .door:active { transform: scale(0.98); }
  .option-card:active { transform: scale(0.97); }
}
