/* SecretStream landing page.
 * Concept: a broadcast control room at night. The page is quiet ink and
 * paper-white type; the only colour comes from the stream itself, cut into
 * blocks. Display: Bricolage Grotesque. Text: IBM Plex Sans. Data: IBM Plex Mono.
 * Everything is scoped to .landing-view so the dashboard styles stay untouched.
 */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-var.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plexsans-var.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

.landing-view {
  /* Layout: one 1180px column, hero split copy | live monitor, sections alternate two inks. */
  --ink: #0d1117;
  --ink-2: #131a22;
  --ink-3: #1b2430;
  --line: #273241;
  --paper: #eef1f4;
  --muted: #95a1b1;
  --signal: #3ddc97;
  --signal-ink: #06261a;
  --tally: #ff6b5a;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-text: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 10px;
  --wrap: 1180px;

  display: block;
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}
.landing-view.hidden { display: none; }

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

.landing-view h1,
.landing-view h2,
.landing-view h3 {
  font-family: var(--font-display);
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.015em;
}
.landing-view p { margin: 0; }
.landing-view section[id] { scroll-margin-top: 72px; }
.landing-view a { color: inherit; }
.landing-view code { font-family: var(--font-mono); }
.landing-view :focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

.lp-wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.lp-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal);
}

/* Buttons ---------------------------------------------------------------- */
.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: 600 0.95rem/1.2 var(--font-text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.lp-btn:hover { transform: translateY(-1px); }
.lp-btn-solid { background: var(--signal); color: var(--signal-ink); }
.lp-btn-solid:hover { background: #5fe8ab; }
.lp-btn-ghost { background: transparent; color: var(--paper); border-color: var(--line); }
.lp-btn-ghost:hover { border-color: var(--muted); background: var(--ink-2); }
.lp-btn-lg { padding: 14px 22px; font-size: 1rem; }

/* Header ----------------------------------------------------------------- */
.lp-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.lp-header-row {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-block: 14px;
}
.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}
.lp-mark { width: 26px; height: 26px; }
.lp-mark .m1 { fill: var(--signal); }
.lp-mark .m2 { fill: var(--tally); }
.lp-mark .m3 { fill: #4f8cff; }
.lp-mark .m4 { fill: #f2c94c; }
.lp-nav { display: flex; gap: 22px; margin-right: auto; }
.lp-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
}
.lp-nav a:hover { color: var(--paper); }
.lp-header-actions { display: flex; gap: 10px; }

/* Hero ------------------------------------------------------------------- */
.lp-hero {
  padding-block: clamp(48px, 8vw, 96px) clamp(56px, 8vw, 104px);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(61, 220, 151, 0.08), transparent 60%),
    var(--ink);
}
.lp-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.lp-hero-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.lp-hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.1rem);
  line-height: 1.02;
  font-weight: 800;
  font-variation-settings: "opsz" 96;
}
.lp-lede { color: var(--muted); font-size: 1.12rem; max-width: 34em; }
.lp-cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-fineprint { color: var(--muted); font-size: 0.88rem; }

.lp-stage { margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lp-screen {
  position: relative;
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
.lp-screen canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #000;
}
.lp-screen-tag {
  position: absolute;
  top: 22px;
  right: 22px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.82);
  border: 1px solid var(--line);
  font: 500 0.74rem/1.4 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lp-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lp-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 10px;
  background: var(--ink-2);
  border: 1px solid var(--line);
}
.lp-toggle-btn {
  padding: 8px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: 500 0.88rem/1.2 var(--font-text);
  cursor: pointer;
}
.lp-toggle-btn[aria-pressed="true"] { background: var(--ink-3); color: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.lp-payload {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.lp-payload code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lp-payload-label {
  flex: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: 600 0.7rem/1.3 var(--font-mono);
}

/* Sections --------------------------------------------------------------- */
.lp-section { padding-block: clamp(64px, 9vw, 112px); }
.lp-section-alt { background: var(--ink-2); border-block: 1px solid var(--line); }
.lp-section-head { display: flex; flex-direction: column; gap: 14px; max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }
.lp-section h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.08; font-weight: 750; }
.lp-section-lede { color: var(--muted); font-size: 1.08rem; }
.lp-section-note { margin-top: 20px; color: var(--muted); font-size: 0.92rem; }

/* How it works ----------------------------------------------------------- */
.lp-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  counter-reset: none;
}
.lp-step { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lp-step-canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #000;
  margin-bottom: 8px;
}
.lp-step + .lp-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: -22px;
  width: 16px;
  height: 2px;
  /* Percent margins follow the item's width: this lands mid-height of the 16:9 canvas. */
  margin-top: 28%;
  background: repeating-linear-gradient(90deg, var(--signal) 0 4px, transparent 4px 8px);
  background-size: 16px 2px;
  animation: lp-flow 0.8s linear infinite;
}
.lp-step-num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--signal);
  color: var(--signal);
  font: 500 0.85rem/1 var(--font-mono);
}
.lp-step h3 { font-size: 1.32rem; font-weight: 700; }
.lp-step p { color: var(--muted); }
.lp-spec { font-family: var(--font-mono); font-size: 0.78rem; color: var(--paper) !important; opacity: 0.72; }

@keyframes lp-flow { to { background-position: 16px 0; } }

