/*
 * MLZ IPTV Player website, in the TV app's own visual language: near-black stage, brand red,
 * a blurred backdrop behind the hero (like the app's ambient stage) and the app's focus ring
 * (white outline, slight lift) on everything that can be pressed. Headings use the app's font
 * (Inter ExtraBold, self-hosted, license in fonts/OFL.txt); body text uses system fonts.
 */
@font-face {
  font-family: 'MLZ Display';
  src: url('/assets/fonts/inter-800.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0b0d;
  --bg-alt: #111114;
  --surface: #18181b;
  --surface-raised: #222226;
  --line: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.74);
  --text-3: rgba(255, 255, 255, 0.58);
  --accent: #e50914;
  --accent-hover: #c4070f;
  --ok: #3ddc84;
  --warn: #f5b942;
  --font:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: 'MLZ Display', var(--font);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--surface-raised) var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1;
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
}

h3 {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
}

/* The app's focus language: a white ring just outside the element */
:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .wrap {
    padding: 0 32px;
  }
}

.wrap-wide {
  max-width: 1320px;
}

.narrow {
  max-width: 780px;
}

.center {
  text-align: center;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 11, 13, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.brand b {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text {
  font-size: 1.02rem;
}

.mark {
  flex: none;
  width: 34px;
  height: 34px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav .lang {
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.nav-wide {
  display: none;
}

@media (min-width: 720px) {
  .nav-wide {
    display: inline-block;
  }
}

/* Buttons lift slightly on hover and focus, like a focused card on the TV */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 0.18s var(--ease-out),
    background 0.18s var(--ease-out),
    color 0.18s var(--ease-out);
}

.btn:hover,
.btn:focus-visible {
  transform: scale(1.04);
  background: var(--text);
  color: var(--bg);
}

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

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-hover);
  color: #fff;
}

/* "Coming soon to Google Play": a status, not a button */
.soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding-right: 8px;
  font-weight: 700;
}

.soon::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.link {
  display: inline-block;
  margin-top: 16px;
  font-weight: 700;
}

/* Hero: the home screen's own colors, blurred behind the copy like the app's ambient stage */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 56px 0 64px;
}

.hero-ambient {
  position: absolute;
  inset: -12%;
  z-index: -2;
  width: 124%;
  max-width: none;
  height: 124%;
  object-fit: cover;
  filter: blur(56px) saturate(1.7) brightness(1.15);
  opacity: 0.9;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(11, 11, 13, 0) 55%, var(--bg)),
    linear-gradient(
      90deg,
      rgba(11, 11, 13, 0.9) 0%,
      rgba(11, 11, 13, 0.6) 50%,
      rgba(11, 11, 13, 0.4)
    );
}

.hero-inner {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 960px) {
  .hero {
    padding: 96px 0 112px;
  }

  .hero-inner {
    grid-template-columns: 5fr 6fr;
    gap: 56px;
  }
}

