/* ===========================
   Creative — Bold Magazine Style
=========================== */

* { box-sizing: border-box; }

:root {
  /* base colors from theme */
  --bg: #ffffff;
  --surface: #f9fafb;
  --text: #111827;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --accent-color: #2563eb;

  /* creative palette */
  --c-orange: #FF5722;
  --c-orange-soft: #FF8A65;
  --c-violet: #7C4DFF;
  --c-violet-soft: #B388FF;
  --c-cyan: #00BCD4;
  --c-cyan-soft: #80DEEA;
  --c-lime: #AEEA00;
  --c-rose: #FF4081;
  --c-amber: #FFD740;
  --c-bg: #FAFAFA;
  --c-surface: #FFFFFF;
  --c-dark: #1A1A2E;
  --c-dark-soft: #16213E;
  --c-text: #1A1A2E;
  --c-text-muted: #6B7280;
  --c-gradient-hot: linear-gradient(135deg, #FF5722, #FF4081);
  --c-gradient-cool: linear-gradient(135deg, #7C4DFF, #00BCD4);
  --c-gradient-warm: linear-gradient(135deg, #FF8A65, #FFD740);
  --c-gradient-hero: linear-gradient(135deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);

  /* typography */
  --font-family: "Outfit", "PT Sans", system-ui, -apple-system, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;

  /* geometry */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --container-padding: 16px;

  /* depth */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-colored: 0 8px 30px rgba(255,87,34,0.15);

  /* 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;

  /* transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.2s var(--ease-out);
  --t-base: 0.35s var(--ease-out);
  --t-slow: 0.5s var(--ease-out);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020617;
    --surface: #0f172a;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --border-color: #1e293b;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  background: var(--c-bg);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--c-violet);
  color: #fff;
}

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

a:hover {
  color: var(--c-orange);
}

body main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body > main > .container {
  width: 100%;
  max-width: 1100px;
  padding: var(--sp-8) var(--container-padding);
  margin-inline: auto;
}

/* 404 / central */
.container-central {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 50vh;
  gap: var(--sp-4);
}

.container-central h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--c-gradient-hot);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.container-central p {
  font-size: 1.15rem;
  color: var(--c-text-muted);
}

.container-central a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  background: var(--c-gradient-hot);
  color: #fff;
  border-radius: var(--radius-full);
  font-weight: 600;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.container-central a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-colored);
  color: #fff;
}

/* ===========================
   Header — Dark + Bold
=========================== */

body > header {
  background: var(--c-gradient-hero);
  padding: var(--sp-4) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.logo:hover { color: #fff; text-decoration: none; }

.logo img {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255,255,255,0.2);
  transition: border-color var(--t-fast);
}

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

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

.nav-menu a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  transition: all var(--t-fast);
}

.nav-menu a:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
  text-decoration: none;
}

#nav-toggle { display: none; }

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

.hamburger span {
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--t-fast);
}

/* ===========================
   Section Titles
=========================== */

.articles h2,
.comments h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-text);
  margin-bottom: var(--sp-8);
  position: relative;
  display: inline-block;
}

.articles h2::after,
.comments h2::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--c-gradient-hot);
}

/* ===========================
   About Section
=========================== */
.about-section {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  margin-top: var(--sp-10);
  border-left: 4px solid transparent;
  border-image: var(--c-gradient-hot) 1;
}
.about-section h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-text);
  margin-bottom: var(--sp-4);
  position: relative;
  display: inline-block;
}
.about-section h1::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--c-gradient-hot);
}
.about-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
}
.about-section p {
  font-size: 0.95rem;
  color: var(--c-text-muted);
  line-height: 1.75;
  margin-bottom: var(--sp-3);
}
.about-section ul {
  margin: var(--sp-3) 0;
  padding-left: var(--sp-6);
}
.about-section li {
  font-size: 0.95rem;
  margin-bottom: var(--sp-2);
  line-height: 1.65;
  color: var(--c-text-muted);
}
.about-section li strong {
  color: var(--c-text);
}

/* === SCDL Anchor Pages (D-69-08-02) === */
/* Приём темы: горячий градиент, но подчёркиванием — не заливкой текста. */
.scdl-page {
  max-width: 72ch;
  margin-inline: auto;
}
.scdl-page h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid transparent;
  border-image: var(--c-gradient-hot) 1;
}
.scdl-revision {
  color: var(--c-text-muted);
  font-size: 0.82rem;
  margin-top: var(--sp-10);
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(26, 26, 46, 0.1);
}

