/* ------------------------------------------------------------
   Design tokens
   All colors live here as CSS variables, so the dark theme only
   has to redefine them once.
   ------------------------------------------------------------ */
:root {
  --bg: #ffffff;
  --ink: #1c1d1f;      /* letters and main text */
  --muted: #6f7177;    /* secondary text, 4.9:1 contrast on white */
  --signal: #2f5fd0;   /* the line, and the letter outlines while they form */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", "Segoe UI", Arial, sans-serif;
}

/* Follow the visitor's system setting for light or dark mode. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --ink: #f2f2f4;
    --muted: #8d9096;
    --signal: #7096ff;
  }
}

/* ------------------------------------------------------------
   Page
   ------------------------------------------------------------ */
* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* One full-height screen with the content centred in both directions. */
.stage {
  min-height: 100vh;
  min-height: 100svh;   /* newer browsers: ignores the mobile address bar */
  display: grid;
  place-items: center;
  padding: 24px 16px;
  text-align: center;
}

.welcome {
  width: 100%;
  max-width: 760px;
}

.title { line-height: 0; }

/* The word is a button so it can replay; strip the default button look. */
.replay {
  display: block;
  width: min(84vw, 600px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.replay:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 10px;
  border-radius: 12px;
}

/* ------------------------------------------------------------
   The SVG word
   The viewBox is in font units (2048 per em), so the drawing
   scales with the button width. vector-effect keeps the stroke
   1.5 px wide at any size.
   ------------------------------------------------------------ */
.word {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.line {
  fill: none;
  stroke: var(--signal);
  stroke-width: 1.5px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.letter {
  fill: var(--ink);
  fill-opacity: 0;
  stroke: var(--signal);
  stroke-width: 1.5px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* ------------------------------------------------------------
   Text under the word
   Hidden at first; welcome.js adds .done when the word settles.
   ------------------------------------------------------------ */
.meta {
  margin-top: clamp(28px, 5vw, 40px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.done .meta {
  opacity: 1;
  transform: none;
}

.domain {
  font-size: clamp(19px, 2.6vw, 22px);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.note {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

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