/* =============================================================
   DESIGN SYSTEM — «Признаки делимости»
   Academic-premium, trust-inspiring, reading-first design
   ============================================================= */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:wght@400;700&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Primary palette — deep navy / warm gold */
    --color-primary: #1a365d;
    --color-primary-light: #2a4a7f;
    --color-primary-dark: #0f2440;
    --color-accent: #d4a853;
    --color-accent-light: #e8c97a;
    --color-accent-dark: #b08a3a;

    /* Neutrals */
    --color-bg: #f8f6f1;
    --color-bg-card: #ffffff;
    --color-bg-alt: #efeade;
    --color-text: #2d2d2d;
    --color-text-muted: #5a6370;
    --color-text-light: #8a919c;
    --color-border: #e0dcd4;
    --color-border-light: #ece8e0;

    /* Semantic */
    --color-success: #2e7d5b;
    --color-info: #2563eb;
    --color-cta: #d4a853;
    --color-cta-hover: #c09a48;

    /* Typography */
    --font-heading: 'Merriweather', 'Georgia', serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

    /* Spacing scale (4px base) */
    --space-xs: 0.25rem;
    /* 4px  */
    --space-sm: 0.5rem;
    /* 8px  */
    --space-md: 1rem;
    /* 16px */
    --space-lg: 1.5rem;
    /* 24px */
    --space-xl: 2rem;
    /* 32px */
    --space-2xl: 3rem;
    /* 48px */
    --space-3xl: 4rem;
    /* 64px */

    /* Layout */
    --max-width: 900px;
    --max-width-wide: 1140px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 3px rgba(26, 54, 93, 0.06);
    --shadow: 0 2px 8px rgba(26, 54, 93, 0.08);
    --shadow-lg: 0 4px 20px rgba(26, 54, 93, 0.10);
    --shadow-xl: 0 8px 32px rgba(26, 54, 93, 0.12);

    /* Transitions */
    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    line-height: 1.3;
    color: var(--color-primary);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

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

a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color var(--transition);
}

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

/* ---------- Layout container ---------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container--wide {
    max-width: var(--max-width-wide);
}

/* =============================================================
   HEADER
   ============================================================= */
.site-header {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 60%, var(--color-primary-light) 100%);
    color: #fff;
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
}

.site-logo__icon {
    width: 36px;
    height: 36px;
    background: var(--color-accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    transition: transform var(--transition);
}

.site-logo:hover .site-logo__icon {
    transform: rotate(-8deg) scale(1.05);
}

.site-logo__text {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Hamburger (mobile) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-xs);
    line-height: 1;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.main-nav__list {
    display: flex;
    list-style: none;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.main-nav__link {
    display: block;
    padding: var(--space-xs) var(--space-md);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
    white-space: nowrap;
}

.main-nav__link:hover,
.main-nav__link--active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.main-nav__link--active {
    background: rgba(212, 168, 83, 0.25);
    color: var(--color-accent-light);
}

/* =============================================================
   HERO (only on index)
   ============================================================= */
.hero {
    background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-light) 50%, #3b6cb5 100%);
    color: #fff;
    padding: var(--space-3xl) 0 var(--space-2xl);
    text-align: center;
    position: relative;
    overflow: visible;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 168, 83, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero h1 {
    color: #fff;
    font-size: 2.4rem;
    margin-bottom: var(--space-md);
    position: relative;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 640px;
    margin: 0 auto var(--space-lg);
    position: relative;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: var(--space-xs) var(--space-md);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-accent-light);
    margin-bottom: var(--space-lg);
}

/* =============================================================
   MAIN CONTENT
   ============================================================= */
.main-content {
    flex: 1;
    padding: var(--space-2xl) 0;
}

/* =============================================================
   CARDS (topic cards grid)
   ============================================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-lg);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    opacity: 0;
    transition: opacity var(--transition);
}

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

.card:hover::before {
    opacity: 1;
}

.card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--color-bg-alt), var(--color-bg));
    color: var(--color-primary);
}

.card__title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.card__desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: var(--space-md);
}

.card__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary-light);
    transition: gap var(--transition), color var(--transition);
}

.card__link:hover {
    gap: var(--space-sm);
    color: var(--color-accent-dark);
}

.card__link::after {
    content: '→';
    transition: transform var(--transition);
}

.card:hover .card__link::after {
    transform: translateX(3px);
}

/* =============================================================
   ARTICLE PAGE (content pages)
   ============================================================= */
.page-header {
    background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: #fff;
    padding: var(--space-2xl) 0 var(--space-xl);
}

.page-header h1 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.page-header__subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.65);
}

