/* CloudFlix "Studio" theme (extends base).
   A professional streaming-platform skin for the CLIENT surface: true dark
   neutrals, generous space, confident type (Outfit display over inherited
   Geist body), one restrained sky accent, white pill CTAs. Loaded AFTER
   base.css by this theme's client layout — base structure carries every page;
   this file re-paints it via the shared palette tokens and adds the .st-*
   components (hero, media-tile catalog, pricing rows).

   RTL-safe: logical properties only. Always dark (streaming standard) — both
   scheme token sets resolve to the same palette. */

/* ---------- Display face (Outfit variable 500–700, OFL, self-hosted) ------- */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/Outfit-Variable.woff2") format("woff2");
}

/* ---------- Palette: override the base tokens in BOTH schemes ---------- */
:root,
html.dark {
  --bg: #0b0c0f;
  --surface: #14161b;
  --text: #f2f3f5;
  --muted: #9aa1ab;
  --border: #23262d;
  --accent: #59a8ff;
  --topbar-bg: #0b0c0f;
  --topbar-text: #f2f3f5;
  --error: #ff7a72;
  --error-bg: #2a1513;
  --ok: #5dd286;
  --ok-bg: #122319;
  --warn: #ffc04d;
  --warn-bg: #2a210f;
  --info: #59a8ff;
  --info-bg: #11202f;

  /* Theme-local tokens */
  --st-display: "Outfit", "Geist", -apple-system, "Segoe UI", sans-serif;
  --st-surface-2: #1b1e25;
  --st-cta: #ffffff;
  --st-cta-text: #0b0c0f;
  --st-radius: 10px;
}
body.client {
  color-scheme: dark;
  background:
    radial-gradient(80% 50% at 50% -20%, rgba(89, 168, 255, 0.08) 0%, transparent 60%),
    var(--bg);
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Rotating cinematic backdrop (pure CSS, no JS) ----------
   Five slides crossfade on a 45s cycle (9s each, staggered delays). A heavy
   dark overlay keeps every page readable — the imagery is atmosphere, not
   content. Content layers sit above via z-index (header is already sticky
   z-20; main/footer get z-1 below). */
.st-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.st-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-size: cover;
  background-position: center;
  animation: st-cycle 45s linear infinite;
  will-change: opacity, transform;
}
.st-slide:nth-child(2) {
  animation-delay: 9s;
}
.st-slide:nth-child(3) {
  animation-delay: 18s;
}
.st-slide:nth-child(4) {
  animation-delay: 27s;
}
.st-slide:nth-child(5) {
  animation-delay: 36s;
}
@keyframes st-cycle {
  0% {
    opacity: 0;
    transform: scale(1.02);
  }
  6% {
    opacity: 1;
  }
  22% {
    opacity: 1;
  }
  30% {
    opacity: 0;
    transform: scale(1.1);
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
  }
}
.st-backdrop::after {
  /* The readability overlay: darkest at the bottom where content sits. */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 12, 15, 0.78) 0%,
    rgba(11, 12, 15, 0.7) 35%,
    rgba(11, 12, 15, 0.88) 80%,
    rgba(11, 12, 15, 0.96) 100%
  );
}
body.client main,
body.client footer {
  position: relative;
  z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
  .st-slide {
    animation: none;
  }
  .st-slide:first-child {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Header: sticky, translucent, blurred ---------- */
body.client .site {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  min-height: 60px;
  background: rgba(11, 12, 15, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-block-end: 1px solid rgba(255, 255, 255, 0.06);
}
body.client .site .brand {
  font-family: var(--st-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
}
body.client .site-nav a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
}
body.client .site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}
body.client .site-nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  font-weight: 600;
}
body.client .site-actions a,
body.client .site-actions .linklike {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}
body.client .site-actions a:hover,
body.client .site-actions .linklike:hover {
  color: var(--text);
  text-decoration: none;
}
/* The always-visible purchase CTA: white, softly rounded (not a full pill). */
body.client .site-cta {
  font-family: var(--st-display);
  font-weight: 600;
  border-radius: 8px;
  border-color: var(--st-cta);
  background: var(--st-cta);
  color: var(--st-cta-text);
}
body.client .site-cta:hover {
  background: #e7e9ec;
  opacity: 1;
}

/* ---------- Content column: a little wider, more air ---------- */
body.client .centered {
  max-width: 860px;
  padding: 40px 24px 56px;
}

/* ---------- Type: Outfit headings, calm hierarchy ---------- */
body.client main h1,
body.client main h2,
body.client main h3 {
  font-family: var(--st-display);
  letter-spacing: -0.015em;
  color: var(--text);
}
body.client main h1 {
  font-size: clamp(26px, 4.5vw, 34px);
  font-weight: 700;
  margin: 0 0 18px;
}
body.client main h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 30px 0 14px;
}

