/* ==========================================================================
   Бюро находок на Лесной — design tokens
   Палитра: архивная бумага, тёмная академия, лавка любопытностей.
   ========================================================================== */

:root {
  --paper: #E4DFC8;         /* фон: тёплый серо-зелёный пергамент, не белый */
  --paper-light: #EEEADA;   /* карточки, панели: чуть светлее фона */
  --paper-dark: #D8D2B8;    /* углубления, обводки полей */
  --ink: #2A2620;           /* основной текст, почти чёрный тёплый */
  --ink-soft: #55503f;      /* второстепенный текст */
  --forest: #3E4F3C;        /* глубокий мох — навигация, заголовки-акценты */
  --forest-dark: #2C3A2B;
  --oxblood: #7C2F2B;       /* сургуч — ссылки, акценты, hover */
  --oxblood-dark: #5f2320;
  --brass: #A9863E;         /* латунь — обводки, теги, метки */

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --container-pad: 1.25rem;
  --radius-card: 3px;
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(169, 134, 62, 0.07), transparent 55%),
    radial-gradient(ellipse at 100% 30%, rgba(62, 79, 60, 0.06), transparent 50%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--forest-dark);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  font-optical-sizing: auto;
}

a { color: var(--oxblood); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--oxblood-dark); }

:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--paper-light);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  z-index: 2000;
  border: 1px solid var(--brass);
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.container { max-width: 1180px; padding-left: var(--container-pad); padding-right: var(--container-pad); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin: 0 0 0.6em;
}

.btn-find, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  padding: 0.7em 1.3em;
  border: 1px solid var(--forest-dark);
  border-radius: 2px;
  background: transparent;
  color: var(--forest-dark);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.btn-find { background: var(--forest-dark); color: var(--paper-light); }
.btn-find:hover { background: var(--oxblood-dark); border-color: var(--oxblood-dark); color: var(--paper-light); transform: translateY(-1px); }
.btn-ghost:hover { background: var(--forest-dark); color: var(--paper-light); }

/* ==========================================================================
   Emblem (signature mark)
   ========================================================================== */

.brand-emblem svg { width: 38px; height: 38px; display: block; }
.emblem-ring { fill: none; stroke: var(--brass); stroke-width: 1.4; }
.emblem-eye { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.emblem-pupil { fill: var(--ink); }
.emblem-key { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   Header / navbar
   ========================================================================== */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--paper-dark);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.custom-navbar { padding: 0.7rem 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.32rem;
  line-height: 1.05;
  color: var(--forest-dark);
  display: flex;
  flex-direction: column;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 400;
}

.navbar-toggler {
  border: 1px solid var(--forest-dark);
  border-radius: 2px;
  padding: 0.4rem 0.55rem;
}
.navbar-toggler:focus { box-shadow: none; }
.toggler-lines { display: flex; flex-direction: column; gap: 4px; width: 20px; }
.toggler-lines span { height: 2px; background: var(--forest-dark); display: block; }

.navbar-nav { gap: 0.25rem; padding-top: 0.75rem; }
.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--ink) !important;
  padding: 0.55rem 0.6rem !important;
  border-bottom: 1px solid transparent;
}
.nav-link:hover { color: var(--oxblood) !important; border-bottom-color: var(--oxblood); }

@media (min-width: 992px) {
  .navbar-nav { padding-top: 0; gap: 0.5rem; }
  .nav-link { padding: 0.4rem 0.7rem !important; }
}

/* ==========================================================================
   Postal perforation divider (signature motif)
   ========================================================================== */