/* Modes ------------------------------------------------------------------ */
.lp-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.lp-mode {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border-radius: 14px;
  background: var(--ink);
  border: 1px solid var(--line);
  min-width: 0;
}
.lp-mode-private { border-color: color-mix(in srgb, var(--signal) 45%, var(--line)); }
.lp-mode-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lp-mode h3 { font-size: 1.5rem; }
.lp-mode p { color: var(--muted); }
.lp-chip {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font: 500 0.75rem/1.5 var(--font-mono);
  color: var(--paper);
}
.lp-chip-accent { border-color: var(--signal); color: var(--signal); }
.lp-qr-line {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 10px;
  background: var(--ink-2);
  border: 1px dashed var(--line);
  min-width: 0;
}
.lp-qr-line code { font-size: 0.85rem; overflow-wrap: anywhere; min-width: 0; }
.lp-qr-line mark { background: rgba(61, 220, 151, 0.16); color: var(--signal); border-radius: 3px; padding: 0 3px; }
.lp-qr-glyph {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background:
    linear-gradient(var(--paper), var(--paper)) 0 0 / 12px 12px no-repeat,
    linear-gradient(var(--paper), var(--paper)) 100% 0 / 12px 12px no-repeat,
    linear-gradient(var(--paper), var(--paper)) 0 100% / 12px 12px no-repeat,
    repeating-conic-gradient(var(--paper) 0 25%, transparent 0 50%) 50% 50% / 8px 8px;
  background-color: var(--ink-3);
  box-shadow: inset 0 0 0 3px var(--ink-3);
}
.lp-mode-foot { font: 0.8rem/1.5 var(--font-mono); color: var(--paper) !important; opacity: 0.7; margin-top: auto !important; }

/* Rotation --------------------------------------------------------------- */
.lp-rotation { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.lp-rotation-copy { display: flex; flex-direction: column; gap: 18px; }
.lp-rotation-copy p:not(.lp-eyebrow) { color: var(--muted); }
.lp-rotation-demo {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-radius: 14px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  min-width: 0;
}
.lp-epoch { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 14px; }
.lp-epoch-label { font: 500 0.75rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lp-epoch-value { font: 600 1.3rem/1 var(--font-mono); color: var(--signal); font-variant-numeric: tabular-nums; min-width: 3ch; }
.lp-epoch-bar { height: 4px; border-radius: 4px; background: var(--ink-3); overflow: hidden; }
.lp-epoch-fill { display: block; height: 100%; width: 100%; background: var(--signal); transform-origin: left; animation: lp-epoch 6s linear infinite; }
@keyframes lp-epoch { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.lp-viewers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lp-viewer { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lp-viewer-canvas { width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 8px; border: 1px solid var(--line); background: #000; }
.lp-viewer-name { font-size: 0.86rem; font-weight: 500; overflow-wrap: anywhere; }
.lp-viewer-state { font: 500 0.75rem/1.4 var(--font-mono); }
.lp-viewer-state.is-ok { color: var(--signal); }
.lp-viewer-state.is-off { color: var(--tally); }

/* Plans ------------------------------------------------------------------ */
.lp-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.lp-plan {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border-radius: 14px;
  background: var(--ink);
  border: 1px solid var(--line);
  min-width: 0;
}
.lp-plan-featured { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal), 0 24px 60px -30px rgba(61, 220, 151, 0.35); }
.lp-plan h3 { font-size: 1.25rem; font-weight: 700; }
.lp-price { display: flex; align-items: baseline; gap: 6px; }
.lp-price strong { font: 700 2.6rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.lp-price span { color: var(--muted); }
.lp-plan-tagline { color: var(--muted); }
.lp-plan-list { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lp-plan-list li { position: relative; padding-left: 22px; font-size: 0.96rem; }
.lp-plan-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--signal);
}
.lp-plan .lp-btn { margin-top: auto; }

/* Stores ----------------------------------------------------------------- */
.lp-stores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lp-store {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--ink-2);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.lp-store:hover { border-color: var(--signal); transform: translateY(-2px); }
.lp-store-name { font: 700 1.2rem/1.2 var(--font-display); }
.lp-store-where { color: var(--muted); font-size: 0.9rem; }

/* FAQ -------------------------------------------------------------------- */
.lp-faq { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.lp-faq .lp-section-head { margin-bottom: 0; }
.lp-faq-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.lp-faq-list details { border-bottom: 1px solid var(--line); }
.lp-faq-list summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1.04rem;
}
.lp-faq-list summary::-webkit-details-marker { display: none; }
.lp-faq-list summary::after { content: "+"; font-family: var(--font-mono); color: var(--signal); }
.lp-faq-list details[open] summary::after { content: "–"; }
.lp-faq-list details p { padding-bottom: 18px; color: var(--muted); max-width: 40em; }
.lp-faq-list a { color: var(--signal); }

/* Footer ----------------------------------------------------------------- */
.lp-footer { border-top: 1px solid var(--line); }
.lp-footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 28px; }
.lp-footer-brand { font: 700 1rem/1 var(--font-display); }
.lp-footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.lp-footer-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.lp-footer-links a:hover { color: var(--paper); }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 960px) {
  .lp-nav { display: none; }
  .lp-hero-grid, .lp-rotation, .lp-faq { grid-template-columns: minmax(0, 1fr); }
  .lp-steps, .lp-plans, .lp-stores { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .lp-step + .lp-step::before { display: none; }
  .lp-modes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .lp-header-actions .lp-btn-ghost { display: none; }
  .lp-header-row { gap: 12px; justify-content: space-between; }
  .lp-viewers { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lp-viewers .lp-viewer:last-child { grid-column: 1 / -1; }
  .lp-toggle { width: 100%; }
  .lp-toggle-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .landing-view *, .landing-view *::before, .landing-view *::after { animation: none !important; transition: none !important; }
}

/* The server lists switched-off features in <body data-off="..."> so the
 * landing page never advertises something production does not offer. */
body[data-off~="direct-subscriptions"] [data-feature="direct-subscriptions"],
body[data-off~="web-player"] [data-feature="web-player"],
body[data-off~="twitch-subscribers"] [data-feature="twitch-subscribers"] {
  display: none !important;
}
