/* Cinzel: primary display / ritual headings · Cormorant: softer headings & short labels · Inter: body */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Cormorant+Garamond:wght@500;600&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg-start: #06030f;
  --bg-end: #120a2c;
  --gold: #f5d07f;
  /* Purple accent for highlights/dots; primary CTAs use gold gradient below */
  --magenta: #ff5fbf;
  --accent: #9f7bff;
  --btn-primary-from: #8a6820;
  --btn-primary-to: #efd98f;
  --btn-primary-glow: rgba(212, 175, 95, 0.48);
  --btn-primary-glow-strong: rgba(232, 198, 110, 0.58);
  --panel: rgba(12, 8, 29, 0.7);
  --panel-border: rgba(255, 255, 255, 0.18);
  /* High-contrast cream for busy cosmic backgrounds */
  --text-main: #ede7d9;
  --text-muted: #a89f92;
  --text-heading: #f2ebe0;
  --text-shadow-readable: 0 0 6px rgba(0, 0, 0, 0.6);
  --font-display: 'Cinzel', 'Georgia', serif;
  --font-display-soft: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  /* Legacy alias (templates still use .font-crimson) */
  --font-crimson: var(--font-display);
}

*,
*:before,
*:after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-main);
  background: radial-gradient(circle at top, var(--bg-end) 0%, var(--bg-start) 55%, #05020b 100%);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
}

body.app-body {
  background: transparent;
  text-shadow: var(--text-shadow-readable);
}

/* Keep form controls crisp (no halo on editable text) */
input,
textarea,
select {
  text-shadow: none;
}

/* Primary display: titles, brand, major section headers — weights 400–600 only */
.font-crimson {
  font-family: var(--font-display);
  font-weight: 600;
}

.cosmic-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: radial-gradient(ellipse 120% 100% at 50% 15%, #241838 0%, #120a22 42%, #06030f 100%);
  background-size: cover;
  /* Vertical position updated via JS so portrait image reveals top→bottom with page scroll */
  background-position: center 0%;
  background-repeat: no-repeat;
  transition: opacity 0.45s ease;
}

.cosmic-veil {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(6, 3, 16, 0.45) 0%, rgba(4, 2, 12, 0.75) 55%, rgba(2, 1, 8, 0.88) 100%);
  pointer-events: none;
}

.starfield--subtle {
  opacity: 0.22;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  padding: max(0.65rem, env(safe-area-inset-top)) 0 0.65rem;
  background: linear-gradient(180deg, rgba(5, 3, 16, 0.94) 0%, rgba(8, 5, 22, 0.72) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(1, 1, 8, 0.55);
}

.site-topbar__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 max(1.25rem, env(safe-area-inset-left)) 0 max(1.25rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.site-topbar__brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-decoration: none;
  text-shadow: var(--text-shadow-readable), 0 0 28px rgba(245, 208, 127, 0.35);
}

.site-topbar__brand:hover {
  color: #fff;
}

.site-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-left: auto;
}

.lang-dropdown {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(12, 8, 28, 0.85) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23f5d07f' d='M1 1.5L6 6l5-4.5'/%3E%3C/svg%3E") no-repeat right 0.65rem center;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.lang-dropdown:focus {
  outline: 2px solid rgba(159, 123, 255, 0.5);
  outline-offset: 2px;
}

.site-logout {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 140, 140, 0.45);
  color: rgba(255, 220, 220, 0.95);
  background: rgba(35, 12, 20, 0.65);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.site-logout:hover {
  border-color: rgba(255, 180, 180, 0.75);
  color: #fff;
  background: rgba(55, 18, 28, 0.85);
}

.container--tiles-first {
  padding-top: 1.25rem;
  padding-bottom: 0.5rem;
}

.service-icon.service-icon--tile {
  width: 100%;
  max-width: 200px;
  height: auto;
  min-height: 0;
  margin: 0 auto 1rem;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 0;
  font-size: inherit;
}

.service-icon--tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
}

.cosmic-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at 20% 20%, rgba(159, 123, 255, 0.25), transparent 45%),
              radial-gradient(circle at 80% 10%, rgba(255, 95, 191, 0.2), transparent 40%),
              radial-gradient(circle at 50% 80%, rgba(101, 228, 255, 0.15), transparent 35%);
}

.starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 20% 20%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 80% 30%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 60% 80%, rgba(255, 255, 255, 0.3), transparent);
  animation: drift 60s linear infinite;
  opacity: 0.7;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-10%, -10%, 0); }
}

.language-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 0;
}

.language-pill {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 8, 25, 0.6);
  color: var(--text-main);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.language-pill.active,
.language-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--gold);
  transform: translateY(-2px);
}

header {
  padding-bottom: 0.35rem;
  background: linear-gradient(180deg, rgba(5, 3, 16, 0.97) 0%, rgba(8, 6, 22, 0.82) 85%, transparent 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 48px rgba(2, 1, 10, 0.45);
}

.primary-nav {
  display: flex;
  justify-content: center;
  gap: 1rem 1.75rem;
  padding: 0.4rem 1.5rem 1.35rem;
  flex-wrap: wrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: 0.07em;
  font-weight: 600;
  font-size: 1.02rem;
  padding: 0.85rem 1.45rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(165deg, rgba(22, 12, 42, 0.92) 0%, rgba(10, 6, 28, 0.78) 100%);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.nav-item:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 208, 127, 0.65);
  color: var(--gold);
  box-shadow: 0 10px 28px rgba(245, 208, 127, 0.12), 0 0 0 1px rgba(245, 208, 127, 0.2);
}

.primary-nav .nav-item:last-child {
  border-color: rgba(255, 130, 130, 0.35);
  color: rgba(255, 210, 210, 0.95);
  background: linear-gradient(165deg, rgba(40, 14, 22, 0.85) 0%, rgba(18, 8, 16, 0.82) 100%);
}

.primary-nav .nav-item:last-child:hover {
  border-color: rgba(255, 160, 160, 0.55);
  color: #fff;
}

.nav-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent), 0 0 28px rgba(159, 123, 255, 0.45);
}

.hero {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  position: relative;
  isolation: isolate;
}

