/* ===========================
   Reset
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===========================
   Design Tokens — Elegant Dark
=========================== */
:root {
  /* ── Core palette ── */
  --bg:        #0B0B10;
  --bg-warm:   #0F0F16;
  --surface:   #16161E;
  --surface-2: #1C1C28;
  --surface-3: #22222F;
  --border:    rgba(212, 175, 55, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);

  /* ── Gold spectrum ── */
  --gold:       #D4AF37;
  --gold-light: #F0D060;
  --gold-dim:   #A08520;
  --gold-glow:  rgba(212, 175, 55, 0.15);
  --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #F0D060 50%, #D4AF37 100%);

  /* ── Text ── */
  --text:       #E8E4DC;
  --text-muted: #9A9590;
  --text-dim:   #6B6560;
  --text-gold:  #D4AF37;
  --text-white: #FAFAF8;

  /* ── Typography ── */
  --font-serif:  "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-base: 16px;
  --lh: 1.7;

  /* ── Spacing ── */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* ── Sizing ── */
  --max-width: 1200px;
  --container-padding: var(--sp-6);

  /* ── Decorative ── */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.5);
  --shadow-gold: 0 4px 24px rgba(212, 175, 55, 0.1);
  --t-fast: 0.2s ease;
  --t-base: 0.35s ease;
}

/* ===========================
   Base
=========================== */
html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: var(--lh);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--t-fast);
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text-white);
  line-height: 1.25;
  font-weight: 700;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* ===========================
   Header — Sleek Dark Bar
=========================== */
body > header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-4) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

body > header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold-gradient);
  opacity: 0.4;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-inline: auto;
  max-width: var(--max-width);
  padding-inline: var(--container-padding);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--text-white);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.logo:hover { color: var(--gold-light); text-decoration: none; }

.logo img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color var(--t-fast);
}

.logo:hover img {
  border-color: var(--gold);
}

.nav-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--sp-8);
}

.nav-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
  transition: color var(--t-fast);
}

.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--t-base);
}

.nav-menu a:hover {
  color: var(--gold);
  text-decoration: none;
}

.nav-menu a:hover::after {
  width: 100%;
}

#nav-toggle { display: none; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--sp-3);
}

.hamburger span {
  width: 22px;
  height: 1.5px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: all var(--t-fast);
}

/* ===========================
   Section Titles
=========================== */
.section-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: var(--sp-8);
  position: relative;
  padding-bottom: var(--sp-4);
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--gold-gradient);
}

/* ===========================
   Main Content Area
=========================== */
.content-wrapper {
  padding: var(--sp-12) 0;
}

section + section {
  margin-top: var(--sp-12);
}

/* ===========================
   Article Cards — Grid
=========================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-6);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border);
  box-shadow: var(--shadow-gold);
}

.card a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.card a:hover {
  text-decoration: none;
  color: inherit;
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity var(--t-base);
}

.card:hover .card-image {
  opacity: 1;
}

.card-body {
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  flex: 1;
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.35;
  transition: color var(--t-fast);
}

.card:hover h3 {
  color: var(--gold-light);
}

.card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card time {
  font-size: 0.75rem;
  color: var(--gold-dim);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-top: auto;
}

/* ── Featured first card ── */
.articles-grid .card:first-child {
  grid-column: 1 / -1;
}

.articles-grid .card:first-child a {
  flex-direction: row;
}

.articles-grid .card:first-child .card-image {
  width: 55%;
  min-width: 55%;
  aspect-ratio: auto;
  min-height: 340px;
}

.articles-grid .card:first-child .card-body {
  padding: var(--sp-8);
  justify-content: center;
}

.articles-grid .card:first-child h3 {
  font-size: 1.6rem;
}

.articles-grid .card:first-child p {
  font-size: 0.95rem;
  -webkit-line-clamp: 4;
}

/* ===========================
   Article Page
=========================== */
.article-header {
  margin-bottom: var(--sp-8);
}

.article-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.2;
  margin-bottom: var(--sp-6);
}

