/* tv.2max.tech
 *
 * The palette is lifted from the app's TvPalette (ui/theme/Color.kt) so the site
 * and the television agree. If a colour changes there, change it here too — these
 * are the only two places it lives.
 *
 * No web fonts, no CDN, no framework. The site is served off a box in Jeffrey's
 * house; every request it can't make is a failure mode it can't have.
 */

:root {
  --deep: #14110b;      /* surfaceDeep — page background */
  --nav: #1e1a12;       /* surfaceNav — header, footer */
  --groups: #2a241a;    /* surfaceGroups — cards */
  --drawer: #453a26;    /* surfaceDrawer — raised panels */
  --accent: #f0a81e;    /* the amber everything keys off */
  --accent-dim: #b47c14;
  --text: #ffffff;
  --text-2: #d3c6aa;
  --text-3: #9c8e74;
  --divider: #3a3122;
  --ok: #4cc46a;
  --bad: #e2574c;

  --measure: 62rem;     /* content column */
  --radius: 14px;
  --radius-lg: 22px;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--deep);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* balance stops a heading dropping one word onto a line of its own; browsers
   without it just wrap normally, which is what used to happen anyway. */
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffc451; }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--divider); margin: 3rem 0; }

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

.wrap { width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem; }
.lede { font-size: 1.2rem; color: var(--text-2); max-width: 44ch; }
.muted { color: var(--text-3); }
.small { font-size: .92rem; }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }

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

.site-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(30, 26, 18, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--divider);
}
.site-head .wrap { display: flex; align-items: center; gap: 1.25rem; height: 64px; }

/* The lockup is assembled the way the app assembles it in GuidePanes.Wordmark:
   "2ma" and "TV" are the app's own letter artwork tinted amber, and the duo X sits
   between them carrying its own two colours. It is not type — setting it in a system
   font would be a different logo. The X runs ~15% taller than the letters because the
   vector keeps padding inside its viewport, which is the same ratio as the app's
   30dp-against-26dp. */
