/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500;1,600&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Special+Elite&family=Spectral:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap');

@font-face {
  font-family: "California Sun";
  src: url('/fonts/California sun.woff2') format('woff2'),
       url('/fonts/California sun.woff') format('woff'),
       url('/fonts/California sun.otf') format('opentype'),
       url('/fonts/California sun.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "California Sun";
  src: url('/fonts/California sun Italic.woff2') format('woff2'),
       url('/fonts/California sun Italic.woff') format('woff'),
       url('/fonts/California sun Italic.otf') format('opentype'),
       url('/fonts/California sun Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: block;
}


/* === RESET === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Only hide native cursor on devices with a mouse/trackpad */
@media (pointer: fine) {
  html, html * {
    cursor: none !important;
  }
}

/* === DESIGN TOKENS === */
:root {
  /* Page backgrounds */
  --rose-bg:     #9a616c;    /* landing: dusty rose */
  --emerald-bg:  #1e3622;    /* reading: deep forest green */
  /* Content surface */
  --cream:       #f5eedc;
  --cream-muted: rgba(245, 238, 220, 0.92);
  /* Text on dark backgrounds */
  --text-on-dark:       rgba(245, 238, 220, 0.92);
  --text-on-dark-muted: rgba(245, 238, 220, 0.52);
  /* Palette */
  --bg:          #f5eedc;
  --ink:         #2a1810;
  --ink-muted:   #8a7a70;
  --gold:        #c9a84c;
  --gold-subtle: rgba(201, 168, 76, 0.22);
  --oxblood:     #7a1c1c;
  /* Lace frame decoration */
  --lace-gold:   rgba(195, 165, 100, 0.5);

  /* Card sizing */
  --card-w: 100px;
  --card-h: 150px;
  --card-w-sm: 60px;
  --card-h-sm: 90px;
  --spread-gap: 16px;
  --shuffle-min-h: 360px;
  --shuffle-max-h: 600px;
  --shuffle-stage-h: 250px;
  --hand-offset: 26%;
}

html {
  font-family: "Spectral", Georgia, serif;
  /* Default: deep dusty rose (landing page) */
  background-color: var(--rose-bg);
  color: var(--ink);
  scrollbar-width: none; /* Hide scrollbar globally */
}

/* Dark brown background with CRT scanline texture for secondary pages */
html:has(.history-page),
html:has(.artifacts-page),
html:has(.download-page),
.history-page,
.artifacts-page,
.download-page {
  background-color: #1d1716;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  background-size: 100% 4px;
  color: rgba(245, 238, 220, 0.92);
}

/* Text color overrides for dark dotted background */
.history-page .history-title,
.history-page .history-row-question,
.history-page .history-row-question.no-entry,
.artifacts-page .artifacts-title,
.artifacts-page .artifacts-group-heading,
.artifacts-page .artifacts-section-heading,
.artifacts-page .artifacts-card-name,
.artifacts-page .artifacts-meaning,
.download-page .download-title,
.download-page .download-steps-header,
.download-page .download-step h3,
.download-page .download-step p {
  color: rgba(245, 238, 220, 0.92);
}

.history-page .history-row-date,
.history-page .history-select-all-label,
.history-page .history-toolbar-cancel,
.history-page #history:empty::after,
.artifacts-page .artifacts-keywords,
.artifacts-page .artifacts-keyword-label,
.artifacts-page .artifacts-meaning strong,
.download-page .download-step h3::before {
  color: rgba(245, 238, 220, 0.55);
}

.history-page .history-row-heart,
.history-page .history-row-x {
  color: rgba(245, 238, 220, 0.4);
}

.history-page .history-toolbar,
.history-page .history-row,
.artifacts-page .artifacts-row,
.artifacts-page .artifacts-group-heading,
.artifacts-page .artifacts-section-heading {
  border-color: rgba(245, 238, 220, 0.1);
}

.history-page #history,
.history-page .history-detail,
.artifacts-page #artifacts-content,
.download-page .download-steps {
  background: rgba(255, 255, 255, 0.04);
}

.download-page .download-step code {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(245, 238, 220, 0.8);
}

.history-page .history-toolbar-cancel {
  border-color: rgba(245, 238, 220, 0.2);
}

.history-page .history-toolbar-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 238, 220, 0.92);
}

.history-page .history-row:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.history-page .history-row.selected {
  background-color: rgba(255, 255, 255, 0.07);
}

/* --- History detail view on dark background --- */
.history-page .detail-back {
  color: rgba(245, 238, 220, 0.55);
}

.history-page .detail-spread,
.history-page .detail-card-name,
.history-page .detail-reading,
.history-page .detail-summary-heading,
.history-page .detail-summary-text,
.history-page .detail-reading-plain {
  color: rgba(245, 238, 220, 0.92);
}

.history-page .detail-date,
.history-page .detail-card-orient {
  color: rgba(245, 238, 220, 0.5);
}

.history-page .detail-question,
.history-page .detail-notes-text {
  color: rgba(245, 238, 220, 0.65);
}

.history-page .detail-section-position,
.history-page .detail-notes-label,
.history-page .detail-divider {
  color: var(--gold);
}

.history-page .detail-divider::before,
.history-page .detail-divider::after {
  background: rgba(245, 238, 220, 0.12);
}

.history-page .detail-notes-section {
  border-color: rgba(245, 238, 220, 0.1);
}

/* Delete modal on dark background */
.history-page .history-modal {
  background: #3a2e2d;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.history-page .history-modal-message {
  color: rgba(245, 238, 220, 0.92);
}

.history-page .history-modal-cancel {
  color: rgba(245, 238, 220, 0.75);
  border-color: rgba(245, 238, 220, 0.2);
}

.history-page .history-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 238, 220, 0.92);
}

/* Reading page: flowerbed background covering entire page */
html:has(.reading-page) {
  background-image: url('/images/assets/flowerbed.png');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body.reading-page {
  background: transparent;
  position: relative;
}

/* Vignette — applied globally across all pages */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9996;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    transparent 40%,
    rgba(0, 0, 0, 0.32) 100%
  );
}

/* Reveal page: stronger atmospheric overlay — z-index:-1 puts it above flowerbed but behind all content */
body.reveal-page::after {
  z-index: -1;
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.58) 100%
  );
}

/* Paper texture overlay for reading page — sits behind all content */
body.reading-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  background-repeat: repeat;
}

/* Landing page locks scrolling; all other pages scroll freely */
body.no-scroll {
  overflow: hidden;
}

/* === CUSTOM CURSOR === */
.wand-cursor {
  position: fixed;
  width: 32px;
  height: 32px;
  background: url('/images/assets/magicwand.png') no-repeat center / contain;
  pointer-events: none;
  z-index: 9999;
  transform-origin: 28px 28px;
  transition: none;
  visibility: hidden;
  will-change: transform, left, top;
}

.wand-cursor.twitch {
  animation: wandTwitch 0.12s ease;
}

@keyframes wandTwitch {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(8deg); }
  50% { transform: rotate(-5deg); }
  75% { transform: rotate(2deg); }
  100% { transform: rotate(0deg); }
}

.wand-sparkle {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: sparkleOut 0.4s ease-out forwards;
}

@keyframes sparkleOut {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0);
  }
}

.wand-trail {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  animation: trailSparkle var(--duration) ease-out forwards;
}

.wand-trail::before {
  content: var(--char);
  font-size: var(--size);
  line-height: 1;
  display: block;
}

@keyframes trailSparkle {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.8;
    transform: translate(calc(var(--drift) * 0.5), calc(var(--fall) * 0.4)) scale(1.2) rotate(var(--spin));
  }
  100% {
    opacity: 0;
    transform: translate(var(--drift), var(--fall)) scale(0) rotate(calc(var(--spin) * 2));
  }
}

/* === NAVBAR === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(1.5rem, calc(50vw - 520px));
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  transition: transform 0.3s ease;
}

.navbar.nav-hidden {
  transform: translateY(-100%);
}

.nav-trigger {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  z-index: 99;
  pointer-events: all;
  cursor: default;
}

/* Brand / home side */
.nav-brand {
  font-family: "California Sun", Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.08em;
  color: rgba(42, 8, 18, 0.88);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  user-select: none;
}

/* Link group */
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3.5vw, 2.5rem);
}

.nav-link {
  font-family: "Spectral", Georgia, serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(42, 8, 18, 0.88);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: rgba(42, 8, 18, 1);
}

/* Light navbar on reading page — contrast against dark flowerbed background */
.reading-page .nav-brand {
  color: rgba(245, 238, 220, 0.95);
}

.reading-page .nav-link {
  color: rgba(245, 238, 220, 0.9);
}

.reading-page .nav-link:hover {
  color: rgba(245, 238, 220, 1);
}

/* Light navbar on secondary dark pages */
.history-page .nav-brand,
.artifacts-page .nav-brand,
.download-page .nav-brand {
  color: rgba(245, 238, 220, 0.95);
}

.history-page .nav-link,
.artifacts-page .nav-link,
.download-page .nav-link {
  color: rgba(245, 238, 220, 0.9);
}

.history-page .nav-link:hover,
.artifacts-page .nav-link:hover,
.download-page .nav-link:hover {
  color: rgba(245, 238, 220, 1);
}

/* Reading results text — dark for legibility against doily background */
.reading-page .reading-title {
  color: var(--ink);
}

.reading-page .rcs-position {
  color: #1a0e08;
}

.reading-page .rcs-name {
  color: #1a0e08;
}

.reading-page .rcs-text {
  color: var(--ink);
}

