/*
 * Neon Shift website: tokens, fonts, resets and the few shared building blocks (container,
 * eyebrow, card, button, form field). Dark only, in the game's palette (docs/design.md).
 * Components and pages use only these tokens.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
}

:root {
  color-scheme: dark;

  /* The game's colours (flutter-app/lib/game/palette.dart); solid tokens are the game's
     translucent whites over bg */
  --bg: #07060f;
  --bg-top: #120b2b;
  --arena: #0c0a1c;
  --surface: #16151d;
  --surface-2: #1e1d26;
  --ink: #edebff;
  --muted: #918f9f;
  --primary: #00f0ff;
  --primary-hover: #26f2ff;
  --primary-text: #00f0ff;
  --on-primary: #07060f;
  --chip: #1e1d26;
  --good: #b6ff3b;
  --bad: #ff3b5c;
  --line: #25242c;
  --track: #3a3942;
  --grid: rgb(255 255 255 / 8%);
  --shadow: 0 0 30px rgb(0 240 255 / 12%);
  --shadow-primary: 0 0 24px rgb(0 240 255 / 55%);

  /* The snake's three colours */
  --cyan: #00f0ff;
  --magenta: #ff2bd6;
  --lime: #b6ff3b;

  /* Prism mode: the rainbow the snake runs through (palette.dart prismColor, head to tail) */
  --prism-1: #ff2626;
  --prism-2: #ff8126;
  --prism-3: #ffdb26;
  --prism-4: #93ff26;
  --prism-5: #26ff93;
  --prism-6: #26c9ff;
  --prism-7: #2626ff;

  --display: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --text: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --radius-card: 18px;
  --radius-button: 18px;
  --radius-tile: 14px;
  --radius-arena: 14px;

  --gutter: clamp(16px, 5vw, 40px);
  --column: 1120px;
  --focus-ring: 0 0 0 3px var(--bg), 0 0 0 5px var(--primary);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* The game's screen: bg-top fading into bg */
  background: linear-gradient(var(--bg-top), var(--bg) 640px) no-repeat, var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--text);
  overflow-x: clip;
}

main {
  flex: 1;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary-text);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 6px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Layout */

.container {
  width: min(100% - 2 * var(--gutter), var(--column));
  margin-inline: auto;
}

/* The game's small spaced capitals (the labels over the scores); --tone recolours it */

.eyebrow {
  --tone: var(--primary-text);
  font: 700 12px/1.4 var(--text);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tone);
}

.eyebrow--magenta {
  --tone: var(--magenta);
}

.eyebrow--lime {
  --tone: var(--lime);
}

/* Glowing type, as the game's NeonText: the text in its colour with a halo of it */

.glow {
  text-shadow:
    0 0 0.3em color-mix(in srgb, currentColor 90%, transparent),
    0 0 0.9em color-mix(in srgb, currentColor 60%, transparent);
}

/* Cards: the game's stat tiles (white 6% with a white 12% outline) */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

/* Buttons: the game's NeonButton, filled or outlined, in capitals with a glow */

.button {
  --tone: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-button);
  font: 800 15px/1.2 var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 80ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.button:active {
  transform: scale(0.97);
}

.button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.button--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-primary);
}

.button--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--on-primary);
}

/* Outlined: in --tone (the game's HOME button is the dim one, DAILY SHIFT the lime one) */

.button--secondary,
.button--lime,
.button--danger {
  background: transparent;
  border-color: var(--tone);
  color: var(--tone);
  box-shadow: 0 0 24px color-mix(in srgb, var(--tone) 25%, transparent);
}

.button--secondary {
  --tone: var(--muted);
}

.button--lime {
  --tone: var(--lime);
}

.button--danger {
  --tone: var(--bad);
}

.button--secondary:hover,
.button--lime:hover,
.button--danger:hover {
  background: color-mix(in srgb, var(--tone) 10%, transparent);
  color: var(--tone);
}

.button--secondary:hover {
  --tone: var(--ink);
}

.button__icon {
  width: 20px;
  height: 20px;
}

/* Form fields (contact form, new password) */

.field {
  display: grid;
  gap: 6px;
}

.field__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field__label {
  font: 700 14px/1.4 var(--text);
}

.field__input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
}

.field__input:hover {
  border-color: var(--track);
}

.field__input:focus-visible {
  border-color: var(--primary);
  border-radius: 12px;
}

.field__input[aria-invalid] {
  border-color: var(--bad);
}

.field__hint,
.field__counter {
  font-size: 13px;
  color: var(--muted);
}

.field__counter {
  font-variant-numeric: tabular-nums;
}

.field__error {
  font-size: 14px;
  color: var(--bad);
}

.form-status {
  font-size: 15px;
  color: var(--muted);
}

.form-status:empty {
  display: none;
}

.form-status[data-tone='good'] {
  color: var(--good);
}

.form-status[data-tone='bad'] {
  color: var(--bad);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