.lead {
  max-width: 56ch;
  margin-top: 20px;
  font-size: 1.15rem;
  color: var(--text-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 28px;
}

.notice {
  max-width: 52ch;
  margin-top: 28px;
  font-size: 0.92rem;
  color: var(--text-3);
}

.tv {
  padding: 10px;
  border-radius: 18px;
  background: #050506;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}

.tv img {
  border-radius: 9px;
}

/* Sections */
.section {
  padding: 64px 0;
}

@media (min-width: 960px) {
  .section {
    padding: 96px 0;
  }
}

section[id] {
  scroll-margin-top: 64px;
}

.section > .wrap > h2 {
  margin-bottom: 28px;
}

.section-lead {
  max-width: 60ch;
  margin: -16px 0 32px;
  color: var(--text-2);
}

/* Features without a screen of their own in the tour */
.more {
  display: grid;
  gap: 0 40px;
  padding: 0;
  list-style: none;
}

.more li {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.more p {
  max-width: 46ch;
  margin-top: 6px;
  color: var(--text-2);
}

@media (min-width: 720px) {
  .more {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  .more {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tour: platform switch (Google TV / Windows) beside the heading */
.tour-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.platform-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.platform-switch .tab {
  border-color: transparent;
}

.tab[aria-selected='true'] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* Without the tour script both platforms show; the second one gets some room */
.tour-panel + .tour-panel {
  margin-top: 48px;
}

.tour-panel[hidden] + .tour-panel {
  margin-top: 0;
}

/* Windows download, under the Windows tour */
.download {
  display: grid;
  gap: 20px;
  margin-top: 28px;
  padding: 28px;
  border-radius: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}

.download h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.download-copy p + p {
  margin-top: 10px;
}

.download-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

@media (min-width: 860px) {
  .download {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 40px;
  }

  .download-action {
    align-items: center;
  }
}

/* Screenshot carousel: the slide in view wears the TV's focus ring */
.carousel-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.carousel-tabs::-webkit-scrollbar {
  display: none;
}

/* Phones scroll the tab bar sideways; wider screens show every tab */
@media (min-width: 720px) {
  .carousel-tabs {
    flex-wrap: wrap;
  }
}

.tab {
  flex: none;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: 600 0.95rem/1 var(--font);
  cursor: pointer;
  transition:
    background 0.18s var(--ease-out),
    color 0.18s var(--ease-out);
}

.tab:hover {
  color: var(--text);
  background: var(--surface);
}

.tab[aria-current='true'] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.carousel-viewport {
  position: relative;
}

.carousel-track {
  position: relative;
  display: flex;
  gap: 20px;
  padding: 8px 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.slide {
  flex: 0 0 88%;
  scroll-snap-align: center;
}

.slide:first-child {
  margin-left: 6%;
}

.slide:last-child {
  margin-right: 6%;
}

.slide img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: var(--surface);
  outline: 3px solid transparent;
  outline-offset: 4px;
  transition: outline-color 0.2s var(--ease-out);
}

.slide.is-active img {
  outline-color: var(--text);
}

/* The caption explains what the screen does: the tour is where features are described */
.slide figcaption {
  max-width: 68ch;
  margin-top: 18px;
  font-size: 1.08rem;
  color: var(--text-2);
}

.slide figcaption b {
  display: block;
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.carousel-btn {
  position: absolute;
  top: calc(50% - 44px);
  display: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(11, 11, 13, 0.8);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 0.18s var(--ease-out),
    background 0.18s var(--ease-out),
    color 0.18s var(--ease-out);
}

.carousel-btn:hover,
.carousel-btn:focus-visible {
  transform: scale(1.08);
  background: var(--text);
  color: var(--bg);
}

.carousel-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel-prev {
  left: 12px;
}

.carousel-next {
  right: 12px;
}

@media (min-width: 720px) {
  .carousel-btn:not([hidden]) {
    display: flex;
  }
}

/* Platforms: one row per device family, a dot for the status */
.platforms {
  padding: 0;
  list-style: none;
}

.platform {
  display: grid;
  gap: 6px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.platform h3 {
  font-size: 1.25rem;
}

.platform p:last-child {
  max-width: 60ch;
  color: var(--text-2);
}

@media (min-width: 860px) {
  .platform {
    grid-template-columns: 2fr 1fr 3fr;
    align-items: baseline;
    gap: 32px;
  }
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.status::before {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.status-live {
  color: var(--ok);
}

.status-dev {
  color: var(--warn);
}

.status-plan {
  color: var(--text-2);
}

.status-plan::before {
  background: transparent;
  box-shadow: inset 0 0 0 2px currentColor;
}

/* Closing: privacy and contact side by side */
.closing {
  display: grid;
  gap: 48px;
}

.closing > div {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.closing p {
  max-width: 46ch;
  margin-top: 12px;
  color: var(--text-2);
}

.closing .btn {
  margin-top: 22px;
}

@media (min-width: 860px) {
  .closing {
    grid-template-columns: 1fr 1fr;
  }
}

/* Support and legal pages */
.page h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
}

.page .lead {
  margin-top: 16px;
}

.page > .wrap > h2 {
  margin: 56px 0 12px;
}

.panel {
  padding: 28px;
  border-radius: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}

.contact {
  margin-top: 32px;
}

.contact-mail {
  margin-bottom: 16px;
  font-family: var(--display);
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.contact-mail a {
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-mail a:hover {
  text-decoration: underline;
}

.fine {
  margin-top: 14px;
  font-size: 0.875rem;
  color: var(--text-3);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  padding: 18px 0;
  font-weight: 700;
  cursor: pointer;
}

.faq details p {
  max-width: 66ch;
  padding-bottom: 18px;
  color: var(--text-2);
}

.legal h2 {
  margin: 36px 0 10px;
  font-size: 1.3rem;
}

.legal p {
  max-width: 70ch;
}

.legal p + p {
  margin-top: 10px;
}

.legal > p:not(.fine):not(.lead) {
  color: var(--text-2);
}

/* Footer */
.foot {
  margin-top: 40px;
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
}

.foot-inner {
  display: grid;
  gap: 18px;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.foot-brand .mark {
  width: 28px;
  height: 28px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.foot-links a {
  color: var(--text-2);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.foot-links a:hover {
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  html,
  .carousel-track {
    scroll-behavior: auto;
  }

  .btn,
  .tab,
  .carousel-btn,
  .slide img {
    transition: none;
  }

  .btn:hover,
  .btn:focus-visible,
  .carousel-btn:hover,
  .carousel-btn:focus-visible {
    transform: none;
  }
}
