/*
 * RankingTiger website. Plain CSS, dark only, no web fonts, no scripts.
 * Colours follow src/theme/colors.ts (the app's brand tokens). Mobile first.
 * Text contrast: warm white and muted text pass WCAG AA on every surface used here.
 */

:root {
  color-scheme: dark;
  --background: #0a0a0b;
  --surface: #1e232c;
  --surface-raised: #283039;
  --surface-pressed: #323a46;
  --border: #363e4b;
  --border-strong: #7a8496;
  --primary: #ff8a1f;
  --primary-start: #ffaa3b;
  --primary-end: #f26a0f;
  --on-primary: #0a0a0b;
  --accent: #f5b041;
  --text: #fff6e8;
  --text-muted: #a9a196;
  --focus: #ffaa3b;
  --review-bg: rgba(245, 176, 65, 0.18);
  --card-start: #262d38;
  --card-end: #181c23;
  --glow-soft: rgba(255, 138, 31, 0.3);
  --radius: 14px;
  --gutter: 16px;
  --max-width: 1080px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-underline-offset: 0.2em;
}

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

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

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 6vw, 3rem);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

li + li {
  margin-top: 0.35em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--surface);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* Layout */

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.narrow {
  max-width: 760px;
}

.section {
  padding: 48px 0;
}

/* Skip link: hidden until it takes keyboard focus */

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* Header and footer */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 10, 11, 0.94);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

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

.nav-list,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li + li,
.footer-links li + li {
  margin-top: 0;
}

.nav-list a {
  display: inline-block;
  padding: 6px 2px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.site-footer {
  margin-top: 56px;
  padding: 32px 0 40px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-footer a {
  color: var(--text);
  text-decoration-color: var(--primary);
}

.footer-links {
  margin-bottom: 20px;
}

.site-footer address {
  font-style: normal;
  line-height: 1.7;
  margin-bottom: 16px;
}

.fine {
  margin: 0 0 8px;
  font-size: 0.875rem;
}

/* Hero and sections */

.hero {
  padding: 56px 0 48px;
  background: radial-gradient(60% 70% at 85% 0%, var(--glow-soft), transparent 70%), var(--background);
}

.hero-inner {
  display: grid;
  gap: 28px;
  align-items: center;
}

.hero-logo {
  width: 160px;
  margin: 0 auto;
  border-radius: 50%;
}

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 60ch;
  font-size: 1.15rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1.5rem 0 1rem;
}

.hint {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: var(--on-primary);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  color: var(--on-primary);
  filter: brightness(1.06);
}

.button-secondary {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  color: var(--text);
}

.button-secondary:hover {
  background: var(--surface-pressed);
  color: var(--text);
}

/* TODO placeholders: a small amber tag, removed when the real link is in */

.todo-tag {
  display: inline-block;
  vertical-align: middle;
  padding: 0.3em 0.5em;
  border-radius: 4px;
  background: var(--accent);
  color: var(--on-primary);
  font-size: 0.7em;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
}

.card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card-start), var(--card-end));
}

.card h3 {
  color: var(--text);
}

.card p:last-child {
  margin-bottom: 0;
}

.cards {
  display: grid;
  gap: 16px;
}

.cta-band {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.cta-band .actions {
  justify-content: center;
  margin: 0;
}

.note {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Tables (plans and legal pages). A wrapper scrolls inside itself if a table is too wide. */

.table-wrap {
  width: 100%;
  margin: 0 0 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

caption {
  padding: 12px 14px 0;
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  caption-side: top;
}

th,
td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

thead th {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

th[scope="row"] {
  color: var(--text);
  font-weight: 700;
}

.align-right {
  text-align: right;
}

.align-center {
  text-align: center;
}

/* Legal pages */

.section.legal {
  padding-top: 40px;
}

.draft-banner {
  margin: 0 0 24px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.legal-text h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
}

.legal-text h2 {
  margin-top: 2.25rem;
  font-size: 1.4rem;
  scroll-margin-top: 90px;
}

.legal-text h3 {
  margin-top: 1.5rem;
  font-size: 1.1rem;
}

.legal-text blockquote {
  margin: 0 0 1.5rem;
  padding: 12px 16px;
  border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0;
  background: var(--surface);
}

.legal-text blockquote p {
  margin: 0;
}

.legal-text blockquote p + p {
  margin-top: 0.5rem;
}

/* Review marks from the drafts ([CONFIRM: ...] and similar). Subtle, but easy to find. */

mark.review {
  padding: 0 0.25em;
  border-radius: 4px;
  background: var(--review-bg);
  color: var(--accent);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Wider screens */

@media (min-width: 720px) {
  .section {
    padding: 72px 0;
  }

  .section.legal {
    padding-top: 48px;
  }

  .hero {
    padding: 88px 0 80px;
  }

  .hero-logo {
    width: 300px;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: 1.4fr 1fr;
  }

  .hero-logo {
    width: 340px;
    margin: 0;
    justify-self: end;
  }
}
