:root {
  color-scheme: light;
  --ink: #1d1b19;
  --muted: #6a625a;
  --paper: #fdf7ef;
  --surface: #fff4e4;
  --accent: #ff7a59;
  --accent-deep: #ff4d2d;
  --teal: #2f7b74;
  --shadow: 0 20px 40px rgba(29, 27, 25, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: radial-gradient(circle at top, #fff7e6 0%, #fce4d1 35%, #f9d7e2 70%, #f9efe7 100%);
  color: var(--ink);
}

.screen {
  min-height: auto;
}

body.mode-flight {
  background: radial-gradient(circle at top, #0c1d3a 0%, #0a1426 40%, #070c18 100%);
  color: #f5f2e8;
}

body.mode-scene {
  background: #0f0f0f;
}

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

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  position: relative;
}

.page::before,
.page::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 122, 89, 0.15);
  filter: blur(0px);
  z-index: -1;
}

.page::before {
  top: -80px;
  right: 10%;
}

.page::after {
  bottom: -120px;
  left: 5%;
  background: rgba(47, 123, 116, 0.15);
}

.hero {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  margin-bottom: 48px;
  animation: rise 0.7s ease both;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--muted);
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(32px, 4vw, 52px);
}

.lead {
  font-size: 18px;
  max-width: 520px;
}

.hero-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 122, 89, 0.15);
}

.hero-meta {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  border: none;
  background: #fff;
  color: var(--ink);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(29, 27, 25, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(29, 27, 25, 0.12);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.badge {
  background: rgba(47, 123, 116, 0.12);
  color: var(--teal);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.error {
  background: rgba(255, 77, 45, 0.12);
  color: var(--accent-deep);
}

main {
  display: grid;
  gap: 48px;
}

.section-title {
  margin-bottom: 18px;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  border: 1px solid rgba(29, 27, 25, 0.08);
  border-radius: 20px;
  background: #fff;
  padding: 16px;
  text-align: left;
  display: grid;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
  animation: rise 0.7s ease both;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card.active {
  border-color: var(--accent);
  box-shadow: 0 16px 30px rgba(255, 122, 89, 0.2);
}

.card-body {
  display: grid;
  gap: 6px;
}

.portrait {
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f9efe7;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.2) contrast(1.05);
}

.perk {
  font-weight: 600;
  color: var(--teal);
}

.location-swatch {
  height: 86px;
  border-radius: 16px;
}

.flavor {
  font-weight: 600;
}

.panel {
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(29, 27, 25, 0.08);
  animation: rise 0.7s ease both;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.counter {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(29, 27, 25, 0.12);
  font-weight: 600;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.pill {
  border: 1px solid rgba(29, 27, 25, 0.1);
  border-radius: 999px;
  padding: 10px 16px;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}

.pill.active {
  background: rgba(47, 123, 116, 0.12);
  border-color: var(--teal);
  color: var(--teal);
}

.slider-row {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.slider-row input {
  width: 100%;
}

.value {
  margin-left: 8px;
  font-weight: 600;
}

.review {
  font-size: 18px;
  line-height: 1.6;
}

.journal {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.journal-item {
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(29, 27, 25, 0.08);
  animation: rise 0.7s ease both;
}

#personality-list .card:nth-child(1),
#location-list .card:nth-child(1) {
  animation-delay: 0.05s;
}
#personality-list .card:nth-child(2),
#location-list .card:nth-child(2) {
  animation-delay: 0.1s;
}
#personality-list .card:nth-child(3),
#location-list .card:nth-child(3) {
  animation-delay: 0.15s;
}
#personality-list .card:nth-child(4),
#location-list .card:nth-child(4) {
  animation-delay: 0.2s;
}
#personality-list .card:nth-child(5),
#location-list .card:nth-child(5) {
  animation-delay: 0.25s;
}
#personality-list .card:nth-child(6),
#location-list .card:nth-child(6) {
  animation-delay: 0.3s;
}
#personality-list .card:nth-child(7),
#location-list .card:nth-child(7) {
  animation-delay: 0.35s;
}

.hidden {
  display: none;
}

.flight-screen {
  min-height: 70vh;
  display: grid;
  align-items: center;
  gap: 28px;
  padding: 40px 0;
}

.flight-header h2 {
  font-size: clamp(26px, 4vw, 40px);
  color: #f5f2e8;
}

.globe-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
}

.globe {
  width: min(420px, 80vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #4cc4ff, #0f4c81 55%, #06223d 100%);
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.globe-shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 70%, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.1));
  mix-blend-mode: multiply;
}

.globe-lines {
  position: absolute;
  inset: -10%;
  background-image: repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.15),
      rgba(255, 255, 255, 0.15) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.1) 1px,
      transparent 1px,
      transparent 22px
    );
  animation: spin 6s linear infinite;
}

.flight-path {
  position: absolute;
  width: min(520px, 90vw);
  height: min(280px, 60vw);
  border-top: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translateY(10px);
}

.city-dot {
  position: absolute;
  top: -12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f5f2e8;
}

.city-dot.start {
  left: -20px;
}

.city-dot.end {
  right: -20px;
  text-align: right;
}