.breadcrumb a:hover {
    color: #fff;
}

.breadcrumb__sep {
    color: rgba(255, 255, 255, 0.35);
}

/* Article body */
.article {
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    margin-top: calc(-1 * var(--space-xl));
    position: relative;
    box-shadow: var(--shadow);
    margin-bottom: var(--space-2xl);
}

.article h2 {
    margin-top: var(--space-xl);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-border-light);
}

.article h2:first-child {
    margin-top: 0;
}

.article ul,
.article ol {
    padding-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

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

.article li::marker {
    color: var(--color-accent);
}

/* Info box */
.info-box {
    background: var(--color-bg-alt);
    border-left: 4px solid var(--color-accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: var(--space-lg);
    margin: var(--space-lg) 0;
}

.info-box__title {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
    font-size: 0.95rem;
}

/* Rule card (individual divisibility rule) */
.rule-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin: var(--space-md) 0;
    transition: border-color var(--transition);
}

.rule-card:hover {
    border-color: var(--color-accent);
}

.rule-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    margin-right: var(--space-sm);
    flex-shrink: 0;
}

.rule-card__header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.rule-card__title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
}

.rule-card__body {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    padding-left: calc(32px + var(--space-sm));
}

/* Topic list (for content pages) */
.topic-list {
    list-style: none;
    padding: 0;
}

.topic-list li {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
}

.topic-list li:last-child {
    border-bottom: none;
}

.topic-list__marker {
    color: var(--color-accent);
    font-weight: 600;
    flex-shrink: 0;
}

/* =============================================================
   CTA BANNER (tutor link promotion)
   ============================================================= */
.cta-banner {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    color: #fff;
    text-align: center;
    margin: var(--space-2xl) 0;
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 168, 83, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.cta-banner h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    position: relative;
}

.cta-banner p {
    color: rgba(255, 255, 255, 0.8);
    max-width: 520px;
    margin: 0 auto var(--space-lg);
    position: relative;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-accent);
    color: var(--color-primary-dark);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
    box-shadow: 0 4px 16px rgba(212, 168, 83, 0.3);
}

.btn-cta:hover {
    background: var(--color-accent-light);
    color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(212, 168, 83, 0.4);
}

/* =============================================================
   TRUST BAR
   ============================================================= */
.trust-bar {
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
    padding: var(--space-lg) 0;
}

.trust-bar__inner {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.trust-item__icon {
    font-size: 1.2rem;
    color: var(--color-success);
}

/* =============================================================
   SECTION HEADERS
   ============================================================= */
.section-title {
    text-align: center;
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1rem;
    max-width: 560px;
    margin: 0 auto var(--space-xl);
}

/* =============================================================
   FOOTER
   ============================================================= */
.site-footer {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-2xl) 0 var(--space-lg);
    margin-top: auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: var(--space-xl);
    flex-wrap: wrap;
}

.footer-col {
    min-width: 200px;
}

.footer-col h4 {
    color: var(--color-accent-light);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-md);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: var(--space-sm);
}

