@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..700&family=Inter:wght@300;400&display=swap');

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Design tokens ──────────────────────────────────── */
:root {
  --bg:         #0B0A10;
  --bg-2:       #131120;
  --bg-3:       #1C1930;
  --text:       #EFE9E1;
  --text-muted: #7A6E8E;
  --text-faint: #3C3552;
  --accent:     #C2AADF;
  --accent-dim: #7A6B9A;
  --border:     rgba(194, 170, 223, 0.12);
  --glow:       rgba(194, 170, 223, 0.08);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bloom:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Typography ─────────────────────────────────────── */
.display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-optical-sizing: auto;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.serif {
  font-family: var(--font-display);
  font-optical-sizing: auto;
}

p {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text);
}

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

/* ─── Navigation ─────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1.5rem 2rem;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  mix-blend-mode: normal;
}

.nav a {
  color: var(--text-muted);
  transition: color 0.25s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav .dot {
  opacity: 0.35;
  margin: 0 0.15rem;
}

.nav .nav-brand {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text);
  letter-spacing: 0;
}

/* ─── Hero / Video section ───────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, transparent 0%, var(--bg) 90%),
    linear-gradient(to bottom, var(--bg) 0%, transparent 20%, transparent 80%, var(--bg) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  max-width: 700px;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-dim);
}

.hero-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  font-optical-sizing: auto;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--text);
}

.hero-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-optical-sizing: auto;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.hero-footer {
  position: absolute;
  bottom: 2rem;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.hero-footer a {
  color: var(--text-faint);
  transition: color 0.25s;
}
.hero-footer a:hover {
  color: var(--text-muted);
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2.5rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(194, 170, 223, 0.35);
  color: var(--text);
}

.btn-outline:hover {
  background: rgba(194, 170, 223, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  letter-spacing: 0.1em;
}

.btn-ghost:hover {
  color: var(--text);
}

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

/* ─── Question Flow ──────────────────────────────────── */
.question-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 4rem;
}

.question-progress {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  margin-bottom: 3rem;
}

.question-wrap {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.question-text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  font-optical-sizing: auto;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.question-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.question-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-optical-sizing: auto;
  font-weight: 300;
  line-height: 1.7;
  padding: 1rem 0.5rem;
  text-align: center;
  resize: none;
  outline: none;
  transition: border-color 0.3s ease;
  min-height: 80px;
}

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

.question-input:focus {
  border-bottom-color: var(--accent-dim);
}

.question-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 680px;
  margin-top: 2.5rem;
}

/* ─── Loading / Bloom Growing ────────────────────────── */
.loading-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  text-align: center;
  padding: 2rem;
}

.bloom-grow-anim {
  position: relative;
  width: 120px;
  height: 120px;
}

.bloom-grow-anim .ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ring-pulse 2.4s ease-in-out infinite;
}

.bloom-grow-anim .ring:nth-child(1) {
  inset: 30px;
  opacity: 0.8;
  animation-delay: 0s;
}
.bloom-grow-anim .ring:nth-child(2) {
  inset: 15px;
  opacity: 0.4;
  animation-delay: 0.4s;
}
.bloom-grow-anim .ring:nth-child(3) {
  inset: 0;
  opacity: 0.2;
  animation-delay: 0.8s;
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(0.95); opacity: 0.05; }
  50% { transform: scale(1.05); opacity: 0.6; }
}

.loading-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  font-optical-sizing: auto;
  color: var(--text-muted);
}

/* ─── Bloom Result Page ──────────────────────────────── */
.bloom-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7rem 2rem 5rem;
}

.bloom-container {
  width: 100%;
  max-width: 660px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Image */
.bloom-image-wrap {
  position: relative;
  width: 340px;
  height: 340px;
  margin-bottom: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .bloom-image-wrap { width: 260px; height: 260px; }
}

.bloom-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
}

.bloom-image-placeholder .ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ring-pulse 2.4s ease-in-out infinite;
}

.bloom-image-placeholder .ring:nth-child(1) { inset: 50px; animation-delay: 0s; }
.bloom-image-placeholder .ring:nth-child(2) { inset: 30px; opacity: 0.4; animation-delay: 0.4s; }
.bloom-image-placeholder .ring:nth-child(3) { inset: 10px; opacity: 0.15; animation-delay: 0.8s; }

.bloom-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.bloom-image.loaded {
  opacity: 1;
}

/* Flower id */
.bloom-for-you {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.4rem;
}

.bloom-flower-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-optical-sizing: auto;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--text);
  text-align: center;
  margin-bottom: 1.25rem;
}

.bloom-flower-meaning {
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 480px;
  line-height: 1.75;
  margin-bottom: 3rem;
}

/* Divider */
.bloom-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
  margin: 0 auto 3rem;
}

/* Letter */
.bloom-letter {
  width: 100%;
  max-width: 560px;
  text-align: left;
}

.bloom-letter-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-optical-sizing: auto;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.bloom-letter-body p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.bloom-letter-body p:last-child {
  margin-bottom: 0;
}

/* CTAs */
.bloom-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 3.5rem;
  width: 100%;
}

.bloom-actions-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.bloom-garden-link {
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  transition: color 0.25s;
}

.bloom-garden-link:hover {
  color: var(--text-muted);
}

/* ─── Garden Page ────────────────────────────────────── */
.garden-page {
  min-height: 100dvh;
  padding: 8rem 2rem 5rem;
}

.garden-header {
  text-align: center;
  margin-bottom: 4rem;
}

.garden-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-optical-sizing: auto;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.garden-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.garden-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.garden-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.75rem;
  cursor: pointer;
  transition: border-color 0.3s ease, transform 0.3s var(--ease-out);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.garden-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.garden-card-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.75rem;
  object-fit: cover;
  background: var(--bg-3);
}

.garden-card-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.75rem;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.garden-card-flower {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  font-optical-sizing: auto;
  color: var(--text);
}

.garden-card-title {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.garden-card-date {
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

/* Empty state */
.garden-empty {
  text-align: center;
  padding: 5rem 2rem;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.garden-empty-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  font-optical-sizing: auto;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ─── Fade-in animation ──────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.7s var(--ease-out) forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.25s; }
.fade-in:nth-child(3) { animation-delay: 0.4s; }
.fade-in:nth-child(4) { animation-delay: 0.55s; }
.fade-in:nth-child(5) { animation-delay: 0.7s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.bloom-in {
  opacity: 0;
  transform: scale(0.96);
  animation: bloomReveal 1.2s var(--ease-bloom) forwards;
}

@keyframes bloomReveal {
  to { opacity: 1; transform: scale(1); }
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
  .question-nav {
    flex-direction: column-reverse;
    gap: 0.75rem;
    align-items: center;
  }

  .bloom-actions-row {
    flex-direction: column;
    align-items: center;
  }

  .garden-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 400px) {
  .garden-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Focus visible accessibility ────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
