/*
 * INFUSION — website stylesheet.
 *
 * Hand-written, no framework, no build step, no web font, no external request.
 * The visual identity is the application's: OLED black ground, one near-black
 * panel, white type, and the single orange accent the app uses for selection
 * (InfusionTvAppearance.OledBlack #000000, Panel #161616, PanelBorder #3A3A3A,
 * SelectionOrange #FF7A00).
 *
 * Android-TV-first rules:
 *   - large type and a large minimum target size, because the page is read from
 *     a sofa;
 *   - `:focus` gets the SAME treatment as `:hover`, and a 3px accent outline, so
 *     a D-pad or keyboard user always sees where they are. No affordance is
 *     hover-only.
 *   - nothing depends on JavaScript. There is none.
 */

:root {
  --ink: #000000;
  --panel: #161616;
  --line: #3a3a3a;
  --text: #ffffff;
  --muted: #c8c8c8;
  --accent: #ff7a00;
  --radius: 12px;
  --measure: 68ch;
  --step: clamp(1.05rem, 0.55vw + 0.95rem, 1.35rem);
}

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

html {
  background: var(--ink);
  color-scheme: dark;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: var(--step);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------- skip link */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  z-index: 10;
}

.skip:focus {
  left: 0;
}

/* -------------------------------------------------------------------- layout */

.shell {
  width: min(100% - 3rem, 1180px);
  margin-inline: auto;
}

main {
  flex: 1 0 auto;
  padding-block: 2.5rem 4rem;
}

/* --------------------------------------------------------------------- focus */

a:focus,
button:focus,
summary:focus,
[tabindex]:focus {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* -------------------------------------------------------------------- header */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

.site-header .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 168px;
  height: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.6rem 0.85rem;
  min-height: 44px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--text);
  background: var(--panel);
  border-color: var(--line);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--accent);
  font-weight: 700;
}

.site-nav a[aria-current="page"]:hover,
.site-nav a[aria-current="page"]:focus {
  color: var(--ink);
  background: var(--accent);
}

/* ------------------------------------------------------------------ headings */

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.15;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 3.4vw + 1rem, 3.4rem);
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.4rem, 1.3vw + 1.1rem, 2rem);
  margin-top: 2.75rem;
}

h3 {
  font-size: clamp(1.1rem, 0.6vw + 1rem, 1.35rem);
  margin-top: 2rem;
}

h4,
h5,
h6 {
  font-size: 1.05em;
  margin-top: 1.75rem;
  color: var(--text);
}

p,
ul,
ol,
dl,
table,
pre {
  margin: 0 0 1.1rem;
  max-width: var(--measure);
}

li > ul,
li > ol {
  margin-block: 0.4rem;
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
}

a:hover,
a:focus {
  color: var(--text);
}

code,
pre {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

code {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  overflow-wrap: anywhere;
}

pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  max-width: min(100%, 90ch);
}

pre code {
  background: none;
  border: 0;
  padding: 0;
}

/* --------------------------------------------------------------- components */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2vw, 2rem);
  margin-block: 1.75rem;
  max-width: var(--measure);
}

.lead {
  font-size: clamp(1.2rem, 1vw + 1rem, 1.6rem);
  color: var(--text);
  max-width: 46ch;
}

.muted {
  color: var(--muted);
}

.hero-mark {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin-block: 0 1.5rem;
}

.button {
  display: inline-block;
  padding: 0.95rem 1.6rem;
  min-height: 56px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1em;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid var(--accent);
}

.button:hover,
.button:focus {
  background: var(--text);
  border-color: var(--text);
  color: var(--ink);
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
}

.button.secondary:hover,
.button.secondary:focus {
  background: var(--panel);
  color: var(--text);
  border-color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-block: 1.75rem;
}

/* Facts table: label/value pairs. */

.facts {
  display: grid;
  grid-template-columns: minmax(9rem, max-content) 1fr;
  gap: 0.6rem 1.5rem;
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: var(--measure);
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Feature list: cards, not columns of small print. */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  max-width: none;
}

.features li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.features strong {
  display: block;
  margin-bottom: 0.35rem;
}

.features p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95em;
}

/* Release list: one card per published alpha. */

.release-list {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  max-width: none;
}

.release-list > li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
}

.release-list h3 {
  margin-top: 0;
}

.release-list dl {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: 0.35rem 1.25rem;
  margin-block: 0.75rem 0;
  font-size: 0.95em;
}

.release-list dt {
  color: var(--muted);
}

.release-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Tables outside the generated documents (the privacy destinations table). */

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

th,
td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel);
}

/* Long generated documents (notices, security policy, licence). */

.document {
  max-width: 88ch;
}

.document table {
  border-collapse: collapse;
  width: 100%;
  max-width: 100%;
  font-size: 0.95em;
}

.document th,
.document td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
}

.document th {
  background: var(--panel);
}

.document h2 {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.35rem 1.25rem 0.35rem;
  margin-block: 1.5rem;
  max-width: var(--measure);
}

summary {
  cursor: pointer;
  padding-block: 0.85rem;
  font-weight: 700;
  border-radius: 6px;
}

details[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

details .document {
  max-width: 100%;
}

/* -------------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: var(--muted);
  font-size: 0.92em;
}

.site-footer .shell {
  padding-block: 1.75rem 2.25rem;
}

.site-footer p {
  max-width: var(--measure);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  display: inline-block;
  padding-block: 0.4rem;
}

/* ------------------------------------------------------------------- narrow */

@media (max-width: 40rem) {
  .shell {
    width: min(100% - 1.75rem, 1180px);
  }

  .brand-mark {
    width: 132px;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .facts dd {
    margin-bottom: 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