.article-header img {
  width: 100%;
  border-radius: var(--radius-lg);
  aspect-ratio: 21 / 9;
  object-fit: cover;
  margin-bottom: var(--sp-5);
  border: 1px solid var(--border-subtle);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-meta time {
  color: var(--gold-dim);
  font-weight: 500;
}

/* Article body */
[itemprop="articleBody"] {
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--text);
  max-width: 850px;
  margin: 0 auto;
}

[itemprop="articleBody"] p {
  margin-bottom: var(--sp-5);
}

[itemprop="articleBody"] h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-5);
  color: var(--text-white);
  padding-left: var(--sp-5);
  border-left: 3px solid var(--gold);
}

[itemprop="articleBody"] h3 {
  font-size: 1.2rem;
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
}

[itemprop="articleBody"] img {
  border-radius: var(--radius-md);
  margin: var(--sp-8) 0;
  border: 1px solid var(--border-subtle);
}

[itemprop="articleBody"] a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(212, 175, 55, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t-fast);
}

[itemprop="articleBody"] a:hover {
  text-decoration-color: var(--gold);
}

[itemprop="articleBody"] blockquote {
  border-left: 3px solid var(--gold);
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-8) 0;
  background: var(--surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-muted);
}

[itemprop="articleBody"] pre,
[itemprop="articleBody"] code {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
}

[itemprop="articleBody"] pre {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-6) 0;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  position: relative;
}

[itemprop="articleBody"] pre::before {
  content: "";
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-dim);
  box-shadow: 14px 0 0 var(--gold), 28px 0 0 var(--gold-light);
}

[itemprop="articleBody"] :not(pre) > code {
  background: var(--surface-2);
  padding: 0.15em 0.45em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--gold-light);
  border: 1px solid var(--border-subtle);
}

[itemprop="articleBody"] ul,
[itemprop="articleBody"] ol {
  margin: var(--sp-5) 0;
  padding-left: var(--sp-6);
}

[itemprop="articleBody"] li {
  margin-bottom: var(--sp-2);
}

[itemprop="articleBody"] li::marker {
  color: var(--gold-dim);
}

/* ===========================
   Breadcrumb
=========================== */
.breadcrumb {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 0;
  margin: 0 0 var(--sp-6) 0;
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: var(--sp-2);
  color: var(--text-dim);
}

.breadcrumb a {
  color: var(--gold-dim);
}

.breadcrumb a:hover {
  color: var(--gold);
}

/* ===========================
   Comments
=========================== */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.comment {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: border-color var(--t-base);
}

.comment:hover {
  border-color: var(--border);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  background: transparent !important;
}

.comment-author-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--text-white);
  font-weight: 600;
  font-size: 0.92rem;
  transition: color var(--t-fast);
}

.comment-author-link:hover {
  color: var(--gold);
  text-decoration: none;
}

.comment-source-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  opacity: 0.7;
  transition: opacity var(--t-fast);
}

.comment-author-link:hover .comment-source-icon {
  opacity: 1;
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.comment-content {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── Comments CTA ── */
.comments-cta {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-8);
  text-align: center;
  margin-top: var(--sp-6);
}

.comments-cta p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: var(--sp-4);
}

.comments-cta a {
  display: inline-block;
  background: var(--gold-gradient);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.88rem;
  padding: var(--sp-3) var(--sp-8);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  letter-spacing: 0.02em;
}

.comments-cta a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
  color: var(--bg);
  text-decoration: none;
}

/* ===========================
   Auth Page
=========================== */
.auth-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: var(--sp-10) 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-10);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold-gradient);
}

