/* Kestrel — site styles.
 *
 * The palette is lifted from the clients themselves (kestrel/branding.py and
 * the Roku Theme.brs) so the site reads as the same product: copper on ink.
 * The wordmark is typographic — uppercase, bold, generously tracked — drawn as
 * live text here for the same reason the apps draw it as text rather than a
 * bitmap.
 */

:root {
  --ink: #0c1116;
  --panel: #161c23;
  --panel-alt: #212a33;
  --border: #2e3a45;
  --border-soft: #222c36;

  --accent: #e0793a;
  --accent-bright: #f59e5b;
  --accent-dim: #9a5326;

  --text: #ffffff;
  --text-dim: #93a1af;
  --text-faint: #5f6d7a;

  --ok: #3fbf7f;
  --warn: #f5c542;

  --wrap: 1120px;
  --radius: 12px;
  --radius-lg: 18px;

  --sans: "Inter", "DejaVu Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --mono: "DejaVu Sans Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

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

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

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

a {
  color: var(--accent-bright);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.35rem);
}

h3 {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.88em;
}

code {
  background: var(--panel-alt);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  color: var(--accent-bright);
}

kbd {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.12em 0.45em;
  color: var(--text);
  font-size: 0.8em;
  white-space: nowrap;
}

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

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

.narrow {
  max-width: 760px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* --- wordmark ------------------------------------------------------------ */

.wordmark {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  /* tracking adds space after the final letter too; pull it back so the mark
     optically centres against anything beside it */
  margin-right: -0.16em;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 17, 22, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 1.06rem;
  flex: none;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.main-nav a {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.main-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

.header-cta {
  flex: none;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 18px;
    margin: 0;
    display: none;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
  }

  .main-nav a[aria-current="page"] {
    border-bottom-color: var(--border-soft);
    color: var(--accent-bright);
  }
}

/* Below this the brand, the CTA and the menu button stop fitting together.
   Written as .btn.header-cta because .btn sets display later in the file and
   would otherwise win the tie. */
@media (max-width: 620px) {
  .btn.header-cta {
    display: none;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--accent-bright);
}

.btn-secondary {
  background: var(--panel-alt);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent-dim);
  background: #27313b;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
}

.btn[aria-disabled="true"] {
  background: var(--panel-alt);
  color: var(--text-faint);
  border-color: var(--border-soft);
  cursor: default;
  pointer-events: none;
}

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

.section {
  padding: 84px 0;
  border-top: 1px solid var(--border-soft);
}

.section-tight {
  padding: 56px 0;
}

.section-head {
  max-width: 660px;
  margin-bottom: 44px;
}

.section-head p {
  color: var(--text-dim);
  font-size: 1.08rem;
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.lede {
  font-size: 1.16rem;
  color: var(--text-dim);
}

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

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

.hero {
  position: relative;
  padding: 88px 0 72px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  left: 50%;
  width: 900px;
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(224, 121, 58, 0.16),
    transparent 68%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 780px;
}

.hero h1 {
  margin-bottom: 20px;
}

.hero h1 .wordmark {
  color: var(--accent);
}

.hero-sub {
  font-size: 1.18rem;
  color: var(--text-dim);
  max-width: 620px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0 16px;
}

.hero-note {
  font-size: 0.9rem;
  color: var(--text-faint);
  margin: 0;
}

.hero-shot {
  position: relative;
  margin-top: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.hero-shot img {
  width: 100%;
}

.shot-caption {
  font-size: 0.86rem;
  color: var(--text-faint);
  text-align: center;
  margin: 12px 0 0;
}

/* --- product cards ------------------------------------------------------- */

.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.product {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.product:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
}

.product-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.product h3 {
  margin-bottom: 10px;
}

.product p {
  color: var(--text-dim);
  font-size: 0.98rem;
}

.product ul {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  font-size: 0.94rem;
  color: var(--text-dim);
}

.product li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 7px;
}

.product li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

.product .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* --- feature grid -------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 22px 30px;
}

.feature h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.feature h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  flex: none;
}

.feature p {
  color: var(--text-dim);
  font-size: 0.97rem;
  margin: 0;
}

/* --- alternating detail rows --------------------------------------------- */