/* Copy & CTAs paint above the 3D carousel (transforms create stacking otherwise). */
.hero-tagline,
.hero-title,
.hero-lede,
.cta-group {
  position: relative;
  z-index: 4;
}

.hero-tagline {
  font-size: 0.95rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hero-title,
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.2vw, 3.6rem);
  letter-spacing: 0.04em;
  line-height: 1.28;
  margin: 0 auto 1rem;
  max-width: 920px;
  font-weight: 600;
}

/* Third line stays one visual line (avoid breaking inside “esoteric” / “transcendence”) */
.hero-title__line--keep {
  white-space: nowrap;
}

/* Tagline under “CyberOracle” — slightly quieter than the lead word */
.hero-title__line--sub {
  font-size: 0.88em;
}

@media (max-width: 520px) {
  .hero-title,
  .hero h1 {
    font-size: clamp(1.35rem, 4.6vw, 2.35rem);
    letter-spacing: 0.03em;
  }

  .hero-title__line--sub {
    font-size: 0.9em;
  }
}

.hero-lede {
  max-width: 720px;
  margin: 0 auto;
  color: rgba(237, 231, 217, 0.92);
  line-height: 1.6;
  font-size: 1.05rem;
  font-family: var(--font-body);
}

.hero .hero-tagline {
  color: var(--text-muted);
}

.cta-group {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.cta-button {
  padding: 0.85rem 2.6rem;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cta-button.primary {
  background: linear-gradient(135deg, var(--btn-primary-from), var(--btn-primary-to));
  color: #1c1308;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px var(--btn-primary-glow);
}

.cta-button.primary:hover {
  box-shadow: 0 14px 38px var(--btn-primary-glow-strong);
}

.cta-button.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--text-main);
}

.cta-button:hover {
  transform: translateY(-4px);
}

.cta-button,
.tab-btn,
.site-footer__link--button {
  touch-action: manipulation;
}

/* Same horizontal rhythm as .container / topbar (1100px + gutters) — keeps ring from spanning wider than main content */
.deck-stage {
  container-type: inline-size;
  container-name: hero-deck;
  max-width: 1100px;
  width: 100%;
  margin: 1.25rem auto 3rem;
  padding: 0 1.5rem;
  box-sizing: border-box;
  height: 340px;
  position: relative;
  overflow: visible;
  z-index: 1;
}

/*
 * Ring layout: sin/cos placement on a large radius.
 * Tilt: negative rotateX so the *far* side of the ring sits higher on screen than the near/front.
 * Billboard: undo track rotateY so faces stay parallel to the viewport.
 */
.hero-carousel-scene {
  width: 100%;
  height: 100%;
  perspective: 1400px;
  perspective-origin: 50% 48%;
  overflow: visible;
  transform-style: preserve-3d;
  transform: rotateX(-12deg);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.hero-carousel-scene:active {
  cursor: grabbing;
}

.hero-carousel-track {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(var(--carousel-y, 0deg));
  /*
   * Radius scales with deck column (cqw); vw fallback for browsers without container queries.
   */
  --carousel-radius: min(390px, 36vw);
  --carousel-radius: min(42cqw, 420px);
}

.hero-carousel-face {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 136px;
  height: 216px;
  margin-left: -68px;
  margin-top: -108px;
  transform-style: preserve-3d;
  --face-angle: calc(var(--face-i) * 360deg / var(--carousel-n));
  transform: translate3d(
    calc(var(--carousel-radius) * sin(var(--face-angle))),
    0,
    calc(var(--carousel-radius) * cos(var(--face-angle)))
  );
}

.hero-carousel-billboard {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  /* Undo track rotateY so the card plane always faces the viewer */
  transform: rotateY(calc(-1 * var(--carousel-y, 0deg)));
}

.hero-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transform-style: preserve-3d;
  background: transparent;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: filter 0.45s ease, box-shadow 0.45s ease;
}

.hero-card picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-carousel-face:hover .hero-card:not(.fly):not(.selected) {
  filter: brightness(1.1);
}

.hero-card.fly {
  transform: none;
  z-index: 55;
  filter: brightness(1.2)
    drop-shadow(0 0 18px rgba(245, 208, 127, 0.75))
    drop-shadow(0 0 42px rgba(245, 208, 127, 0.35));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(245, 208, 127, 0.55),
    inset 0 0 0 1px rgba(255, 235, 190, 0.35);
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
}