.reading-page .rcs-orient {
  color: #1a0e08;
}

.reading-page .reading-card-section {
  border-bottom-color: var(--gold-subtle);
}

/* Right column text on parchment background — deep burgundy */
.reading-page .reading-summary-heading {
  color: var(--rose-bg);
}

.reading-page .reading-summary-text {
  color: #4a2030;
}

.reading-page .reading-notes-label,
.reading-page .reading-notes,
.reading-page .notes-hint,
.reading-page .notes-hint a {
  color: rgba(255, 255, 255, 0.88);
}

.reading-page .reading-notes::placeholder {
  color: rgba(245, 245, 220, 0.7);
}

.reading-page .reading-begin-again {
  color: var(--rose-bg);
}

.reading-page .reading-begin-again:hover {
  color: rgba(245, 238, 220, 1);
}

/* === LAYOUT === */
html::-webkit-scrollbar {
  display: none;
}

body {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
  font-family: "Spectral", Georgia, serif;
}

/* === VELVET BACKGROUND OVERLAY === */
/* Sits above the html bg color but below the landing section (z-index 10).
   Theater images are opaque so they naturally cover this layer. */
html::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  /* Quilted diamond fabric with dot in lower corner — matches velvet reference texture */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M10,0 L20,10 L10,20 L0,10 Z' fill='rgba(255,255,255,0.025)' stroke='rgba(0,0,0,0.25)' stroke-width='1'/%3E%3Ccircle cx='10' cy='14' r='1.2' fill='rgba(0,0,0,0.3)'/%3E%3C/svg%3E");
  background-size: 11.4px 11.4px;
  background-repeat: repeat;
}

/* Hide the quilted diamond overlay on reading + secondary pages */
html:has(.reading-page)::after,
html:has(.history-page)::after,
html:has(.artifacts-page)::after,
html:has(.download-page)::after {
  display: none;
}

/* Hide on landing page too — .landing::before handles it within the correct stacking context */
html:has(.landing)::after {
  display: none;
}

/* === CLOUD LAYER === */
.cloud-layer {
  position: fixed;
  top: 3rem;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9;
  overflow: hidden;
  transition: opacity 1.2s ease;
}

/* === LANDING SECTION === */
.landing {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 3.5rem max(1rem, calc(50vw - 500px)) 0;
}

/* === FOREGROUND RAIN CANVAS === */
#rain-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}
#rain-canvas.active {
  opacity: 1;
  filter: blur(6px);
  will-change: opacity;
}


/* Fabric texture overlay within landing — above the wet gradient, behind theater images */
.landing::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M10,0 L20,10 L10,20 L0,10 Z' fill='rgba(255,255,255,0.025)' stroke='rgba(0,0,0,0.25)' stroke-width='1'/%3E%3Ccircle cx='10' cy='14' r='1.2' fill='rgba(0,0,0,0.3)'/%3E%3C/svg%3E");
  background-size: 11.4px 11.4px;
  background-repeat: repeat;
}

/* Rising saturation wash — rain soaks the fabric from bottom up
   Darkest burgundy at the very bottom, gradually lightening as it wicks upward */
