/* Онира — Посока А, „Досие край огъня“
   Архивно, разказвателно, топло. Жаравата е светлина, не декорация. */

:root {
  --bg:        #070605;
  --card:      #0a0908;
  --surface:   #0c0806;
  --surface-2: #100b08;
  --raise:     #17100b;

  --line:      #241d18;
  --line-soft: #1c1611;
  --line-hair: #17110c;
  --line-warm: #2a2119;
  --line-mid:  #3a2f26;

  --text:      #ece7df;
  --text-2:    #ded5c7;
  --text-3:    #c8bfb1;
  --muted:     #b5a892;
  --muted-2:   #9c8d7c;
  --muted-3:   #8a7a68;
  --muted-4:   #7d6f5e;
  --dim:       #6b5d4e;
  --dim-2:     #5f5346;

  --ember:     #d4703a;
  --ember-lit: #e0824a;
  --free:      #7fc47f;
  --free-line: #2f5a2f;
  --warn-line: #6b3a22;

  --display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --player-h: 88px;
  --gut: clamp(18px, 4.6vw, 56px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--ember); color: var(--card); }

main, .sitefoot { max-width: 1240px; margin-inline: auto; }

/* ── шапка ─────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  max-width: 1240px; margin-inline: auto;
  padding: 20px var(--gut);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  font-size: 19px; font-weight: 600;
  letter-spacing: .5em; padding-left: .5em;
  color: var(--text); text-decoration: none;
}

.topnav {
  display: flex; align-items: center; gap: clamp(14px, 2.6vw, 34px);
  font-size: 14px;
}
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--text); }

/* ── бутони ────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex; align-items: center; gap: 11px;
  background: var(--ember); color: var(--card);
  border: 0; border-radius: 8px;
  padding: 15px 28px;
  font-size: 16px; font-weight: 600;
  transition: background .15s, transform .12s;
}
.btn-primary:hover { background: var(--ember-lit); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary.sm { padding: 9px 18px; font-size: 14px; border-radius: 6px; }
.btn-primary.wide { width: 100%; justify-content: center; }

.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line-mid); border-radius: 8px;
  padding: 15px 24px; font-size: 15px;
  transition: border-color .15s;
}
.btn-ghost:hover { border-color: var(--dim); }

/* ── герой ─────────────────────────────────────────────── */

.hero {
  display: grid;
  justify-items: center;
  gap: clamp(24px, 3.4vw, 38px);
  padding: clamp(40px, 5.4vw, 68px) var(--gut) clamp(36px, 4.4vw, 52px);
  border-bottom: 1px solid var(--line-soft);

  /* Снимката е атмосфера, не сюжет. Тъмно в средата, под текста;
     жаравата остава да тлее по краищата. */
  background:
    radial-gradient(96% 86% at 50% 42%,
      rgba(7, 6, 5, .95) 0%,
      rgba(7, 6, 5, .86) 48%,
      rgba(7, 6, 5, .68) 100%),
    url(img/hero-wide.jpg) center / cover no-repeat,
    var(--card);
}

/* Двете корици лежат една върху друга и се преливат кръстосано —
   така никога няма кадър, в който няма нищо. */
.hero-art {
  position: relative;
  width: min(340px, 68vw);
  aspect-ratio: 1;
  border-radius: 8px;
  box-shadow: 0 30px 60px -20px #000, 0 0 0 1px var(--line-warm);
  overflow: hidden;
}

.hero-art img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 1; transform: scale(1);
  transition:
    opacity 900ms cubic-bezier(.4, 0, .2, 1),
    transform 1700ms cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}

/* Скритата стои леко отдалечена; при излизане напред се прибира
   до мащаб 1 и това дава дишането, което липсваше. */
.hero-art img.is-back { opacity: 0; transform: scale(1.045); }

@media (prefers-reduced-motion: reduce) {
  .hero-art img { transition: opacity 200ms linear; transform: none; }
  .hero-art img.is-back { transform: none; }
}

.hero-body { max-width: 680px; }

.eyebrow {
  margin: 0 0 20px;
  font-size: 12px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--muted-3);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.03;
  letter-spacing: -.01em;
  margin: 0 0 22px;
  text-wrap: pretty;
}

.hero-desc {
  font-size: 17px; line-height: 1.7; color: var(--text-3);
  max-width: 560px; margin: 0 0 24px;
  text-wrap: pretty;
}

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 20px;
  margin: 0 0 32px;
  font-size: 14px; color: var(--muted-2);
}
.hero-meta i { font-style: normal; color: var(--line-mid); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ── каталог ───────────────────────────────────────────── */

.seasons { padding: clamp(32px, 4vw, 44px) var(--gut) clamp(44px, 5vw, 56px); }

.section-title {
  font-family: var(--display); font-weight: 400;
  font-size: 26px; margin: 0 0 22px;
}

.shelf {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}

.shelf button {
  background: none; border: 0; padding: 0; text-align: left;
  display: block; width: 100%;
}
.shelf .art {
  aspect-ratio: 1; border-radius: 8px;
  background-color: var(--surface); background-size: cover; background-position: center;
  box-shadow: 0 0 0 1.5px var(--line);
  opacity: .55;
  transition: opacity .18s, box-shadow .18s;
}
.shelf button:hover .art { opacity: .8; }
.shelf button[aria-selected="true"] .art {
  opacity: 1; box-shadow: 0 0 0 1.5px var(--ember);
}
.shelf .label {
  font-size: 12px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--muted-3); margin-top: 10px;
}
.shelf button[aria-selected="true"] .label { color: var(--text-3); }
.shelf button:focus-visible .art { outline: 2px solid var(--ember); outline-offset: 3px; }