.hero-card-label {
  position: absolute;
  bottom: -1.85rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-family: var(--font-display-soft);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hero-card.fly .hero-card-label,
.hero-card.selected .hero-card-label {
  opacity: 1;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 max(1.5rem, env(safe-area-inset-right)) max(4rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
}

/* Breathing room between hero carousel and tab panel (same max-width alignment). */
section.hero + .container {
  margin-top: 1rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-margin-top: 1rem;
  position: sticky;
  top: 0;
  z-index: 45;
  padding: 0.85rem 0.75rem 1rem;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, rgba(10, 7, 26, 0.96) 0%, rgba(12, 9, 32, 0.9) 55%, rgba(12, 9, 32, 0.65) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: none;
  box-shadow: 0 10px 36px rgba(2, 1, 10, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tab-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.85rem 0.65rem;
  border-radius: 999px 999px 0 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(14, 10, 34, 0.88);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  text-align: center;
}

.tab-btn:hover {
  color: rgba(237, 231, 217, 0.95);
  border-color: rgba(159, 123, 255, 0.45);
  transform: translateY(-2px);
}

.tab-btn.active {
  color: var(--gold);
  background: linear-gradient(180deg, rgba(32, 22, 58, 0.98) 0%, rgba(18, 12, 40, 0.96) 100%);
  border-color: rgba(245, 208, 127, 0.55);
  border-bottom-color: transparent;
  text-shadow: 0 0 22px rgba(245, 208, 127, 0.35);
  box-shadow: 0 6px 28px rgba(245, 208, 127, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tab-content {
  display: none;
  background: rgba(13, 10, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0 20px 20px 20px;
  padding: 2rem;
  box-shadow: 0 18px 40px rgba(4, 3, 12, 0.8);
  backdrop-filter: blur(15px);
}

.tab-content.active {
  display: block;
}

.form-group {
  min-width: 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 7, 25, 0.65);
  color: var(--text-main);
  font-family: var(--font-body);
}

/* WebKit date/time pickers have a default min-width; keep inputs inside the card on narrow screens */
.form-group input[type='date'],
.form-group input[type='time'],
.form-group input[type='datetime-local'] {
  min-width: 0;
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

button[type="submit"] {
  margin-top: 0.5rem;
  padding: 0.9rem 2.5rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--btn-primary-from), var(--btn-primary-to));
  color: #1c1308;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  font-size: 1rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 15px 30px var(--btn-primary-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 35px var(--btn-primary-glow-strong);
}

.result-container {
  margin-top: 1.5rem;
  padding: 1.2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 7, 20, 0.75);
  overflow: visible;
}

/* Card Animation Styles */
.card-reveal-container {
  position: relative;
  margin: 2rem 0 1rem;
  min-height: 300px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(2.25rem, 6vw, 4.5rem);
  flex-wrap: wrap;
  padding: 0.5rem 0.5rem 3.5rem;
  overflow: visible;
}

.card-reveal-item {
  position: relative;
  width: 200px;
  height: 320px;
  perspective: 1000px;
  cursor: pointer;
  overflow: visible;
  flex: 0 0 auto;
  margin: 0 0.25rem 2.75rem;
}

.card-reveal-item .card-back,
.card-reveal-item .card-front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-reveal-item .card-back {
  background: image-set(
      url('/static/cards/back.webp') type('image/webp'),
      url('/static/cards/back.png') type('image/png')
    )
    center / cover no-repeat;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transform: rotateY(0deg);
  overflow: hidden;
}

.card-reveal-item .card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-reveal-item .card-front {
  transform: rotateY(180deg);
  overflow: hidden;
}

.card-reveal-item .card-front picture {
  display: block;
  width: 100%;
  height: 100%;
}

.card-reveal-item.flipped .card-back {
  transform: rotateY(180deg);
}

.card-reveal-item.flipped .card-front {
  transform: rotateY(0deg);
}

.card-reveal-item .card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-reveal-item .card-name {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.5rem;
  width: min(12.5rem, 42vw);
  color: var(--gold);
  font-family: var(--font-display-soft);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
  hyphens: auto;
  opacity: 0;
  transition: opacity 0.5s ease 0.4s;
  z-index: 3;
  pointer-events: none;
}

.card-reveal-item.flipped .card-name {
  opacity: 1;
}

/* Space between card row and prose (avoids title clipping against next block) */
.card-reveal-container + .reading-content,
.card-reveal-container + .reading-content.reading-prose {
  margin-top: 2.25rem;
}

.history-reading-body {
  overflow: visible;
}

/* Card fly-in animation */
@keyframes cardFlyIn {
  0% {
    opacity: 0;
    transform: translateY(-100px) rotate(-15deg) scale(0.8);
  }
  60% {
    transform: translateY(10px) rotate(5deg) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

.card-reveal-item {
  animation: cardFlyIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}

.card-reveal-item:nth-child(1) {
  animation-delay: 0.1s;
}

.card-reveal-item:nth-child(2) {
  animation-delay: 0.3s;
}

.card-reveal-item:nth-child(3) {
  animation-delay: 0.5s;
}

/* Particle effects */
.particles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 2s ease-out forwards;
}

@keyframes particleFloat {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0);
  }
}

/* Enhanced reading content */
.result-container .reading-content {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text-main);
  font-size: 1.05rem;
  padding: 1.5rem;
  background: rgba(15, 10, 30, 0.6);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1rem;
  position: relative;
  animation: fadeInUp 0.6s ease-out;
}

/* Markdown-rendered readings (headings, lists, emphasis) */
.result-container .reading-content.reading-prose {
  white-space: normal;
}

.result-container .reading-content.reading-prose h1,
.result-container .reading-content.reading-prose h2,
.result-container .reading-content.reading-prose h3,
.result-container .reading-content.reading-prose h4 {
  margin: 1.15em 0 0.5em;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-heading);
}

.result-container .reading-content.reading-prose h1:first-child,
.result-container .reading-content.reading-prose h2:first-child,
.result-container .reading-content.reading-prose h3:first-child {
  margin-top: 0;
}

.result-container .reading-content.reading-prose p {
  margin: 0.65em 0;
}

.result-container .reading-content.reading-prose ul,
.result-container .reading-content.reading-prose ol {
  margin: 0.65em 0;
  padding-left: 1.35rem;
}

.result-container .reading-content.reading-prose li {
  margin: 0.35em 0;
}

.result-container .reading-content.reading-prose strong {
  font-weight: 600;
  color: var(--accent, #e8c49a);
}

.result-container .reading-content.reading-prose hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin: 1.25rem 0;
}

.result-container .reading-content.reading-prose blockquote {
  margin: 0.75em 0;
  padding-left: 1rem;
  border-left: 3px solid rgba(232, 196, 154, 0.45);
  color: rgba(244, 239, 230, 0.92);
}

.result-container .reading-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

/* Tarot basic/detailed: single active view on parent (.tarot-dual-reading) — survives cascade issues */
.tarot-dual-reading[data-active-view="basic"] > .tarot-text-detailed,
.tarot-dual-reading[data-active-view="detailed"] > .tarot-text-basic {
  display: none !important;
}

.crystal-dual-reading[data-active-view="basic"] > .crystal-text-detailed,
.crystal-dual-reading[data-active-view="detailed"] > .crystal-text-basic {
  display: none !important;
}

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

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin: 2rem 0 3rem;
}

.services-grid.services-grid--top {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: stretch;
  margin: 0 0 1.25rem;
  width: 100%;
}

.services-grid.services-grid--top .service-card {
  min-width: 0;
  padding: 0.85rem 0.65rem;
  border-radius: 16px;
}

.services-grid.services-grid--top .service-icon.service-icon--tile {
  max-width: min(88px, 100%);
  margin-bottom: 0.5rem;
}

.services-grid.services-grid--top .service-icon--tile img {
  border-radius: 12px;
}

.services-grid.services-grid--top .service-card h3 {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  line-height: 1.25;
  margin: 0 0 0.3rem;
}