.auth-card h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: var(--sp-2);
  color: var(--text-white);
}

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--sp-8);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.auth-field label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.auth-field input {
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-warm);
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.auth-field input::placeholder {
  color: var(--text-dim);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.auth-submit {
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-6);
  background: var(--gold-gradient);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  letter-spacing: 0.02em;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.auth-divider {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
  margin: var(--sp-5) 0;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--border-subtle);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-socials {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

.auth-social {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-warm);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color var(--t-fast), color var(--t-fast);
}

.auth-social:hover {
  border-color: var(--border);
  color: var(--text-white);
  text-decoration: none;
}

.auth-social img {
  width: 22px;
  height: 22px;
  opacity: 0.7;
}

.auth-social:hover img {
  opacity: 1;
}

/* ===========================
   404 Page
=========================== */
.not-found {
  text-align: center;
  padding: var(--sp-16) 0 var(--sp-10);
}

.not-found h1 {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: var(--sp-6);
}

.not-found p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: var(--sp-8);
}

.not-found a {
  display: inline-block;
  background: var(--gold-gradient);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.9rem;
  padding: var(--sp-3) var(--sp-8);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.not-found a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
  color: var(--bg);
  text-decoration: none;
}

/* ===========================
   About Page
=========================== */
.about-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--sp-10) var(--sp-8);
  position: relative;
  overflow: hidden;
}
.about-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold-gradient);
}
.about-section h1 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--text-white);
  margin-bottom: var(--sp-6);
}
.about-section h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--gold);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
}
.about-section p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: var(--sp-4);
}
.about-section ul {
  margin: var(--sp-4) 0;
  padding-left: var(--sp-6);
}
.about-section li {
  font-size: 1rem;
  margin-bottom: var(--sp-3);
  line-height: 1.7;
  color: var(--text-muted);
}
.about-section li strong {
  color: var(--text-white);
}

/* === SCDL Anchor Pages (D-69-08-02) === */
/* Приём темы: засечки и разрядка, разделы разведены волосяной линией. */
.scdl-page {
  max-width: 68ch;
  margin-inline: auto;
}
.scdl-page h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border-subtle);
}
.scdl-revision {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  margin-top: var(--sp-10);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}

/* ===========================
   Search Page
=========================== */
.search-section {
  padding: var(--sp-10) 0;
}

.search-section h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin-bottom: var(--sp-6);
}

.search-form {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
}

.search-form input {
  flex: 1;
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--t-fast);
}

.search-form input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.search-form button {
  padding: var(--sp-3) var(--sp-6);
  background: var(--gold-gradient);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.88rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--t-fast);
}

.search-form button:hover {
  transform: translateY(-1px);
}

/* ===========================
   Contacts Page
=========================== */
.contacts-section {
  padding: var(--sp-10) 0;
}

.contacts-section h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin-bottom: var(--sp-6);
}

/* ===========================
   Footer — Understated
=========================== */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-8) 0;
  margin-top: auto;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold-gradient);
  opacity: 0.3;
}

.footer-inner {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
  text-align: center;
}

