/*
Theme Name: ContentRank
Theme URI: https://contentrank.pro/
Author: ContentRank Team
Author URI: https://contentrank.pro/
Description: A modern, conversion-focused WordPress theme for SEO agencies and content marketing services. Includes a polished homepage, blog, and customizable sections built around clean typography and bold accents.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: contentrank
Tags: blog, business, one-column, two-columns, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

/* Push anchor scroll targets below the sticky header (76px) + a small
   buffer. Most sections (.section) already supply 96px of internal
   padding-top, so this base offset is enough to keep them looking clean.
   Affects both native hash navigation and JS scrollIntoView(). */
html { scroll-padding-top: 96px; }
.admin-bar { scroll-padding-top: 128px; } /* +32px for the WP admin toolbar */
@media screen and (max-width: 600px) {
    /* WP admin bar becomes position:absolute below 600px and no longer offsets sticky elements. */
    .admin-bar { scroll-padding-top: 96px; }
}

/* The Contact section anchor lives on a .cta-banner (no internal padding-top),
   so it needs extra scroll-margin to avoid sitting flush with the sticky
   header. Adds on top of html's scroll-padding-top. */
#contact { scroll-margin-top: 36px; }

:root {
    --color-bg: #ffffff;
    --color-bg-soft: #f6f7fb;
    --color-bg-dark: #0b1020;
    --color-text: #0e1330;
    --color-muted: #5b6178;
    --color-border: #e5e7ef;
    --color-primary: #5b5bf7;
    --color-primary-dark: #3f3fd1;
    --color-accent: #18d1a3;
    --color-warning: #ffb547;
    --color-card: #ffffff;
    --color-input-bg: #ffffff;
    --color-header-bg: rgba(255, 255, 255, 0.85);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 4px 14px rgba(20, 24, 60, 0.06);
    --shadow-md: 0 14px 40px rgba(20, 24, 60, 0.10);
    --shadow-lg: 0 30px 80px rgba(20, 24, 60, 0.18);
    --container: 1180px;
    --transition: 0.25s ease;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-display: "Manrope", "Inter", sans-serif;
}

/* ---------- Dark theme palette ----------
   Activated via [data-theme="dark"] on <html>. Set by an inline script in
   header.php before any CSS loads, so there's no flash of wrong theme on
   first paint. Default for new visitors comes from prefers-color-scheme;
   visitors who toggle manually get their choice persisted in localStorage. */
[data-theme="dark"] {
    --color-bg: #0a0f1f;
    --color-bg-soft: #141a2e;
    --color-bg-dark: #050811;
    --color-text: #e8eaff;
    --color-muted: #9aa0bf;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-primary: #7e7eff;
    --color-primary-dark: #5b5bf7;
    --color-accent: #2eddb1;
    --color-card: #141a2e;
    --color-input-bg: #1c2340;
    --color-header-bg: rgba(10, 15, 31, 0.85);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.40);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.50);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.60);
}

/* Smooth crossfade when the theme flips. Only on properties that actually
   change with theme — avoids transitioning hover effects globally. */
html { transition: background-color 0.3s ease, color 0.3s ease; }
body, .site-header, .site-footer, .feature, .testimonial, .stat-card,
.post-card, .team-card, .value-item, .timeline__item,
.contact-form, .contact-form input, .contact-form textarea {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--color-text);
    line-height: 1.2;
    margin: 0 0 0.6em;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); font-weight: 700; }
h4 { font-size: 1.15rem; font-weight: 700; }

p { margin: 0 0 1em; }

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

.section { padding: 96px 0; }
.section--tight { padding: 64px 0; }
.section--dark {
    background: linear-gradient(135deg, #0b1020 0%, #1a1f4a 100%);
    color: #e8ebff;
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: #ffffff; }
.section--soft { background-color: var(--color-bg-soft); }

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 14px;
}
.section--dark .eyebrow { color: var(--color-accent); }

.section-head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 56px;
}
.section-head p {
    color: var(--color-muted);
    font-size: 1.05rem;
}
.section--dark .section-head p { color: #b6bce0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
    line-height: 1;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 10px 24px rgba(91, 91, 247, 0.35);
}
.btn--primary:hover {
    background: var(--color-primary-dark);
    color: #fff;
    box-shadow: 0 14px 30px rgba(91, 91, 247, 0.45);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn--ghost:hover { border-color: var(--color-text); color: var(--color-text); }

.section--dark .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.25); }
.section--dark .btn--ghost:hover { border-color: #fff; color: #fff; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-header-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--color-border);
}

