/* Ёру: светлая «бумажная» тема по умолчанию, тёмная по настройке системы.
   Форма: всё 6px. Акцент один: красная печать. */
:root {
  --bg: #f1f2ef;
  --surface: #e7e9e4;
  --ink: #16181d;
  --muted: #555a63;
  --line: #d3d6cf;
  --accent: #c9361f;
  --accent-ink: #fff;
  --shadow: 0 18px 40px -24px rgb(22 24 29 / .45);
  --r: 6px;
  --wrap: 1240px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121317;
    --surface: #1b1d22;
    --ink: #ecece8;
    --muted: #a3a7ae;
    --line: #2b2e35;
    --accent: #ef5a3f;
    --accent-ink: #120a08;
    --shadow: 0 18px 40px -24px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; }
h2 { font-size: clamp(30px, 4vw, 46px); }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.i { width: 1.15em; height: 1.15em; flex: none; }
.visually-hidden, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: fixed; top: 8px; left: 8px; z-index: 30; padding: 8px 14px; background: var(--ink); color: var(--bg); border-radius: var(--r); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--r);
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: transform .2s var(--ease), background-color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn--sm { height: 40px; padding: 0 14px; font-size: 15px; gap: 8px; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.top__row { display: flex; align-items: center; gap: 28px; height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo__seal {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--r);
  font: 800 20px/1 "Shippori Mincho B1", serif;
}
.logo__name { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; transition: color .2s; }
.nav a:hover { color: var(--ink); }
@media (max-width: 900px) { .nav { display: none; } .top .btn { margin-left: auto; } }
@media (max-width: 420px) { .top .btn span { display: none; } .top .btn { width: 40px; padding: 0; justify-content: center; } }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
  padding-block: clamp(36px, 7vw, 88px) clamp(48px, 7vw, 96px);
}
.hero h1 { font-size: clamp(40px, 5.6vw, 72px); max-width: 13ch; }
.hero__lead { margin-top: 22px; max-width: 46ch; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero__pick { position: relative; }
.hero__pick .card__poster { aspect-ratio: 4 / 5; }
.hero__caption { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 14px; }
.hero__caption strong { font-size: 19px; }
.hero__caption span { color: var(--muted); font-size: 15px; }
.stamp {
  position: absolute; top: 18px; left: 18px; z-index: 2;
  display: grid; place-items: center; width: 58px; height: 58px;
  border: 2px solid var(--accent); color: var(--accent); border-radius: var(--r);
  font: 800 19px/1.05 "Shippori Mincho B1", serif; writing-mode: vertical-rl; text-orientation: upright;
  background: color-mix(in srgb, var(--bg) 70%, transparent); transform: rotate(-6deg);
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero__pick { max-width: 440px; }
}

/* Poster: типографический постер из CSS, без кадров правообладателя */
.poster {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 3 / 4; border-radius: var(--r);
  background: var(--p-bg); color: var(--p-fg);
}
.poster::after { /* полутон печати */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: radial-gradient(rgb(0 0 0 / .22) 1px, transparent 1.4px);
  background-size: 5px 5px; mix-blend-mode: multiply; opacity: .32;
}
.poster__shape { position: absolute; z-index: 0; transition: transform .7s var(--ease); }
.poster__jp {
  position: absolute; z-index: 2; top: 7%; right: 8%; max-height: 74%;
  writing-mode: vertical-rl; font: 800 calc(var(--jpf, 1) * clamp(24px, 3.2vw, 40px))/1.12 "Shippori Mincho B1", serif;
  letter-spacing: .06em; text-wrap: balance;
}
.poster__foot {
  position: absolute; z-index: 2; left: 7%; right: 7%; bottom: 6%;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.poster__foot span:last-child { font-variant-numeric: tabular-nums; }
.poster--wide { aspect-ratio: 16 / 9; }
.poster--wide .poster__jp { font-size: calc(var(--jpf, 1) * clamp(22px, 2.6vw, 34px)); top: 10%; right: 5%; max-height: 70%; }

/* Shapes */
.s-sun { width: 64%; aspect-ratio: 1; border-radius: 50%; background: var(--p-ac); left: -12%; top: 18%; }
.s-moon { width: 52%; aspect-ratio: 1; border-radius: 50%; left: 6%; top: 10%; box-shadow: 26px 18px 0 0 var(--p-ac); }
.s-rain { inset: -10% 30% -10% -20%; background: repeating-linear-gradient(100deg, transparent 0 14px, var(--p-ac) 14px 16px); opacity: .85; }
.s-bands { left: 0; right: 0; top: 34%; height: 40%; background: repeating-linear-gradient(180deg, var(--p-ac) 0 12%, transparent 12% 22%); }
.s-grid { inset: 30% 34% 14% 8%; background-image: linear-gradient(var(--p-ac) 2px, transparent 2px), linear-gradient(90deg, var(--p-ac) 2px, transparent 2px); background-size: 22px 22px; opacity: .9; }
.s-ring { width: 74%; aspect-ratio: 1; border-radius: 50%; border: 18px solid var(--p-ac); left: -18%; bottom: -8%; }
.s-split { left: 0; top: 0; bottom: 0; width: 46%; background: var(--p-ac); }
.s-dot { width: 18%; aspect-ratio: 1; border-radius: 50%; background: var(--p-ac); left: 18%; top: 44%; box-shadow: 0 0 0 26px color-mix(in srgb, var(--p-ac) 35%, transparent); }

/* Sections */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section--tint { background: var(--surface); }
.section__lead { margin-top: 16px; max-width: 62ch; color: var(--muted); }

/* Filters */
.catalog__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 22px 40px; margin-bottom: 36px; }
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.chips, .segment { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 38px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  font-size: 15px; font-weight: 500; color: var(--muted);
  transition: color .2s, border-color .2s, background-color .2s;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.segment { padding: 3px; border: 1px solid var(--line); border-radius: var(--r); gap: 2px; }
.segment .chip { border: 0; height: 32px; }

/* Grid */
.grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 32px) clamp(14px, 2vw, 26px); grid-auto-flow: dense;
}
.card { display: flex; flex-direction: column; gap: 14px; width: 100%; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
.card--wide { grid-column: span 2; }
.card__poster { display: block; position: relative; border-radius: var(--r); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.card--wide .card__poster { flex: 1 1 auto; min-height: 260px; }
.card--wide .card__poster .poster { position: absolute; inset: 0; aspect-ratio: auto; }
.card:hover .card__poster { transform: translateY(-4px); box-shadow: var(--shadow); }
.card:hover .poster__shape { transform: translate(4%, -3%); }
.card__title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 14px; }
.card.is-flash .card__poster { outline: 3px solid var(--accent); outline-offset: 3px; }
.card[hidden] { display: none; }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--wide { grid-column: span 2; }
  .card--wide .card__poster { min-height: 0; aspect-ratio: 16 / 10; }
}
@media (max-width: 420px) { .grid { grid-template-columns: 1fr; } .card--wide { grid-column: auto; } }

