/* =========================================================
   Dromtyda - Design tokens
   Dark, nocturnal, literary. Neutrals tinted toward violet.
   Typography: Spectral (display) + Manrope (body).
   ========================================================= */

:root {
  /* Font families (bound via Google Fonts <link>) */
  --font-display: 'Spectral', Georgia, serif;
  --font-body: 'Manrope', system-ui, sans-serif;

  /* Surfaces - tinted toward brand violet */
  --bg-deep: #0b0a14;
  --bg-card: #14131f;
  --bg-card-hover: #1b1a2a;
  --bg-elevated: #1f1d2e;

  /* Text */
  --text-primary: #ece9f4;
  --text-secondary: #9a96ae;
  --text-muted: #625e78;

  /* Accents */
  --accent: #8b7fd4;
  --accent-glow: #a599e9;
  --accent-dim: #3f3866;
  --accent-deep: #231f3d;
  --gold: #c9a84c;
  --gold-dim: #8a7330;

  /* Borders */
  --border: #201e30;
  --border-strong: #2a2740;

  /* Spacing - 4pt scale, semantic names */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 9rem;

  /* Motion */
  --ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);

  /* Content widths */
  --measure: 68ch;
}

/* =========================================================
   Base
   ========================================================= */

html,
body {
  background: var(--bg-deep);
  color: var(--text-primary);
}

body {
  font-family: var(--font-body), "Manrope", system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.7;
  letter-spacing: -0.003em;

  /* Layered nocturnal atmosphere */
  background-image:
    radial-gradient(ellipse 70% 55% at 50% -8%, rgba(139, 127, 212, 0.14), transparent 62%),
    radial-gradient(ellipse 55% 35% at 92% 15%, rgba(201, 168, 76, 0.055), transparent 62%),
    radial-gradient(ellipse 45% 30% at 8% 85%, rgba(139, 127, 212, 0.06), transparent 65%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* =========================================================
   Typography - modular scale, 1.333 ratio
   ========================================================= */

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display), "Spectral", Georgia, serif;
  color: var(--text-primary);
  font-weight: 500;
  font-variant-numeric: oldstyle-nums;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw + 0.5rem, 4.5rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
  font-weight: 500;
}

h2 {
  font-size: clamp(1.875rem, 3vw + 0.5rem, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 500;
}

h3 {
  font-size: clamp(1.35rem, 1vw + 1rem, 1.625rem);
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 500;
}

h4 {
  font-size: 1.125rem;
  line-height: 1.35;
  letter-spacing: -0.005em;
  font-weight: 600;
}

/* Editorial italic in display */
.display-italic {
  font-style: italic;
  font-weight: 400;
}

/* Paragraphs limited to comfortable measure */
.prose-measure {
  max-width: var(--measure);
}

/* Small caps label */
.eyebrow {
  font-family: var(--font-body), "Manrope", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

a {
  color: inherit;
}

::selection {
  background: rgba(139, 127, 212, 0.38);
  color: #f6f3ff;
}

/* =========================================================
   Interaction: press feedback + focus
   ========================================================= */

button,
a,
[role="button"] {
  transition: transform 200ms var(--ease-out-quint),
    color 180ms var(--ease-out-quint),
    background 180ms var(--ease-out-quint),
    border-color 180ms var(--ease-out-quint);
}

:is(button, a, [role="button"]):active {
  transform: scale(0.975);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Subtle scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: #23223a;
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   Utilities & components
   ========================================================= */

.text-balance {
  text-wrap: balance;
}
.text-pretty {
  text-wrap: pretty;
}

.glass {
  background: rgba(11, 10, 20, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}

/* Card */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.025) inset,
    0 20px 60px -40px rgba(0, 0, 0, 0.6);
}

.card-hover {
  transition: background 220ms var(--ease-out-quint),
    border-color 220ms var(--ease-out-quint),
    transform 220ms var(--ease-out-quint),
    box-shadow 220ms var(--ease-out-quint);
}

@media (hover: hover) and (pointer: fine) {
  .card-hover:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow:
      0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
      0 30px 60px -30px rgba(0, 0, 0, 0.7),
      0 0 0 1px rgba(139, 127, 212, 0.08);
  }
}

.accent-text {
  color: var(--accent);
}
.gold-text {
  color: var(--gold);
}

.container-narrow {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 3vw, 1.75rem);
  padding-right: clamp(1rem, 3vw, 1.75rem);
}

