/* ==========================================================================
   Табакерки Империи — общая таблица стилей
   ========================================================================== */

:root {
  --bg-deep: #101812;
  --bg-panel: #182620;
  --bg-panel-alt: #1f3128;
  --ink: #f1e8d4;
  --ink-muted: #b9ab88;
  --ink-faint: #8a8068;
  --gold: #c6a153;
  --gold-bright: #e8ca86;
  --oxblood: #7c2d3a;
  --oxblood-bright: #a4404f;
  --rule: rgba(198, 161, 83, 0.35);
  --shadow-soft: rgba(4, 8, 5, 0.5);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Lora", Georgia, serif;
  --measure: 66ch;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(198,161,83,0.08), transparent 60%),
    radial-gradient(ellipse 140% 100% at 50% 110%, rgba(0,0,0,0.6), transparent 55%),
    var(--bg-deep);
  background-attachment: fixed;
}

::selection { background: var(--oxblood); color: var(--gold-bright); }

a { color: var(--gold-bright); text-decoration: none; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.page-frame {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-frame.is-leaving {
  opacity: 0;
  transform: scale(0.985);
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.6rem clamp(1.25rem, 5vw, 3.5rem) 1.4rem;
  border-bottom: 1px solid var(--rule);
}

.crest {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
}
.crest:hover { color: var(--gold-bright); }

.crest-icon {
  width: 30px;
  height: 30px;
  color: var(--gold);
  flex-shrink: 0;
}

.crest-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.6rem;
}

.site-nav a {
  font-variant: small-caps;
  letter-spacing: 0.03em;
  font-size: 1.02rem;
  color: var(--ink-muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--gold-bright);
}

.site-nav a.is-current {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

/* ---------- main / footer shell ---------- */

main { flex: 1; }

.site-footer {
  padding: 2rem clamp(1.25rem, 5vw, 3.5rem) 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 0.92rem;
}

.site-footer p { margin: 0; }

/* ---------- ornament divider ---------- */

.ornament {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: 260px;
  margin: 2.2rem auto;
  color: var(--gold);
}
.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.ornament svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ---------- index: hero ---------- */

.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

.hero-reveal > * {
  opacity: 0;
}

.hero-dek {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold-bright);
  margin-bottom: 0.9rem;
}

.hero-title {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  margin-bottom: 1.1rem;
}

.hero-intro {
  max-width: 58ch;
  margin: 0 auto;
  color: var(--ink-muted);
  font-size: 1.1rem;
}

/* ---------- exhibits grid ---------- */

.exhibits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.5rem clamp(1.25rem, 5vw, 3.5rem) clamp(3rem, 8vw, 5rem);
}

.exhibit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.7rem 1.5rem 1.6rem;
  background: linear-gradient(180deg, var(--bg-panel-alt), var(--bg-panel));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
  box-shadow: 0 10px 24px -18px var(--shadow-soft);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.exhibit-card:hover,
.exhibit-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 18px 30px -16px var(--shadow-soft);
}

.exhibit-icon {
  width: 30px;
  height: 30px;
  color: var(--gold);
}

.exhibit-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--ink);
}

.exhibit-teaser {
  color: var(--ink-muted);
  font-size: 0.98rem;
  line-height: 1.55;
  flex: 1;
}

.exhibit-cue {
  font-variant: small-caps;
  font-size: 0.92rem;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}

/* ---------- article pages ---------- */

.article {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 5vw, 2rem) clamp(3rem, 8vw, 4.5rem);
}

.article-header { margin-bottom: 2rem; }

.article-dek {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold-bright);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.article-title {
  font-size: clamp(2.1rem, 5vw, 2.9rem);
}

.article section { margin-bottom: 2.1rem; }

.article h2 {
  font-size: 1.55rem;
  color: var(--gold-bright);
}

.article h3 {
  font-size: 1.25rem;
  color: var(--ink);
  margin-top: 1.4rem;
}

.legend-note {
  margin: 1.6rem 0;
  padding: 1.1rem 1.4rem;
  background: var(--bg-panel);
  border-left: 3px solid var(--oxblood-bright);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

.legend-note strong { color: var(--ink); font-weight: 600; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-variant: small-caps;
  color: var(--gold-bright);
}

/* ---------- transition veil ---------- */

.page-transition-veil {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  clip-path: circle(0% at 50% 50%);
  pointer-events: none;
  z-index: 999;
}

/* ---------- illustrative plates (framed photographs) ---------- */

.plate {
  margin: 2.4rem 0;
  text-align: center;
}

.plate-frame {
  position: relative;
  display: inline-block;
  padding: 10px;
  max-width: 100%;
  background: linear-gradient(155deg, var(--gold-bright), #7a5f26 55%, var(--gold));
  border-radius: 2px;
  box-shadow: 0 20px 36px -18px var(--shadow-soft);
  transition: box-shadow 0.3s ease;
}

.plate-frame:hover,
.plate-frame:focus-visible {
  box-shadow: 0 26px 42px -16px var(--shadow-soft);
}

.plate-frame::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(10, 14, 11, 0.4);
  pointer-events: none;
  z-index: 1;
}

.plate-frame img {
  display: block;
  max-width: 100%;
  min-width: 280px;
  min-height: 220px;
  max-height: 440px;
  width: auto;
  margin: 0 auto;
  background: #0c120e;
  filter: sepia(12%) saturate(102%) brightness(0.97);
  transition: transform 0.6s ease, filter 0.6s ease;
}

.plate-frame:hover img,
.plate-frame:focus-visible img {
  transform: scale(1.035);
  filter: sepia(0%) saturate(112%) brightness(1);
}

.plate-caption {
  margin-top: 0.9rem;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-muted);
  font-size: 1rem;
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}

.plate-credit {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.plate-credit a { color: var(--ink-faint); border-bottom: 1px dotted var(--ink-faint); }
.plate-credit a:hover, .plate-credit a:focus-visible { color: var(--gold-bright); border-bottom-color: var(--gold-bright); }

@media (max-width: 640px) {
  .site-header { flex-direction: column; align-items: flex-start; }
}