.services-grid.services-grid--top .service-card p {
  font-size: 0.72rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 520px) {
  .services-grid.services-grid--top {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    padding-bottom: 0.35rem;
  }

  .services-grid.services-grid--top .service-card {
    flex: 0 0 min(46vw, 168px);
    scroll-snap-align: start;
    max-width: 168px;
  }
}

.service-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(11, 7, 24, 0.8);
  box-shadow: 0 18px 35px rgba(4, 3, 12, 0.7);
  overflow: hidden;
  transition: transform 0.4s ease, border-color 0.4s ease;
  cursor: pointer;
}

.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

.service-card:hover::after {
  opacity: 1;
}

.service-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(159, 123, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.service-card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display-soft);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.service-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

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

.panel-title-group h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.panel-description {
  color: var(--text-muted);
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
}

.oracle-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
  min-width: 0;
}

.oracle-layout > * {
  min-width: 0;
}

.oracle-layout.single-column {
  grid-template-columns: 1fr;
}

/* Intro column + same tile art as services-grid — fills vertical space beside tall forms */
.oracle-intro-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 100%;
}

.panel-tile-art {
  margin-top: auto;
  width: 100%;
  max-width: 220px;
  align-self: center;
}

.panel-tile-art picture {
  display: block;
  width: 100%;
}

.panel-tile-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 16px;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
}

.mini-deck {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mini-card {
  width: 120px;
  height: 180px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 14, 38, 0.8);
  overflow: hidden;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
  transform: rotate(-8deg);
  transition: transform 0.3s ease;
}

.mini-card:nth-child(2) {
  transform: rotate(6deg);
}

.mini-card picture {
  display: block;
  width: 100%;
  height: 100%;
}

.mini-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-badge {
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
}

.palm-dropzone {
  position: relative;
  border: 1.5px dashed rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.3s ease, background 0.3s ease;
  cursor: pointer;
}

.palm-dropzone.active {
  border-color: var(--accent);
  background: rgba(159, 123, 255, 0.08);
}

.palm-dropzone input {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.palm-preview {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  margin: 1rem auto 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.palm-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 2rem;
  position: relative;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 1rem;
  vertical-align: middle;
}

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

.error {
  color: #ff9898;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(128, 12, 34, 0.35);
}

.success {
  color: #9cffc9;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(5, 74, 48, 0.35);
}

.download-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-decoration: none;
  color: var(--text-main);
  letter-spacing: 0.08em;
}

.download-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.as-seen {
  text-align: center;
  padding: 4rem 1rem 3rem;
}

.as-seen h3 {
  font-family: var(--font-display-soft);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.logo-cloud {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.logo-pill {
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  text-transform: uppercase;
  background: rgba(9, 6, 20, 0.7);
}

.how-it-works {
  padding: 3rem 0 4rem;
}

.section-heading {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.2rem;
  letter-spacing: 0.1em;
  margin: 0.3rem 0;
}

.section-heading p {
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.55;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.how-step {
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 8, 24, 0.8);
  box-shadow: 0 18px 30px rgba(3, 2, 10, 0.8);
}

.how-step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.how-step h4 {
  margin: 0 0 0.4rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 1rem;
  text-transform: uppercase;
}

.insight-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.insight-card {
  padding: 2rem;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: radial-gradient(circle at top, rgba(159, 123, 255, 0.18), rgba(8, 5, 19, 0.9));
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.insight-card h3 {
  margin: 0;
  font-family: var(--font-display-soft);
  font-weight: 600;
  letter-spacing: 0.1em;
  font-size: 1.3rem;
}

.insight-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.insight-badge {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

#tarot-form.tarot-flow {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.question-panel {
  background: rgba(18, 12, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: inset 0 0 35px rgba(255, 255, 255, 0.03), 0 20px 40px rgba(3, 2, 12, 0.55);
}

.question-panel-heading {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1rem;
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

.question-actions .cta-button.secondary.locked {
  background: linear-gradient(120deg, rgba(156, 255, 201, 0.2), rgba(183, 172, 212, 0.2));
  border-color: rgba(156, 255, 201, 0.6);
  color: #ffffff;
}

.question-status {
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

.question-status.info {
  color: var(--text-muted);
}

.question-status.success {
  color: #9cffc9;
}

.question-status.error {
  color: #ff9898;
}

.question-status.warn {
  color: #ffd28f;
}

.question-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* —— Crystal ball (optional pre-question ritual) —— */
.crystal-ball-panel {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 280px);
  gap: 1.5rem 2rem;
  align-items: center;
  margin-top: 0.5rem;
  padding: 1.5rem 1.5rem 1.75rem;
  border-radius: 20px;
  border: 1px solid rgba(159, 123, 255, 0.22);
  background:
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(80, 40, 120, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 30% 30%, rgba(245, 208, 127, 0.08) 0%, transparent 45%),
    linear-gradient(165deg, rgba(12, 8, 28, 0.95) 0%, rgba(8, 5, 18, 0.88) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 36px rgba(2, 1, 10, 0.55);
}

.crystal-ball-panel__title {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--font-display-soft, var(--font-body));
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-heading);
}

.crystal-ball-panel__lede {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(237, 231, 217, 0.82);
  max-width: 38rem;
}

.crystal-ball-scene {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  isolation: isolate;
}

/* Looped footage behind the ritual frame: video is decorative only; hitbox receives taps */
.crystal-ball-scene--video {
  width: 100%;
  min-height: 200px;
  max-height: min(48vh, 360px);
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(245, 208, 127, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 12px 32px rgba(2, 1, 10, 0.45);
}

.crystal-ball-scene__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.crystal-ball-scene__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 4, 18, 0.35) 0%, transparent 40%, rgba(6, 3, 14, 0.45) 100%),
    radial-gradient(ellipse 70% 55% at 50% 45%, transparent 30%, rgba(12, 6, 28, 0.5) 100%);
}

.crystal-ball-scene__still {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.crystal-ball-scene__still.is-visible {
  opacity: 1;
}

.crystal-ball-scene__video.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.crystal-ball-scene__dark {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.65s ease;
}

.crystal-ball-scene__dark.is-on {
  opacity: 1;
}

.crystal-ball-scene__hitbox {
  position: absolute;
  inset: 0;
  z-index: 4;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.crystal-ball-scene__hitbox:focus-visible {
  outline: 2px solid rgba(245, 208, 127, 0.75);
  outline-offset: 2px;
}

.crystal-ball-scene__hitbox:disabled {
  cursor: default;
  pointer-events: none;
}

.crystal-ball-panel--attuned .crystal-ball-scene--video {
  border-color: rgba(245, 208, 127, 0.42);
  box-shadow:
    inset 0 0 40px rgba(245, 208, 127, 0.06),
    0 0 28px rgba(245, 208, 127, 0.18),
    0 12px 32px rgba(2, 1, 10, 0.45);
}

.crystal-ball-mist {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.55;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: crystal-mist-drift 14s ease-in-out infinite;
}

.crystal-ball-mist--a {
  width: 180px;
  height: 160px;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(180, 140, 255, 0.5) 0%, transparent 70%);
}

.crystal-ball-mist--b {
  width: 220px;
  height: 200px;
  left: 48%;
  top: 48%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(245, 208, 127, 0.22) 0%, transparent 65%);
  animation-delay: -7s;
  animation-duration: 18s;
}

.crystal-ball-sparks {
  position: absolute;
  width: 200px;
  height: 200px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 35%, rgba(255, 255, 255, 0.15) 0%, transparent 8%),
    radial-gradient(circle at 62% 58%, rgba(255, 230, 180, 0.12) 0%, transparent 6%),
    radial-gradient(circle at 48% 42%, rgba(200, 180, 255, 0.1) 0%, transparent 10%);
  opacity: 0.45;
  animation: crystal-sparkle 4s ease-in-out infinite;
}

.crystal-ball {
  position: relative;
  z-index: 2;
  width: min(152px, 42vw);
  height: min(152px, 42vw);
  padding: 0;
  border: none;
  cursor: pointer;
  background: transparent;
  border-radius: 50%;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.crystal-ball:focus-visible {
  outline: 2px solid rgba(245, 208, 127, 0.75);
  outline-offset: 4px;
}

.crystal-ball:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 0 22px rgba(245, 208, 127, 0.35));
}

