:root {
  --bg: #f3ebe0;
  --bg-2: #ebe0d2;
  --ink: #2a2118;
  --soft: #6b5c4d;
  --line: rgba(42, 33, 24, 0.14);
  --accent: #c45c26;
  --accent-deep: #9e471c;
  --board: #2f3a42;
  --chalk: #e8f0f4;
  --paper: #fff8f0;
  --pad: clamp(16px, 4vw, 20px);
  --max: 1100px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(243, 235, 224, 0.92), rgba(243, 235, 224, 0.96)),
    repeating-linear-gradient(
      0deg,
      transparent 0 23px,
      rgba(42, 33, 24, 0.035) 23px 24px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 23px,
      rgba(42, 33, 24, 0.035) 23px 24px
    ),
    var(--bg);
  line-height: 1.55;
  overflow-x: hidden;
}
body::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--accent) 0 18%, transparent 18% 28%, var(--accent) 28% 36%, transparent 36%);
  background-size: 140px 5px;
  animation: couch-stripe 22s linear infinite;
}
@keyframes couch-stripe {
  from { background-position: 0 0; }
  to { background-position: 140px 0; }
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: #fff; }

.skip {
  position: absolute; left: 12px; top: -40px; background: var(--accent); color: #fff; padding: 8px 12px; z-index: 5;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(var(--max), calc(100% - (var(--pad) * 2)));
  margin-inline: auto;
}

.top {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(243, 235, 224, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  position: relative;
}
.brand {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.05rem, 2.8vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.15;
  max-width: min(14em, 70vw);
}
.brand span { color: var(--accent); }
.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: flex-end;
}
.top nav a {
  text-decoration: none;
  color: var(--soft);
  font-weight: 600;
  padding: 6px 0;
}
.top nav a[aria-current="page"],
.top nav a:hover { color: var(--accent); }

.nav-drop {
  position: relative;
}
.nav-drop > summary {
  list-style: none;
  cursor: pointer;
  color: var(--soft);
  font-weight: 600;
  padding: 6px 0;
}
.nav-drop > summary::-webkit-details-marker { display: none; }
.nav-drop > summary::after {
  content: "";
  display: inline-block;
  margin-left: 0.4em;
  border: 5px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
}
.nav-drop[open] > summary,
.nav-drop > summary:hover { color: var(--accent); }
.nav-drop-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 18px;
  min-width: 14rem;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(42, 33, 24, 0.1);
}
.nav-drop-panel a {
  padding: 6px 0;
  white-space: nowrap;
}
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block; height: 1.5px; margin: 6px 10px; background: var(--ink);
}

.kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
}
h1, h2, h3 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
h1 { font-size: clamp(2.1rem, 8vw, 4.8rem); margin: 0 0 14px; }
h2 { font-size: clamp(1.45rem, 4vw, 2.4rem); margin: 0 0 12px; }
.lede {
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  color: var(--soft);
  max-width: 36rem;
  margin: 0;
}

.hero {
  margin: 0;
  padding: clamp(12px, 2vw, 20px) var(--pad) 0;
  background: transparent;
  animation: rise 0.7s ease both;
}
.hero-stage {
  position: relative;
  width: min(var(--max), 100%);
  margin-inline: auto;
  min-height: min(88vh, 720px);
  display: grid;
  align-items: end;
  padding: clamp(28px, 6vw, 48px) clamp(16px, 3vw, 28px) clamp(36px, 7vw, 56px);
  overflow: hidden;
  background: var(--board);
}
.hero-plane {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 38%;
  width: 62%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
}
.hero-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      90deg,
      #f3ebe0 0%,
      #f3ebe0 42%,
      rgba(243, 235, 224, 0.88) 52%,
      rgba(243, 235, 224, 0.25) 68%,
      transparent 80%
    );
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  z-index: 2;
  width: min(34rem, 100%);
  max-width: 34rem;
  margin: 0;
  padding: 8px 0;
}
.hero .lede { color: var(--soft); max-width: 32rem; }
.hero .btn.ghost {
  background: rgba(243, 235, 224, 0.9);
  border-color: rgba(42, 33, 24, 0.22);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 12px 18px;
  min-height: 44px;
}
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn.ghost:hover { border-color: var(--ink); }

.band {
  width: 100%;
  margin: 0;
  padding: clamp(16px, 3vw, 22px) 0;
  border-block: 1px solid var(--line);
  background: var(--paper);
}
.band p {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.05rem, 2.6vw, 1.45rem);
  line-height: 1.35;
  max-width: 40em;
  color: var(--soft);
}

.section { padding: clamp(32px, 6vw, 48px) 0 clamp(48px, 8vw, 64px); }
.section > h2 { margin-bottom: 18px; text-align: center; }
.section > .kicker { text-align: center; }
.section > p { text-align: center; }

.doors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
a.door {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 100%;
  min-width: 0;
  padding: 18px 0 8px;
  text-align: center;
  text-decoration: none;
  border-top: 2px solid var(--line);
  transition: border-color 0.25s ease, transform 0.25s ease;
  animation: rise 0.65s ease both;
}
a.door:nth-child(2) { animation-delay: 0.08s; }
a.door:nth-child(3) { animation-delay: 0.16s; }
a.door:hover {
  border-top-color: var(--accent);
  transform: translateY(-2px);
}
a.door .num {
  color: var(--accent);
  font-family: Fraunces, Georgia, serif;
  font-size: 1.2rem;
}
a.door h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.7rem); }
a.door p { margin: 0; color: var(--soft); max-width: 22rem; }