.landing::after {
  content: '';
  position: absolute;
  /* Extend past viewport bottom so ink-bleed displacement can't leave a dry edge */
  bottom: -60px;
  left: -10%;
  right: -10%;
  height: calc(72% + 60px);
  background:
    /* Deep saturated burgundy at the very bottom — the most soaked area */
    linear-gradient(to top,
      rgba(42, 12, 22, 0.98) 0%,
      rgba(50, 16, 28, 0.95) 8%,
      rgba(58, 20, 32, 0.88) 16%,
      rgba(68, 28, 40, 0.75) 26%,
      rgba(75, 32, 46, 0.55) 38%,
      rgba(80, 36, 50, 0.3) 52%,
      rgba(85, 40, 54, 0.12) 66%,
      transparent 80%
    ),
    /* Center arch — concave lighter area mimics uneven wicking */
    radial-gradient(ellipse 70% 55% at 50% 108%,
      rgba(48, 14, 25, 0.92) 0%,
      rgba(60, 22, 34, 0.65) 40%,
      rgba(72, 30, 44, 0.25) 65%,
      transparent 82%
    ),
    /* Left corner — heavier saturation, water pools at edges */
    radial-gradient(ellipse 50% 75% at -5% 105%,
      rgba(38, 10, 20, 0.98) 0%,
      rgba(50, 18, 28, 0.75) 35%,
      rgba(62, 22, 35, 0.35) 60%,
      transparent 78%
    ),
    /* Right corner — same heavy pooling */
    radial-gradient(ellipse 50% 75% at 105% 105%,
      rgba(38, 10, 20, 0.98) 0%,
      rgba(50, 18, 28, 0.75) 35%,
      rgba(62, 22, 35, 0.35) 60%,
      transparent 78%
    ),
    /* Undulations along the wicking edge — tall fingers of water reaching higher in some spots */
    radial-gradient(ellipse 18% 48% at 15% 62%, rgba(55, 20, 32, 0.5) 0%, rgba(55, 20, 32, 0.2) 45%, transparent 72%),
    radial-gradient(ellipse 14% 32% at 32% 72%, rgba(60, 24, 36, 0.42) 0%, rgba(60, 24, 36, 0.16) 48%, transparent 70%),
    radial-gradient(ellipse 22% 55% at 50% 58%, rgba(52, 18, 30, 0.48) 0%, rgba(52, 18, 30, 0.18) 42%, transparent 68%),
    radial-gradient(ellipse 12% 28% at 65% 74%, rgba(60, 24, 36, 0.38) 0%, rgba(60, 24, 36, 0.14) 50%, transparent 70%),
    radial-gradient(ellipse 20% 44% at 80% 64%, rgba(56, 22, 34, 0.46) 0%, rgba(56, 22, 34, 0.17) 44%, transparent 68%),
    radial-gradient(ellipse 18% 50% at 92% 52%, rgba(48, 14, 26, 0.5) 0%, rgba(55, 20, 32, 0.28) 38%, rgba(60, 24, 36, 0.1) 62%, transparent 78%),
    radial-gradient(ellipse 16% 40% at 5% 66%, rgba(50, 16, 28, 0.44) 0%, rgba(50, 16, 28, 0.16) 46%, transparent 70%);
  filter: url(#ink-bleed);
  mix-blend-mode: multiply;
  /* Behind all landing content (theater, doors, curtain, etc.) */
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

@keyframes saturationRise {
  /* Water rises to ~30% of the screen, then pools there before climbing */
  0%   { opacity: 0;    height: 60px; }
  8%   { opacity: 0.9;  height: calc(30% + 60px); }
  /* Pause — water collects at 30% for ~1.4s */
  18%  { opacity: 0.9;  height: calc(30% + 60px); }
  /* Now it wicks upward — fast at first, decelerating like capillary action */
  28%  { opacity: 0.95; height: calc(40% + 60px); }
  42%  { opacity: 0.97; height: calc(50% + 60px); }
  58%  { opacity: 1;    height: calc(58% + 60px); }
  76%  { opacity: 1;    height: calc(65% + 60px); }
  100% { opacity: 1;    height: calc(72% + 60px); }
}

.landing.wet-ground::after {
  animation: saturationRise 14s ease-out forwards;
}

.app-header {
  position: absolute;
  top: 3.5rem;
  left: 0;
  right: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  padding-top: 4vh;
  padding-bottom: 1rem;
  background: transparent;
  pointer-events: none;
}

/* === INTRO OPENING SEQUENCE === */
.cloud-layer.intro-hidden,
.landing-image-wrapper.intro-hidden {
  opacity: 0;
}

@keyframes charFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.header-brand h1 .char {
  opacity: 0;
  animation: charFadeIn 0.3s ease-out forwards;
  animation-delay: calc(var(--i) * 55ms);
}

.landing-image-wrapper {
  position: relative;
  width: clamp(280px, 80vw, 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  will-change: transform;
  transform-origin: center center;
  margin: auto auto 3vh;
  overflow: visible;
  transition: opacity 1s ease;
}

.landing-gif {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(111px, 38.8%, 416px);
  height: 60%;
  object-fit: cover;
  object-position: center;
  background-color: transparent;
  z-index: 0;
}

.powder-room {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-40%);
  width: clamp(150px, 48%, 480px);
  height: 75%;
  display: flex;
  align-items: stretch;
  z-index: 0;
  pointer-events: none;
}

.powder-mask {
  overflow: hidden;
  flex-shrink: 0;
}

.powder-left,
.powder-right {
  pointer-events: auto;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  opacity: 1;
}

.powder-mask-left {
  width: 39%;
}

.powder-mask-right {
  width: 61%;
  margin-left: -10%;
}

.curtain-mask {
  position: absolute;
  bottom: 7%;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(120.75px, 39%, 389.85px);
  height: 54.9%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
  animation: curtainBounce 1.3s infinite;
}

@keyframes curtainBounce {
  0%, 100% { transform: translateX(-50%); }
  15% { transform: translateX(-50%) translateY(clamp(-3px, -0.8vw, -6px)); }
  30% { transform: translateX(-50%); }
  35% { transform: translateX(-50%) translateY(clamp(-1px, -0.3vw, -2px)); }
  45% { transform: translateX(-50%); }
}

.landing-curtain {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: auto;
  opacity: 1;
}

.theater-container {
  position: relative;
  z-index: 2;
  max-width: 100%;
  max-height: clamp(33vh, 55vw, 66vh);
  aspect-ratio: 1.25 / 1;
  margin: 0 auto;
  pointer-events: none;
}

.landing-image {
  width: 100%;
  height: 100%;
  display: block;
  background-color: transparent;
  transform-origin: center center;
  pointer-events: none;
  /* Warm-tinted drop shadow */
  filter: drop-shadow(0 5px 16px rgba(50, 8, 25, 0.45)) drop-shadow(0 2px 6px rgba(50, 8, 25, 0.28));
}


.landing-pin {
  position: absolute;
  bottom: 5%;
  right: 85px;
  z-index: 3;
  pointer-events: auto;
}

.landing-pin img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* === LANDING CLOUDS === */
.landing-cloud {
  position: absolute;
  background-color: transparent;
  pointer-events: none;
  animation: cloudDrift 10s linear infinite alternate;
  display: block;
}

.landing-cloud img {
  width: 100%;
  display: block;
  /* Warm-tinted shadow follows cloud shape via drop-shadow filter */
  filter: drop-shadow(0 6px 18px rgba(50, 8, 25, 0.45)) drop-shadow(0 2px 6px rgba(50, 8, 25, 0.28));
}

/* Cloud lightning flash — ghost/glitch with chromatic split */
@keyframes cloudFlash {
  0% {
    transform: scale(1) translate(0, 0);
    filter: drop-shadow(0 6px 18px rgba(50, 8, 25, 0.45)) drop-shadow(0 2px 6px rgba(50, 8, 25, 0.28));
    opacity: 1;
  }
  8% {
    transform: scale(1.06) translate(4px, -2px);
    filter:
      drop-shadow(-6px 0 0 rgba(100, 180, 255, 0.55))
      drop-shadow(6px 0 0 rgba(255, 80, 60, 0.5))
      brightness(1.25) blur(1.5px);
    opacity: 0.88;
  }
  18% {
    transform: scale(1.04) translate(-3px, 2px);
    filter:
      drop-shadow(5px 2px 0 rgba(100, 180, 255, 0.6))
      drop-shadow(-5px -1px 0 rgba(255, 80, 60, 0.55))
      brightness(1.18) blur(0.5px);
    opacity: 0.82;
  }
  30% {
    transform: scale(1.02) translate(2px, -1px);
    filter:
      drop-shadow(-3px 1px 0 rgba(100, 180, 255, 0.4))
      drop-shadow(3px -2px 0 rgba(255, 80, 60, 0.35))
      brightness(1.1);
    opacity: 1;
  }
  45% {
    transform: scale(1.05) translate(-2px, 1px);
    filter:
      drop-shadow(7px 0 0 rgba(100, 180, 255, 0.5))
      drop-shadow(-4px 1px 0 rgba(255, 80, 60, 0.45))
      brightness(1.15) blur(1px);
    opacity: 0.85;
  }
  60% {
    transform: scale(1.01) translate(1px, 0);
    filter:
      drop-shadow(-2px 0 0 rgba(100, 180, 255, 0.2))
      drop-shadow(2px 0 0 rgba(255, 80, 60, 0.18))
      brightness(1.05);
    opacity: 0.95;
  }
  100% {
    transform: scale(1) translate(0, 0);
    filter: drop-shadow(0 6px 18px rgba(50, 8, 25, 0.45)) drop-shadow(0 2px 6px rgba(50, 8, 25, 0.28));
    opacity: 1;
  }
}

.landing-cloud.flash img {
  animation: cloudFlash 0.6s ease-out 1;
}

/* Dimmer second flash — subtler glitch afterglow */
@keyframes cloudFlashDim {
  0% {
    transform: scale(1) translate(0, 0);
    filter: drop-shadow(0 6px 18px rgba(50, 8, 25, 0.45)) drop-shadow(0 2px 6px rgba(50, 8, 25, 0.28));
    opacity: 1;
  }
  10% {
    transform: scale(1.03) translate(-3px, 1px);
    filter:
      drop-shadow(4px 1px 0 rgba(100, 180, 255, 0.4))
      drop-shadow(-4px 0 0 rgba(255, 80, 60, 0.35))
      brightness(1.12) blur(0.8px);
    opacity: 0.9;
  }
  25% {
    transform: scale(1.02) translate(2px, -1px);
    filter:
      drop-shadow(-3px 0 0 rgba(100, 180, 255, 0.3))
      drop-shadow(3px 1px 0 rgba(255, 80, 60, 0.25))
      brightness(1.06) blur(0.3px);
    opacity: 0.88;
  }
  45% {
    transform: scale(1.01) translate(-1px, 0);
    filter:
      drop-shadow(2px 0 0 rgba(100, 180, 255, 0.15))
      drop-shadow(-2px 0 0 rgba(255, 80, 60, 0.12))
      brightness(1.02);
    opacity: 0.96;
  }
  100% {
    transform: scale(1) translate(0, 0);
    filter: drop-shadow(0 6px 18px rgba(50, 8, 25, 0.45)) drop-shadow(0 2px 6px rgba(50, 8, 25, 0.28));
    opacity: 1;
  }
}

.landing-cloud.flash-dim img {
  animation: cloudFlashDim 0.5s ease-out 1;
}

/* Header lightning flash — ghost/glitch: letters double & blur */
@keyframes headerFlash {
  0%   {
    transform: translate(0, 0);
    text-shadow: none;
    filter: blur(0);
    opacity: 1;
  }
  6%   {
    transform: translate(4px, -2px);
    text-shadow:
      -7px 0 0 rgba(100, 180, 255, 0.7),
       7px 0 0 rgba(255, 80, 60, 0.65),
       0 4px 8px rgba(0, 0, 0, 0.4);
    filter: blur(2px);
    opacity: 0.85;
  }
  14%  {
    transform: translate(-3px, 3px);
    text-shadow:
       6px 3px 0 rgba(100, 180, 255, 0.8),
      -6px -2px 0 rgba(255, 80, 60, 0.7),
       0 0 12px rgba(255, 200, 100, 0.3);
    filter: blur(0.5px);
    opacity: 0.8;
  }
  22%  {
    transform: translate(2px, -1px);
    text-shadow:
      -4px 2px 0 rgba(100, 180, 255, 0.5),
       4px -3px 0 rgba(255, 80, 60, 0.45);
    filter: blur(0);
    opacity: 1;
  }
  32%  {
    transform: translate(-2px, 1px);
    text-shadow:
       8px 0 0 rgba(100, 180, 255, 0.65),
      -5px 2px 0 rgba(255, 80, 60, 0.6),
       0 -3px 6px rgba(0, 0, 0, 0.25);
    filter: blur(1.5px);
    opacity: 0.82;
  }
  45%  {
    transform: translate(3px, 2px);
    text-shadow:
      -5px -1px 0 rgba(100, 180, 255, 0.5),
       5px 1px 0 rgba(255, 80, 60, 0.45);
    filter: blur(0.3px);
    opacity: 0.92;
  }
  60%  {
    transform: translate(-1px, 0);
    text-shadow:
       3px 0 0 rgba(100, 180, 255, 0.25),
      -3px 0 0 rgba(255, 80, 60, 0.2);
    filter: blur(0);
    opacity: 0.97;
  }
  100% {
    transform: translate(0, 0);
    text-shadow: none;
    filter: blur(0);
    opacity: 1;
  }
}

@keyframes headerFlashDim {
  0%   {
    transform: translate(0, 0);
    text-shadow: none;
    filter: blur(0);
    opacity: 1;
  }
  8%  {
    transform: translate(-3px, 1px);
    text-shadow:
       5px 1px 0 rgba(100, 180, 255, 0.55),
      -5px 0 0 rgba(255, 80, 60, 0.5);
    filter: blur(1.2px);
    opacity: 0.88;
  }
  20%  {
    transform: translate(2px, -2px);
    text-shadow:
      -4px 0 0 rgba(100, 180, 255, 0.45),
       4px 2px 0 rgba(255, 80, 60, 0.4);
    filter: blur(0.3px);
    opacity: 0.85;
  }
  40%  {
    transform: translate(-1px, 1px);
    text-shadow:
       2px 0 0 rgba(100, 180, 255, 0.2),
      -2px 0 0 rgba(255, 80, 60, 0.18);
    filter: blur(0);
    opacity: 0.95;
  }
  100% {
    transform: translate(0, 0);
    text-shadow: none;
    filter: blur(0);
    opacity: 1;
  }
}

.app-header.header-flash {
  animation: headerFlash 0.6s ease-out 1;
}

.app-header.header-flash-dim {
  animation: headerFlashDim 0.5s ease-out 1;
}

@keyframes theaterFlash {
  0%   {
    transform: translate(0, 0);
    filter: drop-shadow(0 0 0 transparent);
    opacity: 1;
  }
  6%   {
    transform: translate(3px, -2px);
    filter:
      drop-shadow(-6px 0 0 rgba(100, 180, 255, 0.5))
      drop-shadow(6px 0 0 rgba(255, 80, 60, 0.45))
      blur(1.5px);
    opacity: 0.88;
  }
  14%  {
    transform: translate(-2px, 2px);
    filter:
      drop-shadow(5px 2px 0 rgba(100, 180, 255, 0.6))
      drop-shadow(-5px -2px 0 rgba(255, 80, 60, 0.55))
      blur(0.4px);
    opacity: 0.82;
  }
  22%  {
    transform: translate(2px, -1px);
    filter:
      drop-shadow(-3px 1px 0 rgba(100, 180, 255, 0.35))
      drop-shadow(3px -2px 0 rgba(255, 80, 60, 0.3));
    opacity: 1;
  }
  32%  {
    transform: translate(-2px, 1px);
    filter:
      drop-shadow(7px 0 0 rgba(100, 180, 255, 0.5))
      drop-shadow(-4px 2px 0 rgba(255, 80, 60, 0.45))
      blur(1px);
    opacity: 0.85;
  }
  45%  {
    transform: translate(2px, 1px);
    filter:
      drop-shadow(-4px -1px 0 rgba(100, 180, 255, 0.35))
      drop-shadow(4px 1px 0 rgba(255, 80, 60, 0.3))
      blur(0.2px);
    opacity: 0.93;
  }
  60%  {
    transform: translate(-1px, 0);
    filter:
      drop-shadow(2px 0 0 rgba(100, 180, 255, 0.18))
      drop-shadow(-2px 0 0 rgba(255, 80, 60, 0.15));
    opacity: 0.97;
  }
  100% {
    transform: translate(0, 0);
    filter: drop-shadow(0 0 0 transparent);
    opacity: 1;
  }
}

@keyframes theaterFlashDim {
  0%   {
    transform: translate(0, 0);
    filter: drop-shadow(0 0 0 transparent);
    opacity: 1;
  }
  8%  {
    transform: translate(-2px, 1px);
    filter:
      drop-shadow(4px 1px 0 rgba(100, 180, 255, 0.4))
      drop-shadow(-4px 0 0 rgba(255, 80, 60, 0.35))
      blur(0.8px);
    opacity: 0.9;
  }
  20%  {
    transform: translate(1px, -1px);
    filter:
      drop-shadow(-3px 0 0 rgba(100, 180, 255, 0.3))
      drop-shadow(3px 1px 0 rgba(255, 80, 60, 0.25))
      blur(0.2px);
    opacity: 0.87;
  }
  40%  {
    transform: translate(-1px, 1px);
    filter:
      drop-shadow(1px 0 0 rgba(100, 180, 255, 0.15))
      drop-shadow(-1px 0 0 rgba(255, 80, 60, 0.12));
    opacity: 0.96;
  }
  100% {
    transform: translate(0, 0);
    filter: drop-shadow(0 0 0 transparent);
    opacity: 1;
  }
}

.landing-image.theater-flash {
  animation: theaterFlash 0.6s ease-out 1;
}

.landing-image.theater-flash-dim {
  animation: theaterFlashDim 0.5s ease-out 1;
}

/* starting from the left-most clouds */
.cloud-1 {
  width: clamp(144px, 36vw, 420px);
  top: -13%;
  left: -5%;
  opacity: 1;
  z-index: 1;
}

.cloud-3 {
  width: clamp(180px, 45vw, 522px);
  top: 13%;
  left: -3%;
  opacity: 1;
  z-index: 12;
}

.cloud-5 {
  width: clamp(198px, 48vw, 576px);
  top: 4%;
  right: 8%;
  left: auto;
  opacity: 1;
  z-index: 2;
}

.cloud-6 {
  width: clamp(144px, 36vw, 420px);
  top: 1%;
  left: 10%;
  opacity: 1;
  z-index: 0;
}

.cloud-7 {
  width: clamp(106.26px, 22.77vw, 273.24px);
  top: 15%;
  right: -2%;
  left: auto;
  opacity: 1;
  z-index: 3;
}

.cloud-8 {
  width: clamp(168px, 43vw, 504px);
  top: -12%;
  right: -10%;
  left: auto;
  opacity: 1;
  z-index: 0;
}

/* === RESPONSIVE CLOUD POSITIONS === */

/* Tablet: clouds that sit in the header zone (top ~0-30%) get pushed below it */
@media (max-width: 900px) {
  .cloud-5 {
    top: 48%;
    right: 0%;
  }
  .cloud-3 {
    top: 2%;
  }
  .cloud-7 {
    top: 60%;
    right: 10%;
  }
}

/* Mobile: header can occupy top ~40% — keep all clouds below that */
@media (max-width: 600px) {
  .cloud-1 {
    top: 42%;
    left: -18%;
  }
  .cloud-3 {
    top: 58%;
    left: -6%;
  }
  .cloud-5 {
    top: 55%;
    right: -10%;
    width: clamp(130px, 40vw, 240px);
  }
  .cloud-7 {
    top: 65%;
    right: 50%;
    width: clamp(80px, 22vw, 135px);
  }
  .cloud-8 {
    top: 40%;
    right: -14%;
    width: clamp(160px, 48vw, 290px);
  }
}

@keyframes cloudDrift {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-5vw);
  }
}