.perforation {
  height: 18px;
  background-image:
    linear-gradient(135deg, var(--paper) 24%, transparent 24%),
    linear-gradient(225deg, var(--paper) 24%, transparent 24%);
  background-position: 0 0, 9px 0;
  background-size: 18px 18px;
  background-repeat: repeat-x;
  background-color: transparent;
  margin-top: -1px;
}
.perforation.flip {
  transform: scaleY(-1);
  margin-top: 0;
  margin-bottom: -1px;
}
.article-perforation { margin: 2.5rem 0; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { padding: 2.4rem 0 0; }

.hero-grid { display: flex; flex-direction: column; gap: 1.6rem; }

.hero-figure { margin: 0; position: relative; }
.hero-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-card);
  filter: sepia(12%) saturate(85%);
  border: 1px solid var(--paper-dark);
}
.stamp {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  background: var(--paper-light);
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 0.35em 0.6em;
  transform: rotate(-2deg);
  box-shadow: 2px 2px 0 rgba(42, 38, 32, 0.15);
}

.hero-text h1 {
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "SOFT" 40, "opsz" 72;
  margin-bottom: 0.4em;
}
.hero-text .lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-bottom: 1.3em;
}

@media (min-width: 992px) {
  .hero-grid { flex-direction: row; align-items: center; gap: 3rem; padding-bottom: 1.5rem; }
  .hero-figure { flex: 0 0 46%; }
  .hero-text { flex: 1; }
}

/* ==========================================================================
   Archive / cards
   ========================================================================== */

.archive { padding: 2.6rem 0 0.5rem; background: var(--paper); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.section-head h2 { font-size: 1.9rem; font-style: italic; }

@media (min-width: 768px) {
  .section-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}

.find-card {
  background: var(--paper-light);
  border: 1px solid var(--paper-dark);
  border-radius: var(--radius-card);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.find-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 16px 16px 0;
  border-color: transparent var(--paper) transparent transparent;
  filter: drop-shadow(-1px 1px 1px rgba(42,38,32,0.18));
}
.find-card:hover { transform: translateY(-3px); box-shadow: 0 8px 16px rgba(42, 38, 32, 0.12); }

.card-media { position: relative; display: block; text-decoration: none; }
.card-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  filter: sepia(12%) saturate(85%);
}
.card-tag {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  background: var(--forest-dark);
  color: var(--paper-light);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3em 0.55em;
}

.card-body { padding: 1.1rem 1.15rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.card-num { font-family: var(--font-mono); font-size: 0.7rem; color: var(--brass); margin: 0 0 0.3em; letter-spacing: 0.05em; }
.find-card h3 { font-size: 1.25rem; margin-bottom: 0.4em; }
.find-card h3 a { color: var(--forest-dark); text-decoration: none; }
.find-card h3 a:hover { color: var(--oxblood); }
.card-body p:not(.card-num) { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 0.9em; flex: 1; }
.card-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
  align-self: flex-start;
  border-bottom: 1px solid var(--oxblood);
}

/* ==========================================================================
   About the author
   ========================================================================== */

.author { padding: 3rem 0; background: var(--paper-light); }

.author-grid { display: flex; flex-direction: column; gap: 1.8rem; }

.author-portrait { position: relative; max-width: 320px; }
.author-portrait img {
  width: 100%;
  display: block;
  border-radius: var(--radius-card);
  filter: sepia(15%) saturate(80%) contrast(1.02);
  border: 1px solid var(--paper-dark);
}
.portrait-stamp {
  position: absolute;
  top: 0.7rem;
  right: -0.6rem;
  background: var(--paper);
  border: 1px solid var(--brass);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35em 0.55em;
  transform: rotate(3deg);
  color: var(--forest-dark);
}

.author-text h2 { font-size: 2rem; font-style: italic; }
.author-text p { margin-bottom: 1em; color: var(--ink-soft); }
.author-text .signature {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
}

@media (min-width: 768px) {
  .author-grid { flex-direction: row; gap: 3rem; align-items: center; }
  .author-portrait { flex: 0 0 300px; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--forest-dark);
  color: var(--paper-light);
  padding: 2.8rem 0 1.4rem;
}

.footer-grid { display: grid; gap: 2.2rem; grid-template-columns: 1fr; }

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.3fr 0.8fr 1fr; }
}