/* ===========================
   Cards — Magazine Grid
=========================== */

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

.card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base), box-shadow var(--t-base);
  position: relative;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

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

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

.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin: 0;
  transition: transform 0.6s var(--ease-out);
}

.card:hover .card-image {
  transform: scale(1.05);
}

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

.card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--c-text);
  transition: color var(--t-fast);
}

.card:hover h3 {
  color: var(--c-violet);
}

.card p {
  color: var(--c-text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-3);
}

.card-meta time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-orange);
  background: rgba(255,87,34,0.08);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  transition: background-color var(--t-fast), color var(--t-fast);
}

.card:hover .card-meta time {
  background: rgba(255,87,34,0.15);
}

/* Featured first card — full width hero */
.articles-grid .card:first-child {
  grid-column: 1 / -1;
}

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

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

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

.articles-grid .card:first-child h3 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

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

/* Colored accent dot per card */
.card::after {
  content: "";
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-orange);
  opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
  transform: scale(0);
}

.card:hover::after {
  opacity: 1;
  transform: scale(1);
}

.card:nth-child(2)::after { background: var(--c-violet); }
.card:nth-child(3)::after { background: var(--c-cyan); }
.card:nth-child(4)::after { background: var(--c-rose); }
.card:nth-child(5)::after { background: var(--c-lime); }
.card:nth-child(6)::after { background: var(--c-amber); }

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

.article-hero {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.article-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--c-text);
}

.featured-image {
  display: block;
  width: 100%;
  max-width: 680px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-height: 45vh;
}

.article-meta {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  flex-wrap: wrap;
}

.article-meta .author {
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--c-dark);
  color: #fff;
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--radius-full);
  transition: background-color var(--t-fast), transform var(--t-fast);
}

.article-meta time {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-orange);
  background: rgba(255,87,34,0.08);
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--radius-full);
  transition: background-color var(--t-fast);
}

/* ===========================
   Article Body
=========================== */

[itemprop="articleBody"] {
  line-height: 1.85;
  font-size: 1.05rem;
  color: var(--c-text);
  max-width: 720px;
}

[itemprop="articleBody"] h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-block: var(--sp-10) var(--sp-4);
  padding-left: var(--sp-4);
  border-left: 4px solid var(--c-orange);
}

[itemprop="articleBody"] h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-block: var(--sp-8) var(--sp-3);
}

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

[itemprop="articleBody"] img {
  display: block;
  max-width: min(60%, 640px);
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--sp-6) 0;
}

[itemprop="articleBody"] a {
  color: var(--c-violet);
  text-decoration: underline;
  text-decoration-color: rgba(124,77,255,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--t-fast);
}

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

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

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

[itemprop="articleBody"] code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.88em;
  background: rgba(124,77,255,0.08);
  color: var(--c-violet);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

[itemprop="articleBody"] pre {
  background: var(--c-dark);
  color: #E0E7FF;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  padding-top: calc(var(--sp-6) + 16px);
  overflow-x: auto;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  box-shadow: var(--shadow-md);
  position: relative;
}

[itemprop="articleBody"] pre::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-orange);
  box-shadow: 18px 0 0 var(--c-amber), 36px 0 0 var(--c-lime);
}

[itemprop="articleBody"] pre code {
  background: none;
  padding: 0;
  color: inherit;
}

[itemprop="articleBody"] blockquote {
  margin: var(--sp-6) 0;
  padding: var(--sp-5) var(--sp-6);
  background: rgba(124,77,255,0.04);
  border-left: 4px solid var(--c-violet);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--c-text-muted);
}

[itemprop="articleBody"] table {
  width: 100%;
  margin: var(--sp-6) 0;
  border-collapse: collapse;
}

[itemprop="articleBody"] th,
[itemprop="articleBody"] td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

[itemprop="articleBody"] th {
  font-weight: 700;
  background: var(--c-bg);
}

/* ===========================
   Breadcrumb
=========================== */

.breadcrumb {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0;
  margin: 0 0 var(--sp-6) 0;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

.breadcrumb a {
  color: var(--c-violet);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--t-fast);
}

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