/* === CLICK PROMPT === */
.click-prompt {
  position: fixed;
  bottom: calc(2.5rem + 12vh);
  left: 50%;
  transform: translateX(-50%);
  font-family: "California Sun", Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: rgba(42, 8, 18, 0.8);
  z-index: 9992;
  pointer-events: none;
  opacity: 0;
  animation: promptPulse 3s ease-in-out 1.5s infinite;
}

.click-prompt.hidden {
  animation: none !important;
  opacity: 0 !important;
  transition: opacity 0.4s ease;
}

@keyframes promptPulse {
  0% { opacity: 0; }
  30% { opacity: 0.8; }
  70% { opacity: 0.8; }
  100% { opacity: 0; }
}

/* === SKIP INTRO === */
.skip-intro {
  position: fixed;
  bottom: calc(2.5rem + 2vh);
  right: max(2rem, calc(50vw - 520px));
  background: none;
  border: 2px solid rgba(42, 8, 18, 0.4);
  border-radius: 4px;
  padding: 0.3rem 0.8rem;
  font-family: "Spectral", Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(42, 8, 18, 0.88);
  cursor: pointer;
  z-index: 9992;
  opacity: 0;
  pointer-events: none;
  transition: color 0.2s, border-color 0.2s, opacity 0.8s ease;
}

.skip-intro.visible {
  opacity: 1;
  pointer-events: auto;
  animation: skipPulse 2.5s ease-in-out infinite;
}

@keyframes skipPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.skip-intro:hover {
  color: rgba(42, 8, 18, 1);
  border-color: rgba(42, 8, 18, 0.6);
}

.landing.wet-ground ~ .skip-intro {
  color: rgba(220, 200, 180, 0.9);
  border-color: rgba(220, 200, 180, 0.5);
  transition: color 2s ease, border-color 2s ease, opacity 0.8s ease;
}

.landing.wet-ground ~ .skip-intro:hover {
  color: rgba(240, 225, 210, 1);
  border-color: rgba(240, 225, 210, 0.7);
}

/* === LACE FRAME COMPONENT === */
/* Cream-background content card for dark page backgrounds */
.lace-frame {
  position: relative;
  background: var(--cream);
  padding: 2.5rem 2.25rem 2rem;
  /* Lifted 2mm above surface: contact shadow + spread shadow + soft halo */
  box-shadow:
    /* Tight contact shadow directly beneath */
    0 1px 2px rgba(0, 0, 0, 0.25),
    /* Mid-depth shadow for lift */
    0 6px 16px rgba(0, 0, 0, 0.35),
    /* Deep ambient shadow */
    0 24px 64px rgba(0, 0, 0, 0.5),
    /* Wide soft glow beneath */
    0 32px 80px rgba(0, 0, 0, 0.3),
    /* Inner glow — warm candlelight catching the lace edges */
    inset 0 0 20px rgba(245, 235, 200, 0.5),
    inset 0 0 40px rgba(220, 200, 150, 0.15);
}

/* Outer decorative border */
.lace-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--lace-gold);
  pointer-events: none;
  z-index: 1;
}

/* Inner ornamental border — double-frame lace effect */
.lace-frame::after {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(195, 165, 100, 0.3);
  pointer-events: none;
  z-index: 1;
}

/* === PAGE TRANSITIONS === */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: page-out 0.35s ease-in both;
}

::view-transition-new(root) {
  animation: page-in 0.35s ease-out both;
}

@keyframes page-out {
  to { opacity: 0; transform: scale(0.98); }
}

@keyframes page-in {
  from { opacity: 0; transform: scale(0.98); }
}

/* Fallback overlay for browsers without View Transitions */
.page-overlay {
  position: fixed;
  inset: 0;
  background: var(--rose-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 9999;
}

.page-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* === READING SECTION === */
/* === RESULTS PAGE — card-by-card sections === */
.reading-card-section {
  display: flex;
  align-items: flex-start;
  gap: clamp(0.4rem, 1vw, 0.8rem);
  padding: clamp(0.5rem, 1vw, 0.9rem) 0;
  border-bottom: none;
  width: 100%;
  position: relative;
}
.reading-card-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 1px;
  background: var(--gold-subtle);
}

.reading-card-section:last-of-type::after {
  display: none;
}

.rcs-img-wrap {
  flex-shrink: 0;
  width: clamp(44px, 5vw, 72px);
}

.rcs-img-wrap img {
  width: clamp(44px, 5vw, 72px);
  height: clamp(66px, 7.5vw, 108px);
  object-fit: contain;
  border-radius: 5px;
}

.rcs-img-wrap.reversed img {
  transform: rotate(180deg);
  filter: saturate(0.7);
}

.rcs-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.15rem;
}

.rcs-position {
  font-size: clamp(0.5rem, 0.8vw, 0.62rem);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-family: "Playfair Display", Georgia, serif;
}

.rcs-name {
  font-size: clamp(0.95rem, 1.8vw, 1.3rem);
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-style: italic;
  color: var(--ink);
  line-height: 1.2;
}

.rcs-orient {
  font-size: 0.72rem;
  font-style: normal;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}

