@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #09070c;
  --bg-soft: #120d18;
  --panel: rgba(255, 255, 255, 0.065);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --text: #f8f2ea;
  --muted: #cbbfce;
  --soft: #9e91a8;
  --gold: #d8b46a;
  --gold-bright: #f0c66e;
  --rose: #e7a6b8;
  --plum: #6f3f78;
  --line: rgba(255, 255, 255, 0.14);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max: 1180px;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/* Fonts + tokens: use samples.bundle.css in HTML, or run npm run build:css */
*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body.sample-body {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-ui);
  background: var(--bg);
}

.sample-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  height: 100svh;
  max-height: 100dvh;
  overflow: hidden;
}

.sample-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 7, 12, 0.92);
  backdrop-filter: blur(14px);
  z-index: 40;
}

.sample-bar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.sample-bar a:hover { color: var(--gold); }

.sample-bar .badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 800;
}

.sample-stage-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.sample-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.sample-scene {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  padding: clamp(20px, 4vw, 40px);
  background-image: var(--scene-image, none);
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.sample-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(9, 7, 12, 0.15) 0%, rgba(9, 7, 12, 0.88) 100%),
    linear-gradient(90deg, rgba(9, 7, 12, 0.55), transparent 55%);
}

.sample-scene.is-changing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(9, 7, 12, 0.35);
  animation: scenePulse 0.5s ease;
  pointer-events: none;
}

@keyframes scenePulse {
  from { opacity: 1; }
  to { opacity: 0; }
}

.mode-luxury .sample-scene.turning {
  animation: pageTurn 0.7s ease;
}

@keyframes pageTurn {
  0% { opacity: 1; transform: perspective(900px) rotateY(0deg); }
  45% { opacity: 0.35; transform: perspective(900px) rotateY(-10deg); }
  100% { opacity: 1; transform: perspective(900px) rotateY(0deg); }
}

.mode-signature .sample-scene,
.mode-tribute .sample-scene {
  transition: opacity 0.55s ease;
}

.mode-tribute .sample-scene {
  transition-duration: 1.1s;
}

.sample-scene-content {
  position: relative;
  z-index: 1;
  max-width: min(640px, 100%);
}

.sample-kicker {
  color: var(--rose);
  font-size: clamp(0.72rem, 2vw, 0.82rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.sample-title {
  margin: 8px 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.sample-message {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  line-height: 1.7;
  max-width: 52ch;
}

.sample-message .line {
  display: block;
  opacity: 0;
  transform: translateY(10px);
}

.sample-message .line.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.mode-tribute .sample-message .line.visible {
  transition-duration: 1.2s;
}

.sample-panel {
  flex: 0 0 auto;
  max-height: min(42dvh, 380px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(12px, 2.5vw, 20px);
  background: rgba(12, 8, 16, 0.94);
  border-top: 1px solid var(--line);
}

.sample-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sample-scene-count {
  font-size: 0.86rem;
  color: var(--soft);
  font-weight: 600;
}

.sample-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sample-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sample-btn:hover { border-color: rgba(216, 180, 106, 0.45); }
.sample-btn.primary {
  color: #17100a;
  background: linear-gradient(135deg, #f7dd99, var(--gold));
  border-color: transparent;
}

.sample-btn.icon {
  width: 42px;
  padding: 0;
  justify-content: center;
}

.sample-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.memory-tile {
  position: relative;
  min-height: clamp(72px, 12vh, 110px);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: translateY(8px);
}

.memory-tile.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.mode-tribute .memory-tile.visible {
  transition-duration: 1.1s;
}

.memory-tile span {
  position: absolute;
  inset: auto 10px 10px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.memory-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(9, 7, 12, 0.82));
}

.audio-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  margin-top: 10px;
}

.audio-block strong { display: block; font-size: 0.92rem; }
.audio-block span { color: var(--soft); font-size: 0.82rem; }

.wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  margin-top: 8px;
}

.wave i {
  width: 4px;
  border-radius: 4px;
  background: var(--gold);
  height: 8px;
  animation: waveBar 1.1s ease-in-out infinite;
}

.wave.playing i { animation-play-state: running; }
.wave:not(.playing) i { animation-play-state: paused; opacity: 0.35; }

.wave i:nth-child(2) { animation-delay: 0.12s; }
.wave i:nth-child(3) { animation-delay: 0.24s; }
.wave i:nth-child(4) { animation-delay: 0.36s; }
.wave i:nth-child(5) { animation-delay: 0.48s; }

@keyframes waveBar {
  0%, 100% { height: 8px; }
  50% { height: 24px; }
}

.timeline {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.timeline-step {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.4s ease, background 0.4s ease;
}

.timeline-step:hover,
.timeline-step.active {
  border-color: rgba(216, 180, 106, 0.4);
  background: rgba(216, 180, 106, 0.08);
}

.timeline-step strong {
  color: var(--gold);
  font-size: 0.88rem;
}

.timeline-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.family-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.family-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateY(6px);
}

.family-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 1s ease, transform 1s ease;
}

.family-card em {
  display: block;
  color: var(--rose);
  font-size: 0.78rem;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.family-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.dedication {
  margin-top: 12px;
  padding: 14px 16px;
  border-left: 3px solid var(--gold);
  background: rgba(216, 180, 106, 0.08);
  border-radius: 0 12px 12px 0;
}

.dedication p {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 1.15rem;
}

/* Essential static layout */
.essential-app {
  height: 100dvh;
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.essential-scene {
  min-height: 0;
  display: flex;
  align-items: flex-end;
  padding: clamp(24px, 5vw, 48px);
  background-image: var(--scene-image);
  background-size: cover;
  background-position: center;
  position: relative;
}

.essential-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 7, 12, 0.2), rgba(9, 7, 12, 0.9));
}

.essential-content {
  position: relative;
  z-index: 1;
  max-width: min(680px, 100%);
  animation: essentialIn 1.4s ease both;
}

@keyframes essentialIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.essential-closing {
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--gold);
}

.mood-glow.sample-scene::before {
  background:
    linear-gradient(180deg, rgba(9, 7, 12, 0.12), rgba(9, 7, 12, 0.88)),
    radial-gradient(circle at 70% 20%, rgba(216, 180, 106, 0.18), transparent 45%);
}

/* Keepsake overlay (tribute) */
.keepsake-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 7, 12, 0.88);
  opacity: 1;
  transition: opacity 1.2s ease;
  pointer-events: auto;
}

.keepsake-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.keepsake-overlay p {
  max-width: 360px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--text);
  line-height: 1.3;
}

.demo-label {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 30;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--soft);
  border: 1px solid var(--line);
  background: rgba(9, 7, 12, 0.75);
  pointer-events: none;
}

@media (max-width: 720px) {
  .memory-grid { grid-template-columns: 1fr 1fr; }
  .timeline-step { grid-template-columns: 1fr; }
  .sample-panel { max-height: min(48dvh, 420px); }
}

@media (max-width: 480px) {
  .memory-grid { grid-template-columns: 1fr; }
  .sample-bar .hide-mobile { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sample-message .line,
  .memory-tile,
  .family-card,
  .essential-content,
  .mode-luxury .sample-scene.turning {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
