/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Colors */
  --color-bg:         #FFFDF7;
  --color-surface:    #F5EFE3;
  --color-border:     #E2D9CC;
  --color-text:       #1A1714;
  --color-muted:      #7A7068;
  --color-accent:     #E8385A;
  --color-accent-alt: #F5A623;
  --color-pop:        #3B82F6;
  --color-cta:        #25d366;
  --color-cta-text:   #0d2b18;

  /* Typography */
  --font-display:     'Fraunces', Georgia, serif;
  --font:             'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --size-hero:        clamp(2.6rem, 10vw, 5rem);
  --size-h2:          clamp(1.8rem, 6vw, 2.8rem);
  --size-body:        1rem;
  --size-small:       0.875rem;
  --weight-heavy:     900;
  --weight-bold:      700;
  --weight-mid:       500;
  --lh-tight:         1.1;
  --lh-body:          1.7;

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  4rem;
  --space-xl:  6rem;

  /* Layout */
  --max-width: 520px;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 999px;

  /* Transitions */
  --ease:      cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur-fast:  160ms;
  --dur-mid:   300ms;
  --dur-slow:  540ms;

  /* iOS safe areas */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--color-bg);
}

body {
  font-family: var(--font);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.accent {
  color: var(--color-accent);
  font-style: italic;
}

.section-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-xs);
}

.section-heading {
  font-family: var(--font-display);
  font-size: var(--size-h2);
  font-weight: var(--weight-heavy);
  font-style: italic;
  line-height: var(--lh-tight);
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  padding-top: calc(var(--safe-top) + var(--space-lg));
  padding-bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background: var(--color-bg);
  overflow: hidden;
}

/* Decorative blobs */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.hero::before {
  width: 340px;
  height: 340px;
  background: rgba(232, 56, 90, 0.08);
  top: -80px;
  right: -80px;
  filter: blur(60px);
}

.hero::after {
  width: 280px;
  height: 280px;
  background: rgba(245, 166, 35, 0.1);
  bottom: 40px;
  left: -60px;
  filter: blur(50px);
}

.hero__inner {
  max-width: var(--max-width);
  padding-inline: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: var(--size-small);
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  background: #FEE2E8;
  border: 1.5px solid #FBBCCB;
  border-radius: 999px;
  padding: 0.4em 1.1em;
  transform: rotate(-1.5deg);
  animation: fadeDown 0.6s var(--ease) both;
}

.hero__headline {
  font-family: var(--font-display);
  font-size: var(--size-hero);
  font-weight: var(--weight-heavy);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  animation: fadeUp 0.7s 0.1s var(--ease) both;
}

.hero__sub {
  font-size: 1.1rem;
  color: var(--color-muted);
  max-width: 300px;
  font-style: italic;
  animation: fadeUp 0.7s 0.2s var(--ease) both;
}

/* Photo */
.hero__photo-wrap {
  width: 164px;
  height: 164px;
  border-radius: 40% 60% 55% 45% / 45% 45% 55% 55%;
  border: 3px solid var(--color-text);
  overflow: hidden;
  animation: fadeUp 0.7s 0.3s var(--ease) both;
  transform: rotate(2deg);
  box-shadow: 6px 6px 0px var(--color-accent);
}

.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__photo-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--size-small);
  color: var(--color-muted);
  text-align: center;
  padding: var(--space-xs);
}

/* Scroll hint */
.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--color-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: fadeUp 0.7s 0.5s var(--ease) both, bob 2s 1.2s ease-in-out infinite;
  min-height: 44px;
  justify-content: center;
}

.scroll-hint__arrow {
  font-size: 1.1rem;
}

/* ============================================================
   WAVY DIVIDER
   ============================================================ */
.wavy-divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  margin-block: 0;
}

.wavy-divider svg {
  display: block;
  width: 100%;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  padding-block: var(--space-xl);
  background: var(--color-surface);
}

.about__bio {
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  line-height: var(--lh-body);
}

.about__bio:last-child {
  margin-bottom: 0;
  color: var(--color-muted);
  font-style: italic;
}

/* ============================================================
   SCENES
   ============================================================ */
.scenes {
  padding-block: var(--space-xl);
  background: var(--color-bg);
}

/* Photo strip */
.photo-strip-wrap {
  overflow: hidden;
  width: 100%;
  margin-bottom: var(--space-xl);
}

.photo-strip {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: strip-scroll 18s linear infinite;
}

.photo-strip:hover {
  animation-play-state: paused;
}

@keyframes strip-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.photo-strip__item {
  position: relative;
  width: 260px;
  height: 320px;
  flex-shrink: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-surface);
}

.photo-strip__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder state when image 404s */
.photo-strip__item--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-strip__item--placeholder::before {
  content: '📸';
  font-size: 2rem;
  opacity: 0.4;
}

.photo-strip__item--placeholder img {
  display: none;
}

.photo-strip__label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--color-text);
  color: #fff;
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
}

.scene {
  padding-block: var(--space-md);
  border-bottom: 1.5px dashed var(--color-border);
}

.scene:last-child {
  border-bottom: none;
}

.scene__location {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-bg);
  background: var(--color-text);
  border-radius: 4px;
  padding: 0.2em 0.6em;
  margin-bottom: var(--space-xs);
}

.scene__body {
  font-size: 1.05rem;
  color: var(--color-muted);
  line-height: var(--lh-body);
}

/* ============================================================
   QUIZ
   ============================================================ */
.quiz-section {
  padding-block: var(--space-xl);
  background: var(--color-surface);
}

.quiz {
  margin-top: var(--space-md);
}

