@layer reset, tokens, base, layout, components, motion, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
}

@layer base {
  html {
    overflow-x: hidden;
    scrollbar-color: var(--border-gold-mid) var(--black);
  }

  /* Smooth anchor scrolling only for users who haven't asked for less motion */
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }

  body {
    background: var(--black);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
  }

  h1, h2, h3, h4 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1.3;
    text-wrap: balance;
  }

  p { text-wrap: pretty; }

  ::selection {
    background: var(--border-gold-mid);
    color: var(--text);
  }

  a:focus-visible,
  button:focus-visible,
  [tabindex]:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: 3px;
  }

  .skip-link {
    position: fixed;
    top: -100%;
    left: 50%;
    translate: -50% 0;
    z-index: 200;
    background: var(--black);
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--border-gold-strong);
    border-radius: 2px;
    text-decoration: none;
    transition: top 0.2s;
  }

  .skip-link:focus-visible { top: 0.5rem; }
}

@layer layout {
  /* ── The light layer ──────────────────────────
     The WebGL canvas and its scrim sit in negative z-space: painted above
     the body background but beneath all flowing content. No wrappers needed. */
  #mark-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: -2;
    opacity: 0;
    pointer-events: none;
    /* The footer must read as solid ground, not floating light */
    mask-image: linear-gradient(to bottom, black 0%, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 88%, transparent 100%);
    transition: opacity 0.7s ease;
  }

  html.gl-live #mark-canvas { opacity: 1; }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse 120% 90% at 50% 40%,
      transparent 0%,
      rgba(0, 0, 0, 0.35) 60%,
      rgba(0, 0, 0, 0.72) 100%);
  }

  section {
    padding: 6rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    scroll-margin-top: 3.5rem;
  }

  .section-title {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
  }

  .section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    margin: 1rem auto 0;
    background: var(--section-accent, var(--gold));
  }

  .divider {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-gold-mid), transparent);
  }

}