.lockup { display: flex; align-items: center; text-decoration: none; }
.lockup img { display: block; }
.lockup .lk-word { height: 21px; width: auto; }
.lockup .lk-x { height: 24px; width: auto; }
.lockup .lk-tv { margin-left: 3px; }
.lockup-sm .lk-word { height: 18px; }
.lockup-sm .lk-x { height: 21px; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
.site-nav a { color: var(--text-2); text-decoration: none; font-size: .95rem; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 620px) {
  .site-nav { gap: 1rem; }
  .site-nav a.hide-sm { display: none; }
}

/* ---------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #14110b; }
.btn-primary:hover { background: #ffc451; color: #14110b; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--drawer); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.center .btn-row { justify-content: center; }

/* ------------------------------------------------------------------- hero -- */

.hero { padding: clamp(3.5rem, 9vw, 6.5rem) 0 3rem; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% 0 auto 50%;
  width: 900px; height: 900px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(240,168,30,.13), transparent 62%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero-mark { height: 84px; width: auto; margin: 0 auto 1.75rem; }

.pill {
  display: inline-block;
  padding: .3rem .85rem;
  border: 1px solid var(--drawer);
  border-radius: 999px;
  font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.25rem;
}

/* -------------------------------------------------------------- sections -- */

section { padding: clamp(2.5rem, 6vw, 4.25rem) 0; }
.section-head { max-width: 52ch; margin-bottom: 2.5rem; }
.center .section-head { margin-left: auto; margin-right: auto; }

/* Two sections' padding meeting in the middle is twice as much air as either
   asked for. Where one runs straight into the next, one of them gives it up. */
.tight-top { padding-top: 0; }

/* --------------------------------------------------------------- screens -- */

/* 280px, not 310: three of those plus the gaps fit inside the 62rem content
   column, and 310 does not — which left the third screenshot orphaned on a row
   of its own. */
.shots { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.shot { margin: 0; }
.shot figcaption { color: var(--text-3); font-size: .9rem; margin-top: .7rem; }
.shot figcaption b { color: var(--text-2); font-weight: 600; display: block; }

.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #191509;
  border: 1px solid var(--divider);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.frame img { width: 100%; height: 100%; object-fit: cover; }

.shot-lead .frame { box-shadow: 0 30px 70px rgba(0,0,0,.6); }

/* -------------------------------------------------------------- features -- */

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: var(--groups);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 { margin-bottom: .35rem; }
.card p { color: var(--text-2); font-size: .96rem; margin: 0; }
.card .ico {
  width: 34px; height: 34px; margin-bottom: 1rem;
  color: var(--accent);
}
.card .ico svg { width: 100%; height: 100%; display: block; }

/* ----------------------------------------------------------------- steps -- */

.steps { counter-reset: step; display: grid; gap: 1.5rem; }
.step {
  display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start;
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--drawer); color: var(--accent);
  font-weight: 700; font-size: 1.05rem;
}
.step h3 { margin-bottom: .2rem; }
.step p { color: var(--text-2); margin: 0; }
.step code { color: var(--accent); }

/* --------------------------------------------------------------- callout -- */

.callout {
  background: var(--groups);
  border: 1px solid var(--divider);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.callout.warn { border-left-color: var(--bad); }
.callout p:last-child { margin-bottom: 0; }
.callout h3 { font-size: 1rem; }

/* ------------------------------------------------------------------ code -- */

code { font-family: var(--mono); font-size: .9em; }
pre {
  background: #0d0b07;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: .88rem; line-height: 1.6;
}
pre code { color: var(--text-2); }

/* ------------------------------------------------------------------ form -- */

.panel {
  background: var(--groups);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 5vw, 2.5rem);
}

.field { margin-bottom: 1.4rem; }
.field label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .95rem; }
.field .hint { color: var(--text-3); font-size: .88rem; margin: .35rem 0 0; }

input[type="text"], input[type="password"], input[type="url"], select {
  width: 100%;
  padding: .85rem 1rem;
  background: #0d0b07;
  border: 1px solid var(--drawer);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
input::placeholder { color: #6c6350; }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(240,168,30,.18); }

/* The pairing code. Wide tracking and a monospace face because it is copied by
   eye off a television — the shapes have to stay distinct at a glance. */
.code-input {
  font-family: var(--mono) !important;
  font-size: clamp(1.5rem, 7vw, 2rem) !important;
  font-weight: 700;
  letter-spacing: .22em;
  text-align: center;
  text-transform: uppercase;
  padding: 1rem .5rem !important;
}

fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; font-weight: 600; margin-bottom: .75rem; }

.seg { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  flex: 1; text-align: center; cursor: pointer;
  padding: .7rem 1rem; border-radius: 10px;
  border: 1px solid var(--drawer); color: var(--text-2);
  font-weight: 600; font-size: .95rem;
}
.seg input:checked + label { background: var(--drawer); color: var(--text); border-color: var(--accent); }
.seg input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }

.msg { border-radius: 10px; padding: .9rem 1.1rem; margin-bottom: 1.25rem; font-size: .95rem; }
.msg[hidden] { display: none; }
.msg-bad { background: rgba(226,87,76,.13); border: 1px solid rgba(226,87,76,.4); color: #ffb3ac; }
.msg-ok { background: rgba(76,196,106,.12); border: 1px solid rgba(76,196,106,.4); color: #a9e8ba; }
.msg-info { background: rgba(240,168,30,.1); border: 1px solid rgba(240,168,30,.35); color: var(--text-2); }

.stack > * + * { margin-top: 1rem; }

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

.site-foot {
  background: var(--nav);
  border-top: 1px solid var(--divider);
  padding: 3rem 0 2.5rem;
  margin-top: 2rem;
  color: var(--text-3);
  font-size: .92rem;
}
.foot-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-foot a { color: var(--text-2); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot .legal { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--divider); max-width: 70ch; }