.footer-brand-link { color: var(--paper-light); }
.footer-brand .brand-text { color: var(--paper-light); }
.footer-brand .brand-sub { color: rgba(238, 234, 218, 0.6); }
.footer-brand .emblem-ring { stroke: var(--brass); }
.footer-brand .emblem-eye, .footer-brand .emblem-key { stroke: var(--paper-light); }
.footer-brand .emblem-pupil { fill: var(--paper-light); }
.footer-note { font-size: 0.85rem; color: rgba(238, 234, 218, 0.65); margin-top: 1rem; line-height: 1.6; }

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.9rem;
}

.footer-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-nav a { color: var(--paper-light); text-decoration: none; font-size: 0.92rem; }
.footer-nav a:hover { color: var(--brass); }

.footer-subscribe form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.footer-subscribe input {
  flex: 1 1 140px;
  min-width: 0;
  background: rgba(238, 234, 218, 0.08);
  border: 1px solid rgba(238, 234, 218, 0.35);
  color: var(--paper-light);
  padding: 0.6em 0.8em;
  font-family: var(--font-body);
  border-radius: 2px;
}
.footer-subscribe input::placeholder { color: rgba(238, 234, 218, 0.5); }
.footer-subscribe input:focus { outline: 2px solid var(--brass); outline-offset: 1px; }
.footer-subscribe button {
  background: var(--brass);
  color: var(--forest-dark);
  border: none;
  padding: 0.6em 1em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border-radius: 2px;
  cursor: pointer;
}
.footer-subscribe button:hover { background: #c19a4c; }
.subscribe-msg { font-size: 0.82rem; margin: 0.6em 0 0; color: var(--brass); min-height: 1.2em; }

.footer-social { display: flex; gap: 0.7rem; margin-top: 1.1rem; }
.footer-social a {
  width: 32px; height: 32px;
  border: 1px solid rgba(238, 234, 218, 0.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--paper-light);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}
.footer-social a:hover { border-color: var(--brass); color: var(--brass); }

.footer-bottom {
  border-top: 1px solid rgba(238, 234, 218, 0.15);
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  font-size: 0.78rem;
  color: rgba(238, 234, 218, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* ==========================================================================
   Article page
   ========================================================================== */

.article-page { padding: 2.2rem 0 3rem; }

.breadcrumb-trail {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-bottom: 1.6rem;
}
.breadcrumb-trail a { color: var(--ink-soft); }

.article-head { max-width: 720px; margin: 0 auto 1.8rem; }
.article-head h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); font-style: italic; font-weight: 500; font-variation-settings: "SOFT" 40, "opsz" 72; }
.article-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--brass); }

.article-figure { max-width: 900px; margin: 0 auto 2rem; }
.article-figure img { width: 100%; border-radius: var(--radius-card); border: 1px solid var(--paper-dark); filter: sepia(12%) saturate(85%); }
.article-figure figcaption { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); margin-top: 0.6rem; }

.article-body { max-width: 680px; margin: 0 auto; font-size: 1.05rem; }
.article-body p { margin-bottom: 1.3em; }
.article-body .drop-cap:first-letter {
  font-family: var(--font-display);
  font-size: 3.4rem;
  float: left;
  line-height: 0.8;
  padding: 0.1em 0.1em 0 0;
  color: var(--oxblood);
  font-style: italic;
}
.article-body blockquote {
  border-left: 3px solid var(--brass);
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.2em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--forest-dark);
}
.article-body blockquote footer {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 0.5em;
}

.article-tags { max-width: 680px; margin: 0 auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.article-tags span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--brass);
  color: var(--forest-dark);
  padding: 0.3em 0.6em;
}

.article-nav { max-width: 680px; margin: 0 auto; }

/* ==========================================================================
   Scroll reveal & highlight (JS hooks)
   ========================================================================== */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.find-card.is-highlighted {
  box-shadow: 0 0 0 2px var(--oxblood), 0 8px 16px rgba(42, 38, 32, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
