/* Daybreak: shared foundations (fonts, inks, type, small parts). Used by the game, the privacy page and admin. */

@font-face { font-family: "Unbounded"; src: url("/fonts/unbounded.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* Inks are "r g b" triplets so they can take alpha: rgb(var(--ink) / .4). sky.js rewrites them through the day. */
  --sky: 242 101 58;
  --ink: 24 26 23;
  --ground: 24 26 23;
  --on-ground: 242 101 58;
  --paper: 243 231 216;
  --on-paper: 24 26 23;
  --d1: 255 243 176; --d2: 255 210 122; --d3: 255 166 204; --d4: 143 168 255; --rim: 255 90 42; --glow: 1;

  --display: "Unbounded", "Arial Black", "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --text: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --pad: clamp(16px, 4vw, 40px);
}

/* Every surface names its own two inks; components only ever use --bg and --fg. */
:root, .on-field { --bg: var(--sky); --fg: var(--ink); }
.on-ground { --bg: var(--ground); --fg: var(--on-ground); }
.on-paper { --bg: var(--paper); --fg: var(--on-paper); }
:root, .on-field, .on-ground, .on-paper, .ticket {
  /* The poster's hatching: thin diagonal rules of the surface's ink. */
  --hatch: repeating-linear-gradient(-58deg, rgb(var(--fg)) 0 1.5px, transparent 1.5px 6px);
  --hatch-fine: repeating-linear-gradient(-58deg, rgb(var(--fg)) 0 1px, transparent 1px 4px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: rgb(var(--sky));
  color: rgb(var(--ink));
  font: 400 17px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.on-ground, .on-paper, .on-field { background: rgb(var(--bg)); color: rgb(var(--fg)); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; }
[hidden] { display: none !important; }

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

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: rgb(var(--ink)); color: rgb(var(--sky)); font: 700 13px var(--mono); }
.skip:focus { top: 8px; }

/* Tiny monospace captions, the poster's small print. */
.cap { font: 500 11.5px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.cap b { font-weight: 800; }

.link { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
/* Underlined words are small; give them a full-size touch area without moving the text. */
.link, .cap a { position: relative; }
.link::after, .cap a::after { content: ""; position: absolute; inset: -14px -8px; }

/* Rectangular poster button and the round paper one. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px;
  border: 2px solid rgb(var(--fg)); border-radius: 2px;
  background: rgb(var(--fg)); color: rgb(var(--bg));
  font: 800 12.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  transition: transform .15s var(--ease);
}
.btn.ghost { background: transparent; color: rgb(var(--fg)); }
.btn:active { transform: translateY(2px); }
.btn[disabled] { opacity: .55; cursor: default; }

.round-btn {
  display: grid; place-items: center;
  width: 104px; height: 104px; border-radius: 50%; border: 0;
  background: rgb(var(--paper)); color: rgb(var(--on-paper));
  font: 800 13px/1.25 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; text-align: center;
  transition: transform .2s var(--ease);
}
.round-btn.small { width: 76px; height: 76px; font-size: 12px; }
.round-btn:hover { transform: scale(1.05); }
.round-btn:active { transform: scale(.96); }
.round-btn:focus-visible { outline-color: rgb(var(--paper)); outline-offset: 4px; border-radius: 50%; }

/* A divider band with a row of rings. */
.band {
  height: 30px;
  background-color: rgb(var(--ink));
  background-image: radial-gradient(circle at center, transparent 0 4px, rgb(var(--sky)) 4.2px 5.6px, transparent 6px);
  background-size: 24px 100%; background-position: center;
}
.ring-row {
  height: 14px; width: 100%;
  background-image: radial-gradient(circle at center, transparent 0 3.4px, rgb(var(--fg)) 3.6px 4.8px, transparent 5.2px);
  background-size: 20px 100%; background-position: center;
}

/* Marks: print textures, never colour alone. */
.tile {
  display: grid; place-items: center;
  border: 1.5px solid rgb(var(--fg) / .34); border-radius: 2px;
  color: rgb(var(--fg));
  font-family: var(--display); font-weight: 800; line-height: 1; text-transform: uppercase;
  user-select: none; -webkit-user-select: none;
}
.tile[data-state="typed"] { border: 2px solid rgb(var(--fg)); background: rgb(var(--paper)); color: rgb(var(--on-paper)); }
/* On dark skies the ink itself is cream, so a paper fill would read as "solid": keep typed tiles as bold outlines there. */
html[data-field="dark"] .tile[data-state="typed"] { background: transparent; color: rgb(var(--fg)); border-width: 2.5px; }
.tile[data-mark="g"] { background: rgb(var(--fg)); border: 2px solid rgb(var(--fg)); color: rgb(var(--bg)); }
.tile[data-mark="y"] {
  background: var(--hatch); border: 2px solid rgb(var(--fg));
  /* a halo of the surface colour keeps the letter clear of the rules */
  text-shadow: 0 0 0 rgb(var(--bg)), 2px 0 0 rgb(var(--bg)), -2px 0 0 rgb(var(--bg)), 0 2px 0 rgb(var(--bg)), 0 -2px 0 rgb(var(--bg)),
    1.5px 1.5px 0 rgb(var(--bg)), -1.5px 1.5px 0 rgb(var(--bg)), 1.5px -1.5px 0 rgb(var(--bg)), -1.5px -1.5px 0 rgb(var(--bg));
}
.tile[data-mark="b"] { border: 1.5px solid rgb(var(--fg) / .5); font-weight: 300; }

/* The sun-dome: soft bands of light with a hot rim. Size comes from --size (a length). */
.dome { position: relative; width: var(--size, 200px); aspect-ratio: 1; opacity: var(--glow); will-change: transform; animation: breathe 7s ease-in-out infinite; }
.dome::before, .dome::after { content: ""; position: absolute; border-radius: 50%; }
.dome::before {
  inset: -9%;
  background: radial-gradient(closest-side, rgb(var(--rim) / 0) 58%, rgb(var(--rim)) 78%, rgb(var(--rim) / .35) 90%, rgb(var(--rim) / 0) 100%);
  filter: blur(calc(var(--size, 200px) * .05));
}
.dome::after {
  inset: 5%;
  background: linear-gradient(180deg, rgb(var(--d1)) 0 26%, rgb(var(--d2)) 44%, rgb(var(--d3)) 64%, rgb(var(--d4)) 90%);
  filter: blur(calc(var(--size, 200px) * .04));
}
@keyframes breathe { 50% { transform: scale(1.035); } }
/* transform only: the blurred layers are rasterised once and then just scaled by the compositor */
@keyframes pulse { 50% { transform: scale(1.14); } }
@keyframes bloom { 0% { transform: scale(1); } 30% { transform: scale(1.5); } 100% { transform: scale(1); } }
[data-orb="checking"] .dome { animation: pulse .8s ease-in-out infinite; }
[data-orb="bloom"] .dome { animation: bloom 1.1s var(--ease) 1; }
[data-orb="settled"] .dome { animation: none; }

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