* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: clip;
}

body {
  font-family: var(--font-ui);
  background-color: var(--surface-page);
  color: var(--text-primary);
  line-height: var(--line-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100svh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--page-pad) var(--space-5);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

:root {
  --page-pad: 20px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --blur-glass: 10px;
  --blur-strong: 12px;
  --border-soft: 1px solid rgba(92, 78, 55, 0.12);
  --shadow-soft: 0 1px 0 rgba(60, 48, 28, 0.04);
  --shadow-card: none;
  --shadow-control: none;
  --shadow-code: 0 8px 18px rgba(20, 25, 38, 0.22);
  --surface-page: #f6f3ec;
  --surface-card: #f0ebe2;
  --surface-card-alt: #efe8dc;
  --surface-control: #e8e1d4;
  --surface-control-hover: #ddd5c6;
  --surface-dark: #1f2228;
  --text-primary: #1c1f27;
  --text-secondary: #3b4454;
  --text-muted: #5c6470;
  --text-accent: #1f4ea3;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-article: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Times New Roman', serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.0625rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --line-tight: 1.25;
  --line-normal: 1.45;
  --line-relaxed: 1.7;
  --btn-radius: var(--radius-sm);
  --btn-padding-y: var(--space-2);
  --btn-padding-x: var(--space-3);
  --btn-bg: var(--surface-control);
  --btn-bg-hover: var(--surface-control-hover);
  --btn-shadow: var(--shadow-control);
  --interactive-transition: 0.2s ease;
}

a,
button {
  transition:
    color var(--interactive-transition),
    background-color var(--interactive-transition),
    box-shadow var(--interactive-transition),
    transform var(--interactive-transition);
}

a:focus-visible,
button:focus-visible,
.article-read-btn:focus-visible,
.featured-read-btn:focus-visible,
.pagination-link:focus-visible,
.offer-cta:focus-visible,
.home-hero-cta:focus-visible,
.article-neighbor-link:focus-visible,
.community-links a:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(31, 78, 163, 0.24),
    var(--btn-shadow);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  isolation: isolate;
  margin: 0 calc(-1 * var(--page-pad)) var(--space-5);
  padding: 12px calc(var(--page-pad) + 8px);
  background: transparent;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  pointer-events: none;
  background: rgba(246, 243, 236, 0.94);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
  border-bottom: var(--border-soft);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.site-title {
  font-size: 1.12rem;
  margin-bottom: 0;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.2;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: block;
  margin: 0;
}

.logo-link {
  display: inline-flex;
  flex: 0 0 auto;
}

.site-subtitle {
  font-size: 0.8rem;
  margin: 2px 0 0;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.3;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  margin-left: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-search {
  flex: 0 0 auto;
}

.site-search input {
  width: 148px;
  height: 32px;
  padding: 0 12px;
  border: var(--border-soft);
  border-radius: var(--radius-pill);
  background: var(--surface-control);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
}

.site-search input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 78, 163, 0.24);
}

.breadcrumbs {
  margin: 0 0 var(--space-4);
}

.breadcrumbs-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 0;
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.breadcrumbs-list li {
  display: inline-flex;
  align-items: center;
}

.breadcrumbs-list li:not(:last-child)::after {
  content: "/";
  margin: 0 7px;
  color: var(--text-muted);
}

.breadcrumbs-list a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs-list a:hover {
  color: var(--text-accent);
}

.breadcrumbs-list span {
  color: var(--text-secondary);
}

.glossary-hint {
  margin-top: var(--space-5);
}

main {
  flex: 1 0 auto;
}

.menu-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: var(--font-size-sm);
  line-height: 1.2;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  box-shadow: inset 0 -2px 0 transparent;
}

.menu-link.active {
  background: none;
  color: var(--text-primary);
  box-shadow: inset 0 -2px 0 var(--text-primary);
}

.menu-link:focus-visible {
  color: var(--text-primary);
  box-shadow: inset 0 -2px 0 var(--text-accent);
}

p {
  margin-bottom: var(--space-4);
}

a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--interactive-transition);
}

a:hover {
  color: var(--text-accent);
}