footer p {
  color: var(--text-dim);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

/* === SCDL: строка доверия в подвале (D-69-08-02) === */
/* --text-dim (#6B6560) на --surface (#16161E) даёт 3.3:1 — копировать цвет
   копирайта нельзя. Строка доверия берёт --text-muted (6.1:1), ссылки — золото
   темы (8.6:1). */
.footer-trust {
  font-size: 0.92rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: var(--sp-2);
  line-height: 2;
}
.footer-trust a {
  color: var(--text-gold);
  padding-inline: var(--sp-2);
}

/* ===========================
   Responsive — Mobile
=========================== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
    width: 48px;
    height: 48px;
    min-height: 48px;
    min-width: 48px;
    align-items: center;
    justify-content: center;
  }

  .hamburger:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-4);
    z-index: 50;
  }

  #nav-toggle:checked ~ .nav-menu {
    display: block;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 8px;
  }

  .nav-menu a {
    display: block;
    padding: var(--sp-3) var(--sp-4);
    font-size: 0.9rem;
    min-height: 48px;
  }

  .nav-menu a::after {
    display: none;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  .articles-grid .card:first-child a {
    flex-direction: column;
  }

  .articles-grid .card:first-child .card-image {
    width: 100%;
    min-width: 100%;
    aspect-ratio: 16 / 10;
    min-height: auto;
  }

  .articles-grid .card:first-child .card-body {
    padding: var(--sp-5);
  }

  .articles-grid .card:first-child h3 {
    font-size: 1.3rem;
  }

  .articles-grid .card h3 {
    font-size: 1.1rem;
    line-height: 1.4;
  }

  .articles-grid .card p {
    font-size: 0.9rem;
  }

  .auth-card {
    padding: var(--sp-6);
  }

  .search-form {
    flex-direction: column;
  }

  .search-form button {
    width: 100%;
    min-height: 48px;
  }

  [itemprop="articleBody"] img {
    float: none !important;
    max-width: 100%;
    margin: var(--sp-6) 0 !important;
  }
}

/* ===========================
   Utilities / Scrollbar
=========================== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dim);
}

::selection {
  background: rgba(212, 175, 55, 0.25);
  color: var(--text-white);
}

/* =========================
   Comment replies
========================= */
.comment-replies {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.comment--reply {
  margin-left: var(--space-lg);
  border-left: 2px solid var(--accent-color, var(--border-color));
  background: transparent;
}

/* ===========================
   Scroll Animations
=========================== */

:root {
  --t-slow: 0.6s ease;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(25px);
}

.animate-on-scroll.is-visible {
  animation: fadeSlideUp 0.6s ease-out forwards;
}

/* Stagger */
.articles-grid .animate-on-scroll.is-visible:nth-child(2) { animation-delay: 0.1s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(3) { animation-delay: 0.15s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(4) { animation-delay: 0.2s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(5) { animation-delay: 0.25s; }
.articles-grid .animate-on-scroll.is-visible:nth-child(6) { animation-delay: 0.3s; }

/* Fade-in for lazy-loaded images */
@keyframes imgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

img[loading="lazy"] {
  opacity: 0;
  animation: none;
}

img[loading="lazy"].is-loaded {
  animation: imgFadeIn 0.4s ease-out forwards;
}

/* Card hover — refined elegant */
.card {
  transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.08);
}

.card h3 {
  transition: color var(--t-fast), letter-spacing var(--t-fast);
}

.card:hover h3 {
  letter-spacing: 0.01em;
}

/* ===========================
   Cookie Banner — Elegant
=========================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--surface);
  border-top: 1px solid var(--border);
  transform: translateY(100%);
  opacity: 0;
  transition: transform var(--t-slow), opacity var(--t-slow);
}

.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.cookie-banner__inner {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: var(--sp-4) var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.cookie-banner__inner p {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-family: var(--font-serif);
  margin: 0;
  line-height: 1.5;
}

.cookie-banner__actions {
  display: flex;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.cookie-banner__btn {
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-serif);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.cookie-banner__btn:hover {
  transform: translateY(-1px);
}

.cookie-banner__btn--accept {
  background: var(--gold-gradient);
  color: var(--bg);
  border: 1px solid var(--gold);
}

.cookie-banner__btn--accept:hover {
  box-shadow: var(--shadow-gold);
}

.cookie-banner__btn--more {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.cookie-banner__btn--more:hover {
  color: var(--gold);
  border-color: var(--gold);
}

@media (max-width: 600px) {
  .cookie-banner__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ===========================
   Scroll to Top — Elegant
=========================== */

.scroll-to-top {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--gold);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--t-base), visibility var(--t-base), transform var(--t-base), background var(--t-fast), color var(--t-fast);
}

.scroll-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

/* ===========================
   Share Buttons — Elegant
=========================== */

.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-6) 0;
  margin-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.share-buttons__label {
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-serif);
  color: var(--text-muted);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.share-btn:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.share-btn svg {
  flex-shrink: 0;
}

.share-btn--vk,
.share-btn--tg,
.share-btn--tw {
  background: none;
}

@media (max-width: 600px) {
  .share-buttons {
    justify-content: center;
  }
  .share-buttons__label {
    width: 100%;
    text-align: center;
  }
}

/* ===========================
   Related Articles — Elegant
=========================== */

.related-articles {
  margin-top: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border-subtle);
}

.related-articles__heading {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: var(--sp-6);
  position: relative;
  padding-bottom: var(--sp-3);
}