.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--sp-2);
  color: var(--c-text-muted);
}
.breadcrumb li:last-child {
  color: var(--c-text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

/* ===========================
   Search
=========================== */

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

.search-form input {
  flex: 1;
  padding: var(--sp-3) var(--sp-5);
  font-size: 1rem;
  font-family: var(--font-family);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--c-surface);
  color: var(--c-text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.search-form input:focus {
  outline: none;
  border-color: var(--c-violet);
  box-shadow: 0 0 0 4px rgba(124,77,255,0.12);
}

.search-form input::placeholder {
  color: var(--c-text-muted);
}

.search-form button {
  padding: var(--sp-3) var(--sp-8);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-family);
  background: var(--c-gradient-hot);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: var(--shadow-colored);
}

.search-form button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 35px rgba(255,87,34,0.25);
}

/* ===========================
   Comments
=========================== */

.comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.comment {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-sm);
  border: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  position: relative;
  overflow: hidden;
}

.comment::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--c-violet);
  border-radius: 2px;
}

.comment:nth-child(2)::before { background: var(--c-cyan); }
.comment:nth-child(3)::before { background: var(--c-orange); }

.comment:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

.comment-author-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.comment-author-link:hover {
  text-decoration: none;
}

.comment-author-link:hover .comment-author {
  color: var(--c-violet);
}

.comment-source-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  padding: 2px;
  background: var(--c-bg);
}

.comment-author {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--c-text);
  transition: color var(--t-fast);
}

.comment-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-orange);
  background: rgba(255,87,34,0.08);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: background-color var(--t-fast);
}

.comment:hover .comment-date {
  background: rgba(255,87,34,0.15);
}

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

/* ===========================
   Comment CTA
=========================== */

.comment-cta-inner {
  background: var(--c-dark);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.comment-cta-text {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
}

.comment-cta-button {
  padding: var(--sp-3) var(--sp-8);
  background: var(--c-gradient-hot);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 4px 15px rgba(255,87,34,0.3);
}

.comment-cta-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(255,87,34,0.4);
  color: #fff;
  text-decoration: none;
}

/* ===========================
   Auth Page
=========================== */

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: var(--sp-8) var(--container-padding);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--c-surface);
  border-radius: var(--radius-xl);
  padding: var(--sp-10);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

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

.auth-card-header {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  text-align: center;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-text);
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--c-text-muted);
}

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

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

.auth-field label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-muted);
}

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

.auth-field input:focus {
  outline: none;
  border-color: var(--c-violet);
  box-shadow: 0 0 0 4px rgba(124,77,255,0.1);
}

.auth-field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-error {
  color: #dc2626;
  padding: var(--sp-3);
  background: rgba(220,38,38,0.06);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.auth-submit {
  margin-top: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 700;
  background: var(--c-gradient-hot);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: 0 4px 15px rgba(255,87,34,0.3);
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255,87,34,0.4);
}

.auth-divider {
  position: relative;
  text-align: center;
  color: var(--c-text-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 20px);
  height: 1px;
  background: var(--border-color);
}
.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;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: transparent;
  text-decoration: none;
  color: var(--c-text);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--t-fast);
}

.auth-social img {
  width: 20px;
  height: 20px;
}

.auth-social:hover {
  border-color: var(--c-violet);
  background: rgba(124,77,255,0.04);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.auth-submit.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
  color: transparent;
}

.auth-submit.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes auth-error-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================
   Footer — Dark Bold
=========================== */

footer {
  margin-top: auto;
  background: var(--c-dark);
  position: relative;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--c-gradient-hot);
}

footer > .container {
  width: 100%;
  max-width: 100%;
}

.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--sp-8) var(--container-padding);
}

.footer-inner p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

/* === SCDL: строка доверия в подвале (D-69-08-02) === */
/* Подвал .footer-inner — flex-строка; без переноса строка доверия встала бы
   рядом с копирайтом. Ей отдаётся своя строка целиком.
   Цвет литеральный сознательно: фон подвала это --c-dark, литерал самой темы,
   а не палитра сайта — токен --text-muted оттуда пришёл бы светлой палитрой на
   тёмное. Копирайт .5 ниже AA, поэтому копировать его нельзя. */
.footer-inner {
  flex-wrap: wrap;
  gap: var(--sp-2);
}
/* Второй селектор — не украшение. У темы есть правило `.footer-inner p`
   (специфичность 0,1,1), и голый `.footer-trust` (0,1,0) ему проигрывает:
   замер показал, что строка доверия печаталась размером и цветом КОПИРАЙТА, то
   есть правка не применялась вовсе при зелёном тесте на текст CSS. */
.footer-trust,
.footer-inner p.footer-trust {
  flex: 0 0 100%;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: var(--sp-2);
  line-height: 2;
}
.footer-trust a {
  color: #fff;
  padding-inline: var(--sp-2);
  background-image: var(--c-gradient-hot);
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: 0 100%;
}

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

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

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

