/* ==========================================================================
   Quantum Dice Roller — quantumdiceroller.com
   Vanilla CSS, no framework, no build step.

   The look: Tron-style wireframes on deep space-ink. Every visual is drawn
   with CSS or inline SVG — there are no image files on this site, so it stays
   sharp at any resolution and loads in one request.

   Sections are ordered: tokens -> base -> layout -> components -> pages.
   Add new pages by reusing the components; avoid one-off styles.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette. Cyan is the primary "energy" colour; violet is the secondary
     used sparingly so the cyan keeps its impact. */
  --ink:          #05070C;
  --ink-raised:   #0A0F18;
  --ink-line:     #16203180;

  --cyan:         #3FE0FF;
  --cyan-dim:     #1B7F9B;
  --violet:       #B14CFF;
  --amber:        #FFC24C;

  --text:         #E8F3FF;
  --text-muted:   #8FA3B8;
  --text-faint:   #5C6B7D;

  /* Glow strengths, kept as tokens so every glowing thing agrees. */
  --glow-sm: 0 0 6px rgba(63, 224, 255, 0.55);
  --glow-md: 0 0 18px rgba(63, 224, 255, 0.35);
  --glow-lg: 0 0 48px rgba(63, 224, 255, 0.22);

  /* Orbitron is self-hosted (38KB) — no external font request. It's a display
     face only; body copy stays on the system stack for readability. */
  --font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-title: "Orbitron", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --measure: 68ch;      /* readable line length for prose */
  --wrap: 1120px;       /* page max width */
  --radius: 14px;
}

/* --------------------------------------------------------------------------
   1b. Fonts
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Orbitron";
  src: url("../fonts/Orbitron.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;         /* text stays visible while the face loads */
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;           /* the grid horizon overflows by design */
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 600; }

a { color: var(--cyan); text-decoration-color: rgba(63, 224, 255, 0.35); }
a:hover { text-shadow: var(--glow-sm); }

/* Visible focus ring — the neon palette makes the browser default hard to see. */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(63, 224, 255, 0.25); color: #fff; }

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.wrap {
  width: min(100% - 3rem, var(--wrap));
  margin-inline: auto;
}

.section { padding: clamp(3.5rem, 9vw, 7rem) 0; }
.section + .section { border-top: 1px solid var(--ink-line); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cyan);
  color: var(--ink);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   4. Type
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cyan);
  text-shadow: var(--glow-sm);
  margin: 0 0 1rem;
}

/* The signature heading: neon outline + bloom. */
.neon {
  font-family: var(--font-title);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2rem, 6vw, 4rem);
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.6),
    0 0 22px rgba(63, 224, 255, 0.55),
    0 0 60px rgba(63, 224, 255, 0.28);
}

.h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.h3 { font-size: 1.12rem; letter-spacing: 0.01em; }

.lede {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--text-muted);
  max-width: var(--measure);
}

.muted { color: var(--text-muted); }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.1em; }
.prose strong { color: var(--text); }

/* --------------------------------------------------------------------------
   5. The grid horizon
   Two stacked planes in 3D perspective, scrolling toward the viewer. This is
   the whole Tron backdrop — no images involved.
   -------------------------------------------------------------------------- */
