/* Mystic Draw marketing — aligned with app globals (dark, gold, purple, stars) */
:root {
  --background: #06060a;
  --background-elev: rgb(18 18 18 / 0.72);
  --foreground: #f8f8f8;
  --primary: #d4af37;
  --primary-foreground: #000000;
  --secondary: #2a1a40;
  --secondary-bright: #532b88;
  --accent: #8a6e3a;
  --muted: #a0a0a0;
  --border: rgb(42 42 42 / 0.85);
  --card: rgb(26 26 26 / 0.75);
  --radius: 0.5rem;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Palatino", "Book Antiqua", "Times New Roman", serif;
  --content-max: 72rem;
  --header-h: 4rem;
}

@media (min-width: 768px) {
  :root {
    --header-h: 4.5rem;
  }
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-card {
    animation: none !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Starfield + meteors — matches app CosmicBackdrop (mysticdraw-app globals) */
.cosmic-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(83, 43, 136, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(42, 26, 64, 0.25) 0%, transparent 45%),
    #06060a;
  pointer-events: none;
  overflow: hidden;
}

.cosmic-stars {
  position: absolute;
  inset: 0;
}

/* Twinkling dots (opacity only — aligns with app) */
@keyframes twinkle {
  0% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.4;
  }
}

.cosmic-star {
  position: absolute;
  border-radius: 999px;
  width: var(--star-size, 2px);
  height: var(--star-size, 2px);
  background: radial-gradient(
    circle at 35% 35%,
    #fffef5 0%,
    var(--primary) 42%,
    rgba(212, 175, 55, 0.35) 70%,
    transparent 72%
  );
  box-shadow:
    0 0 4px rgba(255, 250, 235, 0.9),
    0 0 10px rgba(212, 175, 55, 0.35);
  opacity: 0.92;
  animation-name: twinkle;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-duration: var(--twinkle-duration, 3.4s);
  animation-delay: var(--twinkle-delay, 0s);
}

.shooting-star {
  position: absolute;
  width: var(--meteor-len, 72px);
  height: 2px;
  transform-origin: left center;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 252, 240, 0.15) 20%,
    rgba(255, 248, 225, 0.95) 45%,
    var(--primary) 72%,
    transparent 100%
  );
  border-radius: 9999px;
  filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.85));
  animation-name: meteor-trail;
  animation-timing-function: cubic-bezier(0.08, 0.55, 0.25, 1);
  animation-fill-mode: forwards;
  will-change: transform, opacity;
}

@keyframes meteor-trail {
  0% {
    transform: rotate(var(--meteor-angle, 42deg)) translate3d(0, 0, 0) scaleX(0.12);
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  88% {
    opacity: 0.85;
  }
  100% {
    transform: rotate(var(--meteor-angle, 42deg)) translate3d(95vw, 72vh, 0) scaleX(1);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cosmic-star,
  .shooting-star {
    animation: none !important;
    opacity: 0.35;
  }
}

.layout-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--background-elev);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--foreground);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
  color: var(--primary);
}

.brand svg {
  flex-shrink: 0;
  border-radius: 0.25rem;
}

/* Same asset as app `public/images/logo.svg` — `assets/brand/logo.svg` */
.brand__mark,
.footer-mark {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 0.25rem;
}

.brand__mark {
  height: 2.5rem;
  width: auto;
}

.footer-mark {
  height: 1.25rem;
  width: auto;
}

/* Matches app LogoMenu mobile: lucide Menu / X toggle, soft hover */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 0.2s;
}

.nav-toggle:hover {
  background: rgb(42 26 64 / 0.5);
}

.nav-toggle__icon {
  display: block;
  flex-shrink: 0;
}

