@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  --sin-black: #0f0505;
  --sin-burgundy: #4a0e1e;
  --sin-gold: #c5a059;
  --sin-cream: #f5f0e0;
  --sin-ember: #8b2500;
  --sin-velvet: #1a0a0f;
  --font-display: 'Cinzel', Georgia, serif;
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --landing-scale: 0.72;
  --landing-aspect: 1.4898;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--sin-black);
  color: var(--sin-cream);
  font-family: var(--font-serif);
  overflow-x: hidden;
  min-height: 100vh;
}

.font-display { font-family: var(--font-display); }
.gold-text { color: var(--sin-gold); }
.gold-glow {
  text-shadow: 0 0 20px rgba(197, 160, 89, 0.3), 0 0 40px rgba(197, 160, 89, 0.1);
}

.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.gold-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197, 160, 89, 0.6), transparent);
}

/* Landing */
.landing-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vmin, 2rem);
  background: #000;
  z-index: 110;
}

.landing-frame {
  position: relative;
  flex-shrink: 0;
  display: inline-block;
  line-height: 0;
  max-width: 100%;
  max-height: 100%;
}

.landing-hero-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(calc((100vw - 2rem) * var(--landing-scale)), calc((100svh - 2rem) * var(--landing-scale) * var(--landing-aspect)));
  max-height: calc((100svh - 2rem) * var(--landing-scale));
  border-radius: 2px;
}

.landing-enter-hitbox {
  position: absolute;
  left: 50%;
  bottom: 9.5%;
  transform: translateX(-50%);
  width: 19%;
  height: 8.5%;
  min-width: 120px;
  min-height: 36px;
  max-width: 220px;
  max-height: 56px;
  cursor: pointer;
  border: none;
  background: transparent;
  border-radius: 4px;
  transition: box-shadow 0.4s ease;
  z-index: 12;
  text-decoration: none;
  color: transparent;
}

.landing-enter-hitbox:hover {
  box-shadow: 0 0 36px rgba(197, 160, 89, 0.4);
}

.landing-leave {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  font-size: 0.75rem;
  color: rgba(245, 240, 224, 0.35);
  text-decoration: none;
  transition: color 0.3s;
}

.landing-leave:hover { color: rgba(245, 240, 224, 0.65); }

/* Doors hub */
.doors-hub {
  position: relative;
  min-height: 100vh;
  padding: 7rem 1rem 6rem;
  background: var(--sin-black);
}

.doors-hub-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 45%, transparent 0%, rgba(15, 5, 5, 0.55) 70%, #0f0505 100%),
    linear-gradient(to bottom, rgba(15, 5, 5, 0.35), transparent 18%, transparent 82%, rgba(15, 5, 5, 0.5));
}

.doors-header { position: relative; z-index: 10; text-align: center; margin-bottom: 3rem; }
.doors-header .eyebrow {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.45em;
  color: rgba(197, 160, 89, 0.65);
  text-transform: uppercase;
}
.doors-header h1 {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.05em;
  color: var(--sin-cream);
}
.doors-header .subtitle {
  margin: 1.5rem auto 0;
  max-width: 36rem;
  font-size: 1.125rem;
  font-style: italic;
  color: rgba(245, 240, 224, 0.55);
}

.door-grid {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 72rem;
  margin: 0 auto;
}

.door-card {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(197, 160, 89, 0.15);
  background: rgba(26, 10, 15, 0.6);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.door-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(197, 160, 89, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(197, 160, 89, 0.08);
}

.door-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  opacity: 0.85;
}

.door-card-body { padding: 1rem 1.25rem 1.25rem; }
.door-card-level {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: rgba(197, 160, 89, 0.7);
  text-transform: uppercase;
}
.door-card-name {
  margin-top: 0.35rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: rgba(245, 240, 224, 0.8);
}
.door-card-desc {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: rgba(245, 240, 224, 0.45);
  line-height: 1.5;
}

.privacy-footer {
  position: relative;
  z-index: 10;
  margin-top: 4rem;
  text-align: center;
  font-size: 0.8rem;
  font-style: italic;
  color: rgba(245, 240, 224, 0.35);
}