.footer-col a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: var(--color-accent-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-bottom p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-primary-dark);
        padding: var(--space-md);
        box-shadow: var(--shadow-lg);
        z-index: 100;
    }

    .main-nav.is-open {
        display: block;
    }

    .main-nav__list {
        flex-direction: column;
        gap: 0;
    }

    .main-nav__link {
        padding: var(--space-sm) var(--space-md);
        border-radius: var(--radius);
    }

    .hero h1 {
        font-size: 1.7rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .article {
        padding: var(--space-lg);
        border-radius: var(--radius);
        margin-left: calc(-1 * var(--space-md));
        margin-right: calc(-1 * var(--space-md));
    }

    .cta-banner {
        padding: var(--space-xl) var(--space-lg);
    }

    .trust-bar__inner {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }

    .footer-inner {
        flex-direction: column;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    /* Page header adjustments */
    .page-header {
        padding: var(--space-xl) 0 var(--space-lg);
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header__subtitle {
        font-size: 0.9rem;
    }

    /* Tables: smaller font on mobile */
    .article table {
        font-size: 0.85rem;
    }

    .article table th,
    .article table td {
        padding: var(--space-xs) var(--space-sm) !important;
    }

    /* Rule cards */
    .rule-card__body {
        padding-left: 0;
    }

    /* FAQ */
    .faq-label {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: var(--space-2xl) 0 var(--space-xl);
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    .container {
        padding: 0 var(--space-md);
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .article {
        padding: var(--space-md);
    }

    /* Ordered list counter smaller on tiny screens */
    .article ol>li::before {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }

    .article ol>li {
        padding-left: calc(var(--space-lg) + var(--space-sm));
    }
}

/* =============================================================
   REDUCED MOTION — Accessibility
   ============================================================= */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =============================================================
   UTILITIES
   ============================================================= */
.text-center {
    text-align: center;
}

.mt-0 {
    margin-top: 0;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

/* =============================================================
   ANIMATIONS — Keyframes
   ============================================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(212, 168, 83, 0.3);
    }

    50% {
        box-shadow: 0 4px 28px rgba(212, 168, 83, 0.55), 0 0 0 6px rgba(212, 168, 83, 0.12);
    }
}

@keyframes subtleBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(3deg);
    }
}

/* --- Apply animations to elements --- */
.hero {
    animation: fadeIn 0.6s ease-out;
}

.page-header {
    animation: fadeIn 0.5s ease-out;
}

.article {
    animation: fadeInUp 0.5s ease-out both;
}

.card {
    animation: fadeInUp 0.5s ease-out both;
}

.card:nth-child(1) {
    animation-delay: 0.05s;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.15s;
}

.card:nth-child(4) {
    animation-delay: 0.2s;
}

.card:nth-child(5) {
    animation-delay: 0.25s;
}

.cta-banner {
    animation: fadeInUp 0.6s ease-out both;
}

.trust-bar {
    animation: fadeIn 0.6s ease-out 0.15s both;
}

/* =============================================================
   CTA ENHANCEMENTS — Pulsing glow, bigger presence
   ============================================================= */
.btn-cta {
    animation: pulseGlow 2.5s ease-in-out infinite;
    font-size: 1.05rem;
    padding: var(--space-md) var(--space-2xl);
    letter-spacing: 0.01em;
}

.btn-cta:hover {
    animation: none;
    box-shadow: 0 6px 28px rgba(212, 168, 83, 0.5);
}

/* CTA trust badges row */
.cta-badges {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.cta-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

.cta-badge__icon {
    font-size: 1.1rem;
}

/* =============================================================
   STICKY MOBILE CTA — Fixed bottom bar on small screens
   ============================================================= */
.mobile-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-primary-dark);
    padding: var(--space-sm) var(--space-md);
    z-index: 200;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.2);
    text-align: center;
    border-top: 2px solid var(--color-accent);
}

.mobile-cta .btn-cta {
    width: 100%;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.95rem;
    animation: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .mobile-cta {
        display: block;
    }
}

/* =============================================================
   DECORATIVE — Hero math pattern overlay
   ============================================================= */
.hero__math-decor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.hero__math-symbol {
    position: absolute;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.06);
    font-weight: 700;
    user-select: none;
    animation: floatSlow 6s ease-in-out infinite;
}

.hero__math-symbol:nth-child(1) {
    top: 12%;
    left: 5%;
    font-size: 3rem;
    animation-delay: 0s;
}

.hero__math-symbol:nth-child(2) {
    top: 60%;
    left: 10%;
    font-size: 2rem;
    animation-delay: 1s;
}

.hero__math-symbol:nth-child(3) {
    top: 25%;
    right: 8%;
    font-size: 2.5rem;
    animation-delay: 2s;
}

.hero__math-symbol:nth-child(4) {
    bottom: 15%;
    right: 15%;
    font-size: 3.5rem;
    animation-delay: 0.5s;
}

.hero__math-symbol:nth-child(5) {
    top: 45%;
    left: 20%;
    font-size: 1.8rem;
    animation-delay: 3s;
}

.hero__math-symbol:nth-child(6) {
    bottom: 30%;
    left: 70%;
    font-size: 2.2rem;
    animation-delay: 1.5s;
}

/* Ensure hero content stays above decorations */
.hero .container {
    position: relative;
    z-index: 1;
}

/* =============================================================
   ARTICLE — Gold gradient top border
   ============================================================= */
.article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent), var(--color-primary-light));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* =============================================================
   TABLES — Zebra striping, hover, polished headers
   ============================================================= */
.article table tbody tr:nth-child(even) {
    background: rgba(239, 234, 222, 0.45);
}

.article table tbody tr {
    transition: background var(--transition);
}

.article table tbody tr:hover {
    background: rgba(212, 168, 83, 0.1);
}