.related-articles__heading::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 1px;
  background: var(--gold);
}

.related-articles__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

.related-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  transition: transform var(--t-base), border-color var(--t-base);
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--border);
}

.related-card .card-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.related-card .card-body {
  padding: var(--sp-4);
}

.related-card h3 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 var(--sp-2);
  color: var(--text-white);
}

.related-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  .related-articles__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }
}

/* ===========================
   Subscribe Form — Elegant
=========================== */

.footer-subscribe {
  padding: var(--sp-12) var(--container-padding) var(--sp-8);
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}

.subscribe-block__title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-white);
  margin: 0 0 var(--sp-2);
}

.subscribe-block__text {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin: 0 0 var(--sp-6);
}

.subscribe-form__group {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-end;
}

.subscribe-form__input {
  flex: 1;
  padding: var(--sp-2) 0;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  background: transparent;
  color: var(--text);
  outline: none;
  min-width: 0;
  transition: border-color var(--t-fast);
}

.subscribe-form__input::placeholder {
  color: var(--text-dim);
}

.subscribe-form__input:focus {
  border-bottom-color: var(--gold);
}

.subscribe-form__btn {
  padding: var(--sp-2) var(--sp-6);
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-serif);
  cursor: pointer;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast), color var(--t-fast);
}

.subscribe-form__btn:hover {
  background: var(--gold);
  color: var(--bg);
}

.subscribe-form__success {
  margin-top: var(--sp-4);
  font-size: 0.9rem;
  color: var(--gold-light);
  font-weight: 600;
}

.subscribe-form__success.is-visible {
  display: block !important;
}

@media (max-width: 600px) {
  .auth-socials {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .subscribe-form__group {
    flex-direction: column;
    gap: var(--sp-4);
  }
  .subscribe-form__btn {
    width: 100%;
  }
}

/* ===========================
   Reduced Motion
=========================== */

/* ===========================
   Accessibility: Skip Link
=========================== */
.skip-link {
  position: fixed;
  top: -100%;
  white-space: nowrap;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-color);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.5rem;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ===========================
   Reading Progress Bar
=========================== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0,0,0,0.05);
  z-index: 1000;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  height: 100%;
  background: var(--accent-color);
  width: 0%;
  transition: width 0.1s linear;
}

/* ===========================
   Reading Time
=========================== */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reading-time::before {
  content: "⏱";
  font-size: 0.9em;
}

@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
  .animate-on-scroll.is-visible {
    animation: none;
  }
  img[loading="lazy"] {
    opacity: 1;
  }
  img[loading="lazy"].is-loaded {
    animation: none;
  }
  .cookie-banner {
    transition: none;
  }
  .scroll-to-top {
    transition: none;
  }
}

/* Article Content Typography */
.article-body {
  line-height: 1.75;
}
.article-body h1,
.article-body h2,
.article-body h3 {
  margin-block: 1.5rem 1rem;
}
.article-body p {
  margin-block: 1rem;
}
.article-body ul,
.article-body ol {
  margin-block: 1rem;
  padding-left: 1.5rem;
}
.article-body li {
  margin-block: 0.35rem;
}
.article-body blockquote {
  border-left: 3px solid currentColor;
  padding-left: 1rem;
  margin: 1.5rem 0;
  opacity: 0.85;
  font-style: italic;
}

/* Featured Image */
.featured-image {
  display: block;
  width: 100%;
  max-width: 680px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: 0 auto var(--space-xl, 2rem);
  border-radius: var(--border-radius, 8px);
  max-height: 45vh;
}
/* Article Content Images */
.article-body img {
  display: block;
  max-width: min(50%, 620px);
  height: auto;
  margin: 1.5rem auto;
  border-radius: 8px;
}