/* WordPress admin bar offset — keep sticky header below the toolbar when logged in */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
}
@media screen and (max-width: 600px) {
    /* WP makes admin bar position:absolute below 600px, so no offset needed */
    .admin-bar .site-header { top: 0; }
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
    gap: 24px;
}
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--color-text);
    letter-spacing: -0.02em;
}
.site-brand:hover { color: var(--color-text); }
.site-brand__mark {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800;
}

.primary-nav { display: flex; }
.primary-nav ul,
.primary-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.primary-nav li { position: relative; }
.primary-nav a {
    position: relative;
    display: inline-block;
    color: var(--color-text);
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.25s ease, background-color 0.3s ease, transform 0.25s ease;
}
.primary-nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 22px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 2px;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}
.primary-nav a:hover {
    color: var(--color-primary);
    background-color: rgba(91, 91, 247, 0.08);
    transform: translateY(-1px);
}
/* Active state is driven exclusively by the .is-active class:
 *   - PHP adds it server-side to the link whose URL matches the current page
 *     (handled by contentrank_active_menu_link in functions.php).
 *   - JS scrollspy adds/removes it dynamically on the homepage as the user
 *     scrolls between sections.
 * We deliberately do NOT use WP's .current-menu-item / .current_page_item /
 * .current-menu-ancestor classes — WP applies them inconsistently to anchor
 * Custom Links, which caused multiple menu items to be underlined at once.
 */
.primary-nav a:hover::after,
.primary-nav a.is-active::after {
    transform: translateX(-50%) scaleX(1);
}
.primary-nav a.is-active { color: var(--color-primary); }

.site-header__cta { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
}
.menu-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: var(--color-text);
    margin: 4px 0;
    transition: var(--transition);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { opacity: 0; transform: translateX(-8px); }
.menu-toggle[aria-expanded="true"] span:nth-child(4) { transform: translateY(-6px) rotate(-45deg); }

@keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .primary-nav, .site-header__cta .btn { display: none; }
    .menu-toggle { display: inline-block; }
    .primary-nav.is-open {
        display: flex;
        position: absolute;
        top: 76px; left: 0; right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        padding: 12px 16px 20px;
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        animation: navSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
    }
    .primary-nav.is-open ul,
    .primary-nav.is-open .primary-nav__list {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
        gap: 2px;
    }
    .primary-nav.is-open a {
        display: block;
        text-align: left;
        padding: 14px 18px;
        border-radius: 12px;
    }
    .primary-nav.is-open a::after { display: none; }
    .primary-nav.is-open li {
        opacity: 0;
        transform: translateX(-10px);
        animation: navSlideDown 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    .primary-nav.is-open li:nth-child(1) { animation-delay: 0.04s; }
    .primary-nav.is-open li:nth-child(2) { animation-delay: 0.08s; }
    .primary-nav.is-open li:nth-child(3) { animation-delay: 0.12s; }
    .primary-nav.is-open li:nth-child(4) { animation-delay: 0.16s; }
    .primary-nav.is-open li:nth-child(5) { animation-delay: 0.20s; }
    .primary-nav.is-open li:nth-child(6) { animation-delay: 0.24s; }
    .primary-nav.is-open li:nth-child(7) { animation-delay: 0.28s; }
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 96px 0 80px;
    background:
        radial-gradient(1000px 500px at 80% -10%, rgba(91,91,247,0.18), transparent 60%),
        radial-gradient(900px 460px at -10% 30%, rgba(24,209,163,0.18), transparent 60%),
        var(--color-bg);
}
.hero__inner {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 60px;
}
.hero__title { margin-bottom: 20px; }
.hero__title em {
    font-style: normal;
    background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero__lead {
    font-size: 1.15rem;
    color: var(--color-muted);
    max-width: 540px;
    margin-bottom: 32px;
}
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 32px; }
.hero__trust {
    display: flex; align-items: center; gap: 16px;
    color: var(--color-muted);
    font-size: 0.9rem;
}
.hero__trust strong { color: var(--color-text); font-weight: 700; }
.hero__avatars { display: inline-flex; }
.hero__avatars span {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -10px;
    background: linear-gradient(135deg, #c7c8ff, #5b5bf7);
    display: inline-block;
}
.hero__avatars span:nth-child(2) { background: linear-gradient(135deg, #b9f3e2, #18d1a3); }
.hero__avatars span:nth-child(3) { background: linear-gradient(135deg, #ffd9a3, #ffb547); }
.hero__avatars span:nth-child(4) { background: linear-gradient(135deg, #f3b9d7, #d15bbb); }

.hero__visual {
    position: relative;
    aspect-ratio: 5/4;
    border-radius: var(--radius-lg);
    background: var(--color-card);
    box-shadow: var(--shadow-lg);
    padding: 22px;
    overflow: hidden;
}
.hero__chart {
    height: 60%;
    position: relative;
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(91,91,247,0.06), transparent 70%),
        var(--color-chart-bg, #f9faff);
    overflow: hidden;
    padding: 14px 18px 8px;
}
.hero-chart {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.hero-chart__line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: heroChartDraw 1.8s cubic-bezier(0.65, 0, 0.35, 1) 0.2s forwards;
    filter: drop-shadow(0 4px 10px rgba(91, 91, 247, 0.25));
}
.hero-chart__area {
    opacity: 0;
    animation: heroChartFade 0.8s ease 1.4s forwards;
}
.hero-chart__points circle {
    opacity: 0;
    animation: heroChartFade 0.4s ease forwards;
    transform-box: fill-box;
    transform-origin: center;
}
.hero-chart__points circle:nth-child(1) { animation-delay: 0.6s; }
.hero-chart__points circle:nth-child(2) { animation-delay: 0.95s; }
.hero-chart__points circle:nth-child(3) { animation-delay: 1.3s; }
.hero-chart__points circle:nth-child(4) { animation-delay: 1.65s; }
.hero-chart__head {
    opacity: 0;
    animation: heroChartFade 0.5s ease 1.9s forwards;
}
.hero-chart__pulse {
    transform-box: fill-box;
    transform-origin: center;
    animation: heroChartPulse 2.2s ease-in-out 2.4s infinite;
}

@keyframes heroChartDraw {
    to { stroke-dashoffset: 0; }
}
@keyframes heroChartFade {
    to { opacity: 1; }
}
@keyframes heroChartPulse {
    0%, 100% { transform: scale(1); opacity: 0.18; }
    50%      { transform: scale(1.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-chart__line  { stroke-dashoffset: 0; animation: none; }
    .hero-chart__area,
    .hero-chart__head,
    .hero-chart__points circle { opacity: 1; animation: none; }
    .hero-chart__pulse { animation: none; }
}

.hero__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 18px;
}
.hero__stat {
    background: var(--color-bg-soft);
    border-radius: 12px;
    padding: 14px;
}
.hero__stat strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--color-text);
}
.hero__stat span { font-size: 0.8rem; color: var(--color-muted); line-height: 1.3; }

@media (max-width: 900px) {
    .hero__inner { grid-template-columns: 1fr; gap: 32px; }
    .hero { padding: 64px 0 48px; }
}

/* On narrow phones, switch the stats to a single column with a horizontal
   number/label layout so the labels stop wrapping into 2-3 cramped lines. */
@media (max-width: 600px) {
    .hero__visual {
        aspect-ratio: auto;
    }
    .hero__chart {
        height: 200px;
    }
    .hero__stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .hero__stat {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 16px;
    }
    .hero__stat strong {
        display: inline-block;
        font-size: 1.25rem;
        min-width: 72px;
        flex-shrink: 0;
    }
    .hero__stat span { font-size: 0.9rem; }
}

/* ---------- Logos ---------- */
.logos {
    padding: 36px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.logos__title {
    text-align: center;
    color: var(--color-muted);
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 20px;
}
.logos__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    gap: 28px;
    opacity: 0.7;
}
.logos__grid span {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-muted);
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

/* ---------- Services / Features ---------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.feature {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 32px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.feature:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}
.feature__icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(91,91,247,0.12), rgba(24,209,163,0.12));
    color: var(--color-primary);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
    font-size: 1.4rem;
}
.feature h3 { margin-bottom: 10px; }
.feature p { color: var(--color-muted); margin-bottom: 0; }

@media (max-width: 900px) { .features-grid { grid-template-columns: 1fr; } }

/* ---------- Process ---------- */
.process {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    counter-reset: step;
}
.process__step {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    padding: 28px;
    position: relative;
}
.process__step::before {
    counter-increment: step;
    content: "0" counter(step);
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-accent);
    display: block;
    margin-bottom: 14px;
}
.process__step h3 { color: #fff; margin-bottom: 8px; }
.process__step p { color: #b6bce0; margin-bottom: 0; font-size: 0.95rem; }

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

/* ---------- Results / Stats ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}
.stat-card {
    text-align: center;
    padding: 32px 18px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}
.stat-card strong {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2rem, 3vw, 2.6rem);
    background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
    margin-bottom: 6px;
}
.stat-card span { color: var(--color-muted); font-size: 0.95rem; }

@media (max-width: 800px) { .stats-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Testimonials ---------- */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.testimonial {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 28px;
}
.testimonial__quote {
    font-size: 1.02rem;
    color: var(--color-text);
    margin-bottom: 22px;
}
.testimonial__author { display: flex; align-items: center; gap: 12px; }
.testimonial__avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: #fff; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.testimonial__name { font-weight: 700; }
.testimonial__role { color: var(--color-muted); font-size: 0.85rem; }

@media (max-width: 900px) { .testimonials-grid { grid-template-columns: 1fr; } }

/* ---------- Blog cards ---------- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
.post-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition);
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.post-card__thumb {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #d6d6ff, #c4f1e3);
    overflow: hidden;
}
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 22px 24px 26px; flex: 1; display: flex; flex-direction: column; }
.post-card__meta {
    font-size: 0.8rem; color: var(--color-muted);
    text-transform: uppercase; letter-spacing: 0.1em;
    margin-bottom: 10px;
}
.post-card__title {
    font-size: 1.2rem;
    margin-bottom: 12px;
}
.post-card__title a { color: var(--color-text); }
.post-card__title a:hover { color: var(--color-primary); }
.post-card__excerpt { color: var(--color-muted); font-size: 0.95rem; flex: 1; }
.post-card__more {
    margin-top: 16px;
    font-weight: 600;
    color: var(--color-primary);
}

@media (max-width: 900px) { .posts-grid { grid-template-columns: 1fr; } }

/* ---------- CTA banner ---------- */
.cta-banner {
    background: var(--gradient-cta, linear-gradient(135deg, var(--color-primary) 0%, #8a48ff 60%, var(--color-accent) 130%));
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 56px;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
    gap: 32px;
    box-shadow: var(--shadow-lg);
}
.cta-banner h2 { color: #fff; margin-bottom: 10px; }
.cta-banner p { color: rgba(255,255,255,0.85); margin-bottom: 0; }
.cta-banner__actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.cta-banner .btn--primary { background: #fff; color: var(--color-primary); box-shadow: none; }
.cta-banner .btn--primary:hover { background: #f4f4ff; color: var(--color-primary-dark); }
.cta-banner .btn--ghost { color: #fff; border-color: rgba(255,255,255,0.5); }
.cta-banner .btn--ghost:hover { border-color: #fff; }

@media (max-width: 800px) {
    .cta-banner { grid-template-columns: 1fr; padding: 36px; text-align: center; }
    .cta-banner__actions { justify-content: center; }
}

/* ---------- Contact form ---------- */
.cta-banner--form { grid-template-columns: 1fr 1.1fr; align-items: start; }
.cta-banner--form .cta-banner__intro { padding-top: 6px; }

.contact-form {
    background: #fff;
    color: var(--color-text);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: 0 12px 40px rgba(11, 16, 32, 0.18);
    text-align: left;
}
.contact-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.contact-form__field { display: block; margin-bottom: 14px; }
.contact-form__field > span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}
.contact-form__field > span em {
    color: var(--color-primary);
    font-style: normal;
    margin-left: 2px;
}
.contact-form__field input,
.contact-form__field textarea {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 11px 13px;
    font: inherit;
    color: var(--color-text);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.contact-form__field input:focus,
.contact-form__field textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(91, 91, 247, 0.18);
}
.contact-form__field textarea { resize: vertical; min-height: 110px; }

.contact-form__submit { width: 100%; margin-top: 4px; justify-content: center; }
.cta-banner .contact-form__submit { background: var(--color-primary); color: #fff; }
.cta-banner .contact-form__submit:hover { background: var(--color-primary-dark); color: #fff; }

.contact-form__hint {
    font-size: 12px;
    color: var(--color-muted);
    margin: 12px 0 0;
    text-align: center;
}
/* Override .cta-banner p — that rule targets every <p> inside the banner
   (including this hint) with translucent white, which becomes invisible on
   the white form background. Restore the muted-gray on-card colour. */
.cta-banner .contact-form__hint { color: var(--color-muted); }

.contact-form__alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.45;
}
.contact-form__alert--ok  { background: #e7f8ee; color: #1a6b3a; border: 1px solid #b8e6c8; }
.contact-form__alert--err { background: #fdeaea; color: #8a1f1f; border: 1px solid #f3c2c2; }

.contact-form__field--err input,
.contact-form__field--err textarea {
    border-color: #c93838;
    box-shadow: 0 0 0 3px rgba(201, 56, 56, 0.12);
}
.contact-form__error {
    display: block;
    font-size: 12px;
    color: #c93838;
    margin-top: 5px;
    line-height: 1.35;
}

/* Honeypot — visually hidden but still in the DOM so bots fill it. */
.contact-form__hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Markdown block — front-end rendered output. The block wraps everything
   in .cr-markdown so we can scope without affecting other content. */
.cr-markdown {
    /* Inherit normal post typography — no overrides needed. */
}
.cr-markdown > *:first-child { margin-top: 0; }
.cr-markdown > *:last-child  { margin-bottom: 0; }

@media (max-width: 800px) {
    .cta-banner--form { grid-template-columns: 1fr; }
    .contact-form { padding: 22px; }
    .contact-form__row { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- About: Split content ---------- */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}
.split--reverse > :first-child { order: 2; }
.split__visual {
    position: relative;
    aspect-ratio: 5/4;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #e6e7ff, #d4f4ea);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.split__visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(400px 240px at 30% 20%, rgba(91,91,247,0.25), transparent 60%),
        radial-gradient(360px 220px at 80% 80%, rgba(24,209,163,0.30), transparent 60%);
}
.split__visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.split__quote {
    position: absolute;
    left: 24px; right: 24px; bottom: 24px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
    color: var(--color-text);
}
.split__quote strong { display: block; margin-top: 8px; font-size: 0.85rem; color: var(--color-muted); font-weight: 600; }

@media (max-width: 900px) {
    .split { grid-template-columns: 1fr; gap: 32px; }
    .split--reverse > :first-child { order: 0; }
}

/* ---------- About: Values with checks ---------- */
.values-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.value-item {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: transform var(--transition), box-shadow var(--transition);
}
.value-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.value-item__check {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}
.value-item h3 { font-size: 1.1rem; margin-bottom: 6px; }
.value-item p { color: var(--color-muted); margin-bottom: 0; font-size: 0.95rem; }

@media (max-width: 700px) { .values-grid { grid-template-columns: 1fr; } }

/* ---------- About: Team ---------- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.team-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 28px;
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}
.team-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.team-card__avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    overflow: hidden;
}
.team-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-card__avatar--alt-1 { background: linear-gradient(135deg, #ffb547, #ff7a59); }
.team-card__avatar--alt-2 { background: linear-gradient(135deg, #18d1a3, #5b5bf7); }
.team-card__avatar--alt-3 { background: linear-gradient(135deg, #d15bbb, #5b5bf7); }
.team-card__avatar--alt-4 { background: linear-gradient(135deg, #5b5bf7, #18d1a3); }
.team-card__avatar--alt-5 { background: linear-gradient(135deg, #ffb547, #5b5bf7); }
.team-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.team-card__role { color: var(--color-primary); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; margin-bottom: 12px; display: block; }
.team-card__bio { color: var(--color-muted); font-size: 0.93rem; margin-bottom: 14px; }
.team-card__social { display: inline-flex; gap: 10px; }
.team-card__social a {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--color-bg-soft);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--color-muted);
    font-size: 0.85rem;
    font-weight: 700;
    transition: background var(--transition), color var(--transition);
}
.team-card__social a:hover { background: var(--color-primary); color: #fff; }

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

/* ---------- About: Timeline ---------- */
.timeline {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    padding-left: 32px;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 8px; top: 6px; bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
    border-radius: 2px;
}
.timeline__item { position: relative; padding-bottom: 36px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
    content: "";
    position: absolute;
    left: -32px;
    top: 6px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--color-primary);
    box-shadow: 0 0 0 4px rgba(91,91,247,0.15);
}
.timeline__year {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--color-primary);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    display: block;
}
.timeline__item h3 { margin-bottom: 6px; font-size: 1.15rem; }
.timeline__item p { color: var(--color-muted); margin-bottom: 0; }

/* ---------- About: Big quote ---------- */
.big-quote {
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
}
.big-quote p {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    line-height: 1.4;
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: -0.01em;
}
.big-quote cite {
    font-style: normal;
    color: var(--color-muted);
    font-size: 0.95rem;
    display: block;
    margin-top: 18px;
}
.section--dark .big-quote p { color: #fff; }
.section--dark .big-quote cite { color: #b6bce0; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--color-bg-dark);
    color: #b6bce0;
    padding: 72px 0 32px;
}
.site-footer a { color: #d8dbf2; }
.site-footer a:hover { color: #fff; }
.footer__grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 48px;
}
.footer__about p { max-width: 320px; color: #b6bce0; }
.footer__col h3 { color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 16px; }
.footer__col ul { list-style: none; padding: 0; margin: 0; }
.footer__col li { margin-bottom: 10px; font-size: 0.95rem; }
.footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 24px;
    display: flex; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    font-size: 0.85rem;
    color: #8b91b3;
}
.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}
.footer-menu li { display: inline-flex; align-items: center; }
.footer-menu li + li::before {
    content: "·";
    color: rgba(255,255,255,0.25);
    margin-right: 18px;
}
.footer-menu a { color: #b6bce0; }
.footer-menu a:hover { color: #fff; }

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

/* ---------- Single post / page ---------- */
.entry-header {
    text-align: center;
    padding: 80px 0 40px;
    background: var(--color-bg-soft);
}
.entry-header__meta {
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    margin-bottom: 14px;
}
.entry-thumb {
    max-width: 980px;
    margin: 0 auto -120px;
    transform: translateY(60px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.entry-content {
    max-width: 760px;
    margin: 80px auto;
    padding: 0 24px;
    font-size: 1.08rem;
    line-height: 1.75;
    color: var(--color-text);
}
.entry-content h2 { margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.4em; }
.entry-content p, .entry-content ul, .entry-content ol { margin-bottom: 1.2em; }
.entry-content blockquote {
    border-left: 4px solid var(--color-primary);
    background: var(--color-bg-soft);
    padding: 18px 22px;
    border-radius: 8px;
    font-style: italic;
    color: var(--color-text);
    margin: 1.6em 0;
}
.entry-content img { border-radius: var(--radius-md); margin: 1.4em 0; }
.entry-content pre {
    background: #0e1330;
    color: #d8dbf2;
    padding: 18px;
    border-radius: var(--radius-md);
    overflow: auto;
    font-size: 0.95rem;
}
.entry-content code {
    background: var(--color-bg-soft);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.95em;
}
.entry-content pre code { background: transparent; padding: 0; color: inherit; }

/* ---------- Archive / Blog list ---------- */
.archive-header {
    padding: 80px 0 32px;
    text-align: center;
}
.archive-header p { color: var(--color-muted); max-width: 620px; margin: 0 auto; }

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 56px;
}
.pagination .page-numbers {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-weight: 600;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ---------- Single post: author meta ---------- */
.entry-author {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 22px;
    padding: 8px 22px 8px 8px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.entry-author:hover {
    border-color: var(--color-primary);
}
.entry-author__avatar { display: inline-flex; }
.entry-author__avatar img {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: block;
    /* Two-layer ring: a thin background-coloured halo, then the brand accent ring. */
    box-shadow:
        0 0 0 2px var(--color-bg),
        0 0 0 3px var(--color-primary);
}
.entry-author__info {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.25;
    text-align: left;
}
.entry-author__name {
    font-weight: 700;
    color: var(--color-text);
    font-size: 0.95rem;
}
.entry-author__role {
    color: var(--color-muted);
    font-size: 0.78rem;
    margin-top: 2px;
    letter-spacing: 0.01em;
}

/* ---------- Single post: tags ---------- */
.entry-tags {
    max-width: 760px;
    margin: 32px auto 0;
    padding: 0 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.entry-tags__label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-muted);
    font-weight: 700;
    margin-right: 4px;
}
.entry-tags a {
    display: inline-block;
    padding: 6px 14px;
    background: var(--color-bg-soft);
    color: var(--color-text);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}
.entry-tags a:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ---------- Single post: end-of-article CTA ---------- */
.entry-cta {
    max-width: 760px;
    margin: 56px auto 0;
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(91,91,247,0.08), rgba(24,209,163,0.08));
    border: 1px solid rgba(91, 91, 247, 0.18);
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.entry-cta h3 {
    font-size: 1.15rem;
    margin-bottom: 4px;
}
.entry-cta p {
    color: var(--color-muted);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* ---------- Single post: prev/next navigation ---------- */
.post-nav {
    max-width: 760px;
    margin: 56px auto 0;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.post-nav a {
    display: block;
    padding: 18px 22px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
    color: var(--color-text);
}
.post-nav a:hover {
    border-color: rgba(91, 91, 247, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
}
.post-nav__direction {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-muted);
    margin-bottom: 6px;
    font-weight: 700;
}
.post-nav__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.4;
}
.post-nav__next { text-align: right; }

@media (max-width: 600px) {
    .post-nav { grid-template-columns: 1fr; }
    .post-nav__next { text-align: left; }
}

/* ---------- Comments ---------- */
.comments-area {
    max-width: 760px;
    margin: 96px auto;
    padding: 0 24px;
    border-top: 1px solid var(--color-border);
    padding-top: 72px;
}
.comments-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin-bottom: 36px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.comments-title__count {
    background: var(--color-bg-soft);
    color: var(--color-primary);
    font-size: 0.85rem;
    padding: 4px 14px;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 56px;
}
.comment-list .children {
    list-style: none;
    padding-left: 28px;
    margin: 14px 0 0;
    border-left: 2px solid var(--color-border);
}
.comment-item {
    margin-bottom: 16px;
}

.comment-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.comment-card:hover {
    border-color: rgba(91, 91, 247, 0.25);
    box-shadow: var(--shadow-sm);
}
.comment-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.comment-card__avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--color-bg-soft);
    display: block;
}
.comment-card__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}
.comment-card__author {
    font-weight: 700;
    color: var(--color-text);
    font-size: 0.98rem;
}
.comment-card__author a { color: inherit; }
.comment-card__author a:hover { color: var(--color-primary); }
.comment-card__date,
.comment-card__date a {
    font-size: 0.82rem;
    color: var(--color-muted);
    text-transform: none;
    letter-spacing: normal;
}
.comment-card__date a:hover { color: var(--color-primary); }

.comment-card__body {
    color: var(--color-text);
    margin-bottom: 14px;
    font-size: 0.98rem;
    line-height: 1.65;
}
.comment-card__body p:last-child { margin-bottom: 0; }
.comment-card__body a { color: var(--color-primary); }

.comment-card__footer {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.comment-reply-btn,
.comment-card__footer .comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(91, 91, 247, 0.08);
    transition: background var(--transition), transform var(--transition);
    text-decoration: none;
}
.comment-reply-btn:hover,
.comment-card__footer .comment-reply-link:hover {
    background: rgba(91, 91, 247, 0.16);
    color: var(--color-primary);
    transform: translateY(-1px);
}
.comment-pending {
    display: block;
    margin-top: 10px;
    color: var(--color-warning);
    font-size: 0.88rem;
    font-style: italic;
}
.comment-edit-link {
    color: var(--color-muted);
    font-size: 0.82rem;
}
.comment-edit-link a { color: inherit; }
.comment-edit-link a:hover { color: var(--color-primary); }

/* Comment form */
.comment-respond {
    background: var(--color-bg-soft);
    border-radius: var(--radius-lg);
    padding: 36px;
    margin-top: 8px;
}
.comment-reply-title {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}
.comment-reply-title small {
    font-weight: 400;
    font-size: 0.8rem;
    margin-left: 10px;
}
.comment-reply-title small a { color: var(--color-muted); }
.comment-reply-title small a:hover { color: var(--color-primary); }

.comment-notes,
.logged-in-as {
    color: var(--color-muted);
    font-size: 0.92rem;
    margin-bottom: 18px;
}

.comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
}
.comment-form-cookies-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    flex-shrink: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}
.comment-form-cookies-consent label {
    display: inline;
    margin: 0;
    font-weight: 400;
    color: var(--color-muted);
    font-size: 0.92rem;
    line-height: 1.5;
    cursor: pointer;
}

.comment-form p { margin-bottom: 16px; }
.comment-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
    font-size: 0.9rem;
}
.comment-form .required { color: var(--color-primary); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--color-input-bg);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(91, 91, 247, 0.18);
}
[data-theme="dark"] .comment-form input:focus,
[data-theme="dark"] .comment-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(126, 126, 255, 0.25);
}
.comment-form textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.6;
}

.form-submit { margin: 24px 0 0; }
.form-submit input[type="submit"],
.form-submit .submit {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 10px 24px rgba(91, 91, 247, 0.35);
    font-family: inherit;
}
.form-submit input[type="submit"]:hover,
.form-submit .submit:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(91, 91, 247, 0.45);
}

.no-comments {
    color: var(--color-muted);
    font-style: italic;
    padding: 16px 0;
}

@media (max-width: 600px) {
    .comment-respond { padding: 24px 20px; }
    .comment-card { padding: 18px 18px; }
    .comment-list .children { padding-left: 18px; }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

.screen-reader-text {
    border: 0; clip: rect(1px,1px,1px,1px); -webkit-clip-path: inset(50%); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}

/* ---------- Theme toggle button ---------- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    margin-right: 4px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.theme-toggle:hover {
    background: var(--color-bg-soft);
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.theme-toggle:active { transform: scale(0.95); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle__sun  { display: none; }
.theme-toggle__moon { display: block; }
[data-theme="dark"] .theme-toggle__sun  { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }

/* On narrow mobile, shrink the toggle so it still fits next to the logo
   and the hamburger button without cramping the header. */
@media (max-width: 480px) {
    .theme-toggle {
        width: 34px;
        height: 34px;
        margin-right: 0;
    }
    .theme-toggle svg { width: 16px; height: 16px; }
}

/* ---------- Dark theme — element overrides ----------
   Most components already pick up theme via CSS variables. The blocks below
   patch hard-coded #fff backgrounds (cards, form, banners) and tune the
   handful of places that need a dedicated dark treatment instead of just
   inversion. */
[data-theme="dark"] body { background-color: var(--color-bg); }

/* Cards that hard-code #fff in light mode */
[data-theme="dark"] .feature,
[data-theme="dark"] .testimonial,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .post-card,
[data-theme="dark"] .team-card,
[data-theme="dark"] .value-item,
[data-theme="dark"] .timeline__item {
    background: var(--color-card);
    border: 1px solid var(--color-border);
}

/* Form fields */
[data-theme="dark"] .contact-form {
    background: var(--color-card);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .contact-form input,
[data-theme="dark"] .contact-form textarea {
    background: var(--color-input-bg);
    color: var(--color-text);
    border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .contact-form input:focus,
[data-theme="dark"] .contact-form textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(126, 126, 255, 0.25);
}

/* Form alerts: tinted instead of solid pastels */
[data-theme="dark"] .contact-form__alert--ok {
    background: rgba(46, 221, 177, 0.12);
    color: #5eebbb;
    border-color: rgba(46, 221, 177, 0.3);
}
[data-theme="dark"] .contact-form__alert--err {
    background: rgba(255, 107, 107, 0.12);
    color: #ff8b8b;
    border-color: rgba(255, 107, 107, 0.3);
}

/* The "About: split visual" — light pastel gradient placeholder in light
   mode reads as a foreign white block on a dark page. Replace with a dark
   surface that keeps the brand glow via the existing ::before radials,
   just bumped in opacity so they stay visible on the darker base. */
[data-theme="dark"] .split__visual {
    background: var(--color-card);
}
[data-theme="dark"] .split__visual::before {
    background:
        radial-gradient(400px 240px at 30% 20%, rgba(126, 126, 255, 0.32), transparent 60%),
        radial-gradient(360px 220px at 80% 80%, rgba(46,  221, 177, 0.32), transparent 60%);
}

/* Quote panel inside split__visual — needs to stay lighter than the visual
   itself to read as a floating glass card, not blend into it. */
[data-theme="dark"] .split__quote {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Post card thumbnails default to a pastel placeholder gradient when no
   featured image is set. Same fix — keep the brand glow but on a dark base. */
[data-theme="dark"] .post-card__thumb {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(126, 126, 255, 0.22), transparent 65%),
        radial-gradient(ellipse at 70% 70%, rgba(46,  221, 177, 0.20), transparent 65%),
        var(--color-card);
}

/* Logos strip — flat tiles need a touch of contrast on dark */
[data-theme="dark"] .logos__grid > span {
    background: var(--color-bg-soft);
    color: var(--color-muted);
}

/* Hero chart inner panel — was a near-white #f9faff, drop to a subtle dark tint
   so the chart sits *on* the visual card rather than glowing white. */
[data-theme="dark"] {
    --color-chart-bg: #1a2140;
    --gradient-cta: linear-gradient(135deg, #2d2da8 0%, #5a2c9b 60%, #1a8c75 130%);
}

/* Hero chart's faded grid lines on dark — bump opacity so they're not invisible */
[data-theme="dark"] .hero-chart__grid line {
    stroke: rgba(255, 255, 255, 0.08);
}

/* Subtle outline so the visual card doesn't look like it's floating without
   shadow on dark backgrounds (the original 0.18-alpha shadow nearly disappears). */
[data-theme="dark"] .hero__visual {
    border: 1px solid var(--color-border);
}

/* CTA banner on dark mode — form sits inside a richer card with a subtle
   border so it reads as "panel on gradient" rather than "dark hole". */
[data-theme="dark"] .cta-banner .contact-form {
    background: rgba(20, 26, 46, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Single-post code blocks — the light-mode #0e1330 panel becomes invisible
   on a dark page background. Lift it slightly so the block stands out. */
[data-theme="dark"] .entry-content pre {
    background: #1c2340;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .entry-content code {
    background: rgba(255, 255, 255, 0.06);
}

/* Author pill — light-mode rgba(255,255,255,0.7) blends to muddy grey on dark.
   Replace with a tinted dark surface that picks up brand purple on the rim. */
[data-theme="dark"] .entry-author {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.10);
}
[data-theme="dark"] .entry-author:hover {
    background: rgba(126, 126, 255, 0.10);
    border-color: var(--color-primary);
}

/* Hero stat tiles sit inside the hero__visual card, so they share its dark
   surface and become invisible. A near-transparent white tint + hairline
   border gives them the same "subtle card on card" effect as in light mode. */
[data-theme="dark"] .hero__stat {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Inline link colors in markdown content */
[data-theme="dark"] .cr-markdown a { color: var(--color-primary); }
[data-theme="dark"] .cr-markdown a:hover { color: var(--color-accent); }

/* Mobile menu open state — overrides the rgba(255,255,255,0.98) background
   defined inside the @media (max-width:900px) block. We don't wrap in the
   same media query because the dropdown only exists when .is-open is set,
   which already only happens at mobile-nav widths. */
[data-theme="dark"] .primary-nav.is-open {
    background: var(--color-card);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .primary-nav.is-open a {
    color: var(--color-text);
}