.rcs-text {
  font-size: clamp(0.72rem, 1.2vw, 0.88rem);
  line-height: 1.45;
  color: var(--ink);
  margin-top: 0.2rem;
}

.reading-summary-divider {
  margin: 3rem auto 2rem;
  max-width: 760px;
  width: 100%;
  height: 1px;
  background: var(--gold-subtle);
  position: relative;
}

.reading-summary-divider span {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--cream);
  padding-right: 0.75rem;
  color: var(--gold);
  font-size: 1rem;
  line-height: 1;
}

.reading-summary-heading {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  text-align: left;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.reading-notes-wrap {
  margin-top: 0;
  width: 100%;
}

.reading-notes-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

.reading-notes {
  width: 100%;
  padding: 0.75rem 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-family: "Spectral", Georgia, serif;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  line-height: 1.8;
  color: var(--ink);
  resize: none;
  min-height: 4em;
  height: 4em;
  overflow: hidden;
  transition: border-color 0.2s;
}

.reading-notes:focus {
  outline: none;
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.reading-notes::placeholder {
  color: var(--ink-muted);
  font-style: italic;
}

.notes-save-status {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-left: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-style: normal;
}

.notes-save-status.visible {
  opacity: 1;
}

.notes-seal-btn {
  display: block;
  margin: 0.8rem 0 0;
  padding: 0.45rem 1.4rem;
  font-family: "Spectral", Georgia, serif;
  font-size: 0.78rem;
  font-style: italic;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.notes-seal-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.3);
}

.notes-seal-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.notes-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
}

.notes-actions-row .notes-seal-btn {
  margin: 0;
}

.notes-actions-row .reading-begin-again {
  margin-top: 0;
}

.notes-hint {
  margin-top: 0.6rem;
  font-size: 0.76rem;
  color: var(--ink-muted);
  font-style: italic;
  line-height: 1.5;
}

.notes-hint a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--gold-subtle);
  transition: color 0.2s;
}

.notes-hint a:hover {
  color: var(--gold);
}

/* === PINK ENVELOPE (reading letter trigger) === */
.reading-envelope {
  position: fixed;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
  z-index: 9991;
  text-align: center;
}

.reading-envelope.visible {
  opacity: 1;
  pointer-events: auto;
}

.reading-envelope svg {
  color: #f2a8be;
  width: 38px;
  height: 38px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
  filter: drop-shadow(0 2px 8px rgba(242, 168, 190, 0.35));
}

.reading-envelope:hover svg {
  transform: scale(1.12) translateY(-2px);
  color: #e8829e;
}

.reading-envelope-label {
  font-family: "Spectral", Georgia, serif;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  line-height: 1.3;
  transition: color 0.2s;
}

.reading-envelope:hover .reading-envelope-label {
  color: var(--ink);
}

/* Inline envelope — positioned inside the right-box instead of fixed */
.reading-envelope.inline-envelope {
  position: static;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  z-index: auto;
}

/* Inline loader for summary fallback */
.inline-loader {
  display: inline-flex;
  gap: 0.5rem;
  color: var(--ink-muted);
  font-style: italic;
  animation: symbolPulse 1.4s ease-in-out infinite;
  font-size: 1.2rem;
  letter-spacing: 0.2em;
}

/* === READING RESULTS LAYOUT === */
/* Starts single-column; right col expands when envelope is opened */
.reading-results-grid {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 100vh;
  min-height: 0;
  flex: 1;
}

.reading-col-left {
  flex: 0 0 57%;
  max-width: 57%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0 6% 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  position: relative;
  text-shadow: none;
  box-sizing: border-box;
  perspective: 800px;
}

/* Card reveal background — sits inside the left column container.
   scaleX(1.1) stretches width +10% while keeping the same height. */
.reading-col-left .card-reveal-bg {
  position: absolute;
  top: 50%;
  left: 47%;
  transform: translate(-50%, -50%) scaleX(1.25);
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.12s ease-out;
  width: clamp(280px, 34vw, 520px);
  height: auto;
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 10px 36px rgba(0, 0, 0, 0.6));
}

/* Scrollable card list — capped to fit inside the doily background.
   Doily height ≈ width × 1.4; inner usable area ≈ 60% of that. */
.reading-card-scroll {
  flex: 0 1 auto;
  max-height: clamp(270px, 34vw, 500px);
  overflow-y: auto;
  scrollbar-width: none;
  min-height: 0;
  border: none;
  border-radius: 8px;
  padding: 0 clamp(1rem, 2vw, 2rem) clamp(1rem, 1.5vw, 1.5rem);
  position: relative;
  z-index: 1;
  width: clamp(230px, 30vw, 440px);
  background: rgba(245, 238, 220, 0.12);
}
.reading-card-scroll::-webkit-scrollbar {
  display: none;
}


.reading-col-right {
  position: relative;
  flex: 0 0 43%;
  max-width: 43%;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow: visible;
  margin-left: 0;
  margin-top: 0;
}

.right-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(150, 130, 100, 0.2);
  border-radius: 8px;
  padding: 1rem 1.2rem;
}

.right-box-top,
.right-box-bottom {
  min-height: 0;
}

.right-box-top {
  position: absolute;
  top: 50%;
  left: 0.5rem;
  right: 5rem;
  transform: translateY(-70%);
  height: clamp(280px, 52vh, 520px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  background: none;
  border: none;
  padding: 0;
  perspective: 800px;
}

/* Envelope image sequence — stacked via position so they cross-fade.
   Height driven by the parent flex allocation; aspect-ratio sizes the width. */
.envelope-sequence {
  position: relative;
  height: 100%;
  aspect-ratio: 1934 / 1500;
  max-width: 100%;
  cursor: pointer;
  margin-right: 1.5rem;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.12s ease-out;
}

@keyframes envelopeFloat {
  0%, 100% { translate: 0 0px; }
  50%       { translate: 0 -14px; }
}

.envelope-sequence.floating {
  animation: envelopeFloat 3s ease-in-out infinite;
}

.envelope-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.6s ease;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

.envelope-sealed { opacity: 1; }
.envelope-broken { opacity: 0; }
.envelope-open   { opacity: 0; }

.envelope-summary-wrap {
  background:
    linear-gradient(135deg, rgba(210, 190, 160, 0.12) 0%, transparent 50%),
    linear-gradient(225deg, rgba(180, 160, 130, 0.10) 0%, transparent 50%),
    linear-gradient(to bottom, #f0e6d2, #e8dcc4, #f2ead8);
  border-radius: 8px;
  box-shadow:
    inset 0 0 30px rgba(160, 140, 110, 0.15),
    0 2px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(180, 160, 130, 0.3);
  text-shadow: none;
}

.right-box-bottom {
  background: rgba(30, 30, 30, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-shadow: none;
}

.envelope-summary-wrap {
  position: absolute;
  top: 6%;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 130, 100, 0.4) #e8dcc4;
  padding: 1.2rem 1.8rem;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.right-box-bottom {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  padding: 1rem 1.5rem;
  box-sizing: border-box;
}

.pen-notes-stack {
  position: absolute;
  left: 0.5rem;
  right: 5rem;
  bottom: 10vh;
  top: calc(50% + clamp(90px, 16vh, 190px));
}

.pen-notes-stack .right-pen-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6));
  z-index: 2;
}

.pen-notes-stack .right-box-bottom {
  position: relative;
  z-index: 1;
}

.reading-summary-text {
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  line-height: 1.8;
  color: #4a2030;
  white-space: pre-line;
  text-indent: 0;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 130, 100, 0.4) transparent;
}

.reading-begin-again {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: "Spectral", Georgia, serif;
  font-size: 0.82rem;
  font-style: italic;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s;
}

.reading-begin-again:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Hide card descriptions when viewport shrinks — keep image + title only */
@media (max-width: 1100px) {
  .rcs-text {
    display: none;
  }
}

@media (max-width: 820px) {
  .reading-results-grid {
    flex-direction: column;
  }
  .reading-results-grid.letter-open .reading-col-right {
    max-width: 100%;
    padding-right: 0;
  }
}

.reading-title {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  font-size: clamp(1.1rem, 2.8vw, 2.4rem);
  color: var(--ink);
  text-align: center;
  font-weight: 300;
  font-style: italic;
  margin-top: 0;
  margin-bottom: 0.15rem;
  padding-left: 0;
  flex-shrink: 0;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.reading-section {
  position: relative;
  z-index: 2;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: visible;
  /* Gradual fade-in for the reading form */
  animation: formFadeIn 1.6s ease-out both;
}

@keyframes formFadeIn {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-content {
  display: flex;
  align-items: center;
  padding: 0.5rem 2rem;
  width: 100%;
}

.header-brand {
  flex: 1;
  font-family: "California Sun", Georgia, serif;
  text-align: center;
  font-size: clamp(52.18px, 7.51vw, 85.58px);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.1em;
  color: rgb(38, 10, 10);
}

/* === READING FORM WRAPPER — image sits behind the form === */
.readingform-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 800px;
}

.piercing-img {
  position: fixed;
  pointer-events: none;
  z-index: 3;
  max-height: 70%;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.piercing-right {
  top: 78%;
  left: 86%;
  transform: translate(-50%, -50%) scale(0.625) rotate(-38deg);
}

.readingform-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.35));
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.12s ease-out;
}

.readingform-button {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  z-index: 4;
  pointer-events: none;
  transform-style: preserve-3d;
}

/* Front face */
.readingform-button-img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
  transform: translateZ(2px);
  backface-visibility: hidden;
}

