/* ==========================================
   House of Almost — Styles
   Mobile-first, scales up to desktop.
   ========================================== */

/* Font face */
@font-face {
  font-family: 'HelloParis';
  src: url('HelloParisSans.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Design tokens */
:root {
  --offwhite: #e6e2d7;
  --offwhite-dim: #afaca2;
  --offwhite-faint: #828078;
  --gold: #c9a961;
  --gold-text: #0f0f14;
  --bg: #050610;
  --card-bg: rgba(20, 20, 28, 0.65);

  --font-display: 'HelloParis', 'Cormorant Garamond', serif;
  --font-serif: Georgia, 'Cormorant Garamond', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius: 4px;
  --transit-y-mobile: 24px;
  --transit-y-desktop: 32px;
}

/* Base */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--offwhite);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  background-image: url('assets/night-sky.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  /* Darken overlay applied via pseudo-element */
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 0;
  pointer-events: none;
}

/* All real content sits above the overlay */
.stage, .transit-bar {
  position: relative;
  z-index: 1;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}

/* ==========================================
   Transit bar (top of every screen, scrolls naturally)
   ========================================== */
.transit-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.transit-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--offwhite);
  white-space: nowrap;
  flex-shrink: 0;
}

.transit-line {
  flex: 1;
  height: 1px;
  background-color: rgba(150, 150, 150, 0.5);
  position: relative;
}

.transit-planet {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--offwhite);
  transform: translate(-50%, -50%);
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(230, 226, 215, 0.4);
}

@media (min-width: 768px) {
  .transit-bar {
    gap: 20px;
    margin-bottom: 64px;
  }
  .transit-label {
    font-size: 12px;
    letter-spacing: 0.22em;
  }
}

/* ==========================================
   Stage / screens
   ========================================== */
.stage {
  min-height: 100vh;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.screen {
  display: none;
  width: 100%;
  max-width: 540px;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.5s ease forwards;
}

.screen.active {
  display: flex;
}

/* Welcome screen: center vertically in remaining space below transit bar */
.screen--welcome.active {
  flex-grow: 1;
  justify-content: center;
  padding-bottom: 60px;
}

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

@media (min-width: 768px) {
  .stage {
    padding: 40px 32px 80px;
  }
  .screen {
    max-width: 680px;
  }
}

/* ==========================================
   Welcome screen
   ========================================== */
.eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(10px, 2.6vw, 13px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--offwhite);
  margin-bottom: 24px;
  white-space: nowrap;
}

.title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(52px, 12vw, 130px);
  line-height: 1;
  margin: 0 0 24px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.08em;
  letter-spacing: 0.005em;
  /* Subtle glow */
  text-shadow: 0 0 24px rgba(230, 226, 215, 0.18);
}

.title-big {
  font-size: 1em;
}

.title-small {
  font-size: 0.5em;
  align-self: center;
  position: relative;
  top: 0.05em;
}

.divider {
  width: clamp(120px, 22vw, 180px);
  height: auto;
  opacity: 0.9;
  margin: 18px 0 28px;
  /* Recolor the white PNG to off-white via filter */
  filter: brightness(0.92) sepia(0.15);
}

.welcome-hook {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(21px, 5.2vw, 30px);
  line-height: 1.35;
  color: var(--offwhite);
  margin: 0 0 24px;
  max-width: 480px;
}

.welcome-meta {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(17px, 4vw, 22px);
  color: var(--offwhite-dim);
  margin: 0 0 36px;
}

/* ==========================================
   Buttons
   ========================================== */
.btn-gold {
  background-color: var(--gold);
  color: var(--gold-text);
  font-family: var(--font-display);
  font-size: clamp(22px, 5.5vw, 30px);
  padding: 14px 56px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: filter 0.2s ease, transform 0.1s ease;
  min-width: 220px;
}

.btn-gold:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-gold:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-gold:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==========================================
   Question screens (Q1-Q6)
   ========================================== */
.question-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 8vw, 64px);
  line-height: 1.1;
  margin: 0 0 24px;
  color: var(--offwhite);
}

.question-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(20px, 5vw, 30px);
  margin: 0 0 28px;
  color: var(--offwhite);
}

.question-body {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 5vw, 36px);
  line-height: 1.35;
  margin: 0 0 32px;
  color: var(--offwhite);
  max-width: 620px;
}

/* Q1 dropdown */
.dropdown-wrap {
  width: 100%;
  max-width: 420px;
  margin-bottom: 36px;
  position: relative;
}

.dropdown {
  width: 100%;
  background-color: rgba(20, 20, 28, 0.7);
  color: var(--offwhite);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 4.5vw, 24px);
  padding: 16px 44px 16px 22px;
  border: 1px solid rgba(150, 150, 150, 0.5);
  border-radius: var(--radius);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8' fill='none'><path d='M1 1L7 7L13 1' stroke='%23e6e2d7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 18px center;
  cursor: pointer;
}

.dropdown:focus {
  outline: none;
  border-color: var(--offwhite);
}

.dropdown option {
  background-color: #14141c;
  color: var(--offwhite);
  font-style: normal;
}

