:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #5f6b7a;
  --line: #d9e0e8;
  --paper: #ffffff;
  --soft: #f4f7fa;
  --navy: #0b1f3a;
  --blue: #155eef;
  --blue-dark: #0b45b5;
  --green: #067647;
  --amber: #9a6700;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: var(--blue-dark);
}

.public-header,
.public-footer,
.public-main {
  width: calc(100% - 2rem);
  max-width: 72rem;
  width: min(72rem, calc(100% - 2rem));
  margin-inline: auto;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  border-bottom: 1px solid var(--line);
}

.public-brand {
  display: inline-flex;
  align-items: center;
  color: var(--navy);
  text-decoration: none;
}

/* Spacing by margin, not by flexbox `gap`: these pages are now opened inside
   Downloader's browser on Fire OS 5, where `gap` in a flex container does
   nothing and the header would collapse into one run of letters. */
.public-brand span {
  margin-right: 0.7rem;
}

.public-brand span {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  align-items: center;
  justify-items: center;
  place-items: center;
  border-radius: 0.55rem;
  color: white;
  background: var(--navy);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.public-header nav,
.public-footer div:last-child {
  display: flex;
  flex-wrap: wrap;
}

.public-header nav a,
.public-footer a {
  margin-left: 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.public-header nav a:first-child {
  margin-left: 0;
}

.public-main {
  padding-block: 4.5rem;
}

.public-hero {
  max-width: 54rem;
  padding-block: 2rem 5rem;
}

.public-kicker {
  margin: 0 0 0.65rem;
  color: var(--blue-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 48rem;
  margin-bottom: 1.2rem;
  color: var(--navy);
  font-size: 2.6rem;
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

h2 {
  color: var(--navy);
  font-size: 1.7rem;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.025em;
}

.public-lead {
  max-width: 46rem;
  color: var(--muted);
  font-size: 1.14rem;
  line-height: 1.7;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}

.trust-row span {
  margin: 0 0.55rem 0.55rem 0;
}

.trust-row span,
.status {
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.public-section {
  padding-block: 3.5rem;
  border-top: 1px solid var(--line);
}

.section-title,
.app-hero,
.public-callout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  grid-gap: 2rem;
  gap: 2rem;
}

.section-title > p {
  max-width: 28rem;
  color: var(--muted);
  line-height: 1.6;
}

.public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  grid-gap: 1rem;
  gap: 1rem;
  margin-top: 1.8rem;
}

.public-card {
  min-height: 13rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--paper);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-live,
.status-pilot {
  color: var(--green);
}

.status-paused,
.status-draft {
  color: var(--amber);
}

.public-card h3 {
  margin-bottom: 0.55rem;
  color: var(--navy);
}

.public-card p {
  min-height: 2.7rem;
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.text-link {
  font-weight: 750;
  text-decoration: none;
}

.public-callout {
  margin-top: 3.5rem;
  padding: 2rem;
  border-radius: 1rem;
  color: white;
  background: var(--navy);
}

.public-callout h2,
.public-callout a {
  color: white;
}

.public-callout > p {
  max-width: 33rem;
  margin-bottom: 0;
  color: #d9e6f5;
  line-height: 1.65;
}

.app-hero {
  align-items: center;
  padding-bottom: 3rem;
}

.app-hero h1 {
  font-size: 2.3rem;
  font-size: clamp(2rem, 6vw, 3.8rem);
}

/* Landing pages are opened from the television storefront, so this block uses
   margins rather than flex gap for the sake of older WebViews. */
.app-hero-main {
  display: flex;
  align-items: center;
}

.app-icon {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  margin-right: 1.5rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  object-fit: contain;
}

.app-note {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--blue);
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.verification-panel,
.legal-page {
  padding-block: 3rem;
  border-top: 1px solid var(--line);
}

.metadata-grid {
  display: grid;
  /* One column per entry: the cell separators are drawn by the container
     background, so a half-empty row would read as a grey hole in the panel. */
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 1px;
  gap: 1px;
  overflow: hidden;
  margin: 1.5rem 0 0;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--line);
}

.metadata-grid > div {
  min-width: 0;
  padding: 1rem;
  background: var(--paper);
}

.metadata-grid dt {
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metadata-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
}

.verification-note {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.download-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.download-box > * {
  margin-right: 1rem;
}

.download-box p {
  max-width: 34rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.download-button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.1rem;
  border-radius: 0.65rem;
  color: white;
  background: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.download-button:hover {
  background: var(--blue-dark);
}

.download-button.disabled {
  background: var(--muted);
  cursor: not-allowed;
}

/* The catalogue's one pointer towards the computer programs, and the setup a
   customer types into them. Light on purpose: the dark band at the bottom of
   the page is the safety notice, and two of those compete with each other. */
.public-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-gap: 2rem;
  gap: 2rem;
  margin-top: 3.5rem;
  padding: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--soft);
}

.public-invite p:last-of-type {
  max-width: 34rem;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.public-invite .download-button {
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   The PIN gate.

   This is the one component a customer meets on a television, inside
   Downloader's browser, holding a remote. So it is built for that: a dark panel
   that reads at three metres, keys a D-pad can walk, and focus you cannot miss.
   The same panel on a phone is simply a large, obvious keypad.

   Compatibility floor is the WebView on Fire OS 5 (Chromium 59): no `clamp()`,
   no flexbox `gap`, and `:focus-visible` never shares a selector list with
   `:focus` — an unknown pseudo-class would void the whole rule and leave an old
   Fire Stick with no visible selection at all.
   --------------------------------------------------------------------------- */
.unlock {
  max-width: 30rem;
  margin: 2rem 0 0;
  padding: 1.8rem;
  border: 1px solid #22345a;
  border-radius: 1.1rem;
  background: #0d1729;
  color: #f2f6ff;
  text-align: center;
}

.unlock-intro {
  margin-bottom: 1.4rem;
}

.unlock-kicker {
  margin: 0 0 0.5rem;
  color: #7fa6ff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.unlock-title {
  margin: 0 0 0.4rem;
  color: #ffffff;
  font-size: 1.7rem;
  line-height: 1.15;
}

.unlock-sub {
  margin: 0;
  color: #a9bcdc;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* One mark per digit typed: on a television the field text is too small to
   read, and this says "it heard me" from across the room. */
.unlock-dots {
  min-height: 1.4rem;
  margin: 0 0 1.1rem;
}

.unlock-dot {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  margin: 0 0.22rem;
  border-radius: 50%;
  background: #ffd24a;
}

.unlock-label {
  display: block;
  margin-bottom: 0.5rem;
  color: #a9bcdc;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.unlock-input {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid #2b4372;
  border-radius: 0.7rem;
  background: #060d1a;
  color: #ffffff;
  font: inherit;
  font-size: 1.5rem;
  letter-spacing: 0.35em;
  text-align: center;
}

.unlock-input:focus {
  border-color: #ffd24a;
  outline: none;
}

/* With the keypad working, the field is no longer the way in: it stays for
   keyboards and screen readers, at a size that no longer competes. */
.unlock-has-pad .unlock-label,
.unlock-has-pad .unlock-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  white-space: nowrap;
}

.unlock-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 0.6rem;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.unlock-key {
  min-height: 3.4rem;
  border: 1px solid #2b4372;
  border-radius: 0.7rem;
  background: #14213a;
  color: #ffffff;
  font: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
}

.unlock-key-wide {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.unlock-key:focus {
  border-color: #ffd24a;
  background: #22345a;
  outline: 3px solid #ffd24a;
  outline-offset: 2px;
}

.unlock-key:focus-visible {
  outline: 3px solid #ffd24a;
}

.unlock-key:active {
  background: #2b4372;
}

.unlock-go {
  display: block;
  width: 100%;
  min-height: 3.4rem;
  border: 0;
  border-radius: 0.7rem;
  background: var(--blue);
  color: #ffffff;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}

.unlock-go:focus {
  outline: 3px solid #ffd24a;
  outline-offset: 3px;
}

.unlock-go:focus-visible {
  outline: 3px solid #ffd24a;
}

.unlock-error {
  margin: 1rem 0 0;
  color: #ffb4a2;
  font-weight: 750;
}

.unlock-help {
  margin: 1.1rem 0 0;
  color: #93a9cc;
  font-size: 0.88rem;
  line-height: 1.6;
}

.unlock-help a {
  color: #9dbcff;
}

.download-locked {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.8rem 1.1rem;
  border: 1px dashed var(--line);
  border-radius: 0.65rem;
  color: var(--muted);
  font-weight: 750;
}

.setup-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  grid-gap: 1px;
  gap: 1px;
  overflow: hidden;
  margin: 1.8rem 0 0;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--line);
}

.setup-list > div {
  padding: 1.1rem 1.35rem;
  background: var(--paper);
}

.setup-list dt {
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.setup-list dd {
  margin: 0;
  color: var(--navy);
  line-height: 1.55;
}

.setup-code {
  font-size: 1.6rem;
  letter-spacing: 0.16em;
}

.setup-warning {
  max-width: 46rem;
  margin: 1.5rem 0 0;
  padding: 1.1rem 1.35rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 0.65rem;
  color: var(--muted);
  line-height: 1.65;
}

.legal-page {
  max-width: 52rem;
  margin-inline: auto;
}

.legal-page h1 {
  font-size: 2.4rem;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
}

.legal-page h2 {
  margin-top: 2rem;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  line-height: 1.75;
}

.public-footer {
  display: flex;
  justify-content: space-between;
  grid-gap: 2rem;
  gap: 2rem;
  padding-block: 2rem;
  border-top: 1px solid var(--line);
}

.public-footer p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .public-header,
  .section-title,
  .app-hero,
  .public-callout,
  .public-invite,
  .public-footer,
  .download-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-header {
    padding-block: 1rem;
  }

  .public-main {
    padding-block: 2.5rem;
  }

  .metadata-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .unlock {
    max-width: none;
    padding: 1.4rem;
  }
}

@media (max-width: 430px) {
  .metadata-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------------------
   Television.

   Set by the server from the User-Agent, because a Fire Stick reports a 1080p
   viewport and no media query can tell it from a laptop. Everything grows, the
   page turns dark so a lit room does not glare, and the unlock panel becomes the
   middle of the screen — a customer at three metres should see the keypad and
   nothing else competing with it.
   --------------------------------------------------------------------------- */
body.on-tv {
  color: #f2f6ff;
  background: #07101f;
  font-size: 20px;
}

body.on-tv .public-header,
body.on-tv .public-footer,
body.on-tv .public-main {
  width: calc(100% - 6rem);
  max-width: 80rem;
}

body.on-tv .public-header {
  min-height: 5.5rem;
  border-bottom: 2px solid #22345a;
}

body.on-tv .public-brand,
body.on-tv h1,
body.on-tv h2,
body.on-tv h3 {
  color: #ffffff;
}

body.on-tv .public-brand {
  font-size: 1.35rem;
}

body.on-tv .public-brand span {
  width: 3rem;
  height: 3rem;
  background: var(--blue);
  font-size: 0.95rem;
}

body.on-tv h1 {
  font-size: 2.9rem;
}

body.on-tv h2 {
  font-size: 2rem;
}

body.on-tv .public-lead,
body.on-tv .public-card p,
body.on-tv .verification-note,
body.on-tv .setup-warning {
  color: #a9bcdc;
  font-size: 1.2rem;
}

body.on-tv .public-kicker {
  color: #7fa6ff;
  font-size: 0.95rem;
}

body.on-tv .public-header nav a,
body.on-tv .public-footer a,
body.on-tv .public-footer p {
  color: #a9bcdc;
  font-size: 1.05rem;
}

/* Cards, panels and rows: dark surfaces with a visible edge, so shapes still
   separate on a television that crushes low contrast. */
body.on-tv .public-card,
body.on-tv .public-invite,
body.on-tv .setup-list > div,
body.on-tv .metadata-grid > div,
body.on-tv .verification-panel,
body.on-tv .setup-warning {
  border-color: #22345a;
  background: #101d33;
  color: #f2f6ff;
}

body.on-tv .setup-list,
body.on-tv .metadata-grid {
  background: #22345a;
}

body.on-tv .trust-row span,
body.on-tv .status {
  border-color: #2b4372;
  color: #cfe0ff;
  background: #14213a;
  font-size: 0.95rem;
}

body.on-tv .status-live {
  color: #5ce08b;
}

body.on-tv .status-paused {
  color: #ffc95c;
}

body.on-tv .public-callout {
  background: #101d33;
  border: 1px solid #22345a;
}

body.on-tv .public-callout > p {
  color: #cfe0ff;
}

body.on-tv .metadata-grid dt {
  color: #8fa6cc;
  font-size: 0.9rem;
}

body.on-tv .metadata-grid dd,
body.on-tv .setup-list dd {
  color: #ffffff;
  font-size: 1.15rem;
}

body.on-tv .setup-code {
  color: #ffd24a;
  font-size: 2.1rem;
}

/* Anything a remote can land on has to announce itself. */
body.on-tv a:focus,
body.on-tv button:focus,
body.on-tv input:focus {
  outline: 4px solid #ffd24a;
  outline-offset: 3px;
}

body.on-tv .download-button,
body.on-tv .text-link {
  font-size: 1.2rem;
}

body.on-tv .download-button {
  min-height: 4rem;
  padding: 1rem 1.6rem;
  font-size: 1.3rem;
}

/* The unlock panel, television size: centred, wide keys, dots you can count
   from the sofa. */
body.on-tv .unlock {
  max-width: 44rem;
  margin: 2.5rem auto 0;
  padding: 2.6rem;
  border-radius: 1.4rem;
}

body.on-tv .unlock-title {
  font-size: 2.4rem;
}

body.on-tv .unlock-sub,
body.on-tv .unlock-help {
  font-size: 1.15rem;
}

body.on-tv .unlock-pad {
  grid-gap: 1rem;
  gap: 1rem;
}

body.on-tv .unlock-key {
  min-height: 5rem;
  font-size: 2.1rem;
}

body.on-tv .unlock-key-wide {
  font-size: 1.2rem;
}

body.on-tv .unlock-go {
  min-height: 5rem;
  font-size: 1.5rem;
}

body.on-tv .unlock-dot {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0 0.3rem;
}

body.on-tv .unlock-error {
  font-size: 1.25rem;
}