/* ---------- Surfaces: cards instead of bare tables ---------- */
body.client main table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--st-radius);
  overflow: hidden;
}
body.client main th {
  font-size: 11px;
  color: var(--muted);
  background: var(--st-surface-2);
  border-block-end: 1px solid var(--border);
}
body.client main td {
  border-block-end: 1px solid rgba(255, 255, 255, 0.05);
}
body.client main tbody tr:last-child td {
  border-block-end: none;
}
body.client main tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
body.client
  main
  :is(input[type="text"], input[type="number"], input[type="email"], input[type="password"], input:not([type]), select, textarea) {
  background: var(--st-surface-2);
  border-color: var(--border);
  border-radius: 8px;
  transition: border-color 140ms ease;
}
body.client main :is(input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* ---------- Buttons: pills; white = primary (streaming CTA) ---------- */
body.client main button,
body.client main .button {
  font-family: var(--st-display);
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition:
    background 140ms ease,
    transform 140ms ease;
}
body.client main button:hover,
body.client main .button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  text-decoration: none;
}
body.client main button.primary,
body.client main a.button {
  background: var(--st-cta);
  border-color: var(--st-cta);
  color: var(--st-cta-text);
}
body.client main button.primary:hover,
body.client main a.button:hover {
  background: #e7e9ec;
  transform: translateY(-1px);
}
body.client main button.danger {
  background: transparent;
  border-color: rgba(255, 122, 114, 0.45);
  color: var(--error);
}
body.client main button.danger:hover {
  background: rgba(255, 122, 114, 0.1);
}

/* ---------- Badges: tinted pills ---------- */
body.client .badge {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}
body.client .badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
body.client .badge-danger {
  background: var(--error-bg);
  color: var(--error);
}
body.client .badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

/* ---------- Flashes/notices: soft cards with an accent edge ---------- */
body.client .flash,
body.client .account-notice {
  border-radius: var(--st-radius);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent);
  background: var(--surface);
  color: var(--text);
}
body.client .flash-error,
body.client .account-notice.flash-error {
  border-inline-start-color: var(--error);
}
body.client .flash-warning,
body.client .account-notice.flash-warning {
  border-inline-start-color: var(--warn);
}
body.client .flash-success {
  border-inline-start-color: var(--ok);
}

/* ---------- Hero (home) ---------- */
.st-hero {
  padding: clamp(48px, 9vw, 96px) 0 36px;
  text-align: center;
}
.st-hero-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
  animation: st-fade 600ms ease both;
}
.st-hero-title {
  font-family: var(--st-display);
  font-weight: 700;
  font-size: clamp(34px, 6.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  animation: st-fade 600ms 100ms ease both;
}
.st-hero-sub {
  max-inline-size: 50ch;
  margin: 0 auto 28px;
  font-size: 16.5px;
  color: var(--muted);
  animation: st-fade 600ms 200ms ease both;
}
.st-hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  animation: st-fade 600ms 300ms ease both;
}
@keyframes st-fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Feature row (home) ---------- */
.st-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 28px 0 0;
}
.st-feature {
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--st-radius);
  text-align: start;
}
.st-feature h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
}
.st-feature p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- Catalog: media tiles ---------- */
.st-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin: 0 0 26px;
}
.st-tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--st-radius);
  overflow: hidden;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}
.st-tile:hover {
  transform: scale(1.02);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}
.st-tile-art {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 140% at 20% 0%, rgba(89, 168, 255, 0.28) 0%, transparent 55%),
    linear-gradient(150deg, #1d2330 0%, #12151b 70%);
}
.st-tile-art span {
  font-family: var(--st-display);
  font-weight: 700;
  font-size: 40px;
  letter-spacing: -0.02em;
  color: rgba(242, 243, 245, 0.9);
}
.st-tile-body {
  padding: 16px 18px 18px;
}
.st-tile-body h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
}
.st-tile-body h2 a {
  color: var(--text);
}
.st-tile-body h2 a:hover {
  color: var(--text);
  text-decoration: none;
}
.st-tile-body p {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--muted);
}
.st-tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.st-tile-price {
  font-size: 13px;
  color: var(--muted);
}
.st-tile-price strong {
  display: block;
  font-family: var(--st-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}

/* ---------- Pricing rows (product page) ---------- */
.st-price strong {
  font-family: var(--st-display);
  font-weight: 700;
  font-size: 17px;
}
.st-price-interval {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Footer ---------- */
body.client footer {
  margin-block-start: 24px;
  padding-block: 26px;
  border-block-start: 1px solid var(--border);
  font-size: 12.5px;
}

/* ---------- Motion respect ---------- */
@media (prefers-reduced-motion: reduce) {
  .st-hero-kicker,
  .st-hero-title,
  .st-hero-sub,
  .st-hero-actions {
    animation: none;
  }
  .st-tile,
  body.client main button,
  body.client main .button {
    transition: none;
  }
}