.crystal-ball:active {
  transform: scale(0.98);
}

.crystal-ball__orb {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55) 0%, transparent 28%),
    radial-gradient(circle at 70% 65%, rgba(180, 140, 255, 0.35) 0%, transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(40, 28, 70, 0.5) 0%, rgba(12, 6, 28, 0.95) 100%);
  box-shadow:
    inset -8px -12px 24px rgba(0, 0, 0, 0.45),
    inset 6px 10px 20px rgba(255, 255, 255, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 12px 40px rgba(100, 70, 160, 0.45);
  animation: crystal-orb-shimmer 6s ease-in-out infinite;
}

.crystal-ball__sheen {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: linear-gradient(
    125deg,
    transparent 35%,
    rgba(255, 255, 255, 0.12) 48%,
    transparent 58%
  );
  animation: crystal-sheen 8s linear infinite;
  pointer-events: none;
}

.crystal-ball__rim {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(245, 208, 127, 0.28);
  box-shadow: 0 0 24px rgba(245, 208, 127, 0.15);
  pointer-events: none;
}

.crystal-ball-panel--attuned .crystal-ball__orb,
.crystal-ball.is-attuned .crystal-ball__orb {
  animation-duration: 3.5s;
  box-shadow:
    inset -8px -12px 24px rgba(0, 0, 0, 0.4),
    inset 6px 10px 22px rgba(255, 255, 255, 0.22),
    0 0 0 1px rgba(245, 208, 127, 0.35),
    0 0 48px rgba(245, 208, 127, 0.35),
    0 16px 48px rgba(156, 255, 201, 0.12);
}

.crystal-ball-panel--attuned .crystal-ball-mist,
.crystal-ball-panel--attuned .crystal-ball-sparks {
  opacity: 0.85;
}

.crystal-ball-status {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: rgba(183, 172, 212, 0.95);
  font-style: italic;
  text-align: center;
}

@media (max-width: 720px) {
  .crystal-ball-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .crystal-ball-panel__lede {
    margin-left: auto;
    margin-right: auto;
  }

  .crystal-ball-status {
    text-align: center;
  }
}

@keyframes crystal-mist-drift {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 0.45;
  }
  50% {
    transform: translate(-48%, -54%) scale(1.08) rotate(8deg);
    opacity: 0.65;
  }
}