.season-title {
  font-family: var(--display); font-style: italic;
  font-size: 18px; color: var(--muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 24px; margin: 0 0 8px;
}

/* ── епизоди ───────────────────────────────────────────── */

.episodes { list-style: none; margin: 0; padding: 0; }

.ep {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 20px; align-items: center;
  padding: 16px 8px;
  border-bottom: 1px solid var(--line-hair);
  cursor: pointer;
  transition: background .13s;
}
.ep:hover { background: var(--surface-2); }
.ep:focus-visible { outline: 2px solid var(--ember); outline-offset: -2px; }

.ep-num {
  font-family: var(--display); font-size: 22px;
  color: var(--dim-2); text-align: center;
  font-variant-numeric: tabular-nums;
}
.ep.playing .ep-num { color: var(--ember); }

.ep-head {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 5px;
}
.ep-name { font-size: 16px; color: var(--text); }
.ep.playing .ep-name { color: var(--ember); }
.ep-dur { font-size: 13px; color: var(--muted-4); }

.tag {
  font-size: 10px; letter-spacing: .14em;
  padding: 2px 7px; border-radius: 4px; border: 1px solid;
  white-space: nowrap;
}
.tag.free { color: var(--free); border-color: var(--free-line); }
.tag.warn { color: var(--ember-lit); border-color: var(--warn-line); letter-spacing: .1em; }

.ep-progress {
  margin-top: 9px; height: 3px; width: 220px; max-width: 60%;
  background: var(--line); border-radius: 2px; overflow: hidden;
}
.ep-progress i { display: block; height: 100%; background: var(--ember); }

.ep-go {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-mid);
  display: grid; place-items: center;
  color: var(--ember); font-size: 13px;
  transition: border-color .15s, background .15s;
}
.ep:hover .ep-go { border-color: var(--ember); background: rgba(212, 112, 58, .08); }
.ep.locked .ep-name { color: var(--muted-2); }
.ep.locked .ep-go { color: var(--muted-4); }

/* ── подвал ────────────────────────────────────────────── */

.sitefoot {
  border-top: 1px solid var(--line-soft);
  padding: 32px var(--gut) 44px;
  color: var(--muted-4); font-size: 13px;
}
.sitefoot p { margin: 0 0 7px; }
.foot-brand {
  font-size: 14px; font-weight: 600;
  letter-spacing: .44em; padding-left: .44em;
  color: var(--muted); margin-bottom: 12px;
}
.fine { font-size: 12px; color: var(--dim); }

/* ── плейър ────────────────────────────────────────────── */

.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.player-body {
  display: flex; align-items: center; gap: clamp(12px, 2vw, 26px);
  max-width: 1240px; margin-inline: auto;
  padding: 14px var(--gut);
  min-height: calc(var(--player-h) - 12px);
}

.play {
  width: 56px; height: 56px; flex: none;
  border-radius: 50%; border: 0;
  background: var(--ember); color: var(--card);
  display: grid; place-items: center;
  transition: background .15s, transform .12s;
}
.play:hover { background: var(--ember-lit); }
.play:active { transform: scale(.95); }
.play > svg { grid-area: 1 / 1; }
.play #ic-pause { display: none; }
.play.is-playing #ic-play { display: none; }
.play.is-playing #ic-pause { display: block; }

.player-skip { display: flex; gap: 14px; flex: none; }
.player-skip button {
  background: none; border: 0; padding: 4px 2px;
  color: var(--text-3); font-size: 13px;
  white-space: nowrap;
}
.player-skip button:hover { color: var(--text); }

.player-now {
  display: flex; align-items: center; gap: 12px;
  min-width: 0; flex: 0 1 240px;
}
.player-now img {
  width: 46px; height: 46px; flex: none;
  border-radius: 5px; box-shadow: 0 0 0 1px var(--line-warm);
}
.player-text { display: flex; flex-direction: column; min-width: 0; }
.player-title {
  font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-sub { font-size: 12px; color: var(--muted-4); }

.player-track { flex: 1 1 auto; min-width: 120px; }

#seek {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 12px; background: transparent; cursor: pointer;
  display: block;
}
#seek::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px;
  background: linear-gradient(to right,
    var(--ember) var(--pct, 0%), var(--line) var(--pct, 0%));
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--ember); margin-top: -4px;
  opacity: 0; transition: opacity .15s;
}
.player:hover #seek::-webkit-slider-thumb { opacity: 1; }
#seek::-moz-range-track { height: 5px; background: var(--line); border-radius: 3px; }
#seek::-moz-range-progress { height: 5px; background: var(--ember); border-radius: 3px; }
#seek::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--ember); }