.horizon {
  position: absolute;
  inset: auto 0 0;
  height: 46vh;
  overflow: hidden;
  perspective: 260px;
  perspective-origin: 50% 0%;
  pointer-events: none;
  mask-image: linear-gradient(to top, #000 20%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, #000 20%, transparent 100%);
}

.horizon::before {
  content: "";
  position: absolute;
  inset: -60% -50% -100%;
  background-image:
    linear-gradient(to right, rgba(63, 224, 255, 0.32) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(63, 224, 255, 0.32) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: rotateX(72deg);
  transform-origin: 50% 0%;
  animation: grid-run 5.5s linear infinite;
}

@keyframes grid-run {
  to { background-position: 0 46px; }
}

/* A soft cyan bloom sitting on the horizon line. */
.horizon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 70vw;
  height: 1px;
  transform: translateX(-50%);
  box-shadow: 0 0 90px 26px rgba(63, 224, 255, 0.18);
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-items: center;
  padding: 6rem 0 4rem;
  isolation: isolate;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }        /* die leads on narrow screens */
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   7. The wireframe d20
   -------------------------------------------------------------------------- */
.hero-art { display: grid; place-items: center; }

/* The app mark: neon d20 image with the wordmark set beneath it. */
.mark { margin: 0; display: grid; justify-items: center; }

.mark-img {
  width: min(100%, 400px);
  height: auto;

  /* The source art is a square on a near-black navy vignette. Three things
     dissolve that square edge:
       1. screen blending drops the darkest pixels into the page background,
       2. the radial mask fades the outer ~25% to nothing, and
       3. border-radius is the fallback if masks aren't supported.
     The mask stays fully opaque out to 70% so the die's left and right
     vertices — which sit close to the frame edge — are never clipped. */
  mix-blend-mode: screen;
  border-radius: 22%;
  -webkit-mask-image: radial-gradient(closest-side,
      rgba(0,0,0,1) 70%, rgba(0,0,0,0.45) 86%, rgba(0,0,0,0) 100%);
  mask-image: radial-gradient(closest-side,
      rgba(0,0,0,1) 70%, rgba(0,0,0,0.45) 86%, rgba(0,0,0,0) 100%);

  /* drop-shadow follows the masked alpha, so the cyan bloom traces the soft
     edge rather than a hard box. */
  filter: drop-shadow(0 0 30px rgba(63, 224, 255, 0.45));
  animation: d20-float 7s ease-in-out infinite;
}

.d20 {
  width: min(100%, 380px);
  height: auto;
  filter: drop-shadow(0 0 12px rgba(63, 224, 255, 0.45));
  animation: d20-float 7s ease-in-out infinite;
}

.d20 .edge {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.6;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.d20 .edge-inner { stroke: var(--violet); opacity: 0.75; }

.d20 .face { fill: rgba(63, 224, 255, 0.05); }

.d20 .numeral {
  fill: #fff;
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 600;
  text-anchor: middle;
  letter-spacing: 0.06em;
}

/* Traces the outline like a charging circuit. */
.d20 .sweep {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 40 560;
  animation: sweep 4.5s linear infinite;
}

@keyframes sweep { to { stroke-dashoffset: -600; } }

@keyframes d20-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(1.5deg); }
}

/* --------------------------------------------------------------------------
   7b. Quantum motes
   Drifting points of light. Purely atmospheric — hidden from assistive tech.
   -------------------------------------------------------------------------- */
.motes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.mote {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px 3px rgba(63, 224, 255, 0.55);
  animation: mote-pulse 3.2s ease-in-out infinite;
}

@keyframes mote-pulse {
  0%, 100% { opacity: 0.15; transform: translateY(0) scale(0.8); }
  50%      { opacity: 0.9;  transform: translateY(-12px) scale(1.15); }
}

/* --------------------------------------------------------------------------
   7c. Qubit — the quantum familiar
   Carried over from the original teaser: a hovering observer with orbiting
   electrons and one glowing eye. Sits out of the way on wide screens only.
   -------------------------------------------------------------------------- */
.qubit {
  position: fixed;
  left: 1.6rem;
  bottom: 1.6rem;
  z-index: 20;
  display: none;
  align-items: flex-end;
  gap: 0.7rem;
  pointer-events: none;
  animation: d20-float 4.5s ease-in-out infinite;
}

@media (min-width: 1040px) { .qubit { display: flex; } }

.qubit svg { filter: drop-shadow(0 0 18px rgba(63, 224, 255, 0.55)); }

.qubit-say {
  margin-bottom: 0.75rem;
  border: 1px solid rgba(63, 224, 255, 0.28);
  background: rgba(4, 16, 31, 0.82);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(63, 224, 255, 0.8);
}