/* Article Tables */
.article-body table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 8px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
.article-body table thead,
.article-body table tbody,
.article-body table tfoot {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.article-body table thead {
  background: rgba(128, 128, 128, 0.35);
  font-weight: 700;
}
.article-body table th,
.article-body table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid rgba(128, 128, 128, 0.4);
  white-space: normal;
  word-break: break-word;
}
.article-body table th {
  font-weight: 700;
  text-align: center;
}
.article-body table tbody tr:nth-child(even) {
  background: rgba(128, 128, 128, 0.1);
}
.article-body table tbody tr:hover {
  background: rgba(128, 128, 128, 0.15);
}
@media (max-width: 768px) {
  .article-body table {
    font-size: 0.85rem;
  }
  .article-body table th,
  .article-body table td {
    padding: 0.5rem;
  }
  .article-body img {
    max-width: 100%;
  }
}

/* Fix: auto-reveal hidden elements that never enter viewport */
.animate-on-scroll:not(.is-visible) {
  animation: aos-fallback-reveal 0.5s ease forwards;
  animation-delay: 1.5s;
}
@keyframes aos-fallback-reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* === Contacts === */
.contacts-hero { margin-bottom: 2rem; }
.contacts-hero h1 { font-family: var(--font-heading); margin-bottom: 0.5rem; }
.contacts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
.contacts-form-section h2 { font-family: var(--font-heading); margin-bottom: 1rem; }
.contacts-form .form-group { margin-bottom: 1rem; }
.contacts-form .form-group label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
.contacts-form .form-group input,
.contacts-form .form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface, #fff);
  color: var(--text, #333);
}
.contacts-form .form-group textarea { min-height: 120px; resize: vertical; }
.contacts-form .btn-submit {
  padding: 0.8rem 2rem;
  background: var(--accent-color, #333);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.contacts-form .btn-submit:hover { opacity: 0.9; }
.contacts-info h3 { font-family: var(--font-heading); margin-bottom: 0.5rem; }
.contacts-info p { margin-bottom: 0.5rem; }
.contacts-info a { color: var(--accent-color, #333); }
.social-links { list-style: none; padding: 0; }
.social-links li { margin-bottom: 0.3rem; }
@media (max-width: 768px) {
  .contacts-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Тач-цели, не покрытые селекторами плана 69-09.
   Правила 69-09 поднимали только те классы, у которых объявление размера
   УЖЕ существовало; у элементов ниже min-height не был объявлен вовсе,
   поэтому сканер mobile_css_test их не видел, а палец получал 24–41 px.
   Порог 48 px — параграф 15.1 (domain/techseo.TouchTargetMinPx).
   ============================================ */
@media (max-width: 768px) {
  .comment-author-link,
  .subscribe-form__input,
  .subscribe-form__btn,
  .cookie-banner__btn,
  .author-link,
  .share-btn,
  .comment-cta-button,
  .breadcrumb li a {
    min-height: 48px;
  }

  .comment-author-link,
  .subscribe-form__btn,
  .cookie-banner__btn,
  .author-link,
  .share-btn,
  .comment-cta-button,
  .breadcrumb li a {
    display: inline-flex;
    align-items: center;
  }

  .subscribe-form__btn,
  .cookie-banner__btn,
  .share-btn {
    justify-content: center;
  }

  /* Иконочные кнопки шеринга узкие по содержимому: в editorial и luxe замер дал
     42×48 и 43.6×48 — высота порог держит, ширина нет. Порог книги про ОБЕ
     стороны. */
  .share-btn {
    min-width: 48px;
  }
}

/* === Изображение с подписью (фаза 72, §16.2е книги) ===
   Серифный курсив и золотая черта под подписью — язык темы. Цвет взят у
   --text-muted, а НЕ у --text-dim: последний даёт 3.42:1 на фоне темы, то
   есть ниже нормы AA. */
figure {
  margin: var(--sp-8) auto;
  max-width: min(50%, 620px);
}

.article-body figure img {
  margin: 0 !important;
  max-width: 100%;
}

figcaption {
  margin-top: var(--sp-3);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}

figcaption::after {
  content: "";
  display: block;
  width: var(--sp-10);
  height: 1px;
  margin: var(--sp-3) auto 0;
  background: var(--gold-gradient);
}

@media (max-width: 768px) {
  figure {
    max-width: 100%;
  }
}