.player-times {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted-4);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

.player-right { display: flex; gap: 12px; flex: none; }

.chip {
  background: transparent; border: 1px solid var(--line-mid);
  border-radius: 6px; padding: 7px 12px;
  font-size: 13px; color: var(--muted);
  white-space: nowrap;
  transition: color .13s, border-color .13s;
}
.chip:hover { color: var(--text); border-color: var(--dim); }
.chip.on { color: var(--ember); border-color: var(--warn-line); }

.sleep-menu {
  position: absolute; right: var(--gut); bottom: calc(100% - 6px);
  background: var(--raise); border: 1px solid var(--line-warm);
  border-radius: 12px; padding: 6px; min-width: 184px;
  box-shadow: 0 18px 44px -12px #000;
}
.sleep-menu button {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: 8px;
  padding: 10px 13px; font-size: 14px; color: var(--text-2);
}
.sleep-menu button:hover { background: var(--surface-2); }

/* ── модал ─────────────────────────────────────────────── */

.modal[hidden] { display: none; }

.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(5, 4, 3, .8);
  backdrop-filter: blur(6px);
  padding: 20px;
  overflow-y: auto;
}

.modal-card {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line-warm);
  border-radius: 14px;
  padding: clamp(26px, 4vw, 38px);
  width: min(100%, 460px);
  box-shadow: 0 40px 90px -30px #000;
}
.modal-card h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(24px, 3.4vw, 32px); line-height: 1.12;
  margin: 0 0 14px; text-wrap: pretty;
}
.modal-lead { margin: 0 0 22px; color: var(--text-3); font-size: 15px; }

.modal-x {
  position: absolute; top: 12px; right: 14px;
  background: transparent; border: 0; color: var(--muted-4);
  font-size: 26px; line-height: 1; padding: 4px 8px;
}
.modal-x:hover { color: var(--text); }

.perks {
  list-style: none; margin: 0 0 26px; padding: 0;
  display: flex; flex-direction: column; gap: 13px;
}
.perks li {
  display: grid; grid-template-columns: 16px 1fr; gap: 12px;
  font-size: 14.5px; color: var(--text-2);
}
.perks li::before { content: "—"; color: var(--ember); }

.price { display: flex; align-items: baseline; gap: 9px; margin-bottom: 4px; }
.price b { font-family: var(--display); font-size: 46px; font-weight: 400; }
.price span { color: var(--muted); font-size: 16px; }
#price-note { margin: 0 0 22px; }

.field { display: block; margin-bottom: 14px; }
.field span {
  display: block; font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted-3); margin-bottom: 7px;
}
.field input {
  width: 100%; font: inherit; font-size: 15px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-mid); border-radius: 8px;
  padding: 13px 14px;
}
.field input:focus { outline: none; border-color: var(--ember); }

#paywall-note { text-align: center; margin: 16px 0 0; letter-spacing: .06em; }

/* ── известия ──────────────────────────────────────────── */

.toast {
  position: fixed; z-index: 70;
  left: 50%; bottom: calc(var(--player-h) + 24px);
  transform: translate(-50%, 14px);
  background: var(--raise); color: var(--text);
  border: 1px solid var(--line-warm); border-radius: 999px;
  padding: 11px 22px; font-size: 14px;
  box-shadow: 0 16px 40px -12px #000;
  opacity: 0; transition: opacity .25s, transform .25s;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }

/* ── малки екрани ──────────────────────────────────────── */

@media (max-width: 940px) {
  .hero {
    /* Тесният кадър при изправен екран. */
    background:
      radial-gradient(120% 76% at 50% 44%,
        rgba(7, 6, 5, .95) 0%,
        rgba(7, 6, 5, .88) 52%,
        rgba(7, 6, 5, .74) 100%),
      url(img/hero-tall.jpg) center top / cover no-repeat,
      var(--card);
  }
  .player-now { display: none; }
}

@media (max-width: 720px) {
  :root { --player-h: 82px; }
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Шапката се цепеше на два реда — по-стегната разредка я побира. */
  .eyebrow { letter-spacing: .18em; margin-bottom: 16px; }

  /* Дългият надпис се пренасяше през иконата. Опашката пада,
     а бутонът заема реда си целия. */
  .cta-tail { display: none; }
  .hero-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .hero-actions button { width: 100%; justify-content: center; }
  .player-right, .player-skip { display: none; }
  .player-body { gap: 14px; }
  .play { width: 50px; height: 50px; }
  .ep { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 14px 4px; }
  .ep-num { font-size: 18px; }
  .ep-name { font-size: 15px; }
  .ep-go { width: 32px; height: 32px; font-size: 11px; }
  .topnav a[href="#catalog"] { display: none; }
}