/* Q2-Q6 answer cards */
.answer-list {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 32px;
}

.answer-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background-color: var(--card-bg);
  border: 1px solid rgba(150, 150, 150, 0.5);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  width: 100%;
  color: var(--offwhite);
  font-family: var(--font-sans);
  font-size: clamp(16px, 4vw, 22px);
  line-height: 1.45;
}

.answer-card:hover {
  background-color: rgba(40, 40, 52, 0.7);
}

.answer-card.selected {
  border-color: var(--gold);
  background-color: rgba(40, 36, 22, 0.65);
}

.answer-letter {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(22px, 5vw, 30px);
  color: var(--offwhite-faint);
  flex-shrink: 0;
  min-width: 22px;
  text-align: center;
}

.answer-card.selected .answer-letter {
  color: var(--gold);
}

.answer-text {
  flex: 1;
}

.answer-card--named .answer-text strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

/* ==========================================
   Email capture screen
   ========================================== */
.email-headline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(20px, 5vw, 30px);
  line-height: 1.4;
  margin: 0 0 22px;
  color: var(--offwhite);
}

.email-jk {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 4.5vw, 26px);
  margin: 0 0 22px;
  color: var(--offwhite-dim);
}

.email-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(20px, 5vw, 30px);
  line-height: 1.4;
  margin: 0 0 48px;
  color: var(--offwhite);
}

.email-form {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

/* Honeypot field (hidden from real users, catches bots) */
.hp-field {
  display: none;
}

.text-input {
  width: 100%;
  background-color: rgba(20, 20, 28, 0.7);
  color: var(--offwhite);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 4.5vw, 24px);
  padding: 16px 22px;
  border: 1px solid rgba(150, 150, 150, 0.5);
  border-radius: var(--radius);
}

.text-input::placeholder {
  color: var(--offwhite-dim);
  font-style: italic;
}

.text-input:focus {
  outline: none;
  border-color: var(--offwhite);
}

.email-form .btn-gold {
  margin-top: 12px;
  align-self: center;
}

/* ==========================================
   Waiting (Mercury) screen
   ========================================== */
.screen--waiting {
  justify-content: center;
  min-height: 80vh;
}

.dots {
  display: flex;
  gap: 12px;
  margin-bottom: 56px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--offwhite);
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.1); }
}

.mercury-line {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(26px, 6vw, 44px);
  line-height: 1.3;
  margin: 0 0 22px;
  color: var(--offwhite);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.mercury-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   Reveal screen
   ========================================== */
.screen--reveal {
  max-width: 680px;
}

.result-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 8.5vw, 90px);
  line-height: 1.05;
  margin: 8px 0 18px;
  letter-spacing: 0.005em;
  color: var(--offwhite);
  text-shadow: 0 0 24px rgba(230, 226, 215, 0.18);
}

.result-edition {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(20px, 5vw, 32px);
  margin: 0 0 12px;
  color: var(--offwhite);
}

/* Mid divider between result body and footer cards.
   Positioned in the breathing room between result content and the
   pin/email/personal cards. */
.divider--mid {
  margin: 0 auto 24px;
}

.result-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.result-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 24px 26px;
  width: 100%;
}

.result-card h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(13px, 3vw, 16px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 16px;
}

.result-card p {
  font-family: var(--font-sans);
  font-size: clamp(16px, 4vw, 22px);
  line-height: 1.55;
  margin: 0;
  color: var(--offwhite);
}

/* Aside cards (disclaimer / pin / close) use serif italic */
.result-card--aside,
.result-card--pin,
.result-card--close {
  text-align: center;
  padding: 32px 24px;
}

.result-card--aside p,
.result-card--pin p,
.result-card--close p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(17px, 4vw, 24px);
  line-height: 1.5;
  margin: 0;
}

.result-card--aside p + p {
  margin-top: 6px;
}

.result-card .dim {
  color: var(--offwhite-dim);
}

/* Decorative icons sitting at the top of footer cards */
.result-icon {
  color: var(--offwhite);
  margin: 0 auto 20px;
  display: block;
}

/* Aside cards stack with a clear gap so they read as 3 distinct boxes,
   regardless of order. */
.result-card--pin + .result-card--aside,
.result-card--pin + .result-card--close,
.result-card--aside + .result-card--pin,
.result-card--aside + .result-card--close,
.result-card--close + .result-card--pin,
.result-card--close + .result-card--aside {
  margin-top: 20px;
}

/* Pin card layout */
.pin-link {
  display: inline-block;
  margin-bottom: 18px;
  transition: transform 0.2s ease;
}

.pin-link:hover {
  transform: scale(1.05);
}

.pin-logo {
  width: 56px;
  height: auto;
}

.result-card--pin p {
  margin-top: 0;
}

.result-card--pin p + p {
  margin-top: 6px;
}

/* ==========================================
   Desktop refinements
   ========================================== */
@media (min-width: 1024px) {
  .screen--reveal {
    max-width: 800px;
  }
  .result-body {
    gap: 22px;
  }
  .result-card {
    padding: 32px 36px;
  }
  .result-card h3 {
    letter-spacing: 0.28em;
  }
}
