:root {
  --color-bg: #141414;
  --color-bg-elevated: #1e1e1e;
  --color-surface: #252525;
  --color-border: rgba(255, 255, 255, 0.12);
  --color-border-strong: rgba(255, 255, 255, 0.22);
  --color-text: #f2f2f2;
  /* 0.72 keeps this ~5.5:1 on the darkest surface (#252525) — WCAG AA for
     body text. It was 0.55 (~3.6:1), which failed. */
  --color-text-muted: rgba(255, 255, 255, 0.72);
  --color-accent: #0095ff;
  --color-accent-hover: #1aa3ff;
  /* For solid fills that carry white label text: white on #1668c4 is ~5.1:1,
     white on --color-accent (#0095ff) is only ~2.6:1 and fails. */
  --color-accent-strong: #1668c4;
  --color-success: #1ee388;
  --color-danger: #ff5c5c;
  --color-warning: #f1c232;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --font-sans: "DM Sans", system-ui, -apple-system, Tahoma, Geneva, Verdana,
    sans-serif;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

html {
  scroll-behavior: smooth;
}

button {
  color: white;
  font-family: inherit;
}

button,
a,
input,
summary {
  transition: color 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, transform 0.2s ease;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Respect the OS "reduce motion" setting: kill the smooth scroll, the
   spinners, and the hover/translate transitions. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background-color: var(--color-bg-elevated);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

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

/* Keyboard skip link — off-screen until focused. */
.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 1000;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-strong);
  color: #fff;
  font-weight: 700;
  transition: top 0.15s ease;
}

.skip-link:focus-visible {
  top: 8px;
}

.legal__pending {
  font-size: 15px;
  margin-top: 5px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.legal__pending span {
  font-weight: 400;
  opacity: 0.8;
}

.legal__manage {
  margin-top: 8px;
  display: inline-block;
  background: transparent;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

.legal__manage:hover {
  border-color: var(--color-text);
}

.trademark-note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ─── Cookie consent banner (injected by consent.js) ──────────────────── */
#cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 1.25rem;
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border-strong);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4);
}

.cookie-consent__text {
  flex: 1 1 20rem;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text);
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.cookie-consent__btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border-strong);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.cookie-consent__btn:hover {
  border-color: var(--color-text);
}

.cookie-consent__btn--accept {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
  color: #fff;
}

.cookie-consent__btn--accept:hover {
  background: #1f7ad6;
}

/* ─── Shared modal dialog ─────────────────────────────────────────────── */
.app-dialog {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
  padding: 0;
  width: min(28rem, 92vw);
  max-width: 92vw;
  /* The global `* { margin: 0 }` reset kills a <dialog>'s default
     `margin: auto`, which is what centres it when opened with showModal().
     Put it back, and pin it dead-centre as a belt-and-braces fallback. */
  margin: auto;
  position: fixed;
  inset: 0;
}

.app-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.app-dialog__form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem 1.35rem 1.35rem;
}

.app-dialog__title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.15rem;
}

.app-dialog__text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.app-dialog__label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.app-dialog input[type="text"] {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.app-dialog__status {
  min-height: 1.1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.app-dialog__status[data-kind="error"] {
  color: var(--color-danger);
}

.app-dialog__result {
  font-size: 0.88rem;
  line-height: 1.6;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.app-dialog__result a {
  color: var(--color-accent);
  text-decoration: underline;
}

.app-dialog__result code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.95em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.app-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.app-dialog__btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border-strong);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.app-dialog__btn:hover {
  border-color: var(--color-text);
}

.app-dialog__btn--primary {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
  color: #fff;
}

.app-dialog__btn--primary:hover {
  background: #1f7ad6;
}

header,
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.site-header__brand:hover {
  color: var(--color-accent);
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-header__nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.site-header__nav a:hover {
  color: var(--color-text);
}

.site-header__auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sign-in-button {
  font-size: 15px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border-strong);
  background-color: transparent;
  cursor: pointer;
}

.sign-in-button:hover {
  border-color: var(--color-text);
}

.sign-in-button--solid {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.sign-in-button--solid:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.sign-out-button {
  font-size: 15px;
  font-weight: 600;
  background-color: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
}

.sign-out-button:hover {
  color: var(--color-danger);
}

a {
  text-decoration: none;
  color: white;
  font-weight: bold;
  width: fit-content;
  height: fit-content;
}

footer {
  width: 100%;
  height: fit-content;
  background-color: #202020;
  border-top: solid 1.75px white;
  margin-top: 100px;
  padding: 15px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
}

footer > .legal > a > p {
  margin-top: 5px;
  width: fit-content;
  font-size: 15px;
}

footer > .legal > .copyright-more > a > div {
  outline: none;
  margin-top: 60px;
  width: fit-content;
  padding: 10px;
  border: none;
  border-radius: 5px;
  background-color: #424242;
  font-weight: 500;
}

footer > .extra {
  font-weight: bold;
  margin-top: 80px;
  width: 50%;
  font-size: 17px;
}