.orbit-a { transform-origin: 36px 36px; animation: spin 6s linear infinite; }
.orbit-b { transform-origin: 36px 36px; animation: spin 4s linear infinite reverse; }

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

/* --------------------------------------------------------------------------
   7d. Dice band
   -------------------------------------------------------------------------- */
.dice-band {
  position: relative;
  padding: 0 0 clamp(2rem, 6vw, 4rem);
  text-align: center;
}

.dice-band img {
  width: min(100%, 1000px);
  height: auto;
  filter: drop-shadow(0 0 40px rgba(63, 224, 255, 0.35));
}

/* --------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s;
}

.btn-primary {
  background: linear-gradient(180deg, rgba(63, 224, 255, 0.18), rgba(63, 224, 255, 0.06));
  border-color: rgba(63, 224, 255, 0.55);
  color: var(--cyan);
  box-shadow: var(--glow-md), inset 0 0 22px rgba(63, 224, 255, 0.09);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--glow-lg), var(--glow-md); }

.btn-ghost { border-color: var(--ink-line); color: var(--text-muted); }
.btn-ghost:hover { border-color: rgba(63, 224, 255, 0.4); color: var(--text); }

/* Status chip for the pre-launch state. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(255, 194, 76, 0.4);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}
.chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.chip-sm { padding: 0.22rem 0.6rem; font-size: 0.62rem; letter-spacing: 0.14em; }

/* --------------------------------------------------------------------------
   9. Cards
   -------------------------------------------------------------------------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.card {
  position: relative;
  padding: 1.6rem;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--ink-raised), transparent);
  transition: border-color 0.3s, transform 0.3s;
}
.card:hover { border-color: rgba(63, 224, 255, 0.35); transform: translateY(-3px); }

/* Corner ticks — cheap way to make a plain box feel like an instrument panel. */
.card::before, .card::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--cyan);
  opacity: 0.5;
}
.card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: var(--radius) 0 0 0; }
.card::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 var(--radius) 0; }

.card .tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan-dim);
}

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

/* An unreleased source: same card, held back visually so it doesn't read as
   available. Amber (the "not yet" colour) replaces cyan on the ticks. */
.card-soon { border-style: dashed; }
.card-soon::before, .card-soon::after { border-color: var(--amber); }
.card-soon:hover { border-color: rgba(255, 194, 76, 0.45); }
.tag-soon { color: var(--amber); }

/* --------------------------------------------------------------------------
   10. Nav & footer
   -------------------------------------------------------------------------- */
.nav {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}
.nav-logo svg { filter: drop-shadow(var(--glow-sm)); }

.nav-links { display: flex; gap: 1.4rem; font-size: 0.9rem; }
.nav-links a { color: var(--text-muted); text-decoration: none; }
.nav-links a:hover { color: var(--cyan); }

.footer {
  border-top: 1px solid var(--ink-line);
  padding: 2.5rem 0;
  font-size: 0.88rem;
  color: var(--text-faint);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
.footer a { color: var(--text-muted); text-decoration: none; }
.footer a:hover { color: var(--cyan); }

/* --------------------------------------------------------------------------
   11. Legal pages
   -------------------------------------------------------------------------- */
.page-head { padding: 4.5rem 0 2rem; position: relative; }

.legal h2 {
  font-size: 1.25rem;
  color: var(--cyan);
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--ink-line);
}
.legal h2:first-of-type { margin-top: 1.5rem; }

.legal .stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  border: 1px solid var(--ink-line);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  margin-bottom: 1.5rem;
}

.legal ul { padding-left: 1.1rem; color: var(--text-muted); }
.legal li { margin-bottom: 0.4rem; }

/* Callout for the "we collect nothing" summary. */
.callout {
  border: 1px solid rgba(63, 224, 255, 0.3);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: rgba(63, 224, 255, 0.04);
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0 2rem;
}
.callout p { margin: 0; }

/* --------------------------------------------------------------------------
   12. Motion preferences
   Honour reduced-motion: the site is heavy on ambient animation, and none of
   it carries meaning, so it can all stop.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
