/* =============================================================================
   BASE — The Witchy Room
   CSS reset, root typography, heading scales, utility defaults.
   Depends on: design-tokens.css
   ============================================================================= */

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

/* ---------------------------------------------------------------------------
   Margin / padding reset
   --------------------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
}

/* ---------------------------------------------------------------------------
   Root & body
   --------------------------------------------------------------------------- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------------------------------------------------------------------------
   Headings — Cormorant Garamond
   H1–H4 sizes scale from mobile up.
   --------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl));
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
  font-weight: 600;
}

h4 {
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
  font-weight: 500;
}

h5 {
  font-size: var(--text-xl);
  font-weight: 500;
}

h6 {
  font-size: var(--text-lg);
  font-weight: 500;
}

/* ---------------------------------------------------------------------------
   Prose / readable text sections
   Apply .prose to article bodies, FAQs, etc.
   --------------------------------------------------------------------------- */
.prose {
  max-width: 68ch;
}

.prose p,
.prose li {
  line-height: 1.7;
  color: var(--color-text);
}

.prose p + p {
  margin-top: var(--space-md);
}

.prose h2,
.prose h3,
.prose h4 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.prose ul,
.prose ol {
  padding-left: var(--space-lg);
}

.prose li + li {
  margin-top: var(--space-xs);
}

/* ---------------------------------------------------------------------------
   Links
   --------------------------------------------------------------------------- */
a {
  color: var(--color-violet);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition-fast),
              color var(--transition-fast);
}

a:hover {
  color: var(--color-pink);
  text-decoration-color: currentColor;
}

/* ---------------------------------------------------------------------------
   Images & media
   --------------------------------------------------------------------------- */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* ---------------------------------------------------------------------------
   Form elements — inherit font
   --------------------------------------------------------------------------- */
input,
button,
textarea,
select {
  font: inherit;
}

/* ---------------------------------------------------------------------------
   Focus-visible — glowing ring instead of default outline
   --------------------------------------------------------------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-violet);
  outline-offset: 3px;
  box-shadow: var(--glow-sm);
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------------------
   Lists (unstyled when needed)
   --------------------------------------------------------------------------- */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* ---------------------------------------------------------------------------
   Horizontal rule
   --------------------------------------------------------------------------- */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

/* ---------------------------------------------------------------------------
   Selection colour
   --------------------------------------------------------------------------- */
::selection {
  background-color: rgba(157, 123, 255, 0.3);
  color: var(--color-text);
}

/* ---------------------------------------------------------------------------
   Scrollbar — subtle dark theme styling (Chromium)
   --------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-violet);
}

/* ---------------------------------------------------------------------------
   Skip link (accessibility)
   --------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-violet);
  color: var(--color-bg);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-card);
  font-weight: 600;
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-md);
}

/* ---------------------------------------------------------------------------
   Reduced motion — disable smooth scroll for users who prefer it
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}