.detail {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 72px;
}

.detail:last-child {
  margin-bottom: 0;
}

.detail.flip .detail-text {
  order: 2;
}

.detail-media img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

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

.detail-text .muted {
  font-size: 0.98rem;
}

@media (max-width: 800px) {
  .detail {
    grid-template-columns: 1fr;
    gap: 26px;
    margin-bottom: 56px;
  }

  .detail.flip .detail-text {
    order: 0;
  }
}

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

.notice {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 22px 26px;
}

.notice h3 {
  font-size: 1.05rem;
}

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

.notice-warn {
  border-left-color: var(--warn);
}

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

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 28px;
}

.steps li {
  counter-increment: step;
  padding-top: 46px;
  position: relative;
  color: var(--text-dim);
  font-size: 0.97rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-dim);
  border-radius: 9px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.steps strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
  margin-bottom: 5px;
}

/* --- tables -------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

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

th,
td {
  text-align: left;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
}

th {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

td {
  color: var(--text-dim);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* --- download ------------------------------------------------------------ */

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.download-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.download-card h3 {
  margin-bottom: 6px;
}

.download-meta {
  font-size: 0.85rem;
  color: var(--text-faint);
  font-family: var(--mono);
  margin-bottom: 14px;
}

.download-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.download-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

pre {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 1em;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* --- faq ----------------------------------------------------------------- */

.faq details {
  border-bottom: 1px solid var(--border-soft);
  padding: 4px 0;
}

.faq summary {
  cursor: pointer;
  padding: 16px 34px 16px 0;
  font-weight: 600;
  position: relative;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details > *:not(summary) {
  color: var(--text-dim);
  font-size: 0.97rem;
  padding-right: 34px;
}

.faq details p:last-child {
  padding-bottom: 14px;
}

/* --- legal pages --------------------------------------------------------- */

.page-head {
  padding: 62px 0 34px;
}

.page-head h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  margin-bottom: 12px;
}

.page-head .updated {
  color: var(--text-faint);
  font-size: 0.9rem;
  margin: 0;
}

.legal {
  padding-bottom: 84px;
}

.legal h2 {
  font-size: 1.32rem;
  margin: 46px 0 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.legal h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.legal h3 {
  font-size: 1.05rem;
  margin: 26px 0 8px;
}

.legal p,
.legal li {
  color: var(--text-dim);
  font-size: 1rem;
}

.legal ul,
.legal ol {
  padding-left: 22px;
  margin: 0 0 1em;
}

.legal li {
  margin-bottom: 8px;
}

.legal strong {
  color: var(--text);
}

.legal .summary-box {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  margin-bottom: 34px;
}

.legal .summary-box p {
  margin-bottom: 0;
  color: var(--text);
}

.toc {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 40px;
}

.toc h2 {
  font-size: 0.76rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: none;
  margin: 0 0 12px;
  padding: 0;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 32px;
}

.toc li {
  margin-bottom: 6px;
  font-size: 0.93rem;
}

@media (max-width: 620px) {
  .toc ol {
    columns: 1;
  }
}

/* A value the operator must set before publishing. Deliberately conspicuous. */
.placeholder {
  background: rgba(245, 197, 66, 0.14);
  color: var(--warn);
  border: 1px dashed rgba(245, 197, 66, 0.5);
  border-radius: 4px;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 0.85em;
}

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

.site-footer {
  border-top: 1px solid var(--border-soft);
  background: #0a0e12;
  padding: 54px 0 34px;
  font-size: 0.93rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 36px;
  margin-bottom: 40px;
}

.footer-brand .brand {
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--text-faint);
  max-width: 300px;
  font-size: 0.9rem;
  margin: 0;
}

.footer-col h4 {
  font-size: 0.76rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
  font-weight: 700;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 9px;
}

.footer-col a {
  color: var(--text-dim);
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  border-top: 1px solid var(--border-soft);
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 0.86rem;
}

.footer-bottom p {
  margin: 0;
  max-width: 640px;
}

@media (max-width: 760px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .section {
    padding: 60px 0;
  }

  .hero {
    padding: 60px 0 48px;
  }

  .hero-cta .btn {
    width: 100%;
  }
}