/* Back face — same image, flipped so it shows when parent rotates past 90deg */
.readingform-button-back {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform: translateZ(-2px) rotateX(180deg);
  backface-visibility: hidden;
}

/* Edge ring — thin dark strip visible from the side during spins */
.readingform-button::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 3px solid #3a0e0e;
  border-radius: 50%;
  transform: translateZ(0px);
}

/* === READING FORM === */
.reading-form-frame {
  position: relative;
  z-index: 3;
  width: clamp(240px, 62vw, 416px);
  background: #eee8d8;
  padding: 2.5rem 2.25rem 2rem;
  box-shadow: 0 4px 16px rgba(45, 44, 44, 0.35);
  transform: translateX(1%);
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.12s ease-out;
}

#reading-form {
  width: 100%;
}

.form-input-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(201, 168, 76, 0.45);
  margin-bottom: clamp(1rem, 2.5vh, 1.5rem);
  gap: 0.5rem;
}

#question {
  flex: 1;
  border: none;
  background: transparent;
  font-family: "Cormorant Garamond", "Spectral", Georgia, serif;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-style: italic;
  color: var(--ink);
  outline: none;
  padding: clamp(0.5rem, 1.5vh, 0.85rem) 0;
}

#question::placeholder {
  font-family: "Special Elite", cursive;
  color: var(--ink-muted);
  font-size: clamp(0.72rem, 1.5vw, 0.9rem);
  font-style: normal;
}

/* Submit manicule */
.form-arrow-btn {
  background: none;
  border: none;
  color: rgba(30, 6, 6, 0.78);
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.25s, transform 0.25s ease;
}

.form-arrow-btn .manicule {
  width: clamp(1.6rem, 3.5vw, 2.2rem);
  height: auto;
  display: block;
}

.form-arrow-btn:hover {
  color: rgba(30, 6, 6, 1);
  transform: translateX(4px);
}

/* === SPREAD SELECTION === */
.spread-pills {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-evenly;
  padding: 0.75rem 0 1rem;
}

.spread-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 1;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.spread-pill-img {
  width: auto;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(40, 20, 10, 0.35));
}

.spread-pill-label {
  position: absolute;
  bottom: -1.3rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.78rem;
  font-style: italic;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.spread-pill:hover {
  transform: translateY(-2px);
}

.spread-pill:hover .spread-pill-label {
  opacity: 1;
}

.spread-pill.active {
  filter: brightness(1.1);
}

.spread-pill.active .spread-pill-label {
  opacity: 1;
}

/* Needle-thread stitch animation on the burgundy button */
@keyframes stitchGlow {
  0%   { box-shadow: 0 0 6px rgba(201, 168, 76, 0.2); }
  50%  { box-shadow: 0 0 18px rgba(201, 168, 76, 0.5), 0 0 30px rgba(180, 120, 60, 0.2); }
  100% { box-shadow: 0 0 6px rgba(201, 168, 76, 0.2); }
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === CARD BACK (shared by shuffle + fan) === */
.card-back {
  position: relative;
  width: var(--card-w-sm);
  height: var(--card-h-sm);
  background: url('/images/assets/backCover.jpg') center / cover no-repeat;
  border: none;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.card-back::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1px,
      rgba(0, 0, 0, 0.03) 1px,
      rgba(0, 0, 0, 0.03) 2px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 1px,
      rgba(0, 0, 0, 0.02) 1px,
      rgba(0, 0, 0, 0.02) 2px
    );
  mix-blend-mode: multiply;
  pointer-events: none;
  opacity: 0.7;
}

.shuffle-card {
  width: var(--card-w);
  height: var(--card-h);
  position: absolute;
  will-change: transform;
  transition: transform 0.18s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* === SHUFFLE ANIMATION === */
.shuffle-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  height: clamp(150px, 35vw, 250px);
  margin-top: 5%;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

/* === FAN LAYOUT === */
.fan-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  height: clamp(120px, 15vw, 180px);
  margin: 2% auto 0.8rem;
  position: relative;
  overflow: visible;
  width: 100%;
  z-index: 2;
}

.fan-card-wrapper {
  position: absolute;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  will-change: transform;
}

.fan-card-wrapper.picked .fan-card {
  transform: translateY(-25px);
  cursor: pointer;
}

.fan-card {
  width: clamp(42px, 7vw, 68px);
  height: clamp(70px, 12vw, 110px);
  cursor: pointer;
  transition: transform 0.2s ease;
  will-change: transform;
}

@media (hover: hover) {
  .fan-card:hover {
    transform: translateY(-15px);
  }
}

/* === SWEEP ANIMATION === */
.fan-card-wrapper.sweep-left {
  transition:
    transform 0.6s ease-in,
    opacity 0.6s ease-in;
  transform: translateX(-150vw) !important;
  opacity: 0;
}

.fan-card-wrapper.sweep-right {
  transition:
    transform 0.6s ease-in,
    opacity 0.6s ease-in;
  transform: translateX(150vw) !important;
  opacity: 0;
}

/* === SPREAD AREA (card flip mechanics) === */
#spread-area {
  position: relative;
  margin: 2rem auto;
  display: none;
}

#spread-area.active {
  display: block;
}

.spread-card {
  width: var(--card-w);
  height: var(--card-h);
  position: absolute;
  perspective: 800px;
  transition:
    transform 0.6s ease,
    left 0.6s ease,
    top 0.6s ease;
}

.spread-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(0.23, 1, 0.32, 1);
}

.spread-card.flipped .spread-card-inner {
  transform: rotateY(180deg);
}

.spread-card.reversed.flipped .spread-card-inner {
  transform: rotateY(180deg) rotate(180deg);
}

.spread-card-back,
.spread-card-front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.spread-card-back {
  background: url('/images/assets/backCover.jpg') center / cover no-repeat;
  border: none;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.spread-card-front {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.spread-card-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  position: absolute;
  top: 0;
  left: 0;
}

.spread-card.reversed.flipped .spread-card-front {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* === CARD LIST (exploration phase) === */
.card-list {
  max-width: 720px;
  width: 100%;
  margin: 4rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0 1rem;
  transition: opacity 0.5s ease, max-height 0.6s ease;
  max-height: calc(100vh - 10rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.card-list:hover {
  scrollbar-color: rgba(150, 130, 100, 0.4) transparent;
}

.card-list.collapsed {
  opacity: 0;
  max-height: 0 !important;
  margin: 0 auto;
  padding: 0 1rem;
}

.card-list-heading {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--ink);
  font-weight: normal;
  border-bottom: 1px solid #d5cfc5;
  padding-bottom: 0.4rem;
  margin-top: 0.5rem;
}

.card-list-heading:first-child {
  margin-top: 0;
}

.card-list-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #eae6df;
}

.card-list-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.card-list-img {
  flex-shrink: 0;
  width: 70px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.card-list-img.card-list-img-reversed {
  transform: rotate(180deg);
}

.card-list-img img {
  width: 100%;
  display: block;
}

.card-list-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.2rem;
}

.card-list-position {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  color: var(--ink);
  line-height: 1.2;
}

.card-list-name {
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  color: var(--ink);
  line-height: 1.3;
}

.card-list-orient {
  font-size: clamp(0.65rem, 1.4vw, 0.72rem);
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-list-keywords {
  font-size: clamp(0.7rem, 1.6vw, 0.8rem);
  color: #666;
  font-style: italic;
  line-height: 1.4;
  margin-top: 0.15rem;
}

/* === REVEAL BUTTON === */
.reveal-reading-btn {
  display: block;
  margin: 3rem auto 1rem;
  padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 50px;
  background: #222;
  color: #fff;
  border: none;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.reveal-reading-btn.ready {
  animation: revealPulse 2s ease-in-out infinite;
}

@keyframes revealPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 34, 34, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(34, 34, 34, 0);
  }
}

/* === READING OUTPUT === */
#reading {
  width: 100%;
  font-family: "Spectral", Georgia, serif;
  color: var(--ink);
}

.reading-stage.spread-visible {
  padding-top: 1rem;
  justify-content: center;
  transition: padding-top 0.8s ease;
}

.reading-stage.results-visible {
  max-width: 100%;
  padding: 0 2rem;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
  margin: 0;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.reading-stage.results-visible.content-ready {
  opacity: 1;
}

/* #reading must fill reading-stage so the grid can inherit height */
.reading-stage.results-visible > #reading {
  height: 100%;
  display: flex;
}

/* === LOADER === */
.reading-loader {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 0;
}

.loader-symbol {
  animation: symbolPulse 1.4s ease-in-out infinite;
}

.loader-symbol:nth-child(2) {
  animation-delay: 0.2s;
}

.loader-symbol:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes symbolPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

/* === AUTO-DRAW BUTTON === */
.auto-draw-btn {
  display: block;
  margin: 0.5rem auto 0;
  background: none;
  border: none;
  font-family: "Spectral", Georgia, serif;
  font-size: 1.08rem;
  font-style: italic;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 1);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: color 0.2s, opacity 0.6s ease;
  text-align: center;
}

.auto-draw-btn.visible {
  opacity: 1;
  pointer-events: auto;
  animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.auto-draw-btn:hover {
  color: rgba(245, 238, 220, 1);
  animation-play-state: paused;
  opacity: 1;
  transform: scale(1.08);
}

/* === READING PAGE === */
.reading-stage {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 1);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 4px 20px rgba(0, 0, 0, 0.5), 0 8px 40px rgba(0, 0, 0, 0.35);
  max-width: 860px;
  margin: 0 auto;
  /* Vertically center the initial shuffle scene in the viewport.
     max() ensures we always clear the fixed navbar (~5rem). */
  padding: max(5rem, calc(50vh - 220px)) 1rem 4rem;
  display: flex;
  flex-direction: column;
  /* No align-items: center — that conflicts with the full-bleed shuffle-scene
     breakout margin trick. Individual items center themselves as needed. */
  min-height: 100vh;
  transition: padding-top 0.8s ease;
}

