*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #000; --bg-alt: #080808; --card: #0d0d0d; --card-h: #111;
    --border: rgba(255,255,255,0.07); --border-h: rgba(255,255,255,0.14);
    --text: #fff; --text-2: rgba(255,255,255,0.55); --text-3: rgba(255,255,255,0.28);
    --accent: #6366f1; --radius: 14px;
    --serif: 'Fraunces', Georgia, serif;
}
[data-theme="light"] {
    --bg: #f9f9fb; --bg-alt: #f0f0f5; --card: #fff; --card-h: #fafafa;
    --border: rgba(0,0,0,0.07); --border-h: rgba(0,0,0,0.14);
    --text: #0a0a0a; --text-2: rgba(0,0,0,0.55); --text-3: rgba(0,0,0,0.28);
}
body { font-family: 'Geist', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ── PROGRESS BAR ── */
.progress { position: fixed; top: 0; left: 0; z-index: 9999; height: 3px; background: var(--accent); width: 0%; transition: width 0.1s linear; }

/* ── NAV ── */
.nav { position: sticky; top: 0; z-index: 200; background: rgba(0,0,0,0.88); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
[data-theme="light"] .nav { background: rgba(249,249,251,0.92); }
.nav__inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.nav__logo { font-size: 1rem; font-weight: 900; letter-spacing: -0.03em; }
.nav__logo span { color: var(--accent); }
.nav__title {
    position: absolute;
    left: 50%; transform: translateX(-50%);
    width: 420px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}
.nav__title--visible { opacity: 1; }
.nav__title__track {
    display: inline-flex;
    white-space: nowrap;
    animation: nav-marquee var(--marquee-dur, 16s) linear infinite;
}
.nav__title__track span {
    font-family: var(--serif);
    font-size: 0.88rem; font-weight: 700;
    color: var(--text);
    padding-right: 80px;
    font-variation-settings: 'opsz' 14;
}
@keyframes nav-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.nav__right { display: flex; gap: 20px; align-items: center; }
.nav__link { font-size: 0.82rem; color: var(--text-2); transition: color 0.2s; }
.nav__link:hover { color: var(--text); }
.theme-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px; color: var(--text-2); font-size: 0.75rem; cursor: pointer; transition: all 0.2s; }
.theme-btn:hover { border-color: var(--border-h); color: var(--text); }

/* ── POST HERO ── */
.post-hero { max-width: 900px; margin: 0 auto; padding: 56px 24px 0; }

/* ── Breadcrumb ── */
.post-breadcrumb { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 100px; padding: 7px 14px; margin-bottom: 32px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; }
.post-breadcrumb__home { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); transition: color 0.2s; }
.post-breadcrumb__home:hover { color: var(--text); }
.post-breadcrumb__sep { color: var(--text-3); font-weight: 300; }
.post-breadcrumb__cat { font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.68rem; }
.post-hero__title { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 900; line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 20px; font-variation-settings: 'opsz' 80; }
.post-hero__excerpt { font-size: 1.1rem; color: var(--text-2); line-height: 1.65; margin-bottom: 28px; max-width: 680px; }
.post-hero__meta { display: flex; gap: 16px; align-items: center; font-size: 0.8rem; color: var(--text-2); flex-wrap: wrap; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.post-hero__meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.post-hero__badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 0.72rem; color: var(--text-2); }

/* ── COVER ── */
.post-cover { max-width: 900px; margin: 0 auto; padding: 32px 24px 0; }
.post-cover img { width: 100%; border-radius: 16px; aspect-ratio: 16/9; object-fit: cover; }