.articles {
  margin-top: 0;
}

.list-header {
  margin-bottom: var(--space-5);
}

.list-title {
  margin: 0 0 var(--space-2);
  font-size: 1.55rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.list-intro {
  margin: 0 0 var(--space-3);
  color: var(--text-secondary);
  line-height: var(--line-relaxed);
}

.list-topics {
  margin-top: var(--space-2);
}

.topic-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.topic-index-link {
  display: grid;
  gap: 4px;
  text-decoration: none;
  padding: var(--space-3) 0;
  border-bottom: var(--border-soft);
}

.topic-index-name {
  font-weight: 650;
  color: var(--text-primary);
}

.topic-index-count {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.topic-index-text {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-normal);
}

.article {
  margin-bottom: var(--space-6);
}

.article:last-child {
  margin-bottom: 0;
}

.article-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
  line-height: var(--line-tight);
  font-weight: 600;
}

.article-title a {
  text-decoration: none;
}

.article-thumb-link {
  display: block;
  margin-bottom: var(--space-2);
}

.article-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.article-card {
  background: var(--surface-card);
  border: var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(var(--blur-strong));
  -webkit-backdrop-filter: blur(var(--blur-strong));
}

.article-meta {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  line-height: var(--line-normal);
}

.article-topics {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.article-topics a {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: var(--border-soft);
  background: var(--surface-control);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.article-related {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: var(--border-soft);
}

.article-related-title {
  margin: 0 0 var(--space-3);
  font-size: 1.15rem;
  font-family: var(--font-ui);
  line-height: var(--line-tight);
}

.article-related-list {
  margin: 0;
  padding-left: 18px;
}

.article-related-list li {
  margin: 0 0 var(--space-2);
}

.article-related-list a {
  font-family: var(--font-ui);
  text-decoration: none;
}

.article-excerpt {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  line-height: var(--line-relaxed);
}

.article-read-btn {
  display: inline-block;
  text-decoration: none;
  border: 0;
  border-radius: var(--btn-radius);
  background: var(--btn-bg);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  font-size: var(--font-size-sm);
  font-weight: 600;
  box-shadow: var(--btn-shadow);
  border: var(--border-soft);
}

.offer-cta {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  text-decoration: none;
  margin-top: var(--space-2);
  margin-inline: auto;
  padding: var(--btn-padding-y) var(--btn-padding-x);
  border-radius: var(--btn-radius);
  border: 1px solid rgba(31, 34, 40, 0.18);
  background: var(--surface-dark);
  color: #fff;
  font-size: 0.92em;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 10px 20px rgba(31, 34, 40, 0.2);
  width: 100%;
  min-width: 0;
  margin-bottom: var(--space-2);
}

.offer-cta:hover {
  color: #fff;
  background: #2a2f38;
  box-shadow: 0 12px 22px rgba(31, 34, 40, 0.24);
}

.menu-link:hover {
  background: none;
  color: var(--text-primary);
}

.article-read-btn:hover,
.featured-read-btn:hover,
.pagination-link:hover,
.community-links a:hover {
  background: var(--btn-bg-hover);
  color: var(--text-primary);
}

.article-neighbor-link:hover {
  color: var(--text-accent);
}

.article-read-btn:active,
.featured-read-btn:active,
.pagination-link:active,
.offer-cta:active,
.home-hero-cta:active,
.community-links a:active {
  transform: translateY(1px);
}

.offer-card {
  position: relative;
  overflow: hidden;
  margin-top: var(--space-2);
  padding: var(--space-3);
  border: var(--border-soft);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(58, 120, 255, 0.12) 0%, rgba(58, 120, 255, 0) 55%),
    radial-gradient(120% 140% at 100% 100%, rgba(70, 224, 194, 0.1) 0%, rgba(70, 224, 194, 0) 52%),
    var(--surface-card-alt);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  box-shadow: var(--shadow-card);
}

.offer-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(45, 111, 255, 0.08), rgba(30, 201, 184, 0.04) 45%, rgba(0, 0, 0, 0));
}

.offer-section {
  margin-bottom: var(--space-4);
}