.empty { padding: 48px 0; max-width: 52ch; }
.empty__title { font-weight: 700; font-size: 21px; margin-bottom: 8px; }
.empty p:not(.empty__title) { color: var(--muted); margin-bottom: 20px; }

/* Runtime chart */
.runtime { margin-top: 44px; position: relative; display: grid; gap: 10px; --scale: 640; }
.rt-row { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: 18px; align-items: center; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.rt-row__name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.rt-row__name small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.rt-track { position: relative; height: 26px; }
.rt-bar {
  position: absolute; left: 0; top: 3px; bottom: 3px; border-radius: 3px;
  width: calc(var(--min) / var(--scale) * 100%);
  background: var(--ink); transform-origin: left center;
  transition: transform 1.1s var(--ease), opacity .3s;
}
.rt-bar--series { background: repeating-linear-gradient(90deg, var(--accent) 0 calc(var(--ep) - 2px), transparent calc(var(--ep) - 2px) var(--ep)); }
.rt-row:hover .rt-bar { opacity: .75; }
.rt-row__min { position: absolute; top: 50%; transform: translateY(-50%); left: calc(var(--min) / var(--scale) * 100% + 10px); font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.runtime__line { position: absolute; top: -14px; bottom: -8px; width: 0; border-left: 2px dashed var(--accent); pointer-events: none; }
.runtime.is-hidden .rt-bar { transform: scaleX(0); }
.runtime__legend { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 30px; font-size: 14px; color: var(--muted); }
.runtime__legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 22px; height: 10px; border-radius: 2px; }
.sw--film { background: var(--ink); }
.sw--series { background: repeating-linear-gradient(90deg, var(--accent) 0 5px, transparent 5px 7px); }
.sw--line { height: 0; border-top: 2px dashed var(--accent); border-radius: 0; }
@media (max-width: 640px) {
  .rt-row { grid-template-columns: 1fr; gap: 6px; }
  .runtime__line { display: none; }
}

/* Pairs */
.pairs {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(520px, 86vw);
  gap: 20px; margin-top: 40px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px max(16px, calc((100vw - var(--wrap)) / 2)) 20px; scroll-padding-inline: max(16px, calc((100vw - var(--wrap)) / 2));
  scrollbar-width: thin;
}
.pair { scroll-snap-align: start; display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); }
.pair button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.pair .poster { aspect-ratio: 4 / 5; }
.pair .poster__jp { font-size: calc(var(--jpf, 1) * 22px); }
.pair .poster__foot span:first-child { display: none; }
.pair .poster__foot { justify-content: flex-end; }
.pair__arrow { color: var(--accent); width: 26px; height: 26px; }
.pair__why { grid-column: 1 / -1; color: var(--muted); font-size: 15px; }
.pair__why strong { color: var(--ink); font-weight: 600; }