/* ── ARTICLE BODY ── */
.article { padding: 48px 0 0; }
.article__content { font-size: 1.05rem; line-height: 1.85; color: var(--text-2); }
.article__content h2 { font-family: var(--serif); font-size: 1.65rem; font-weight: 800; color: var(--text); margin: 52px 0 16px; letter-spacing: -0.01em; line-height: 1.2; font-variation-settings: 'opsz' 40; }
.article__content h3 { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 36px 0 12px; font-variation-settings: 'opsz' 20; }
.article__content h4 { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 24px 0 10px; font-variation-settings: 'opsz' 14; }
.article__content p { margin-bottom: 22px; }
.article__content ul, .article__content ol { margin: 0 0 22px 26px; }
.article__content li { margin-bottom: 10px; }
.article__content strong { color: var(--text); font-weight: 700; }
.article__content em { font-style: italic; }
.article__content code { background: var(--card); border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; font-size: 0.84em; font-family: 'Fira Code', monospace; color: var(--accent); }
.article__content pre { background: #080808; border: 1px solid var(--border); border-radius: 12px; padding: 24px; overflow-x: auto; margin-bottom: 24px; }
[data-theme="light"] .article__content pre { background: #f0f0f5; }
.article__content pre code { background: none; border: none; padding: 0; color: var(--text-2); }
.article__content blockquote { border-left: 3px solid var(--accent); padding: 4px 24px; margin: 28px 0; }
.article__content blockquote p { color: var(--text); font-size: 1.1rem; font-style: italic; font-weight: 500; margin-bottom: 0; }
.article__content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article__content img { border-radius: 12px; margin: 24px 0; }
.article__content hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ── TAGS ── */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.tag { display: inline-block; padding: 5px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; font-size: 0.73rem; color: var(--text-3); cursor: default; user-select: none; }

/* ── SHARE ── */
.share { display: flex; align-items: center; gap: 10px; margin-top: 32px; flex-wrap: wrap; }
.share__label { font-size: 0.78rem; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.share__btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.78rem; color: var(--text-2); transition: all 0.2s; cursor: pointer; background: none; }
.share__btn:hover { border-color: var(--border-h); color: var(--text); }
.share__btn svg { flex-shrink: 0; }
.share__btn--icon { padding: 9px; border-radius: 10px; }
.share__btn--icon:hover { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* ── AUTHOR BOX ── */
/* reaction + author row */
.reaction-author { display: flex; flex-direction: column; gap: 16px; padding: 28px 0 8px; border-top: 1px solid var(--border); }
.author-box__inner {
    padding: 16px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.author-box__inner::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 0% 50%, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 55%);
    pointer-events: none;
}
.author-box__img {
    width: 44px; height: 44px;
    border-radius: 50%; object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
    flex-shrink: 0;
    position: relative; z-index: 1;
}
.author-box__info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.author-box__name { font-size: 0.88rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.author-box__role { font-size: 0.65rem; color: var(--accent); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }
.author-box__ctas { display: flex; gap: 8px; flex-shrink: 0; position: relative; z-index: 1; }
.btn-primary { display: inline-block; padding: 8px 20px; background: var(--accent); color: #fff; border-radius: 8px; font-size: 0.8rem; font-weight: 700; transition: opacity 0.2s; }
.btn-primary:hover { opacity: 0.85; }
.btn-ghost { display: inline-block; padding: 8px 20px; border: 1px solid var(--border-h); border-radius: 8px; font-size: 0.8rem; color: var(--text-2); transition: all 0.2s; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── RELATED ── */
.related { max-width: 1100px; margin: 60px auto 0; padding: 0 24px 80px; }
.related__hd { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--accent); width: fit-content; }
.related__hd h2 { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.related__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.25s, transform 0.25s; }
.card:hover { border-color: var(--border-h); transform: translateY(-3px); }
.card__cover-wrap { overflow: hidden; aspect-ratio: 16/9; }
.card__cover { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card__cover { transform: scale(1.05); }
.card__cover--empty { width: 100%; height: 100%; background: linear-gradient(135deg,#0d0d1a,#16213e); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--accent); }
.card__body { padding: 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card__cat { font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.card__title { font-size: 0.9rem; font-weight: 700; line-height: 1.4; }
.card__date { font-size: 0.72rem; color: var(--text-3); margin-top: auto; padding-top: 10px; }

/* ── TTS PLAYER ── */
.tts-wrap { max-width: 720px; margin: 32px auto 0; padding: 0 24px; }
.tts-idle { display: flex; align-items: center; gap: 12px; }
.tts-idle__btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 22px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; font-size: 0.82rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all 0.22s; }
.tts-idle__btn:hover { border-color: var(--accent); color: var(--accent); background: var(--card-h); }
.tts-idle__btn svg { flex-shrink: 0; color: var(--accent); }
.tts-idle__hint { font-size: 0.7rem; color: var(--text-3); }
.tts-loading { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--text-2); padding: 10px 0; }
.tts-loading__spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: tts-spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes tts-spin { to { transform: rotate(360deg); } }
.tts-player { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.tts-player__btn { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; transition: opacity 0.2s; }
.tts-player__btn:hover { opacity: 0.85; }
.tts-bars { display: flex; align-items: center; gap: 2.5px; height: 28px; flex-shrink: 0; }
.tts-bar { width: 3px; border-radius: 2px; background: var(--accent); height: 4px; opacity: 0.5; transition: height 0.15s; }
.tts-bars.playing .tts-bar { opacity: 1; animation: bar-wave 0.8s ease-in-out infinite alternate; }
.tts-bars.playing .tts-bar:nth-child(2)  { animation-delay: 0.1s;  animation-duration: 0.65s; }
.tts-bars.playing .tts-bar:nth-child(3)  { animation-delay: 0.2s;  animation-duration: 0.9s;  }
.tts-bars.playing .tts-bar:nth-child(4)  { animation-delay: 0.05s; animation-duration: 0.7s;  }
.tts-bars.playing .tts-bar:nth-child(5)  { animation-delay: 0.3s;  animation-duration: 0.75s; }
.tts-bars.playing .tts-bar:nth-child(6)  { animation-delay: 0.15s; animation-duration: 0.85s; }
.tts-bars.playing .tts-bar:nth-child(7)  { animation-delay: 0.25s; animation-duration: 0.6s;  }
.tts-bars.playing .tts-bar:nth-child(8)  { animation-delay: 0.08s; animation-duration: 0.95s; }
@keyframes bar-wave { from { height: 4px; } to { height: 22px; } }
.tts-seek { flex: 1; height: 4px; background: var(--border); border-radius: 2px; cursor: pointer; position: relative; min-width: 60px; }
.tts-seek:hover { background: var(--border-h); }
.tts-seek__fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0%; pointer-events: none; transition: width 0.1s linear; }
.tts-time { font-size: 0.68rem; color: var(--text-3); white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.tts-close { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 0.9rem; padding: 4px; line-height: 1; transition: color 0.2s; flex-shrink: 0; }
.tts-close:hover { color: var(--text); }
@media(max-width:500px) { .tts-idle__hint { display: none; } .tts-time { display: none; } }

/* ── FOOTER ── */
.footer { border-top: 3px double var(--border); padding: 32px 24px; text-align: center; }
.footer__logo { font-family: var(--serif); font-size: 1.8rem; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 6px; font-variation-settings: 'opsz' 60; }
.footer__logo span { color: var(--accent); }
.footer__copy { font-size: 0.78rem; color: var(--text-2); margin-bottom: 16px; }
.footer__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; }
.footer__link { font-size: 0.78rem; color: var(--text-2); transition: color 0.2s; }
.footer__link:hover { color: var(--accent); }

@media(max-width:600px) {
    .author-box__inner { flex-direction: column; }
    .nav__right .nav__link { display: none; }
}

/* ── POST LAYOUT ── */
.post-layout {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── TOC ── */
.toc { display: none; }
@media (min-width: 1200px) {
    .toc {
        display: block;
        width: 224px;
        position: fixed;
        right: 24px;
        top: 108px;
        max-height: calc(100vh - 132px);
        overflow-y: auto;
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 16px;
        scrollbar-width: thin;
        scrollbar-color: var(--border) transparent;
        opacity: 0;
        transition: opacity 0.6s ease;
        z-index: 100;
    }
    .toc--visible { opacity: 1; }
    .toc::-webkit-scrollbar { width: 3px; }
    .toc::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
}
/* Header row */
.toc__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.toc__title { font-size: 0.59rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-3); }
/* Progress ring */
.toc__ring { position: relative; width: 26px; height: 26px; flex-shrink: 0; }
.toc__ring svg { display: block; transform: rotate(-90deg); }
.toc__ring .r-bg   { fill: none; stroke: var(--border); stroke-width: 2.5; }
.toc__ring .r-fill { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 56.5; stroke-dashoffset: 56.5; transition: stroke-dashoffset 0.4s ease; }
.toc__ring-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.42rem; font-weight: 900; color: var(--accent); pointer-events: none; }
/* Time left */
.toc__time { font-size: 0.61rem; color: var(--text-3); margin: 8px 0 10px; }
.toc__time strong { color: var(--accent); font-weight: 700; }
/* Items */
.toc__item {
    display: block; position: relative;
    font-size: 0.74rem; color: var(--text-3); line-height: 1.35;
    padding: 6px 22px 6px 26px;
    border-radius: 8px; margin-bottom: 1px;
    transition: color 0.18s, background 0.18s;
    text-decoration: none; overflow: hidden;
    opacity: 0; transform: translateX(6px);
    animation: toc-in 0.28s ease forwards;
}
.toc__item:hover { color: var(--text-2); background: rgba(255,255,255,0.03); }
[data-theme="light"] .toc__item:hover { background: rgba(0,0,0,0.03); }
.toc__item--h3 { font-size: 0.7rem; padding-left: 38px; }
/* Section fill */
.toc__item__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 8px; pointer-events: none; transition: width 0.15s linear; }
/* Section number */
.toc__item__num { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); font-size: 0.52rem; font-weight: 800; color: var(--text-3); width: 14px; text-align: right; transition: color 0.18s; line-height: 1; }
/* Checkmark */
.toc__item__check { position: absolute; right: 7px; top: 50%; transform: translateY(-50%) scale(0) rotate(-20deg); font-size: 0.62rem; color: var(--accent); transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), opacity 0.2s; opacity: 0; }
/* Active */
.toc__item--active { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.toc__item--active::after { content: ''; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; background: var(--accent); border-radius: 2px; }
.toc__item--active .toc__item__num { color: var(--accent); }
/* Done */
.toc__item--done .toc__item__check { opacity: 1; transform: translateY(-50%) scale(1) rotate(0deg); }
/* Keyboard hint */
.toc__kbd { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.toc__kbd-hint { font-size: 0.55rem; color: var(--text-3); margin: 0 2px; }
.toc__kbd kbd { display: inline-flex; align-items: center; justify-content: center; padding: 1px 5px; background: var(--bg-alt); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; font-size: 0.58rem; color: var(--text-2); font-family: inherit; line-height: 1.6; }
[data-theme="light"] .toc__kbd kbd { background: #fff; }
/* Entrance animation */
@keyframes toc-in { to { opacity: 1; transform: translateX(0); } }

/* ── BACK TO TOP ── */
.back-to-top { position: fixed; bottom: 32px; right: 28px; z-index: 500; width: 42px; height: 42px; border-radius: 50%; background: var(--card); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(12px); transition: opacity 0.25s, transform 0.25s, border-color 0.2s, color 0.2s; pointer-events: none; }
.back-to-top--visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { border-color: var(--accent); color: var(--accent); }

/* ── HIGHLIGHT TO SHARE POPUP ── */
.share-popup { position: absolute; z-index: 9000; background: #111; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 6px 8px; display: flex; gap: 4px; opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity 0.18s, transform 0.18s; white-space: nowrap; }
.share-popup--visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.share-popup__tweet { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: none; border: none; color: #e7e7e7; font-size: 0.73rem; font-weight: 600; cursor: pointer; border-radius: 5px; transition: background 0.15s; font-family: inherit; }
.share-popup__tweet:hover { background: rgba(255,255,255,0.08); }
[data-theme="light"] .share-popup { background: #fff; border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .share-popup__tweet { color: #111; }

/* ── NEWSLETTER ── */
.newsletter { max-width: 720px; margin: 40px auto 0; padding: 0 24px; }
.newsletter__inner { padding: 44px 40px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; text-align: center; position: relative; overflow: hidden; }
.newsletter__inner::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 70%); pointer-events: none; }
.newsletter__icon { font-size: 1.4rem; color: var(--accent); margin-bottom: 14px; }
.newsletter__title { font-size: 1.25rem; font-weight: 900; letter-spacing: -0.03em; margin-bottom: 8px; }
.newsletter__desc { font-size: 0.85rem; color: var(--text-2); line-height: 1.6; margin-bottom: 24px; max-width: 360px; margin-left: auto; margin-right: auto; }
.newsletter__form { display: flex; gap: 10px; max-width: 400px; margin: 0 auto; }
.newsletter__input { flex: 1; padding: 10px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: 0.85rem; color: var(--text); font-family: inherit; outline: none; transition: border-color 0.2s; }
.newsletter__input:focus { border-color: var(--accent); }
.newsletter__input::placeholder { color: var(--text-3); }
.newsletter__btn { padding: 10px 22px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s; white-space: nowrap; font-family: inherit; }
.newsletter__btn:hover { opacity: 0.85; }
.newsletter__btn:disabled { opacity: 0.5; cursor: not-allowed; }
.newsletter__msg { font-size: 0.8rem; margin-top: 14px; min-height: 18px; }
.newsletter__msg--ok  { color: #10b981; font-weight: 600; }
.newsletter__msg--err { color: #ef4444; }
@media (max-width: 520px) {
    .newsletter__form { flex-direction: column; }
    .newsletter__inner { padding: 32px 20px; }
}

/* ── SPARK AI COMPANION (inline) ── */
.spark-inline {
    max-width: 900px;
    margin: 28px auto 0;
    padding: 0 24px;
}
.spark-inline__card {
    background: var(--card);
    border: 1px solid rgba(139,92,246,0.18);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}
.spark-inline__card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #ec4899, #f59e0b);
    pointer-events: none;
}
.spark-inline__hd {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px;
    cursor: pointer; user-select: none;
    background: rgba(139,92,246,0.04);
    transition: background 0.18s;
}
.spark-inline__hd:hover { background: rgba(139,92,246,0.07); }
.spark-inline__hd-icon {
    background: linear-gradient(135deg,#8b5cf6,#ec4899);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    font-size: 0.82rem; flex-shrink: 0;
}
.spark-inline__hd-label {
    font-size: 0.63rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.16em;
    background: linear-gradient(90deg,#a78bfa,#f472b6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    flex: 1;
}
.spark-inline__hd-chevron {
    color: rgba(255,255,255,0.25); flex-shrink: 0;
    transition: transform 0.3s ease;
}
[data-theme="light"] .spark-inline__hd-chevron { color: rgba(0,0,0,0.25); }
.spark-inline__card--collapsed .spark-inline__hd-chevron { transform: rotate(-90deg); }

.spark-inline__body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    border-top: 1px solid rgba(139,92,246,0.1);
    max-height: 400px;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(.4,0,.2,1);
}
.spark-inline__card--collapsed .spark-inline__body { max-height: 0; border-top-color: transparent; }

.spark-inline__section { padding: 16px 20px; }
.spark-inline__section + .spark-inline__section {
    border-left: 1px solid rgba(139,92,246,0.08);
}
[data-theme="light"] .spark-inline__section + .spark-inline__section {
    border-left-color: rgba(139,92,246,0.1);
}
.spark-inline__section-label {
    font-size: 0.57rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.18em;
    color: rgba(255,255,255,0.3); margin-bottom: 8px;
}
[data-theme="light"] .spark-inline__section-label { color: rgba(0,0,0,0.3); }
.spark-inline__section-body {
    font-size: 0.8rem; line-height: 1.68; color: rgba(255,255,255,0.62);
}
[data-theme="light"] .spark-inline__section-body { color: rgba(0,0,0,0.6); }

.spark-inline__terms { display: flex; flex-wrap: wrap; gap: 5px; }
.spark-inline__term {
    display: inline-block; padding: 3px 10px;
    background: rgba(139,92,246,0.1);
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 999px;
    font-size: 0.66rem; font-weight: 500; color: #c084fc;
}
[data-theme="light"] .spark-inline__term { color: #7c3aed; background: rgba(139,92,246,0.07); }

@media (max-width: 620px) {
    .spark-inline__section + .spark-inline__section {
        border-left: none;
        border-top: 1px solid rgba(139,92,246,0.08);
    }
}

/* ── REACTION ── */
.reaction { display: flex; align-items: center; gap: 14px; }
.reaction__prompt { font-size: 0.8rem; color: var(--text-3); }
.reaction__btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 20px;
    background: none; border: 1px solid var(--border); border-radius: 999px;
    color: var(--text-2); font-size: 0.8rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.reaction__btn:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.reaction__btn--liked { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); pointer-events: none; }
.reaction__btn--liked svg { fill: var(--accent); stroke: var(--accent); }
.reaction__count { font-variant-numeric: tabular-nums; min-width: 14px; text-align: center; }