.offer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  gap: var(--space-3);
  align-items: start;
}

.offer-main,
.offer-side {
  min-width: 0;
}

.home-page {
  display: grid;
  gap: var(--space-6);
}

.home-hero {
  padding-top: var(--space-1);
}

.home-stage {
  position: relative;
  margin: 0 0 var(--space-4);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(31, 34, 40, 0.16);
  background: #1b2030;
  box-shadow: var(--shadow-soft);
}

.home-stage canvas {
  display: block;
  width: 100%;
  height: 168px;
  cursor: pointer;
  touch-action: manipulation;
}

.home-stage-hud {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: rgba(231, 236, 255, 0.72);
  pointer-events: none;
}

.home-stage-hint {
  transition: opacity 0.2s ease;
}

.home-stage.is-playing .home-stage-hint {
  opacity: 0;
}

.home-kicker {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.home-hero-title {
  margin: 0 0 var(--space-3);
  font-size: 1.55rem;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.home-hero-text {
  margin: 0 0 var(--space-4);
  color: var(--text-secondary);
  font-size: var(--font-size-md);
  line-height: var(--line-relaxed);
}

.home-hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-bottom: var(--space-4);
  padding: 10px 16px;
  border-radius: var(--btn-radius);
  border: 1px solid rgba(31, 34, 40, 0.18);
  background: var(--surface-dark);
  color: #fff;
  font-size: var(--font-size-sm);
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(31, 34, 40, 0.18);
}

.home-hero-cta:hover {
  color: #fff;
  background: #2a2f38;
}

.home-topics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.home-topics li {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: var(--border-soft);
  background: var(--surface-control);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 600;
  line-height: 1.3;
}

.home-topics a {
  color: inherit;
  text-decoration: none;
}

.home-topics .is-active {
  background: var(--surface-dark);
  border-color: var(--surface-dark);
  color: #fff;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.section-head .section-title {
  margin-bottom: 0;
}

.section-head-link {
  flex: 0 0 auto;
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--text-accent);
}

.section-card {
  border: var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
}

.section-title {
  font-size: 1.2rem;
  line-height: var(--line-tight);
  margin: 0 0 var(--space-2);
}

.offer-title {
  font-size: 1.06rem;
  line-height: var(--line-tight);
  margin: 0 0 var(--space-2);
}

.offer-title-accent {
  color: var(--text-accent);
}

.offer-text {
  margin: 0 0 var(--space-2);
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: var(--line-normal);
}

.offer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.offer-list li {
  position: relative;
  margin: 0;
  padding: 4px 6px 4px 18px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  line-height: 1.2;
  background: var(--surface-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  border: var(--border-soft);
}

.offer-list li::before {
  content: '✓';
  position: absolute;
  left: 5px;
  top: 3px;
  color: var(--text-accent);
  font-weight: 700;
  font-size: 0.68rem;
}

.offer-result-preview {
  margin: 4px 0 0;
}

.offer-result-image {
  width: 100%;
  height: 112px;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: var(--border-soft);
  box-shadow: var(--shadow-soft);
  display: block;
  background: rgba(255, 255, 255, 0.78);
  padding: 6px;
}

.offer-result-preview figcaption {
  margin-top: 4px;
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--text-muted);
  text-align: left;
}

.offer-cta-lead {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: var(--line-normal);
  text-align: center;
  opacity: 0.9;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.featured-card {
  background: var(--surface-card);
  border: var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-soft);
}

.featured-card-lead {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.featured-card-lead .featured-thumb-link {
  margin-bottom: 0;
}

.featured-card-lead .featured-title {
  font-size: 1.15rem;
  min-height: 0;
  -webkit-line-clamp: 3;
}

.featured-copy {
  min-width: 0;
}

.featured-thumb-link {
  display: block;
  margin-bottom: var(--space-2);
}

.featured-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--space-2);
  display: block;
}

.featured-title {
  font-size: 0.92rem;
  line-height: var(--line-tight);
  margin: 0 0 var(--space-2);
  min-height: 2.2em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-title a {
  text-decoration: none;
}

.featured-excerpt {
  margin: 0 0 var(--space-2);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-normal);
}