.doors-cover,
.doors-actors {
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
a.door-cover,
a.door-actor {
  padding-top: 0;
  border-top: none;
  gap: 10px;
}
a.door-cover img,
a.door-actor img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
  background: var(--bg-2);
}
a.door-actor img { aspect-ratio: 2 / 3; }
a.door-cover:hover,
a.door-actor:hover { transform: translateY(-3px); }
a.door-cover .num,
a.door-actor .num { font-size: 0.95rem; }
a.door-cover h2,
a.door-actor h2 { font-size: clamp(1.15rem, 2.8vw, 1.5rem); }
.row a.door-cover { padding-top: 0; border-top: none; }
.credit { margin: 0 0 22px; font-size: 0.92rem; }
.credit a { color: var(--accent); }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.pager-auto {
  flex-direction: column;
  min-height: 1px;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.pager-sentinel {
  width: 100%;
  height: 1px;
  pointer-events: none;
}

.portrait {
  margin: 8px 0 28px;
  max-width: min(280px, 70%);
}
.portrait img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
  background: var(--bg-2);
}
.portrait figcaption {
  margin-top: 8px;
  color: var(--soft);
  font-size: 0.88rem;
}
.portrait figcaption a { color: var(--accent); }

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.row > [class*="col-"] { min-width: 0; }
.row a.door { padding: 18px 0 8px; }

.article {
  width: min(68ch, calc(100% - (var(--pad) * 2)));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 36px) 0 clamp(48px, 8vw, 72px);
}
.article h1 { font-size: clamp(1.9rem, 6.5vw, 3.8rem); }
.prose h2 { margin: 1.4em 0 0.3em; }
.prose p, .prose li { font-size: clamp(1rem, 2.2vw, 1.1rem); }
.prose a { text-underline-offset: 3px; text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose blockquote {
  margin: 1em 0;
  padding-left: 0.9em;
  border-left: 3px solid var(--accent);
  color: var(--soft);
}

.empty, .quiet { color: var(--soft); }
.stop {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.95rem;
}

.foot {
  border-top: 1px solid var(--line);
  padding: clamp(24px, 4vw, 28px) 0 clamp(32px, 6vw, 40px);
  color: var(--soft);
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
.foot .brand { font-size: clamp(1.2rem, 3vw, 1.35rem); margin: 0 0 8px; }
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.foot nav a { text-decoration: none; font-weight: 600; color: var(--soft); }
.foot nav a:hover { color: var(--accent); }
.foot > div:last-child {
  text-align: right;
}
.foot > div:last-child p { margin: 0 0 6px; }
.foot-copy { margin: 0; font-size: 0.92rem; }

/* Планшет */
@media (min-width: 700px) {
  .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
  .doors-cover,
  .doors-actors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Широкий экран */
@media (min-width: 1000px) {
  .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .doors-cover,
  .doors-actors { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Узкий планшет / большой телефон: hero ещё сбоку, меню уже бургер */
@media (max-width: 900px) {
  .hero-plane { left: 48%; width: 52%; }
  .hero-stage::after {
    background: linear-gradient(
      90deg,
      #f3ebe0 0%,
      #f3ebe0 48%,
      rgba(243, 235, 224, 0.88) 58%,
      rgba(243, 235, 224, 0.25) 74%,
      transparent 88%
    );
  }
}

/* Мобильное меню и компактный hero */
@media (max-width: 800px) {
  .nav-toggle { display: inline-flex; flex-direction: column; justify-content: center; }
  .top { border-bottom-color: var(--line); }
  .top nav {
    display: none;
    position: absolute;
    top: 100%;
    left: calc(var(--pad) * -1);
    right: calc(var(--pad) * -1);
    width: calc(100% + var(--pad) * 2);
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 4px var(--pad) 12px;
    box-shadow: 0 12px 24px rgba(42, 33, 24, 0.08);
  }
  body.nav-open .top nav { display: flex; }
  body.nav-open .top { border-bottom-color: transparent; }
  .top nav a {
    padding: 14px 0;
    border-top: 1px solid var(--line);
  }
  .nav-drop {
    border-top: 1px solid var(--line);
  }
  .nav-drop > summary {
    padding: 14px 0;
  }
  .nav-drop-panel {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
    margin: 0 0 8px;
    padding: 4px 0 8px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .nav-drop-panel a {
    border-top: none;
    padding: 8px 0;
  }

  .hero { padding: 12px var(--pad) 0; }
  .hero-stage {
    min-height: auto;
    padding: 36px 16px 40px;
    align-items: end;
  }
  .hero-plane {
    left: 0;
    width: 100%;
    object-position: center top;
    opacity: 0.35;
  }
  .hero-stage::after {
    background: linear-gradient(
      180deg,
      #f3ebe0 0%,
      #f3ebe0 42%,
      rgba(243, 235, 224, 0.92) 68%,
      rgba(243, 235, 224, 0.72) 100%
    );
  }
  .hero .wrap {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .actions .btn { flex: 1 1 auto; }
}

/* Узкий телефон */
@media (max-width: 480px) {
  .brand { max-width: 11.5em; }
  .doors-cover,
  .doors-actors { grid-template-columns: 1fr 1fr; gap: 12px; }
  a.door-cover p,
  a.door-actor p { display: none; }
  .portrait { max-width: 100%; }
  .band p { font-size: 1.05rem; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
}

@media print {
  .top, .foot, .nav-toggle, .actions, body::before { display: none !important; }
  body { background: white; color: black; }
  a { color: black; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before, .hero, a.door { animation: none; }
  a.door { transition: none; }
}
