/* Публичная оболочка. Эффекты только на transform, opacity и градиентах. */
template { display: none !important; }

body.spa {
  margin: 0;
  min-height: 100vh;
  color: #162033;
  background:
    radial-gradient(900px 480px at 8% -10%, rgba(232, 176, 122, 0.45), transparent 60%),
    radial-gradient(800px 520px at 100% 0%, rgba(28, 78, 140, 0.28), transparent 55%),
    linear-gradient(180deg, #f6f1e8 0%, #eef3f8 42%, #f7f8fb 100%);
}

html[data-theme="dark"] body.spa {
  color: #e7eef8;
  background:
    radial-gradient(800px 420px at 0% 0%, rgba(232, 176, 122, 0.16), transparent 55%),
    radial-gradient(900px 500px at 100% -10%, rgba(56, 120, 196, 0.28), transparent 50%),
    linear-gradient(180deg, #0c1422 0%, #101a2c 48%, #0b121c 100%);
}

body.spa a { color: inherit; }

#root { min-height: 100vh; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.bar, .head, .nav, .stage, .foot { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 14px 0 0;
  font-size: 13px;
  color: #5d6b7c;
}
html[data-theme="dark"] .bar { color: #9aabC2; }

.bar b { font-weight: 600; color: #17325c; }
html[data-theme="dark"] .bar b { color: #d5e4f8; }
.up { color: #0f8a4b; }
.down { color: #c53648; }

.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 8px;
}

.brand { text-decoration: none; }
.brand strong {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.brand span { display: block; margin-top: 6px; color: #5c6b7e; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 320px);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(23, 50, 92, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(22, 40, 70, 0.06);
  backdrop-filter: blur(10px);
}
html[data-theme="dark"] .search { background: rgba(16, 26, 44, 0.72); border-color: rgba(255,255,255,0.08); }
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 15px;
}

.nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  text-decoration: none;
  white-space: nowrap;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #24344c;
  transition: transform 160ms ease, background 160ms ease;
}
html[data-theme="dark"] .nav a { color: #d5e2f2; }
.nav a:hover { transform: translateY(-1px); background: rgba(255,255,255,0.7); }
html[data-theme="dark"] .nav a:hover { background: rgba(255,255,255,0.06); }
.nav a.is-on {
  color: #fff;
  background: linear-gradient(135deg, #16325c, #1f6f86);
  box-shadow: 0 8px 18px rgba(22, 50, 92, 0.22);
}

.stage { flex: 1; padding: 22px 0 48px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.stack { display: grid; gap: 16px; }

.hero, .card, .rail, .paper {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 50px rgba(28, 48, 78, 0.08);
  backdrop-filter: blur(8px);
}
html[data-theme="dark"] .hero,
html[data-theme="dark"] .card,
html[data-theme="dark"] .rail,
html[data-theme="dark"] .paper {
  background: rgba(16, 26, 42, 0.78);
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; overflow: hidden; min-height: 360px; }
.hero__copy { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.hero h1, .paper h1 { font-family: Unbounded, sans-serif; font-weight: 600; letter-spacing: -0.03em; line-height: 1.12; margin: 0; font-size: clamp(28px, 3vw, 44px); }
.hero h1 a, .card h2 a, .card h3 a, .line a { text-decoration: none; }
.lede { font-size: 18px; line-height: 1.55; color: #3d4c60; margin: 0; }
html[data-theme="dark"] .lede { color: #c5d2e2; }
.shot { min-height: 220px; background: linear-gradient(160deg, #d7e3f2, #f3e4d2); position: relative; overflow: hidden; }
.hero .shot { min-height: 100%; height: 100%; align-self: stretch; }
.paper > .shot { min-height: 280px; aspect-ratio: 16 / 9; border-radius: 16px; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.shot span { position: absolute; inset: auto 16px 16px auto; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: #17325c; }
.card__shot--empty { display: block; text-decoration: none; }

.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { padding: 18px 18px 16px; display: grid; gap: 10px; transition: transform 180ms ease, box-shadow 180ms ease; }
.card__shot { min-height: 150px; aspect-ratio: 16 / 10; border-radius: 14px; }
.pill--hot { background: #9a3412; color: #fff; }
.card:hover { transform: translateY(-3px); box-shadow: 0 22px 40px rgba(28, 48, 78, 0.12); }
.card h2, .card h3 { margin: 0; font-size: 20px; line-height: 1.25; font-family: Unbounded, sans-serif; font-weight: 600; }
.card p { margin: 0; color: #526277; line-height: 1.45; }
html[data-theme="dark"] .card p { color: #b7c6d8; }

body.spa a.pill,
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #122844 0%, #1a4564 62%, #6d3c1c 100%);
  box-shadow: 0 1px 2px rgba(18, 40, 68, 0.28);
  text-decoration: none;
}
.meta { color: #6b7888; font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }

body.spa a.btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  background: linear-gradient(135deg, #16325c 0%, #1d6d8a 55%, #d08955 140%);
  background-size: 140% 100%;
  box-shadow: 0 10px 24px rgba(22, 50, 92, 0.22);
  transition: transform 160ms ease, background-position 220ms ease;
}
.btn:hover { transform: translateY(-2px); background-position: 100% 0; }
body.spa a.btn.ghost,
.btn.ghost {
  color: #17325c;
  background: rgba(255,255,255,0.7);
  box-shadow: none;
  border: 1px solid rgba(23, 50, 92, 0.12);
}
html[data-theme="dark"] body.spa a.btn.ghost,
html[data-theme="dark"] .btn.ghost { color: #e7eef8; background: rgba(255,255,255,0.04); }

.preview {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 16px;
  align-items: start;
  padding: 14px;
}
.preview__shot { min-height: 112px; aspect-ratio: 16 / 10; border-radius: 14px; }
.preview h2 { margin: 8px 0 6px; font-size: 18px; line-height: 1.3; font-family: Unbounded, sans-serif; font-weight: 600; }
.preview h2 a { text-decoration: none; }
.preview p { margin: 0 0 8px; color: #526277; line-height: 1.45; }
html[data-theme="dark"] .preview p { color: #b7c6d8; }

.line { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid rgba(23, 50, 92, 0.08); text-decoration: none; }
.line time { color: #6b7888; font-size: 13px; padding-top: 3px; }
.line strong { display: block; font-size: 16px; line-height: 1.35; }

.rail { padding: 18px; display: grid; gap: 8px; position: sticky; top: 16px; }
.rail h2 { margin: 0 0 6px; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: #6b7888; font-weight: 600; }
.rail a { text-decoration: none; padding: 8px 0; border-top: 1px solid rgba(23, 50, 92, 0.08); line-height: 1.35; }
.rail a b { margin-right: 8px; color: #8b5e34; font-variant-numeric: tabular-nums; }
.brief { display: grid; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(23, 50, 92, 0.08); }
.brief p { margin: 0; color: #526277; font-size: 14px; line-height: 1.4; }
.brief input[type="email"] { border: 1px solid rgba(23, 50, 92, 0.15); border-radius: 12px; padding: 10px 12px; background: transparent; color: inherit; }
.hp { position: absolute; left: -9999px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #6b7888; }
.crumbs a { text-decoration: none; }
.sourcebox { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: rgba(23, 50, 92, 0.04); }
.sourcebox h2 { margin: 0; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.share { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.share a { text-decoration: none; }
blockquote { margin: 0; padding: 8px 0 8px 16px; border-left: 3px solid #9a3412; font-size: 18px; line-height: 1.5; color: #24344c; }
html[data-theme="dark"] blockquote { color: #d5e2f2; }
.days { display: flex; gap: 8px; }
.days div { flex: 1; text-align: center; padding: 8px 0; border-radius: 14px; background: rgba(23, 50, 92, 0.05); font-size: 12px; }
html[data-theme="dark"] .days div { background: rgba(255,255,255,0.04); }

.paper { padding: 28px; display: grid; gap: 14px; }
.paper p { margin: 0; line-height: 1.65; font-size: 17px; color: #24344c; }
html[data-theme="dark"] .paper p { color: #d5e2f2; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags a { text-decoration: none; padding: 6px 10px; border-radius: 999px; background: rgba(23, 50, 92, 0.06); font-size: 13px; }

.pager { display: flex; gap: 10px; }
.empty { padding: 48px 16px; text-align: center; color: #6b7888; border: 0; }
.rail .empty { display: none; }

.foot { padding: 10px 0 28px; color: #5d6b7c; }
.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; padding-top: 18px; border-top: 1px solid rgba(23, 50, 92, 0.1); }
.foot a { display: block; text-decoration: none; padding: 4px 0; }
.foot strong { font-family: Unbounded, sans-serif; }

.theme {
  margin-left: auto;
  border: 0;
  background: rgba(255,255,255,0.7);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  color: inherit;
}
html[data-theme="dark"] .theme { background: rgba(255,255,255,0.06); }

.fade { animation: rise 280ms ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .layout, .hero, .foot__grid { grid-template-columns: 1fr; }
  .rail { position: static; }
  .head { flex-direction: column; align-items: stretch; }
}
@media (max-width: 680px) {
  .bar, .head, .nav, .stage, .foot { width: min(100% - 20px, 1180px); }
  .mosaic { grid-template-columns: 1fr; }
  .preview { grid-template-columns: 1fr; }
  .preview__shot { min-height: 180px; }
  .line { grid-template-columns: 1fr; gap: 4px; }
  .hero { min-height: 0; }
}