.animate-on-scroll.is-visible {
  animation: fadeSlideUp 0.5s var(--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 для lazy-loaded изображений */
@keyframes imgFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

/* ===========================
   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;
}

/* Для prefers-reduced-motion — отключить анимации */
@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;
  }
}

/* ===========================
   Cookie Banner
=========================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--c-dark);
  border-top: 3px solid;
  border-image: var(--c-gradient-hot) 1;
  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: 1100px;
  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: rgba(255,255,255,0.8);
  font-size: 0.88rem;
  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-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

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

.cookie-banner__btn--accept {
  background: var(--c-gradient-hot);
  color: #fff;
}

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

.cookie-banner__btn--more {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.cookie-banner__btn--more:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

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

/* ===========================
   Scroll to Top
=========================== */

.scroll-to-top {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-gradient-cool);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--t-base), visibility var(--t-base), transform var(--t-base), box-shadow var(--t-fast);
}

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

.scroll-to-top:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ===========================
   Share Buttons
=========================== */

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

.share-buttons__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text-muted);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.share-btn:hover {
  transform: translateY(-2px);
  color: #fff;
}

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

.share-btn--vk {
  background: #4680C2;
}

.share-btn--vk:hover {
  box-shadow: 0 4px 15px rgba(70, 128, 194, 0.4);
}

.share-btn--tg {
  background: #0088cc;
}

.share-btn--tg:hover {
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.4);
}

.share-btn--tw {
  background: #1a1a2e;
}

.share-btn--tw:hover {
  box-shadow: 0 4px 15px rgba(26, 26, 46, 0.4);
}

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

/* ===========================
   Responsive
=========================== */

@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(--c-accent);
    outline-offset: 2px;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--c-dark);
    padding: var(--sp-4);
    box-shadow: var(--shadow-lg);
    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);
    min-height: 48px;
  }

  .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);
    border-radius: var(--radius-lg);
  }

  .auth-socials {
    grid-template-columns: 1fr;
  }

  .comment-cta-inner {
    flex-direction: column;
    text-align: center;
    padding: var(--sp-5);
  }

  .comment-cta-button {
    width: 100%;
    text-align: center;
    min-height: 48px;
  }

  .container-central h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  /* Larger touch targets */
  input, button, textarea, select {
    font-size: 16px;
  }
}

/* =========================
   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;
}

/* ===========================
   Related Articles
=========================== */

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

.related-articles__heading {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-6);
  background: var(--c-gradient-cool);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.related-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

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

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

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

.related-card p {
  font-size: 0.82rem;
  color: var(--c-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 (Footer)
=========================== */

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

.subscribe-block__title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 var(--sp-2);
  letter-spacing: -0.01em;
}

.subscribe-block__text {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  margin: 0 0 var(--sp-6);
}

.subscribe-form__group {
  display: flex;
  gap: 0;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.subscribe-form__input {
  flex: 1;
  padding: var(--sp-3) var(--sp-5);
  border: none;
  font-size: 0.9rem;
  font-family: inherit;
  background: rgba(255,255,255,0.1);
  color: #fff;
  outline: none;
  min-width: 0;
  transition: background var(--t-fast);
}

.subscribe-form__input::placeholder {
  color: rgba(255,255,255,0.4);
}

.subscribe-form__input:focus {
  background: rgba(255,255,255,0.15);
}

.subscribe-form__btn {
  padding: var(--sp-3) var(--sp-6);
  background: var(--c-gradient-hot);
  color: #fff;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--t-fast);
}

.subscribe-form__btn:hover {
  opacity: 0.9;
}

.subscribe-form__success {
  margin-top: var(--sp-4);
  font-size: 0.9rem;
  color: var(--c-lime);
  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;
    border-radius: var(--radius-md);
  }
  .subscribe-form__btn {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }
}

/* 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;
}

/* 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е книги) ===
   Цвет берётся из СОБСТВЕННОЙ палитры темы (--c-*), а не из общей --text-*:
   фон страницы у creative тоже --c-bg, и в тёмной схеме общая палитра
   уезжает, а фон остаётся светлым — подпись стала бы нечитаемой. */
figure {
  margin: var(--sp-8) auto;
  max-width: min(50%, 620px);
}

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

figcaption {
  margin-top: var(--sp-3);
  padding-left: var(--sp-3);
  border-left: 3px solid var(--c-violet);
  font-size: 0.875rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--c-text-muted);
}

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