@keyframes crystal-sparkle {
  0%,
  100% {
    opacity: 0.35;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.65;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

@keyframes crystal-orb-shimmer {
  0%,
  100% {
    filter: saturate(1) brightness(1);
  }
  50% {
    filter: saturate(1.15) brightness(1.08);
  }
}

@keyframes crystal-sheen {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .crystal-ball-mist,
  .crystal-ball-sparks,
  .crystal-ball__orb,
  .crystal-ball__sheen {
    animation: none !important;
  }

  .crystal-ball:hover {
    transform: none;
  }
}

/* Crystal Ball tab: video lives inside the ritual panel only */
.crystal-tab {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  min-height: unset;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 55px rgba(2, 1, 10, 0.65);
}

.crystal-tab__inner {
  position: relative;
  z-index: 2;
  padding: 1.75rem 1.5rem 2rem;
}

.crystal-tab__header.panel-header {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.crystal-tab__form {
  margin-top: 1rem;
}

.crystal-ball-panel--on-video {
  background:
    linear-gradient(145deg, rgba(14, 10, 32, 0.72) 0%, rgba(8, 5, 20, 0.55) 100%);
  border-color: rgba(245, 208, 127, 0.22);
  box-shadow: inset 0 0 40px rgba(120, 90, 180, 0.08), 0 12px 36px rgba(2, 1, 10, 0.5);
}

.crystal-tab__result.result-container {
  margin-top: 1.5rem;
}

.crystal-after-reading {
  margin-top: 1.25rem;
  text-align: center;
}

.crystal-after-reading .cta-button {
  min-width: min(100%, 14rem);
}

@media (max-width: 520px) {
  .crystal-tab {
    min-height: unset;
    border-radius: 18px;
  }

  .crystal-tab__inner {
    padding: 1.25rem 1rem 1.5rem;
  }
}

.arc-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.interactive-arc {
  margin-top: 2rem;
  padding: 2rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 7, 22, 0.85);
  box-shadow: 0 25px 50px rgba(3, 2, 12, 0.8);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
}

.arc-instructions h3 {
  margin: 0.4rem 0 0.8rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 1.5rem;
}

.arc-actions {
  margin-top: 1.5rem;
}

.deck-alert {
  min-height: 1.2rem;
  color: #ff9898;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

.interactive-arc.locked .arc-canvas::after {
  content: attr(data-locked-hint);
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: rgba(7, 4, 18, 0.82);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  letter-spacing: 0.08em;
  z-index: 10;
  pointer-events: none;
}

.interactive-arc.locked .arc-card {
  pointer-events: none;
  opacity: 0.2;
  filter: saturate(0);
}

.interactive-arc.locked .arc-canvas {
  filter: grayscale(0.4);
  opacity: 0.5;
}

.interactive-arc.locked + .spread-stage {
  filter: grayscale(0.4);
  opacity: 0.6;
}

.arc-canvas {
  position: relative;
  min-height: 560px;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  overflow: hidden;
  padding-bottom: 140px; /* Space for spread slots */
}

@media (min-width: 901px) {
  .interactive-arc .arc-canvas {
    margin-top: 0.5rem;
  }
}

.arc-cards {
  position: relative;
  width: 100%;
  height: 500px;
  pointer-events: auto;
  overflow: visible;
  margin: 0 auto;
  min-height: 500px;
}

.arc-card {
  position: absolute;
  width: 110px;
  height: 180px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: image-set(
      url('/static/cards/back.webp') type('image/webp'),
      url('/static/cards/back.png') type('image/png')
    )
    center / cover no-repeat;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transform-origin: center center;
  transition: left 1.5s cubic-bezier(0.4, 0, 0.2, 1), top 1.5s cubic-bezier(0.4, 0, 0.2, 1), transform 1.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, filter 0.3s ease, border 0.3s ease;
  color: var(--text-main);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 0.6rem;
  opacity: 1;
  z-index: 2;
}

.arc-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 1;
}

.arc-card span {
  display: none;
}

/* Hover effects are handled by JavaScript to preserve original transform */

.arc-card.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.arc-card.picked {
  pointer-events: none;
  opacity: 0;
}

.spread-stage {
  margin-top: 2rem;
  padding: 2rem;
  padding-bottom: 3rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 7, 22, 0.85);
  box-shadow: 0 20px 45px rgba(3, 2, 12, 0.65);
}

.spread-stage-heading {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.spread-note {
  color: #b7acd4;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.spread-slots {
  position: relative;
  display: flex;
  justify-content: center;
  gap: clamp(2.5rem, 7vw, 5rem);
  z-index: 5;
  width: 100%;
  flex-wrap: wrap;
  padding: 3rem clamp(0.5rem, 3vw, 1.5rem) 3.25rem;
  row-gap: 2.5rem;
}

.spread-slot {
  width: 140px;
  height: 220px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  background: rgba(10, 7, 22, 0.4);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.spread-slot.filled {
  border-color: rgba(159, 123, 255, 0.5);
  background: rgba(159, 123, 255, 0.1);
}

.slot-label {
  position: absolute;
  top: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  z-index: 10;
}

.spread-card {
  width: 140px;
  height: 220px;
  border-radius: 18px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.6);
  position: relative;
  opacity: 0;
  animation: slotFlyIn 0.5s ease forwards;
  margin-bottom: 2.5rem;
}

@keyframes slotFlyIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.spread-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: block;
  position: relative;
  z-index: 0;
}

.spread-card .card-name {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.45rem;
  width: min(10.5rem, 36vw);
  text-align: center;
  color: var(--gold);
  font-family: var(--font-display-soft);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
}

.cta-hint {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.reading-mode-hint {
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(237, 231, 217, 0.9);
  max-width: 36rem;
  margin: 0;
}

.reading-mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.reading-mode-tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 6px;
  background: rgba(140, 110, 45, 0.38);
  color: #f2e8d4;
  vertical-align: middle;
}

.reading-mode-btn.reading-mode-btn-active {
  box-shadow: 0 0 0 2px rgba(245, 208, 127, 0.55);
  opacity: 1;
}

.reading-mode-btn:not(.reading-mode-btn-active) {
  opacity: 0.75;
}

/* Tarot result: basic/detailed toggle above the reading body (synced with Step 4) */
.tarot-reading-view-controls {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 9, 28, 0.6);
  box-shadow: 0 8px 28px rgba(2, 1, 10, 0.45);
}

.tarot-reading-view-controls__buttons {
  margin-bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.tarot-reading-view-controls__buttons .reading-mode-btn {
  text-align: center;
  min-height: 44px;
}

@media (max-width: 520px) {
  .tarot-reading-view-controls__buttons {
    grid-template-columns: 1fr;
  }
}

.history-note {
  font-size: 0.9rem;
  color: rgba(220, 215, 255, 0.75);
  max-width: 40rem;
  margin-bottom: 1rem;
}

.history-list-wrap {
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.history-table th,
.history-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  vertical-align: top;
}

.history-table th {
  color: #c9b8e8;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.history-summary-cell {
  max-width: 22rem;
  color: rgba(255, 255, 255, 0.88);
}

.history-open-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(200, 180, 255, 0.45);
  background: rgba(60, 40, 90, 0.5);
  color: #eee;
  cursor: pointer;
  font-size: 0.85rem;
}

.history-delete-btn {
  margin-left: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 120, 120, 0.45);
  background: rgba(60, 20, 20, 0.35);
  color: rgba(255, 200, 200, 0.95);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.history-delete-btn:hover {
  border-color: rgba(255, 160, 160, 0.75);
  background: rgba(90, 30, 30, 0.55);
}

.history-open-btn:hover {
  background: rgba(90, 60, 140, 0.55);
}

.history-empty,
.history-loading {
  color: rgba(230, 224, 255, 0.85);
}

.history-detail-panel {
  margin-top: 1.5rem;
}

.history-open-meta {
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 15, 35, 0.45);
  color: rgba(245, 242, 255, 0.95);
}

.history-open-meta .history-time {
  opacity: 0.92;
}