.plane-icon {
  position: absolute;
  top: -18px;
  left: 0;
  width: 44px;
  height: 28px;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='80' viewBox='0 0 120 80'><g fill='none' stroke='none'><ellipse cx='58' cy='40' rx='40' ry='10' fill='%23ffffff' stroke='%23B0BEC5' stroke-width='3'/><ellipse cx='94' cy='40' rx='10' ry='7' fill='%23FF6B6B'/><path d='M58 32 L30 8 L12 10 L44 33 Z' fill='%23E8E8E8' stroke='%23B0BEC5' stroke-width='3'/><path d='M58 48 L30 72 L12 70 L44 47 Z' fill='%23E8E8E8' stroke='%23B0BEC5' stroke-width='3'/><path d='M18 40 L4 22 L8 20 L24 38 Z' fill='%23FF6B6B'/><circle cx='70' cy='38' r='2.5' fill='%2364B5F6'/><circle cx='58' cy='38' r='2.5' fill='%2364B5F6'/><circle cx='46' cy='38' r='2.5' fill='%2364B5F6'/></g></svg>");
  animation: orbit 3.6s ease-in-out forwards;
  z-index: 2;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
}

@keyframes orbit {
  0% {
    left: 0;
    top: -16px;
    transform: rotate(12deg);
  }
  50% {
    left: 50%;
    top: -44px;
    transform: rotate(-10deg);
  }
  100% {
    left: calc(100% - 26px);
    top: -16px;
    transform: rotate(6deg);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.travel-track {
  position: relative;
  height: 180px;
  border-radius: 18px;
  background: linear-gradient(135deg, #cfe8ff, #e8f7ff, #fef6e4);
  overflow: hidden;
  border: 1px solid rgba(29, 27, 25, 0.08);
}

.travel-track .city {
  position: absolute;
  top: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--muted);
}

.travel-track .city.left {
  left: 20px;
}

.travel-track .city.right {
  right: 20px;
}

.plane {
  position: absolute;
  top: 90px;
  left: -40px;
  width: 32px;
  height: 32px;
  background: var(--accent);
  clip-path: polygon(0 50%, 70% 0, 100% 50%, 70% 100%);
  animation: fly 3.6s ease-in-out infinite;
}

.trail {
  position: absolute;
  top: 106px;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 122, 89, 0.2), rgba(255, 122, 89, 0.8));
  animation: trail 3.6s ease-in-out infinite;
}

@keyframes fly {
  0% {
    transform: translateX(0) translateY(0) rotate(8deg);
  }
  50% {
    transform: translateX(60vw) translateY(-10px) rotate(-6deg);
  }
  100% {
    transform: translateX(110vw) translateY(0) rotate(6deg);
  }
}

@keyframes trail {
  0% {
    width: 0%;
    opacity: 0.2;
  }
  40% {
    width: 50%;
    opacity: 0.5;
  }
  100% {
    width: 100%;
    opacity: 0;
  }
}

.scene {
  border-radius: 28px;
  min-height: 420px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
  border: 1px solid rgba(29, 27, 25, 0.08);
}

.scene-overlay {
  backdrop-filter: blur(2px);
  padding: 28px;
  min-height: 420px;
  display: grid;
  gap: 20px;
}

.scene-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.scene-content {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(200px, 260px) 1fr;
  align-items: center;
}

.scene-portrait {
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(29, 27, 25, 0.1);
}

.scene-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.speech-bubble {
  background: rgba(255, 255, 255, 0.92);
  padding: 22px 24px;
  border-radius: 20px;
  position: relative;
  border: 1px solid rgba(29, 27, 25, 0.1);
}

.speech-bubble::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 36px;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.92);
  border-left: 1px solid rgba(29, 27, 25, 0.1);
  border-bottom: 1px solid rgba(29, 27, 25, 0.1);
  transform: rotate(45deg);
}

.scene-actions {
  display: flex;
  justify-content: flex-end;
}

.cheese-btn {
  position: relative;
  background: radial-gradient(circle at top left, #fff6c9, #f7c46d 70%);
  color: #3b2b14;
  border: 3px solid rgba(230, 166, 70, 0.9);
  font-weight: 700;
  box-shadow: 0 14px 26px rgba(255, 196, 109, 0.35);
  border-radius: 26px 34px 22px 30px;
  padding: 16px 28px;
  overflow: hidden;
}

.cheese-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 35%, rgba(255, 255, 255, 0.7) 0 8px, transparent 9px),
    radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.7) 0 10px, transparent 11px),
    radial-gradient(circle at 68% 40%, rgba(255, 255, 255, 0.6) 0 7px, transparent 8px),
    radial-gradient(circle at 82% 65%, rgba(255, 255, 255, 0.6) 0 9px, transparent 10px);
  mix-blend-mode: screen;
  opacity: 0.6;
  pointer-events: none;
}

.cheese-btn span,
.cheese-btn {
  position: relative;
}

@media (max-width: 720px) {
  .page {
    padding: 32px 18px 60px;
  }

  .hero-card {
    order: -1;
  }

  .scene-content {
    grid-template-columns: 1fr;
  }
}
