/* =====================================================================
   topics-extras.css — additive polish pack (CRT scanlines, terminal
   boot strip, topics shelf, phosphor glow). Loaded AFTER site.css so it
   wins ties. Keep this file tight — it intentionally does not redefine
   tokens from site.css.
   ===================================================================== */

/* --- Terminal boot strip shown under hero eyebrow -------------------- */
.terminal-boot {
    margin: 14px 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--accent-line);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(255, 122, 38, 0.04), transparent 60%), var(--bg-code);
    font-family: "ProggySquare", "JetBrains Mono", "SF Mono", Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
    box-shadow: 0 0 0 1px rgba(255, 122, 38, 0.05) inset,
                0 0 32px -12px rgba(255, 122, 38, 0.28);
    position: relative;
    overflow: hidden;
}

.terminal-boot::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02) 0,
        rgba(255, 255, 255, 0.02) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    opacity: 0.6;
    mix-blend-mode: screen;
}

.terminal-boot-prompt {
    color: var(--accent);
    font-weight: 600;
    margin-right: 6px;
}

.terminal-boot-line {
    display: block;
    white-space: pre;
    overflow: hidden;
}

.terminal-boot-line[data-typewriter] {
    width: 0;
    animation: tb-type 1.5s steps(40, end) forwards;
    border-right: 2px solid transparent;
}

.terminal-boot-line:nth-child(1)[data-typewriter] { animation-delay: 0.05s;  }
.terminal-boot-line:nth-child(2)[data-typewriter] { animation-delay: 0.65s;  }
.terminal-boot-line:nth-child(3)[data-typewriter] { animation-delay: 1.25s; border-right-color: var(--tui-cursor); animation: tb-type 1.1s steps(36, end) forwards 1.25s, tb-blink 1s steps(2) infinite 2.4s; }

@keyframes tb-type {
    from { width: 0; }
    to   { width: 100%; }
}
@keyframes tb-blink {
    50% { border-right-color: transparent; }
}

.terminal-boot-ok  { color: #7dff9b; }
.terminal-boot-dim { color: var(--text-soft); }

@media (prefers-reduced-motion: reduce) {
    .terminal-boot-line[data-typewriter] {
        width: 100%;
        animation: none !important;
        border-right-color: transparent !important;
    }
}

/* --- Topics callout block (homepage spotlight) ----------------------- */
.topics-spotlight {
    margin-top: 48px;
    padding: 28px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 85% 15%, rgba(255, 122, 38, 0.10), transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 40%),
        var(--bg-elevated);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.topics-spotlight::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        180deg,
        transparent 0,
        transparent 2px,
        var(--tui-scanline) 2px,
        var(--tui-scanline) 3px
    );
    pointer-events: none;
    opacity: 0.35;
    mix-blend-mode: overlay;
}

.topics-spotlight-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.topics-spotlight-head .eyebrow {
    margin: 0;
    color: var(--accent);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
}

.topics-spotlight-head h2 {
    margin: 4px 0 0;
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.2;
    color: var(--text);
}

.topics-spotlight-head p {
    margin: 0;
    max-width: 520px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
}

.topic-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    color: inherit;
    text-decoration: none;
    transition: border-color var(--motion-fast) var(--ease-fluid),
                transform var(--motion-fast) var(--ease-fluid),
                box-shadow var(--motion-mid) var(--ease-fluid);
    position: relative;
}

.topic-card::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(255, 122, 38, 0.7),
                0 0 2px rgba(255, 122, 38, 1);
    opacity: 0.85;
    animation: topic-led-pulse 2.4s ease-in-out infinite;
}

@keyframes topic-led-pulse {
    0%, 100% { opacity: 0.5; transform: scale(0.92); }
    50%      { opacity: 1;   transform: scale(1.08); }
}

.topic-card:hover,
.topic-card:focus-visible {
    border-color: var(--accent-line);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -18px rgba(255, 122, 38, 0.45);
    outline: none;
}

.topic-card-tag {
    margin-left: 20px;
    font-family: "ProggySquare", "JetBrains Mono", monospace;
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.85;
}

.topic-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    margin: 0;
}

.topic-card-copy {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

.topic-card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-family: "ProggySquare", "JetBrains Mono", monospace;
    font-size: 10.5px;
    letter-spacing: 0.08em;
    color: var(--text-soft);
}

.topic-card-meta span {
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
}

/* --- Subtle phosphor glow on the whole page (opt-in via body class) -- */
body.home-page::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: repeating-linear-gradient(
        180deg,
        transparent 0,
        transparent 3px,
        rgba(255, 255, 255, 0.012) 3px,
        rgba(255, 255, 255, 0.012) 4px
    );
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
    opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
    .topic-card::before { animation: none; }
}

/* --- Footer GitHub link accent --------------------------------------- */
.site-footer-links a[href*="github.com"] {
    color: var(--accent);
    position: relative;
}

.site-footer-links a[href*="github.com"]::after {
    content: " ↗";
    font-size: 0.85em;
    opacity: 0.7;
}