.article table thead th {
    position: relative;
}

/* Make tables more readable */
.article table {
    border-radius: var(--radius);
    overflow: hidden;
}

/* =============================================================
   FORMULA BLOCKS — Styled math expressions
   ============================================================= */
.formula,
.article p[style*="text-align: center"] {
    background: linear-gradient(135deg, rgba(239, 234, 222, 0.6), rgba(248, 246, 241, 0.9));
    border: 1px solid var(--color-border-light);
    border-left: 3px solid var(--color-primary-light);
    border-radius: var(--radius);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-md) 0;
    font-family: 'Georgia', 'Times New Roman', serif;
}

/* =============================================================
   ORDERED LISTS — Custom counters in articles
   ============================================================= */
.article ol {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
}

.article ol>li {
    counter-increment: step-counter;
    position: relative;
    padding-left: calc(var(--space-xl) + var(--space-sm));
    margin-bottom: var(--space-md);
}

.article ol>li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* =============================================================
   INFO-BOX — Subtle entrance
   ============================================================= */
.info-box {
    animation: fadeIn 0.4s ease-out both;
}

/* =============================================================
   RULE-CARD — Enhanced hover & focus feel
   ============================================================= */
.rule-card {
    transition: border-color var(--transition), box-shadow var(--transition);
}

.rule-card:hover {
    box-shadow: var(--shadow-sm);
}

/* =============================================================
   TRUST BAR — Enhanced styling
   ============================================================= */
.trust-item {
    transition: transform var(--transition);
}

.trust-item:hover {
    transform: translateY(-1px);
}

.trust-item__icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(46, 125, 91, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

/* =============================================================
   HERO — Decorative bottom wave / separator
   ============================================================= */
.hero__wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 1;
}

.hero__wave svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* .hero already has position: relative and overflow: hidden */

/* =============================================================
   PAGE HEADER — Decorative pattern for inner pages
   ============================================================= */
.page-header {
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '÷';
    position: absolute;
    top: -20px;
    right: 30px;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.04);
    font-weight: 700;
    pointer-events: none;
    line-height: 1;
}

.page-header::after {
    content: '≡';
    position: absolute;
    bottom: -10px;
    left: 40px;
    font-size: 6rem;
    color: rgba(255, 255, 255, 0.03);
    font-weight: 700;
    pointer-events: none;
    line-height: 1;
}

/* =============================================================
   FOOTER — Decorative top gradient line
   ============================================================= */
.site-footer {
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-accent), var(--color-primary-light));
}

/* =============================================================
   SECTION HEADERS — Decorative underline
   ============================================================= */
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-accent);
    border-radius: 2px;
    margin: var(--space-sm) auto 0;
}

/* =============================================================
   FAQ ACCORDION — Pure CSS toggle
   ============================================================= */
.faq-item {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
    overflow: hidden;
    transition: border-color var(--transition);
}

.faq-item:hover {
    border-color: var(--color-accent);
}

.faq-toggle {
    display: none;
}

.faq-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
    user-select: none;
    transition: background var(--transition);
}

.faq-label:hover {
    background: rgba(239, 234, 222, 0.4);
}

.faq-label__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-primary-dark);
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.faq-label__arrow {
    margin-left: auto;
    font-size: 1.2rem;
    color: var(--color-text-muted);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 var(--space-lg);
}

.faq-answer__inner {
    padding: 0 0 var(--space-lg) calc(28px + var(--space-sm));
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.faq-toggle:checked~.faq-answer {
    max-height: 500px;
    padding: var(--space-xs) var(--space-lg);
}

.faq-toggle:checked~.faq-label .faq-label__arrow {
    transform: rotate(180deg);
}

/* =============================================================
   MISC POLISH
   ============================================================= */

/* Smooth scroll for all anchor links */
html {
    scroll-behavior: smooth;
}

/* Selection color matching brand */
::selection {
    background: rgba(212, 168, 83, 0.3);
    color: var(--color-primary-dark);
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Link underline on hover within articles */
.article a {
    text-decoration: none;
    border-bottom: 1px solid rgba(42, 74, 127, 0.3);
    transition: border-color var(--transition), color var(--transition);
}

.article a:hover {
    border-bottom-color: var(--color-accent-dark);
    color: var(--color-accent-dark);
}

/* Breadcrumb separator animation */
.breadcrumb__sep {
    transition: transform var(--transition);
}

.breadcrumb a:hover+.breadcrumb__sep {
    transform: translateX(2px);
}