.nav-toggle__icon--close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon--menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon--close {
  display: block;
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

/* Floating card under header — same pattern as mysticdraw-app LogoMenu (dark theme) */
.nav-panel {
  display: flex;
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  top: calc(var(--header-h) + 0.5rem);
  z-index: 60;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  max-height: min(70vh, calc(100dvh - var(--header-h) - 1.25rem));
  overflow-y: auto;
  border-radius: 1rem;
  border: 1px solid rgb(212 175 55 / 0.35);
  background: #17131d;
  box-shadow:
    0 25px 50px -12px rgb(0 0 0 / 0.45),
    0 0 0 1px rgb(0 0 0 / 0.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.95);
  transform-origin: top center;
  transition:
    opacity 150ms ease-out,
    transform 150ms ease-out,
    visibility 150ms;
}

.nav-panel[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .nav-panel {
    transition: none;
  }

  .nav-panel[aria-hidden="true"] {
    transform: none;
  }
}

.nav-panel a {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  color: #f8f4ff;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.nav-panel a:hover {
  background: rgb(255 255 255 / 0.1);
  color: #f2d27a;
  text-decoration: none;
}

.nav-panel a:active {
  background: rgb(255 255 255 / 0.15);
}

.nav-panel a[aria-current="page"] {
  color: var(--primary);
  background: rgb(212 175 55 / 0.08);
}

.nav-panel a.nav-cta--mobile {
  margin-top: 0.25rem;
  text-align: center;
  color: var(--primary-foreground) !important;
  background: linear-gradient(180deg, #e8c85c, var(--primary));
  border: 1px solid rgb(212 175 55 / 0.5);
}

.nav-panel a.nav-cta--mobile:hover {
  color: var(--primary-foreground) !important;
  background: linear-gradient(180deg, #f0d778, #e0bc4a);
  filter: brightness(1.03);
}

.nav-panel a.nav-cta--mobile:active {
  filter: brightness(0.97);
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.75rem;
}

@media (min-width: 768px) {
  .nav-desktop {
    display: flex;
  }

  .nav-panel {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

.nav-desktop a {
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, box-shadow 0.2s;
}

.nav-desktop a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Current page — exclude primary CTA */
.nav-desktop a[aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 0 var(--primary);
  padding-bottom: 0.1rem;
}

.nav-desktop a[aria-current="page"]:hover {
  color: var(--primary);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #e8c85c, var(--primary));
  color: var(--primary-foreground);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 20px rgba(212, 175, 55, 0.25);
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn-primary:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 28px rgba(212, 175, 55, 0.35);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

.mystic-text {
  background: linear-gradient(to right, var(--primary), #fff8e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  line-height: 1.2;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  margin: 0 0 0.5rem;
}

h3 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
  color: var(--foreground);
}

p.lead {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 1.5rem;
}

/* Hero */
.hero {
  padding-top: clamp(2rem, 6vw, 4rem);
  padding-bottom: clamp(3rem, 10vw, 6rem);
  text-align: center;
}

.hero-visual {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.5rem;
  perspective: 900px;
}

/* Tarot-proportioned card — logo scales to fill the face (see .hero-card__mark) */
.hero-card {
  position: relative;
  overflow: hidden;
  width: min(10.5rem, 32vw);
  max-width: 11.25rem;
  aspect-ratio: 1 / 1.45;
  border-radius: 0.6rem;
  background: linear-gradient(155deg, rgba(42, 26, 64, 0.55) 0%, rgba(10, 10, 16, 0.92) 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 2px 1px rgba(255, 255, 255, 0.06) inset,
    0 24px 48px -16px rgba(83, 43, 136, 0.45);
  transform: rotateZ(-1.5deg) rotateX(4deg);
  transform-style: preserve-3d;
  animation: hero-levitate 7s ease-in-out infinite;
}

@media (min-width: 768px) {
  .hero-card {
    width: 11.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-card {
    animation: none;
  }
}

@keyframes hero-levitate {
  0%,
  100% {
    transform: rotateZ(-1.5deg) rotateX(4deg) translateY(0);
  }
  50% {
    transform: rotateZ(-1.2deg) rotateX(3deg) translateY(-6px);
  }
}

.hero-card__glow {
  position: absolute;
  inset: -30%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(212, 175, 55, 0.2) 0%, rgba(42, 26, 64, 0.15) 40%, transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0.12rem;
  z-index: 2;
  border-radius: 0.5rem;
  border: 1px solid rgba(212, 175, 55, 0.14);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.hero-card__inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  padding: 0;
  overflow: hidden;
  border-radius: inherit;
}

/* Zoom past SVG letterboxing so the mark reads edge-to-edge on the card */
.hero-card__mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 138%;
  height: 138%;
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%);
  object-fit: cover;
  object-position: 50% 50%;
  filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.12));
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}

/* Sections */
section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}

.section-header {
  text-align: center;
  max-width: 38rem;
  margin: 0 auto 2.5rem;
}

.section-header p {
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.12);
}

.card__icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--secondary);
  color: var(--primary);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.how-list {
  display: grid;
  gap: 1.5rem;
  counter-reset: step;
  max-width: 44rem;
  margin: 0 auto;
}

.how-list li {
  list-style: none;
  position: relative;
  padding-left: 3.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.how-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--secondary);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
}

.how-list strong {
  color: var(--foreground);
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

/* CTA band */
.cta-band {
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: calc(var(--radius) * 2);
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: linear-gradient(145deg, rgba(42, 26, 64, 0.5) 0%, rgba(6, 6, 10, 0.8) 100%);
  margin-top: 1rem;
}

.cta-band p {
  color: var(--muted);
  margin: 0 0 1.25rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

/* Page hero (inner pages) */
.page-hero {
  padding-top: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.page-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 0.5rem;
}

.page-hero .updated {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.prose {
  max-width: 46rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.prose h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--foreground);
  font-family: var(--font-sans);
}

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

.prose ul {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}

.prose li {
  margin-bottom: 0.35rem;
}

.prose code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  background: rgba(42, 26, 64, 0.45);
  color: #f0e6c8;
  border: 1px solid var(--border);
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--background-elev);
  backdrop-filter: blur(8px);
  padding: 1.25rem 1rem;
}

.site-footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer__copy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.site-footer__copy .footer-mark {
  border-radius: 0.2rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
  text-decoration: none;
}

.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;
}

/* About / info blocks */
.about-grid {
  display: grid;
  gap: 2rem;
  align-items: start;
  max-width: 48rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 3rem;
  }
}

.about-grid p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.about-grid p:last-child {
  margin-bottom: 0;
}

/* FAQ (home teaser + full page) */
.faq-home {
  max-width: 40rem;
  margin: 0 auto;
}

.faq-home__more {
  margin-top: 1.5rem;
  text-align: center;
}

.faq-list {
  max-width: 44rem;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--card);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--foreground);
  list-style: none;
  font-family: var(--font-sans);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "";
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg);
  transition: transform 0.2s;
  margin-top: -0.2rem;
}

.faq-item[open] summary::after {
  transform: rotate(225deg);
  margin-top: 0.2rem;
}

.faq-item summary:hover {
  color: var(--primary);
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border);
  color: var(--primary);
}

.faq-answer {
  padding: 0 1.15rem 1.15rem;
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.65;
}

.faq-answer a {
  font-weight: 500;
}

.link-cta {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 175, 55, 0.4);
  padding-bottom: 0.1rem;
  transition: color 0.2s, border-color 0.2s;
}

.link-cta:hover {
  color: #fff8e1;
  border-bottom-color: var(--primary);
  text-decoration: none;
}