.reading-status {
  position: relative;
  z-index: 3;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: rgba(255, 255, 255, 1);
  font-style: italic;
  letter-spacing: 0.12em;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 4px 24px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  margin: 0 auto 0.5rem;
  line-height: 1;
  padding: 0.8rem 1.8rem;
}

/* Centered loading overlay — used while waiting for API */
.api-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: rgba(255, 255, 255, 1);
  font-style: italic;
  letter-spacing: 0.12em;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 4px 24px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.api-loading-overlay.visible {
  opacity: 1;
}

.loading-char {
  opacity: 0;
  animation: charFadeIn 0.6s ease forwards;
}

@keyframes charFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Shift the deck stack up slightly within the shuffle scene */
.shuffle-scene > #cards {
  position: relative;
  top: -6%;
}

/* === SHUFFLE SCENE (hands + deck) === */
.shuffle-scene {
  position: relative;
  /* Break out of the max-width container to span full viewport width.
     margin-left: calc(-50vw + 50%) works when the parent uses default
     align-items (stretch), not center. */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  min-height: clamp(180px, 35vw, 280px);
  max-height: clamp(300px, 50vh, 500px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition: max-height 0.8s ease;
  background: transparent;
  box-shadow: none;
}

/* Doily image centered behind the shuffle deck and fan spread */
.shuffle-doily {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%);
  width: clamp(483px, 94.5vw, 945px);
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.6)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  transition: opacity 0.5s ease;
}

.shuffle-scene.collapsed {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.8s ease,
    min-height 0.8s ease,
    overflow 0s 0s;
}


.shuffle-hand {
  position: absolute;
  top: 38%;
  width: clamp(139px, 17.1vw, 214px);
  height: auto;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  margin-top: calc(-1 * clamp(139px, 17.1vw, 214px) * 0.75);
  z-index: 10;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6)) drop-shadow(0 3px 8px rgba(0, 0, 0, 0.4));
}

.hand-left {
  left: var(--hand-offset);
  transform: rotate(10deg);
  transform-origin: center center;
}

.hand-right {
  right: var(--hand-offset);
  top: 41%;
  /* Right hand image is shorter (1086×1352) vs left (1022×1484).
     Scale height to match the left hand's aspect ratio so both look the same size. */
  height: calc(clamp(130px, 16vw, 200px) * 1.423);
  transform: rotate(-10deg);
  transform-origin: center center;
}

/* Hands appear during shuffle */
.shuffle-scene.is-shuffling .shuffle-hand {
  opacity: 1;
}

/* Hands hover in and out — magical shuffle motion */
.shuffle-scene.is-shuffling .hand-left {
  animation: handHoverLeft 1.8s ease-in-out infinite;
}

.shuffle-scene.is-shuffling .hand-right {
  animation: handHoverRight 1.8s ease-in-out infinite;
}

@keyframes handHoverLeft {
  0%, 100% { transform: translateX(0) rotate(10deg); }
  50% { transform: translateX(clamp(30px, 6vw, 75px)) rotate(12deg); }
}

@keyframes handHoverRight {
  0%, 100% { transform: translateX(0) rotate(-10deg); }
  50% { transform: translateX(clamp(-30px, -6vw, -75px)) rotate(-12deg); }
}

/* === HISTORY PAGE === */

.history-page {
  padding-top: 4rem;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.history-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Leave room for fixed footer */
  padding-bottom: 3rem;
}

.history-title {
  font-family: "California Sun", "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--ink);
  text-align: center;
  font-weight: 400;
  font-style: normal;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

.history-privacy-note {
  text-align: center;
  font-family: "Spectral", Georgia, serif;
  font-size: 0.85rem;
  font-style: italic;
  color: rgba(245, 238, 220, 0.55);
  margin-bottom: 1.2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

#history {
  flex: 0 1 auto;
  min-height: 0;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  background: rgba(42, 24, 16, 0.05);
  border-radius: 12px;
  padding: 0.5rem 1rem;
}

#history:hover {
  scrollbar-color: rgba(150, 130, 100, 0.4) transparent;
}

#history::-webkit-scrollbar {
  width: 6px;
}

#history::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}

#history:hover::-webkit-scrollbar-thumb {
  background: rgba(150, 130, 100, 0.4);
}

/* --- History Toolbar --- */
.history-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 2rem 0.75rem;
  border-bottom: 1px solid #eae6df;
}

.history-select-all-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: clamp(0.7rem, 1.6vw, 0.8rem);
  color: #999;
  cursor: pointer;
  user-select: none;
}

.history-select-all-label input[type="checkbox"] {
  accent-color: var(--ink);
  cursor: pointer;
}

.history-delete-btn {
  margin-left: auto;
  padding: 0.3rem 0.9rem;
  font-size: clamp(0.7rem, 1.6vw, 0.8rem);
  font-family: inherit;
  background: transparent;
  color: #c0392b;
  border: 1px solid #c0392b;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.history-delete-btn:hover:not(:disabled) {
  background: #c0392b;
  color: #fff;
}

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

/* --- History List View --- */
.history-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0.5rem;
  border-bottom: 1px solid #eae6df;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.history-row:last-child {
  border-bottom: none;
}

.history-row:hover {
  background-color: rgba(42, 24, 16, 0.04);
}

.history-row.selected {
  background-color: rgba(42, 24, 16, 0.07);
}

/* Checkbox hidden by default, shown in select mode */
.history-row-checkbox {
  display: none;
  flex-shrink: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

.history-page .history-row-checkbox {
  accent-color: rgba(245, 238, 220, 0.7);
}

#history.select-mode .history-row-checkbox {
  display: block;
}

/* Heart button */
.history-row-heart {
  flex-shrink: 0;
  align-self: center;
  background: none;
  border: none;
  font-size: 0.85rem;
  line-height: 1;
  color: #bbb;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  transition: color 0.15s ease, transform 0.15s ease;
}

.history-row-heart:hover {
  color: #e18ea1;
  transform: scale(1.15);
}

.history-row-heart.favorited {
  color: #e18ea1;
}

.history-row-heart.favorited:hover {
  color: #bbb;
}

#history.select-mode .history-row-heart {
  display: none;
}

/* X button visible on row hover, hidden in select mode */
.history-row-x {
  display: none;
  flex-shrink: 0;
  align-self: center;
  background: none;
  border: none;
  font-size: 1.15rem;
  line-height: 1;
  color: #bbb;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  transition: color 0.15s ease;
}

.history-row-x:hover {
  color: #c0392b;
}

@media (hover: hover) {
  .history-row:hover .history-row-x {
    display: block;
  }
}

#history.select-mode .history-row-x {
  display: none !important;
}

/* In select mode, clicking a row toggles its checkbox */
#history.select-mode .history-row {
  cursor: default;
}