/* Editorial divider */
.rule {
  position: relative;
  height: 1px;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-strong) 20%,
    var(--border-strong) 80%,
    transparent
  );
}
.rule::after {
  content: "";
  position: absolute;
  left: 38%;
  top: 50%;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 999px;
  transform: translateY(-50%);
  box-shadow: 0 0 10px rgba(139, 127, 212, 0.6);
}

/* Stagger helpers */
.stage-0 { animation-delay: 0ms; }
.stage-1 { animation-delay: 60ms; }
.stage-2 { animation-delay: 120ms; }
.stage-3 { animation-delay: 180ms; }
.stage-4 { animation-delay: 240ms; }
.stage-5 { animation-delay: 300ms; }

/* FAQ grid-rows transition */
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 260ms var(--ease-out-quint);
}
.faq-panel[data-open="true"] {
  grid-template-rows: 1fr;
}
.faq-panel > .faq-inner {
  overflow: hidden;
}

.chevron {
  transition: transform 220ms var(--ease-out-quint);
}
[data-open="true"] .chevron {
  transform: rotate(45deg);
}

/* Starfield */
.starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 18% 24%, rgba(236, 233, 244, 0.5), transparent 50%),
    radial-gradient(1px 1px at 62% 38%, rgba(236, 233, 244, 0.35), transparent 50%),
    radial-gradient(1px 1px at 82% 72%, rgba(236, 233, 244, 0.4), transparent 50%),
    radial-gradient(1px 1px at 28% 78%, rgba(201, 168, 76, 0.4), transparent 50%),
    radial-gradient(1px 1px at 48% 12%, rgba(236, 233, 244, 0.3), transparent 50%),
    radial-gradient(1px 1px at 92% 28%, rgba(236, 233, 244, 0.35), transparent 50%);
  background-repeat: no-repeat;
}

/* Crescent moon */
.crescent {
  --size: 128px;
  position: relative;
  width: var(--size);
  height: var(--size);
  border-radius: 999px;
  background: radial-gradient(
    circle at 35% 35%,
    #f1ecd7 0%,
    #d9cfa5 45%,
    #8a7330 100%
  );
  box-shadow:
    0 0 60px rgba(201, 168, 76, 0.25),
    0 0 120px rgba(139, 127, 212, 0.2),
    inset -6px -10px 24px rgba(0, 0, 0, 0.35);
}
.crescent::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--bg-deep);
  transform: translate(22%, -8%) scale(0.94);
}

/* Text color utility classes matching Tailwind/Next.js output */
.text-muted { color: var(--text-secondary); }
.text-ink { color: var(--text-primary); }
.text-dim { color: var(--text-muted); }
.border-border-dark { border-color: var(--border); }
.bg-bg-deep { background-color: var(--bg-deep); }
.bg-bg-card { background-color: var(--bg-card); }
.bg-accent { background-color: var(--accent); }
.text-bg-deep { color: var(--bg-deep); }
.hover\:text-ink:hover { color: var(--text-primary); }
.hover\:bg-accent-glow:hover { background-color: var(--accent-glow); }
.hover\:text-accent:hover { color: var(--accent); }
.hover\:border-accent-dim:hover { border-color: var(--accent-dim); }
.hover\:bg-bg-card:hover { background-color: var(--bg-card); }

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.6s var(--ease-out-quint) both;
}

/* Drift animation for crescent */
@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.animate-drift {
  animation: drift 6s ease-in-out infinite;
}