.quiz__progress {
  height: 4px;
  background: var(--color-border);
  border-radius: 999px;
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.quiz__progress-bar {
  height: 100%;
  background: var(--color-accent);
  border-radius: 999px;
  width: 0%;
  transition: width 0.4s var(--ease);
}

/* Individual question */
.quiz__question {
  display: none;
  animation: fadeUp 0.35s var(--ease) both;
}

.quiz__question.active {
  display: block;
}

.quiz__q {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  font-weight: var(--weight-heavy);
  font-style: italic;
  line-height: var(--lh-tight);
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.quiz__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.quiz__opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 110px;
  padding: var(--space-sm);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.quiz__opt:active {
  transform: scale(0.95);
}

.quiz__opt.selected {
  border-color: var(--color-accent);
  background: #FEE2E8;
}

.quiz__opt-icon {
  font-size: 1.8rem;
  line-height: 1;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border-radius: 16px;
  border: 1.5px solid var(--color-border);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

/* Alternate icon rotation for visual rhythm */
.quiz__opt:nth-child(odd) .quiz__opt-icon  { transform: rotate(-3deg); }
.quiz__opt:nth-child(even) .quiz__opt-icon { transform: rotate(2deg); }

.quiz__opt:hover .quiz__opt-icon,
.quiz__opt:focus .quiz__opt-icon {
  transform: rotate(0deg) scale(1.08);
}

.quiz__opt.selected .quiz__opt-icon {
  background: #FEE2E8;
  border-color: var(--color-accent);
  transform: rotate(0deg) scale(1.12);
  animation: icon-pop 0.25s var(--ease) both;
}

@keyframes icon-pop {
  0%   { transform: scale(1); }
  60%  { transform: scale(1.22); }
  100% { transform: scale(1.12); }
}

.quiz__opt-label {
  font-size: 0.9rem;
  font-weight: var(--weight-bold);
  color: var(--color-text);
  text-align: center;
  line-height: 1.3;
}

/* Rigged button */
.quiz__opt--rigged {
  position: relative;
}

.quiz__opt-arrow {
  display: none;
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  white-space: nowrap;
}

.quiz__opt--rigged.wrong .quiz__opt-arrow {
  display: block;
  animation: nudge 1.2s ease-in-out infinite;
}

.quiz__opt--rigged.wrong {
  opacity: 0.4;
}

@keyframes nudge {
  0%, 100% { transform: translateX(-50%) translateX(0); }
  50%       { transform: translateX(-50%) translateX(-6px); }
}

/* Text question */
.quiz__question--text .quiz__text-wrap {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.quiz__text-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: var(--size-body);
  color: var(--color-text);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.quiz__text-input:focus {
  border-color: var(--color-accent);
}

.quiz__text-input::placeholder {
  color: var(--color-muted);
}

.quiz__text-submit {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: var(--color-accent);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.1s;
}

.quiz__text-submit:active {
  transform: scale(0.94);
}

.quiz__text-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quiz__text-response {
  margin-top: var(--space-md);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 16px;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  animation: fadeUp 0.35s var(--ease) both;
}

.quiz__text-response-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--color-text);
  line-height: var(--lh-body);
  margin: 0;
}

/* Blinking caret while the AI reply streams in */
.is-streaming::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--color-accent);
  animation: caret-blink 0.9s steps(1) infinite;
}

@keyframes caret-blink {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.quiz__text-next {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--color-accent);
  font-family: var(--font);
  font-size: var(--size-small);
  font-weight: var(--weight-mid);
  cursor: pointer;
  padding: 0.25rem 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Result */
.quiz__result {
  animation: fadeUp 0.4s var(--ease) both;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.quiz__result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.quiz__result-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: var(--size-small);
  font-weight: var(--weight-bold);
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: 999px;
  padding: 0.35em 0.9em;
}

.quiz__result-line {
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 1.15rem);
  font-weight: var(--weight-bold);
  font-style: italic;
  line-height: 1.6;
  color: var(--color-text);
  max-width: 380px;
  text-align: center;
}

.quiz__restart {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: var(--size-small);
  color: var(--color-muted);
  cursor: pointer;
  padding: 0.5rem;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}


/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 52px;
  width: 100%;
  max-width: 320px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-lg);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: var(--weight-bold);
  cursor: pointer;
  border: none;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.96);
}

.btn--primary {
  background: var(--color-cta);
  color: var(--color-cta-text);
  box-shadow: 0 4px 0px #1aad50;
}

.btn--primary:active {
  box-shadow: 0 0px 0px #1aad50;
  transform: translateY(4px) scale(0.99);
}

.btn--ghost {
  background: transparent;
  color: var(--color-muted);
  border: 1.5px solid var(--color-border);
}

.btn--ghost:active {
  background: var(--color-surface);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding-block: var(--space-lg);
  padding-bottom: calc(var(--space-lg) + var(--safe-bottom));
  text-align: center;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.footer__text {
  font-size: var(--size-small);
  color: var(--color-muted);
  line-height: 2;
}

.footer__easter {
  cursor: pointer;
  display: inline-block;
  font-size: 1.2rem;
  transition: transform var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
  min-width: 44px;
  min-height: 44px;
  line-height: 44px;
}

.footer__easter:active {
  transform: scale(1.5) rotate(25deg);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px) rotate(-1.5deg); }
  to   { opacity: 1; transform: translateY(0) rotate(-1.5deg); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}

/* ============================================================
   CONFETTI
   ============================================================ */
.confetti-particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ============================================================
   DESKTOP
   ============================================================ */
@media (min-width: 600px) {
  .hero__photo-wrap {
    width: 200px;
    height: 200px;
  }

  .scene:hover .scene__location {
    background: var(--color-accent);
  }
}