.history-row-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.history-row-question {
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  color: var(--ink);
  font-weight: normal;
  font-style: italic;
  margin: 0 0 0.2rem;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row-question.no-entry {
  font-style: normal;
  color: var(--ink);
}

.history-row-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.history-row-date {
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  color: #666;
}

.history-row-cards {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.history-mini-card {
  width: 28px;
  height: 42px;
  object-fit: fill;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.history-mini-card-reversed {
  transform: rotate(180deg);
}

/* Cancel button in toolbar */
.history-toolbar-cancel {
  padding: 0.3rem 0.9rem;
  font-size: clamp(0.7rem, 1.6vw, 0.8rem);
  font-family: inherit;
  background: transparent;
  color: #999;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.history-toolbar-cancel:hover {
  background: rgba(42, 24, 16, 0.06);
  color: var(--ink);
}

#history:empty::after {
  content: "No readings yet.";
  display: block;
  text-align: center;
  color: #999;
  font-size: 0.95rem;
  padding: 3rem 0;
}

/* --- History Delete Modal --- */
.history-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-modal {
  background: #fff;
  border-radius: 8px;
  padding: 2rem 2.5rem;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.history-modal-message {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--ink);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.history-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.history-modal-cancel {
  padding: 0.45rem 1.2rem;
  font-size: clamp(0.75rem, 1.6vw, 0.85rem);
  font-family: inherit;
  background: transparent;
  color: var(--ink);
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.history-modal-cancel:hover {
  background: rgba(42, 24, 16, 0.06);
}

.history-modal-confirm {
  padding: 0.45rem 1.2rem;
  font-size: clamp(0.75rem, 1.6vw, 0.85rem);
  font-family: inherit;
  background: #c0392b;
  color: #fff;
  border: 1px solid #c0392b;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.history-modal-confirm:hover {
  background: #a93226;
}

/* --- History Detail View --- */
.history-detail {
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 14rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}

.history-detail:hover {
  scrollbar-color: rgba(150, 130, 100, 0.4) transparent;
}

.history-detail::-webkit-scrollbar {
  width: 6px;
}

.history-detail::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}

.history-detail:hover::-webkit-scrollbar-thumb {
  background: rgba(150, 130, 100, 0.4);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.detail-back {
  font-size: clamp(0.78rem, 1.6vw, 0.88rem);
  color: var(--ink);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.detail-back:hover {
  opacity: 1;
}

.detail-new-reading {
  font-size: clamp(0.78rem, 1.6vw, 0.88rem);
  color: var(--gold);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.detail-new-reading:hover {
  opacity: 1;
}

.detail-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail-spread {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--ink);
  font-weight: normal;
  font-style: italic;
}

.detail-date {
  font-size: clamp(0.7rem, 1.6vw, 0.8rem);
  color: #999;
  white-space: nowrap;
}

.detail-question {
  font-style: italic;
  color: #666;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  margin-bottom: 1.25rem;
}

.detail-cards {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.detail-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
}

.detail-card-img-wrap {
  position: relative;
  width: 80px;
  height: 120px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.2);
  margin-bottom: 0.4rem;
  display: block;
  text-decoration: none;
}

a.detail-card-img-wrap:hover img:first-child {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.detail-card-img-wrap.detail-card-reversed {
  transform: rotate(180deg);
}

.detail-card-img-wrap img:first-child {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.detail-card-name {
  font-size: 0.75rem;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
}

.detail-card-orient {
  font-size: 0.65rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-reading {
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  color: var(--ink);
  line-height: 1.8;
  padding-bottom: 1rem;
}

.detail-divider {
  text-align: center;
  margin: 1rem 0 0.4rem;
  color: var(--gold);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.detail-divider::before,
.detail-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gold-subtle);
}

.detail-summary-heading {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: normal;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.detail-summary-text {
  white-space: pre-line;
  line-height: 1.8;
}

.detail-reading-plain {
  white-space: pre-wrap;
  line-height: 1.8;
}

.detail-notes-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gold-subtle);
}

.detail-notes-label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.detail-notes-text {
  font-style: italic;
  color: var(--ink-muted);
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
  :root {
    --card-w: 85px;
    --card-h: 127px;
    --card-w-sm: 50px;
    --card-h-sm: 75px;
    --hand-offset: 21%;
  }

  .card-list-img {
    width: 60px;
  }

  /* Card-by-card result sections: stack vertically on mobile */
  .reading-card-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1.5rem 0;
  }

  .rcs-content {
    align-items: center;
    padding-top: 0;
  }

  .rcs-img-wrap {
    width: 90px;
  }

  .rcs-img-wrap img {
    width: 90px;
    height: 135px;
  }
}

@media (max-width: 700px) {
  .header-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 600px) {
  :root {
    --card-w: 70px;
    --card-h: 105px;
    --card-w-sm: 45px;
    --card-h-sm: 67px;
    --hand-offset: 16%;
  }

  .fan-stage {
    height: 110px;
  }

  .card-list-img {
    width: 55px;
  }

  .history-row {
    padding: 0.75rem 0.25rem;
  }

  /* On touch devices, always show the X (no hover) */
  .history-row-x {
    display: block;
  }

  #history.select-mode .history-row-x {
    display: none !important;
  }

  .detail-card {
    width: 70px;
  }

  .detail-card-img-wrap {
    width: 65px;
    height: 97px;
  }

  /* Responsive hand animation for mobile */
  @keyframes handHoverLeft {
    0%, 100% { transform: translateX(10px) rotate(35deg); }
    50% { transform: translateX(-15px) rotate(35deg); }
  }

  @keyframes handHoverRight {
    0%, 100% { transform: translateX(-10px) rotate(-35deg); }
    50% { transform: translateX(15px) rotate(-30deg); }
  }
}

@media (max-width: 480px) {
  :root {
    --card-w: 60px;
    --card-h: 90px;
    --card-w-sm: 40px;
    --card-h-sm: 60px;
    --hand-offset: 12%;
  }

  .shuffle-hand {
    width: clamp(90px, 22vw, 130px);
    margin-top: calc(-1 * clamp(90px, 22vw, 130px) * 0.75);
  }

  .card-list-img {
    width: 50px;
  }

  .card-list {
    padding: 0 0.5rem;
  }

  .detail-card {
    width: 55px;
  }

  .detail-card-img-wrap {
    width: 50px;
    height: 75px;
  }
}

@media (max-width: 380px) {
  :root {
    --card-w: 52px;
    --card-h: 78px;
    --card-w-sm: 35px;
    --card-h-sm: 52px;
    --hand-offset: 7%;
  }

  .fan-stage {
    height: 90px;
  }

  .shuffle-hand {
    width: clamp(75px, 20vw, 100px);
    margin-top: calc(-1 * clamp(75px, 20vw, 100px) * 0.75);
  }

  .landing-image-wrapper {
    width: 95vw;
  }

  .card-list-img {
    width: 45px;
  }
}

@media (max-width: 320px) {
  .navbar {
    padding: 0.5rem 0.5rem;
  }

  .nav-links {
    gap: 0.5rem;
  }
}

/* === ARTIFACTS PAGE === */
.artifacts-page {
  padding-top: 4rem;
}

.artifacts-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

#artifacts-content {
  background: rgba(42, 24, 16, 0.05);
  border-radius: 12px;
  padding: 1.5rem 1.5rem 0.5rem;
}

.artifacts-title {
  font-family: "California Sun", "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--ink);
  text-align: center;
  font-weight: 400;
  font-style: normal;
  margin-bottom: 1.5rem;
}

.artifacts-group-heading {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--ink);
  font-weight: normal;
  font-style: italic;
  margin-bottom: 1.5rem;
  margin-top: 1rem;
  border-bottom: 1px solid #d5cfc5;
  padding-bottom: 0.5rem;
}

.artifacts-group-heading:first-child {
  margin-top: 0;
}

.artifacts-section {
  margin-bottom: 3rem;
}

.artifacts-section:last-child {
  margin-bottom: 0;
}

.artifacts-section-heading {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--ink);
  font-weight: normal;
  border-bottom: 1px solid #d5cfc5;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.artifacts-table {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.artifacts-row {
  display: flex;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eae6df;
}

.artifacts-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.artifacts-card-img {
  position: relative;
  flex-shrink: 0;
  width: 80px;
}

.artifacts-card-img img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.2);
  transition: opacity 0.2s ease;
}

.artifacts-card-img:hover img {
  opacity: 0.6;
}

a.artifacts-card-img {
  display: block;
  cursor: pointer;
}

.artifacts-card-info {
  flex: 1;
  min-width: 0;
}

.artifacts-card-name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: var(--ink);
  font-weight: normal;
  margin-bottom: 0.4rem;
}

.artifacts-keywords {
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  color: #666;
  margin-bottom: 0.2rem;
}

.artifacts-keyword-label {
  font-weight: bold;
  color: #555;
}

.artifacts-keyword-list {
  font-style: italic;
}

.artifacts-meaning {
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  color: var(--ink);
  line-height: 1.5;
  margin-top: 0.35rem;
}

.artifacts-meaning strong {
  color: #555;
}

@media (max-width: 500px) {
  .artifacts-card-img {
    width: 60px;
  }

  .artifacts-row {
    gap: 0.75rem;
  }
}

/* === DOWNLOAD PAGE === */
.download-page {
  padding-top: 4rem;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.download-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.download-title {
  font-family: "California Sun", "Playfair Display", Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--ink);
  text-align: center;
  font-style: normal;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.download-steps-header {
  font-weight: normal;
  text-align: center;
  color: var(--ink);
  font-size: clamp(0.85rem, 2vw, 1rem);
  margin-bottom: 0.75rem;
}

.download-steps {
  list-style: none;
  counter-reset: step;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 1rem 1.5rem 0.25rem;
}

.download-step {
  margin-bottom: 0.75rem;
  counter-increment: step;
}

.download-step h3 {
  font-size: clamp(0.8rem, 1.8vw, 0.88rem);
  color: var(--ink);
  margin-bottom: 0.3rem;
}

.download-step h3::before {
  content: counter(step) ". ";
  color: #999;
}

.download-step p {
  font-size: clamp(0.65rem, 1.4vw, 0.75rem);
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 0.4rem;
}

.download-step code {
  font-family: "Menlo", "Consolas", monospace;
  font-size: 0.8em;
  background: rgba(42, 24, 16, 0.07);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.download-code {
  font-family: "Menlo", "Consolas", monospace;
  font-size: clamp(0.6rem, 1.3vw, 0.7rem);
  background: #1a1514;
  color: #d4cfc8;
  padding: 0.5rem 0.85rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  margin-top: 0.3rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.download-link {
  color: rgba(245, 238, 220, 0.75);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.download-link:hover {
  color: rgba(245, 238, 220, 1);
}

.download-privacy-note {
  font-family: "Spectral", Georgia, serif;
  font-size: 0.82rem;
  font-style: italic;
  color: rgba(245, 238, 220, 0.5);
  text-align: center;
  max-width: 520px;
  margin: 1.5rem auto 0;
  line-height: 1.6;
}

/* === MOBILE GATE === */
.mobile-gate {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--rose-bg);
  z-index: 99999;
  padding: 2rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

@media (max-width: 768px) {
  .mobile-gate {
    display: flex;
  }

  .landing, .cloud-layer, .skip-intro,
  .reading-section, .custom-cursor {
    display: none !important;
  }
}

.mobile-gate-content {
  max-width: 320px;
}

.mobile-gate-label {
  font-family: 'Special Elite', cursive;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  display: block;
  margin-bottom: 1.5rem;
}

.mobile-gate-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--text-on-dark);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.mobile-gate-subtitle {
  font-family: 'Spectral', serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-on-dark-muted);
  margin-bottom: 2.5rem;
}

.mobile-gate-thesis {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--gold);
  line-height: 1.5;
  padding-top: 2rem;
  border-top: 1px solid rgba(245, 238, 220, 0.15);
}

/* === FOOTER === */