/* Pipeline / questionnaire */
.pipeline-root {
  position: relative;
  min-height: 100vh;
  padding: 6rem 1rem 5rem;
}

.pipeline-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.14;
  pointer-events: none;
}

.pipeline-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 5, 5, 0.72);
  pointer-events: none;
}

.pipeline-vignette::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(15, 5, 5, 0.55) 100%);
}

.door-badge {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 20;
}
.door-badge .level {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: rgba(197, 160, 89, 0.55);
  text-transform: uppercase;
}
.door-badge .name {
  font-size: 0.85rem;
  font-style: italic;
  color: rgba(245, 240, 224, 0.55);
}

.step-dots {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 0.35rem;
}
.step-dot {
  width: 1.5rem;
  height: 2px;
  border-radius: 1px;
  background: rgba(197, 160, 89, 0.2);
  transition: background 0.5s;
}
.step-dot.active { background: var(--sin-gold); }

.elevator-nav {
  position: fixed;
  top: 1.5rem;
  right: 1rem;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 220px;
  justify-content: flex-end;
}
.elevator-link {
  padding: 0.25rem 0.5rem;
  font-family: var(--font-display);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245, 240, 224, 0.35);
  text-decoration: none;
  border: 1px solid rgba(197, 160, 89, 0.1);
  border-radius: 2px;
  transition: all 0.3s;
}
.elevator-link:hover, .elevator-link.active {
  color: var(--sin-gold);
  border-color: rgba(197, 160, 89, 0.4);
}

.parchment-panel {
  position: relative;
  z-index: 10;
  max-width: 32rem;
  margin: 2rem auto 0;
  padding: 2rem;
  border: 1px solid rgba(197, 160, 89, 0.22);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(197, 160, 89, 0.06), transparent 40%),
    linear-gradient(180deg, rgba(26, 10, 15, 0.95), rgba(15, 5, 5, 0.98));
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35), 0 12px 40px rgba(0, 0, 0, 0.35);
}

.screen { display: none; animation: fadeIn 0.5s ease; }
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.layer-header { text-align: center; margin-bottom: 1.5rem; }
.layer-header .step-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(197, 160, 89, 0.5);
}
.layer-header .layer-title {
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--sin-cream);
  letter-spacing: 0.05em;
}
.layer-header .layer-sub {
  margin-top: 0.25rem;
  font-style: italic;
  font-size: 0.9rem;
  color: rgba(245, 240, 224, 0.45);
}

.frame-text {
  font-size: 0.95rem;
  color: rgba(245, 240, 224, 0.55);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.field-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(197, 160, 89, 0.65);
  margin-bottom: 0.35rem;
}

.input-field {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  background: rgba(15, 5, 5, 0.5);
  border: 1px solid rgba(197, 160, 89, 0.2);
  border-radius: 4px;
  color: var(--sin-cream);
  font-family: var(--font-serif);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}
.input-field:focus { border-color: rgba(197, 160, 89, 0.45); }
.input-field::placeholder { color: rgba(245, 240, 224, 0.25); }
textarea.input-field { min-height: 4.5rem; resize: vertical; line-height: 1.5; }

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.35rem;
  background: rgba(15, 5, 5, 0.4);
  border: 1px solid rgba(197, 160, 89, 0.12);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}