.featured-meta {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.featured-read-btn {
  display: inline-block;
  text-decoration: none;
  border: 0;
  border-radius: var(--btn-radius);
  background: var(--btn-bg);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--btn-shadow);
  border: var(--border-soft);
}

.community-text {
  margin: 0 0 var(--space-3);
  color: var(--text-secondary);
}

.community-links {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.community-links a {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1 1 220px;
  text-decoration: none;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: var(--border-soft);
  background: var(--surface-page);
  font-weight: 700;
  color: var(--text-accent);
  box-shadow: none;
}

.community-link-head {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.community-link-head svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-link-sub {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.book-offer-card {
  position: relative;
  overflow: hidden;
  padding: var(--space-3);
  border-color: rgba(98, 125, 220, 0.34);
  background:
    radial-gradient(140% 150% at 0% 0%, rgba(83, 106, 255, 0.2) 0%, rgba(83, 106, 255, 0) 55%),
    radial-gradient(120% 140% at 100% 100%, rgba(119, 80, 255, 0.14) 0%, rgba(119, 80, 255, 0) 55%),
    linear-gradient(180deg, rgba(246, 249, 255, 0.96), rgba(255, 255, 255, 0.95));
  box-shadow:
    0 14px 28px rgba(69, 89, 176, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.book-offer-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(99, 118, 255, 0.08), rgba(58, 214, 180, 0.06) 52%, rgba(0, 0, 0, 0));
}

.book-offer-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.book-offer-cover {
  width: 100%;
  max-width: 160px;
  border-radius: var(--radius-md);
  border: var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.book-offer-content {
  min-width: 0;
}

.book-offer-text {
  margin: 0 0 var(--space-2);
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: var(--line-normal);
}

.book-offer-price {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 var(--space-2);
}

.book-offer-price-current {
  font-size: 1.3rem;
  line-height: 1;
  font-weight: 800;
  color: var(--text-primary);
}

.book-offer-price-old {
  font-size: 0.95rem;
  line-height: 1;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.book-offer-cta {
  position: relative;
  overflow: hidden;
  margin: var(--space-2) 0 0;
  border: 1px solid rgba(122, 162, 247, 0.34);
  background: linear-gradient(130deg, #1f2335 0%, #24283b 32%, #2f3f78 62%, #5a7fd8 82%, #7aa2f7 100%);
  background-size: 220% 220%;
  color: #e7ecff;
  box-shadow:
    0 10px 24px rgba(31, 44, 92, 0.3),
    inset 0 1px 0 rgba(210, 225, 255, 0.22);
  transition:
    color 0.2s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
  animation: bookCtaGradientFlow 7s ease-in-out infinite;
}

.book-offer-cta:hover {
  color: #f6f9ff;
  border-color: rgba(165, 195, 255, 0.5);
  box-shadow:
    0 10px 24px rgba(31, 44, 92, 0.3),
    0 0 0 1px rgba(165, 195, 255, 0.22),
    inset 0 1px 0 rgba(223, 236, 255, 0.28);
}

.book-offer-cta:active {
  color: #edf3ff;
  border-color: rgba(145, 180, 248, 0.46);
  box-shadow:
    0 9px 18px rgba(31, 44, 92, 0.24),
    inset 0 1px 0 rgba(210, 225, 255, 0.22);
}

.book-offer-cta:focus-visible {
  box-shadow:
    0 0 0 2px rgba(122, 162, 247, 0.34),
    0 12px 24px rgba(52, 84, 168, 0.32);
}

@keyframes bookCtaGradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.single-article {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  margin-bottom: var(--space-6);
}

.article-header {
  margin-bottom: var(--space-6);
}

.article-detail-title {
  font-size: 2.05rem;
  margin-bottom: var(--space-3);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.article-content {
  font-family: var(--font-article);
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-toc,
.article-neighbors,
.lesson-materials,
.course-program,
.lesson-cta {
  font-family: var(--font-ui);
}

.article-toc {
  margin-bottom: var(--space-5);
  padding: 0 0 0 14px;
  background: none;
  border: 0;
  border-left: 2px solid rgba(92, 78, 55, 0.18);
}

.article-toc-title {
  margin: 0 0 var(--space-2);
  font-size: 1.05rem;
  line-height: var(--line-tight);
}

.article-toc-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.article-toc-list li {
  margin: 0 0 var(--space-2);
  padding-left: calc((var(--toc-level, 2) - 2) * 14px);
  position: relative;
}

.article-toc-list li:last-child {
  margin-bottom: 0;
}

.article-toc-list a {
  text-decoration: none;
  display: inline-block;
  line-height: var(--line-normal);
}

.article-toc-list .toc-level-3 a,
.article-toc-list .toc-level-4 a {
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.article-toc-list .toc-level-3::before,
.article-toc-list .toc-level-4::before {
  content: '';
  position: absolute;
  left: calc((var(--toc-level, 2) - 2) * 14px - 8px);
  top: 0.45em;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #a5b0c5;
}

.article-body h2 {
  margin: 1.7em 0 0.55em;
  line-height: var(--line-tight);
  font-size: 1.32rem;
  font-weight: 700;
  font-family: var(--font-ui);
  letter-spacing: -0.02em;
  scroll-margin-top: 96px;
}

.article-body h3 {
  margin: 1.35em 0 0.45em;
  line-height: var(--line-normal);
  font-size: 1.12rem;
  font-weight: 650;
  font-family: var(--font-ui);
  color: var(--text-secondary);
  border-left: 0;
  scroll-margin-top: 96px;
}

.article-body h4 {
  margin: 1.15em 0 0.4em;
  line-height: var(--line-normal);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-ui);
  color: var(--text-muted);
  border-left: 0;
  scroll-margin-top: 96px;
}

.article-body p {
  margin: 0 0 1.15em;
}

.article-body img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--space-3) 0;
}

.article-body ul,
.article-body ol {
  margin: 0 0 var(--space-3);
  padding-left: 22px;
}

.article-body li {
  margin: 0 0 var(--space-2);
}

.article-body li:last-child {
  margin-bottom: 0;
}

.article-body a {
  overflow-wrap: anywhere;
}

.lesson-materials {
  margin: var(--space-3) 0 var(--space-5);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: var(--border-soft);
  background: var(--surface-card-alt);
  box-shadow: var(--shadow-card);
}

.lesson-materials h3 {
  margin: 0 0 var(--space-2);
  font-size: 1.18rem;
  line-height: var(--line-tight);
}

.lesson-materials p {
  margin: 0 0 var(--space-2);
}

.lesson-materials .article-read-btn {
  font-size: 0.92rem;
  border-radius: var(--radius-pill);
  padding-inline: 18px;
  box-shadow: 0 10px 18px rgba(31, 34, 40, 0.12);
}

.lesson-materials-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.lesson-materials-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  columns: 2;
  column-gap: var(--space-4);
}

.lesson-materials-list li {
  margin: 0 0 var(--space-1);
  break-inside: avoid;
}

.lesson-materials-list li:last-child {
  margin-bottom: 0;
}

.lesson-materials-list a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lesson-materials-list a::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #7c8ecb;
  opacity: 0.85;
}

.course-program {
  margin: var(--space-4) 0;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(122, 150, 231, 0.18);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.8), rgba(255, 255, 255, 0.96));
  box-shadow: 0 14px 28px rgba(60, 95, 180, 0.08);
}

.course-program h3 {
  margin: 0 0 var(--space-3);
  font-size: 1.22rem;
  line-height: var(--line-tight);
}

.course-program ol {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.course-program li {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(129, 149, 201, 0.24);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(80, 97, 160, 0.08);
}

.course-step-index {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2f80ed, #1cb5e0);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 12px rgba(47, 128, 237, 0.35);
}

.course-step-text {
  min-width: 0;
  display: block;
}

.lesson-cta {
  margin-top: var(--space-4);
  margin-bottom: var(--space-1);
  display: flex;
  justify-content: center;
}

.lesson-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-pill);
  padding: 13px 26px;
  min-width: 260px;
  border: 0;
  background: linear-gradient(90deg, #2f6bff 0%, #1f8eff 46%, #15c9b5 100%);
  background-size: 200% 100%;
  color: #fff;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 26px rgba(40, 122, 230, 0.33);
  width: 100%;
  max-width: 100%;
  transition: filter 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  animation: lessonCtaGradientShift 3.2s ease-in-out infinite;
}

.lesson-cta-btn::after {
  content: '';
  position: absolute;
  top: -120%;
  left: -40%;
  width: 32%;
  height: 340%;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 46%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-260%) rotate(18deg);
  animation: lessonCtaShine 3.2s ease-in-out infinite;
  pointer-events: none;
}

.lesson-cta-btn:hover {
  color: #fff;
  filter: brightness(1.06);
  box-shadow: 0 16px 30px rgba(40, 122, 230, 0.38);
}

.lesson-cta-btn:active {
  transform: translateY(1px);
}

@keyframes lessonCtaGradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes lessonCtaShine {
  0%,
  58% {
    transform: translateX(-260%) rotate(18deg);
    opacity: 0;
  }
  66% {
    opacity: 1;
  }
  82% {
    transform: translateX(420%) rotate(18deg);
    opacity: 0;
  }
  100% {
    transform: translateX(420%) rotate(18deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lesson-cta-btn,
  .lesson-cta-btn::after,
  .book-offer-cta {
    animation: none;
  }
}

.article-code {
  margin: var(--space-4) 0 var(--space-5);
  padding: var(--space-3) 14px;
  border-radius: var(--radius-md);
  background: #24283b;
  color: #c0caf5;
  overflow-x: auto;
  border: 1px solid rgba(148, 164, 194, 0.26);
  box-shadow: var(--shadow-code);
}

.article-code code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  line-height: 1.5;
  white-space: pre;
}

.article-code .hljs-comment,
.article-code .hljs-quote {
  color: #565f89;
}

.article-code .hljs-keyword,
.article-code .hljs-selector-tag,
.article-code .hljs-type {
  color: #bb9af7;
}

.article-code .hljs-string,
.article-code .hljs-attr {
  color: #9ece6a;
}

.article-code .hljs-number,
.article-code .hljs-literal {
  color: #ff9e64;
}

.article-code .hljs-title,
.article-code .hljs-function {
  color: #7aa2f7;
}

.article-neighbors {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: var(--border-soft);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.article-neighbors.article-neighbors-single {
  grid-template-columns: minmax(0, 1fr);
}

.article-neighbor-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: var(--line-normal);
}

.article-neighbor-next {
  text-align: right;
  justify-self: end;
}

.article-neighbor-prev .neighbor-label::before {
  content: '← ';
}

.article-neighbor-next .neighbor-label::after {
  content: ' →';
}

.neighbor-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.neighbor-title {
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-primary);
}

.article-cover {
  width: 100%;
  border-radius: var(--radius-lg);
  border: var(--border-soft);
  margin-bottom: 14px;
}

.pagination {
  margin-top: var(--space-3);
  padding-top: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.pagination-link {
  text-decoration: none;
  border: 0;
  border-radius: var(--btn-radius);
  background: var(--btn-bg);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  font-size: 0.88rem;
  box-shadow: var(--btn-shadow);
  border: var(--border-soft);
}

.pagination-info {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.not-found-page {
  min-height: 48vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.not-found-icon {
  width: 92px;
  height: 92px;
  border-radius: var(--radius-lg);
}

.not-found-code {
  margin: 0;
  font-size: 2.2em;
  line-height: 1;
}

.not-found-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.not-found-home-btn {
  margin-top: var(--space-2);
  display: inline-block;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: var(--border-soft);
  background: var(--surface-control);
  color: var(--surface-dark);
  font-weight: 600;
  font-size: 0.92em;
}

.not-found-home-btn:hover {
  color: var(--surface-dark);
  background: var(--surface-control-hover);
}

code {
  background: #efeae0;
  padding: 2px 6px;
  border-radius: var(--space-1);
  font-size: 0.86em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

.app-footer {
  margin-top: auto;
  padding: var(--space-5) 0 var(--space-4);
  border-top: var(--border-soft);
}

.footer-legal,
.footer-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.footer-legal {
  margin-bottom: 8px;
}

.footer-legal a,
.footer-meta a {
  color: inherit;
  text-decoration: none;
}

.footer-legal a:hover,
.footer-meta a:hover {
  color: var(--text-accent);
}

.consent-popup {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 16px;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border: var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
  padding: 14px;
  z-index: 100;
}

.consent-popup p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
}

.consent-popup a {
  text-decoration: none;
  font-weight: 700;
}

.consent-btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--surface-dark);
  cursor: pointer;
}

@media (max-width: 768px) {
  .container {
    --page-pad: 16px;
    max-width: 100%;
    padding: 0 var(--page-pad) calc(var(--space-6) + env(safe-area-inset-bottom));
  }

  .site-header {
    margin-bottom: var(--space-4);
    padding: 12px var(--page-pad);
  }

  .site-title-rest {
    display: none;
  }

  .brand-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 10px;
    text-align: center;
  }

  .brand-copy {
    flex: 0 1 auto;
  }

  .site-nav {
    flex-basis: 100%;
    justify-content: center;
    margin-left: 0;
    gap: 22px;
    padding-top: 2px;
  }

  .site-search {
    flex-basis: 100%;
  }

  .site-search input {
    width: 100%;
  }

  .logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .site-title {
    font-size: 1.08rem;
  }

  .site-subtitle {
    font-size: 0.78rem;
    line-height: 1.3;
  }

  .offer-card {
    padding: var(--space-2) var(--space-3);
  }

  .offer-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
  }

  .offer-title {
    font-size: 0.98rem;
    margin-bottom: 5px;
  }

  .offer-text {
    font-size: 0.84rem;
    margin-bottom: 6px;
    line-height: 1.35;
  }

  .offer-list li {
    font-size: 0.68rem;
    padding: 4px 5px 4px 17px;
  }

  .offer-result-image {
    height: 98px;
  }

  .offer-cta-lead {
    font-size: 0.76rem;
    margin-top: 6px;
  }

  .offer-cta {
    font-size: 0.82rem;
    padding: 7px 10px;
    min-width: 100%;
  }

  .article {
    margin-bottom: 40px;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .home-hero-title {
    font-size: 1.32rem;
  }

  .home-stage canvas {
    height: 140px;
  }

  .featured-card-lead {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-detail-title {
    font-size: 1.7rem;
  }

  .article-content {
    font-size: 1.0625rem;
    line-height: 1.75;
  }

  .article-body h2,
  .article-body h3,
  .article-body h4 {
    scroll-margin-top: 84px;
  }

  .article-neighbors {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  .article-neighbor-link,
  .article-neighbor-next {
    align-items: center;
    text-align: center;
    justify-self: stretch;
  }

  .app-footer {
    text-align: center;
    padding-top: var(--space-4);
  }

  .footer-legal,
  .footer-meta {
    justify-content: center;
    gap: 6px 12px;
  }

  .lesson-materials-list {
    columns: 1;
  }

  .course-program li {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lesson-cta-btn {
    min-width: 0;
    width: 100%;
  }

  .book-offer-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
  }

  .book-offer-cover {
    max-width: 190px;
    margin: 0 auto;
  }
}

@media (max-width: 430px) {
  .container {
    --page-pad: 16px;
    padding: 0 var(--page-pad) calc(var(--space-6) + env(safe-area-inset-bottom));
  }

  .home-page {
    gap: var(--space-5);
  }

  .featured-card {
    padding: var(--space-2);
  }

  .section-card,
  .offer-card,
  .article-card {
    padding: var(--space-2);
  }

  .featured-grid {
    gap: 6px;
  }

  .footer-card {
    font-size: 0.75rem;
  }
}

@media (max-width: 390px) {
  .site-subtitle {
    font-size: 0.76rem;
  }

  .offer-list li {
    font-size: 0.66rem;
    padding: 4px 5px 4px 16px;
  }

  .offer-list li::before {
    left: 4px;
  }
}

@media (max-width: 360px) {
  .site-header {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .section-title {
    font-size: 1.08rem;
  }
}