.history-recap {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  opacity: 0.88;
}

@keyframes slotFly {
  from {
    opacity: 0;
    transform: translateY(-40px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.authors-section {
  padding: 4rem 0;
}

.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
}

.author-card {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
  background: rgba(9, 6, 18, 0.85);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.author-card picture {
  display: block;
  width: 100%;
}

.author-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  filter: grayscale(20%);
}

.author-card-content {
  padding: 1.2rem 1.4rem 1.4rem;
}

.author-card h4 {
  margin: 0;
  font-family: var(--font-display-soft);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.author-card span {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.author-card p {
  margin: 0.8rem 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.cta-ribbon {
  margin: 5rem auto 4rem;
  padding: 2.5rem 2rem;
  max-width: 960px;
  border-radius: 30px;
  border: 1px solid rgba(245, 208, 127, 0.22);
  background: linear-gradient(135deg, rgba(180, 140, 55, 0.18), rgba(245, 220, 150, 0.12));
  text-align: center;
  box-shadow: 0 30px 60px rgba(5, 4, 15, 0.8);
}

.cta-ribbon h3 {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: 0.1em;
}

.cta-ribbon p {
  margin: 0 auto 1.5rem;
  max-width: 640px;
  color: var(--text-muted);
}

.cta-ribbon .cta-button {
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- Login (shares theme + fonts) --- */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.login-wrap {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: rgba(10, 7, 24, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  box-shadow: 0 24px 60px rgba(2, 1, 10, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.login-lang-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.login-title {
  text-align: center;
  font-size: 2.1rem;
  margin: 0 0 0.5rem;
  color: var(--gold);
  text-shadow: var(--text-shadow-readable), 0 0 24px rgba(245, 208, 127, 0.3);
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 1.75rem;
}

.login-form .form-group {
  margin-bottom: 1.15rem;
}

.login-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(237, 231, 217, 0.88);
}

.login-form input[type='text'],
.login-form input[type='password'] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(5, 4, 18, 0.65);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
}

.login-form input:focus {
  outline: none;
  border-color: rgba(245, 208, 127, 0.55);
  box-shadow: 0 0 0 3px rgba(245, 208, 127, 0.12);
}

.login-error {
  color: #ff9a9a;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 1rem;
}

.login-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, var(--btn-primary-from), var(--btn-primary-to));
  color: #1c1308;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 28px var(--btn-primary-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px var(--btn-primary-glow-strong);
}

/* Tablets / small laptops — stack two-column layouts (fixes arc overflow on narrow viewports) */
@media (max-width: 900px) {
  .oracle-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
  }

  .oracle-intro-column {
    min-height: 0;
  }

  .panel-tile-art {
    margin-top: 1rem;
    align-self: center;
    max-width: min(200px, 70vw);
  }

  .interactive-arc {
    padding: 1.25rem;
    gap: 1.25rem;
    min-width: 0;
    width: 100%;
  }

  .arc-canvas {
    margin-top: 0.75rem;
    min-height: min(88vw, 520px);
    padding-bottom: 100px;
  }

  .arc-cards {
    height: min(76vw, 440px);
    min-height: 360px;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .primary-nav {
    gap: 0.6rem;
    padding: 0 1rem 1.2rem;
  }

  .nav-item {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }

  .site-topbar__inner {
    padding: 0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
  }

  .site-topbar__brand {
    font-size: 1.1rem;
  }

  .lang-dropdown {
    font-size: 0.72rem;
    padding: 0.4rem 1.75rem 0.4rem 0.6rem;
  }

  .site-logout {
    font-size: 0.7rem;
    padding: 0.32rem 0.65rem;
  }

  .deck-stage {
    height: 280px;
    padding: 0 max(1rem, env(safe-area-inset-left)) 0 max(1rem, env(safe-area-inset-right));
    margin: 1rem auto 2.5rem;
  }

  .hero-carousel-scene {
    transform: rotateX(-10deg);
    perspective: 1000px;
  }

  .hero-carousel-track {
    --carousel-radius: min(38cqw, 260px);
  }

  .hero-carousel-face {
    width: 112px;
    height: 178px;
    margin-left: -56px;
    margin-top: -89px;
  }

  .hero {
    padding: 2.5rem max(1rem, env(safe-area-inset-left)) 2rem max(1rem, env(safe-area-inset-right));
  }

  .hero-lede {
    font-size: 1rem;
  }

  .container--tiles-first {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .services-grid:not(.services-grid--top) {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1rem 0 2rem;
  }

  .services-grid.services-grid--top {
    margin: 0.75rem 0 1.25rem;
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }

  .service-card {
    padding: 1.25rem;
  }

  .tabs {
    gap: 0.45rem;
    /* Match .tab-content horizontal inset so the tab strip aligns with the panel below */
    padding: 0.65rem max(1rem, env(safe-area-inset-right)) 0.85rem max(1rem, env(safe-area-inset-left));
    margin-left: 0;
    margin-right: 0;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-padding-inline: max(1rem, env(safe-area-inset-right));
  }

  .tab-btn {
    flex: 0 0 auto;
    min-width: min-content;
    padding: 0.75rem 1.1rem;
    min-height: 44px;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
  }

  .tab-content {
    padding: 1.25rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left));
    border-radius: 16px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .status-badge {
    align-self: flex-start;
  }

  .cta-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }

  .cta-button {
    width: 100%;
    text-align: center;
    min-height: 48px;
  }

  .spread-slots {
    gap: 1.25rem 1rem;
    row-gap: 2rem;
    padding-top: 2.75rem;
  }

  .reading-mode-buttons {
    width: 100%;
    justify-content: flex-start;
  }

  .reading-mode-buttons .cta-button {
    flex: 1 1 auto;
    min-width: min(100%, 11rem);
  }

  .cta-ribbon {
    margin: 3rem max(0.75rem, env(safe-area-inset-left)) 3rem max(0.75rem, env(safe-area-inset-right));
    padding: 1.75rem 1.25rem;
  }

  .cta-ribbon h3 {
    font-size: 1.35rem;
    letter-spacing: 0.06em;
  }

  .interactive-arc .arc-instructions h3 {
    font-size: 1.2rem;
  }

  .interactive-arc {
    padding: 1rem;
  }

  .spread-stage {
    padding: 1.25rem;
    padding-bottom: 2.5rem;
  }

  .tarot-submit.oracle-layout {
    grid-template-columns: 1fr;
  }

  .question-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .question-actions .cta-button {
    width: 100%;
    text-align: center;
  }

  .history-summary-cell {
    max-width: none;
  }

  .history-open-btn {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }

  .card-reveal-container {
    gap: 1.5rem;
    padding-left: max(0.25rem, env(safe-area-inset-left));
    padding-right: max(0.25rem, env(safe-area-inset-right));
  }

  .card-reveal-item {
    width: min(200px, 88vw);
    height: auto;
    aspect-ratio: 200 / 320;
  }

  .legal-topnav__inner {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .legal-main {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .login-page {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .section-heading h2 {
    font-size: clamp(1.35rem, 5vw, 1.85rem);
  }

  .authors-section {
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(0.5rem, env(safe-area-inset-right));
  }

  .form-group input[type='text'],
  .form-group input[type='email'],
  .form-group input[type='search'],
  .form-group input[type='password'],
  .form-group input[type='number'],
  .form-group input[type='date'],
  .form-group input[type='time'],
  .form-group input[type='datetime-local'],
  .form-group textarea {
    font-size: 16px;
  }

  .result-container .reading-content,
  .reading-prose {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .site-footer__nav {
    row-gap: 0.5rem;
  }

  .site-footer__link,
  .site-footer__link--button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
  }
}

@media (max-width: 420px) {
  .hero-title__line--keep {
    white-space: normal;
  }

  .slot-label {
    letter-spacing: 0.2em;
    font-size: 0.68rem;
  }
}


/* --- Site footer (dashboard, login, legal pages) --- */
.site-footer {
  margin-top: 3.5rem;
  padding: 1.75rem max(0.75rem, env(safe-area-inset-right)) max(2.5rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, transparent 0%, rgba(8, 5, 20, 0.55) 100%);
}

.login-page .site-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
}

.site-footer__inner {
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-display-soft, var(--font-body));
}

.site-footer__link {
  color: var(--gold, #e8c97a);
  text-decoration: none;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-footer__link:hover {
  color: #fff8e8;
  background: rgba(232, 201, 122, 0.08);
}

.site-footer__link--button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  background: none;
  border: none;
  cursor: pointer;
  margin: 0;
  display: inline;
  line-height: inherit;
}

.site-footer__sep {
  color: rgba(255, 255, 255, 0.25);
  user-select: none;
}

.site-footer__tagline {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  color: rgba(237, 231, 217, 0.55);
  letter-spacing: 0.04em;
}

.site-footer__tagline strong {
  color: rgba(237, 231, 217, 0.72);
  font-weight: 600;
}

/* --- Public legal / info layout --- */
.legal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.legal-body .legal-main {
  flex: 1;
}

.legal-topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 7, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.legal-topnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.legal-topnav__tools {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-dropdown--public {
  min-width: 9.5rem;
  font-size: 0.8rem;
}

.legal-topnav__brand {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-main);
  text-decoration: none;
}

.legal-topnav__brand:hover {
  color: var(--gold);
}

.legal-topnav__back {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(237, 231, 217, 0.75);
  text-decoration: none;
}

.legal-topnav__back:hover {
  color: var(--gold);
}

.legal-main {
  padding: 2.5rem 1.5rem 3rem;
}

.legal-prose {
  max-width: 46rem;
  margin: 0 auto;
  color: rgba(237, 231, 217, 0.92);
  line-height: 1.65;
}

.legal-prose--short {
  padding-bottom: 2rem;
}

.legal-prose__header {
  margin-bottom: 2rem;
}

.legal-prose h1 {
  font-family: var(--font-display-soft, var(--font-body));
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
  color: var(--text-main);
}

.legal-prose__updated {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(237, 231, 217, 0.55);
}

.legal-prose__lead {
  font-size: 1.05rem;
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 14, 38, 0.45);
}

.legal-prose h2 {
  font-family: var(--font-display-soft, var(--font-body));
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 2rem 0 0.75rem;
  color: var(--gold);
  font-weight: 600;
}

.legal-prose p {
  margin: 0 0 1rem;
}

.legal-prose .legal-body ul {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.legal-prose .legal-body ul li {
  margin-bottom: 0.4rem;
}

.legal-prose__crumb {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.legal-prose__crumb a {
  color: var(--gold);
}

.legal-prose__subtitle {
  margin: -0.25rem 0 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(237, 231, 217, 0.78);
}

.legal-hub__docs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.legal-hub__docs li {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.legal-hub__docs li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.legal-hub__docs a {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.legal-hub__doc-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  font-weight: 400;
  color: rgba(237, 231, 217, 0.65);
  letter-spacing: 0.02em;
}

.legal-prose a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.legal-prose a:hover {
  color: #fff8e8;
}

.legal-prose__email {
  font-size: 1.15rem;
}

@media (max-width: 520px) {
  .site-footer__nav {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
  }
}

/* --- Contact modal (footer) --- */
.contact-modal {
  max-width: min(22rem, 92vw);
  width: 100%;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(18, 12, 40, 0.98) 0%, rgba(8, 5, 20, 0.99) 100%);
  color: var(--text-main);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(232, 201, 122, 0.12);
}

.contact-modal::backdrop {
  background: rgba(4, 2, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.contact-modal__panel {
  position: relative;
  padding: 1.75rem 1.5rem 1.5rem;
}

.contact-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(237, 231, 217, 0.85);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.contact-modal__close:hover {
  background: rgba(232, 201, 122, 0.15);
  color: #fff8e8;
}

.contact-modal__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display-soft, var(--font-body));
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  padding-right: 2.5rem;
}

.contact-modal__lede {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: rgba(237, 231, 217, 0.88);
  line-height: 1.5;
}

.contact-modal__email {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.contact-modal__email a {
  color: var(--gold);
  text-decoration: none;
  word-break: break-all;
}

.contact-modal__email a:hover {
  text-decoration: underline;
  color: #fff8e8;
}

.contact-modal__hint {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(237, 231, 217, 0.5);
  line-height: 1.4;
}