.choice-card:hover {
  border-color: rgba(197, 160, 89, 0.3);
  background: rgba(74, 14, 30, 0.2);
}
.choice-card.selected {
  border-color: rgba(197, 160, 89, 0.5);
  background: rgba(74, 14, 30, 0.35);
}
.choice-card .dot {
  width: 14px; height: 14px; min-width: 14px; margin-top: 2px;
  border: 1.5px solid rgba(197, 160, 89, 0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.choice-card.selected .dot { border-color: var(--sin-gold); }
.choice-card.selected .dot::after {
  content: '';
  width: 7px; height: 7px;
  background: var(--sin-gold);
  border-radius: 50%;
}
.choice-card .label { font-size: 0.95rem; color: var(--sin-cream); }
.choice-card .desc { font-size: 0.75rem; color: rgba(245, 240, 224, 0.4); margin-top: 2px; }

.multi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.multi-card {
  padding: 0.5rem 0.65rem;
  text-align: center;
  background: rgba(15, 5, 5, 0.4);
  border: 1px solid rgba(197, 160, 89, 0.12);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--sin-cream);
  transition: all 0.3s;
}
.multi-card:hover { border-color: rgba(197, 160, 89, 0.3); }
.multi-card.selected {
  border-color: rgba(197, 160, 89, 0.5);
  background: rgba(74, 14, 30, 0.35);
  color: var(--sin-gold);
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(197, 160, 89, 0.15);
}

.ornate-button {
  position: relative;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--sin-cream);
  min-width: 140px;
}
.ornate-button:disabled { opacity: 0.3; cursor: default; }
.ornate-button-border {
  border: 1px solid rgba(197, 160, 89, 0.55);
  box-shadow: 0 0 20px rgba(197, 160, 89, 0.12);
  padding: 0.65rem 1.25rem;
  transition: all 0.4s;
}
.ornate-button:hover:not(:disabled) .ornate-button-border {
  box-shadow: 0 0 30px rgba(197, 160, 89, 0.25);
}
.ornate-button.primary .ornate-button-border {
  background: linear-gradient(180deg, rgba(106, 30, 46, 0.95), rgba(74, 14, 30, 0.98));
}
.ornate-button.primary:hover:not(:disabled) .ornate-button-border {
  background: linear-gradient(180deg, rgba(130, 40, 58, 0.98), rgba(90, 20, 36, 1));
}

.boundary-group {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid rgba(197, 160, 89, 0.15);
  border-radius: 4px;
  background: rgba(15, 5, 5, 0.5);
}
.boundary-group h4 {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(197, 160, 89, 0.8);
  margin-bottom: 0.75rem;
}
.boundary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.boundary-row span { font-size: 0.85rem; color: rgba(245, 240, 224, 0.7); }
.boundary-btns { display: flex; gap: 0.35rem; }
.boundary-btn {
  padding: 0.35rem 0.75rem;
  font-family: var(--font-serif);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 3px;
  border: 1px solid rgba(197, 160, 89, 0.1);
  background: transparent;
  color: rgba(245, 240, 224, 0.4);
  cursor: pointer;
  transition: all 0.3s;
}
.boundary-btn.include.active {
  background: rgba(197, 160, 89, 0.2);
  border-color: rgba(197, 160, 89, 0.5);
  color: var(--sin-gold);
}
.boundary-btn.exclude.active {
  background: rgba(127, 29, 29, 0.4);
  border-color: rgba(185, 28, 28, 0.5);
  color: #fecaca;
}

.result-story {
  max-height: 60vh;
  overflow-y: auto;
  text-align: left;
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(245, 240, 224, 0.85);
}
.result-story p { margin-bottom: 1rem; }

.i-bar { display: flex; gap: 2px; margin-top: 4px; justify-content: center; }
.i-bar span {
  width: 14px; height: 3px; border-radius: 2px;
  background: rgba(197, 160, 89, 0.15);
}
.selected .i-bar span.filled { background: var(--sin-gold); }
.length-detail { font-size: 0.7rem; color: rgba(245, 240, 224, 0.35); margin-top: 2px; }

.beta-banner {
  max-width: 36rem;
  margin: 0 auto 2rem;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(245, 240, 224, 0.45);
  border: 1px solid rgba(197, 160, 89, 0.15);
  border-radius: 4px;
  background: rgba(15, 5, 5, 0.6);
}

/* Age gate */
.age-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 1.5rem;
}
.age-gate-overlay.hidden { display: none; }
.age-gate-panel {
  max-width: 28rem;
  padding: 2.5rem 2rem;
  text-align: center;
  border: 1px solid rgba(197, 160, 89, 0.25);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(26, 10, 15, 0.98), rgba(15, 5, 5, 0.99));
}
.age-gate-panel h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--sin-cream);
  letter-spacing: 0.05em;
}
.age-gate-panel p {
  margin-top: 1rem;
  font-size: 1rem;
  color: rgba(245, 240, 224, 0.55);
  line-height: 1.6;
}
.age-gate-actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 640px) {
  .door-grid { grid-template-columns: 1fr; }
  .elevator-nav { max-width: 140px; }
  .parchment-panel { padding: 1.25rem; }
}