/* About */
.about__statement { font-size: clamp(24px, 3.1vw, 38px); line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; max-width: 30ch; }
.about__facts { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr; gap: 28px; margin: 56px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.about__facts dt { font-weight: 700; margin-bottom: 6px; }
.about__facts dd { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 760px) { .about__facts { grid-template-columns: 1fr; } }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 36px; }
.foot__row { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; }
.foot p { color: var(--muted); font-size: 14px; flex: 1; min-width: 240px; }
.foot__up { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; font-weight: 600; font-size: 15px; }

/* Sheet (modal) */
.sheet {
  width: min(1120px, 100% - 24px); max-height: min(92dvh, 900px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg); color: var(--ink); box-shadow: 0 40px 120px -30px rgb(0 0 0 / .55);
  overflow: auto;
}
.sheet::backdrop { background: rgb(10 11 14 / .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet[open] { animation: sheet-in .5s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }
.sheet__body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; padding: 28px; }
.sheet__jp { font: 800 18px/1.3 "Shippori Mincho B1", serif; color: var(--accent); margin-bottom: 8px; }
.sheet__info h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 18px; }
.sheet__info h3 { font-size: 15px; margin: 22px 0 6px; letter-spacing: 0; }
.sheet__info p { color: var(--muted); font-size: 16px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.tag { font-size: 13px; padding: 4px 10px; border-radius: var(--r); background: var(--surface); color: var(--muted); }
.sheet__bar { display: flex; justify-content: space-between; gap: 12px; padding: 0 28px 24px; }
.sheet__close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); cursor: pointer;
}
.sheet__close:hover { border-color: var(--ink); }
@media (max-width: 860px) { .sheet__body { grid-template-columns: 1fr; padding: 18px; gap: 22px; } .sheet__bar { padding: 0 18px 18px; } }

.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #0d0e11; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .poster { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.player__go {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 24px 0 20px;
  border: 0; border-radius: var(--r); background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 0 12px 30px -10px rgb(0 0 0 / .5);
  transition: transform .25s var(--ease);
}
.player__go:hover { transform: translate(-50%, -50%) scale(1.04); }
.player__go:active { transform: translate(-50%, -50%) scale(.98); }
.player__note { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* Reveal */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * 60ms); }
  .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .runtime.is-hidden .rt-bar { transform: none; }
}
