/* ============================================================
   Surf the Singularity — retro / terminal theme
   Modeled on the "terminus" Zola theme (catppuccin-macchiato).
   Shared by /blog/index.html and /blog/posts/*.html
   ============================================================ */

:root {
    /* Synthwave / retrowave "retro sun" palette
       sky-cyan + bright-blue + hot-pink + yellow-orange on deep purple */
    --bg:        #241b35;
    --bg-soft:   #2e2347;
    --text:      #ece7ff;
    --text-dim:  #b7add9;

    --cyan:      #36f9f6;   /* primary accent: sky / cyan */
    --blue:      #21b7ff;   /* bright blue */
    --pink:      #ff6ac1;   /* hot pink */
    --yellow:    #ffcc4d;   /* yellow-orange */
    --orange:    #ff8b39;

    --accent:    var(--cyan);
    --danger:    var(--pink);
    --green:     #7af7c0;
    --footnote:  rgba(183, 173, 217, 0.75);
    --code-bg:   color-mix(in srgb, var(--cyan) 8%, transparent);
    --code-border: color-mix(in srgb, var(--cyan) 22%, transparent);
    --line:      color-mix(in srgb, var(--cyan) 22%, transparent);
    --font-mono: "Fira Code", "JetBrains Mono", Monaco, Consolas, "Ubuntu Mono", monospace;
    --font-size: 1rem;
    --line-height: 1.6;
    --radius: 0;
}

* , *::before, *::after { box-sizing: border-box; }

html {
    min-height: 100%;
    background: var(--bg);
    accent-color: var(--accent);
    scrollbar-color: var(--accent) transparent;
    scroll-behavior: smooth;
}

body {
    margin: 0 auto;
    padding: 40px;
    max-width: 864px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(900px 480px at 50% 0, rgba(255,138,57,.12), transparent 55%),
        radial-gradient(700px 380px at 50% 0, rgba(255,106,193,.10), transparent 60%),
        linear-gradient(180deg, #2c2148 0%, var(--bg) 30%, #1b1428 100%);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: var(--font-size);
    line-height: var(--line-height);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "liga";
    overflow-wrap: break-word;
}

/* moai.studio SPA shell — keep blog standalone */
.mstudio-sidebar { display: none !important; }

/* ---------- typography ---------- */
h1 { font-size: calc(var(--font-size) * 1.6);  letter-spacing: 0; line-height: 1.2; }
h2 { font-size: calc(var(--font-size) * 1.35); letter-spacing: 0; }
h3 { font-size: calc(var(--font-size) * 1.15); letter-spacing: 0; }
h4, h5, h6 { font-size: var(--font-size); letter-spacing: 0; }
h1, h2, h3, h4, h5, h6, p, ul, ol, img, figure, table { margin: 25px 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--text); font-weight: 700; }
em { color: var(--text); }

ul, ol { margin-inline-start: 3ch; padding: 0; }
li { position: relative; }
li::marker { color: var(--accent); }

hr {
    width: 100%; height: 2px; border: none;
    background: color-mix(in srgb, var(--text) 50%, transparent);
    margin: 30px 0;
}

code {
    font-family: var(--font-mono) !important;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    padding: 1px 6px; margin: 0 2px;
    font-size: calc(var(--font-size) * 0.95);
    color: var(--pink);
}
pre {
    tab-size: 4;
    background: var(--code-bg);
    color: var(--text);
    padding: 14px; overflow: auto;
    border: 1px solid var(--code-border);
    border-radius: var(--radius);
    font-size: calc(var(--font-size) * 0.9) !important;
}
pre code { background: none; border: none; padding: 0; margin: 0; color: inherit; }

blockquote {
    position: relative;
    border-top: 1px solid var(--pink);
    border-bottom: 1px solid var(--pink);
    margin: 25px 0; padding: 25px 25px 25px 40px;
}
blockquote::before {
    content: ">"; position: absolute; left: 14px; top: 25px;
    color: var(--pink); font-weight: 700;
}
blockquote p:first-child { margin-top: 0; }
blockquote p:last-child  { margin-bottom: 0; }

/* ============================================================
   HEADER  (shared by index + posts)
   ============================================================ */
header {
    position: static !important;
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 14px 18px;
    margin: 0 0 30px;
    padding: 0 0 16px;
    background: none !important;
    backdrop-filter: none !important;
    border: none;
    border-bottom: 2px dashed var(--line);
}

.logo {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--accent); color: var(--bg) !important;
    padding: 5px 10px; font-weight: 700;
    font-family: var(--font-mono); text-decoration: none;
    border-radius: var(--radius);
}
.logo span { color: var(--bg) !important; }
.logo .mark, .mark { width: 22px; height: 22px; border-radius: 0; }

nav { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-left: auto; }
nav a {
    color: var(--accent); text-decoration: none;
    font-size: calc(var(--font-size) * 0.9); text-transform: lowercase;
}
nav a:hover, nav a.active { color: var(--pink); text-decoration: underline; }

.navbar-center { position: static !important; transform: none !important; }
.blog-btn {
    background: none; border: 2px solid var(--accent); color: var(--accent);
    padding: 4px 12px; font-family: var(--font-mono);
    font-size: calc(var(--font-size) * 0.85); font-weight: 700;
    text-decoration: none; border-radius: var(--radius);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.blog-btn:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); text-decoration: none; }

.post-nums { display: flex; gap: 5px; align-items: center; }
.pnum {
    width: 9px; height: 9px; display: inline-block; border-radius: 0;
    background: var(--footnote); text-decoration: none; transition: background .12s;
}
.pnum:hover { background: var(--cyan); }
.pnum.active { background: var(--pink); box-shadow: 0 0 6px var(--pink); }

/* ============================================================
   INDEX PAGE
   ============================================================ */
main { width: 100%; flex: 1; }

.page-label {
    color: var(--accent); text-transform: uppercase;
    letter-spacing: 0.18em; font-size: 0.8rem; font-weight: 700;
    margin-bottom: 8px;
}
.wave-icon { width: 52px; height: 52px; vertical-align: middle; margin-right: 14px; object-fit: contain; }

.intro, .lede { color: var(--text-dim); }
.intro { margin: 10px 0 30px; }

.posts { display: flex; flex-direction: column; }

/* post list items */
.post-card {
    display: block; text-decoration: none; color: var(--text);
    padding: 28px 0; border: none;
    border-bottom: 1px dashed var(--line);
    background: none; border-radius: 0;
}
.post-card:hover { background: none; transform: none; text-decoration: none; }
.post-card:hover .post-title { color: var(--pink); text-decoration: none; }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.post-date { color: var(--footnote); font-size: 0.85rem; }
.post-series {
    color: var(--bg); background: var(--pink);
    padding: 1px 8px; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.post-card .post-title {
    color: var(--accent); font-size: 1.3rem; font-weight: 700;
    margin: 0 0 8px; line-height: 1.3; border: none; padding: 0;
}
.post-excerpt { color: var(--text-dim); margin: 0 0 12px; }
.read-more { color: var(--accent); font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   POST PAGE
   ============================================================ */
article { width: 100%; }

.back-link {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--footnote); text-decoration: none; font-size: 0.9rem;
    margin-bottom: 24px;
}
.back-link:hover { color: var(--accent); }

.article-meta { margin-bottom: 24px; }
.series-badge {
    display: inline-block; color: var(--bg); background: var(--accent);
    padding: 3px 10px; font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px;
    font-family: var(--font-mono);
}
.article-date { color: var(--footnote); font-size: 0.9rem; }

/* SNES pixel-art hero — full-page background behind the centered column.
   On load: background washes in (B&W -> colour) in ~0.6s, then the content
   panel rises in the middle (~0.5s-0.9s). Whole intro < 1s. */
body.has-hero { background: var(--bg); }
body.has-hero::before {
    content: "";
    position: fixed; inset: 0; z-index: -1;
    background:
        linear-gradient(rgba(28,20,42,.80), rgba(20,13,31,.90)),
        var(--hero) center top / cover no-repeat,
        var(--bg);
    image-rendering: pixelated;
    /* wallpaper loads in top->bottom in chunky bands (full colour, no slow fade) */
    animation: heroReveal 1.5s steps(16, end) both;
}
/* mask reveals the image bottom->up in pixelated bands — colour loads in with it */
@keyframes heroReveal {
    from { clip-path: inset(100% 0 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}
/* pixelated horizontal scanlines flicker over the wallpaper, then fade */
body.has-hero::after {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: repeating-linear-gradient(0deg,
        rgba(8,6,14,.72) 0, rgba(8,6,14,.72) 2px,
        transparent 2px, transparent 6px);
    animation: scanFade 1.5s steps(24, end) both;
}
@keyframes scanFade {
    0%   { opacity: .95; transform: translateY(0); }
    70%  { opacity: .5; }
    100% { opacity: 0; }
}
body.has-hero article {
    background: rgba(27,20,40,0.62);
    border: 1px solid var(--line);
    padding: 30px;
    backdrop-filter: blur(2px);
    /* content panel is instant — only the hero/background images animate */
}
/* landscape hero banner at the top of the post (in addition to the background) */
.hero {
    display: block; width: 100%;
    height: clamp(140px, 24vh, 220px);
    object-fit: cover; object-position: center 40%;
    margin: 0 0 28px;
    border: 1px solid var(--cyan);
    border-radius: var(--radius);
    image-rendering: pixelated;
    box-shadow: 0 0 22px rgba(54,249,246,.18);
    animation: heroReveal 1.5s steps(16, end) both;
}
/* scanline mask over the banner during load (blog.js wraps the img) */
.hero-wrap { position: relative; display: block; margin: 0 0 28px; }
.hero-wrap .hero { margin: 0; }
.hero-wrap::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: repeating-linear-gradient(0deg,
        rgba(8,6,14,.55) 0, rgba(8,6,14,.55) 2px, transparent 2px, transparent 5px);
    animation: scanFade 1.5s steps(24, end) both;
}

/* 4chan-style greentext (chevrons kept; not colored green) */
.greentext {
    margin: 30px 0;
    padding: 18px 22px;
    border-left: 3px solid var(--cyan);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--bg-soft);
    line-height: 1.7;
}
.greentext .gl { display: block; color: var(--text); margin: 0; }
.greentext .gl .c { color: var(--cyan); user-select: none; margin-right: 2px; }
.greentext .gl.imp { color: var(--text); }
.greentext .gt-cur { color: var(--cyan); animation: gtblink 1s steps(1, end) infinite; }
@keyframes gtblink { 50% { opacity: 0; } }

/* appendix — further reading / signal */
.appendix-reading { margin: 44px 0 0; border-top: 1px dashed var(--line); padding-top: 22px; }
.reading-list { list-style: none; margin: 14px 0 0; padding: 0; }
.reading-list li { margin: 0 0 11px; position: relative; padding-left: 20px; line-height: 1.5; }
.reading-list li::before { content: "\2192"; position: absolute; left: 0; color: var(--cyan); }
.reading-list a { color: var(--cyan); text-decoration: none; }
.reading-list a:hover { text-decoration: underline; color: var(--pink); }
.reading-list .rl-src { color: var(--footnote); font-size: 0.8rem; }

/* post title — terminus signature: accent + dotted underline */
article > h1, .content + h1, h1 {
    color: var(--text);
}
article h1 {
    color: var(--cyan);
    padding-bottom: 16px; margin-bottom: 24px;
    border-bottom: 3px dotted var(--pink);
    line-height: 1.25;
}

.lede {
    font-size: 1.15rem; color: var(--text-dim);
    margin-bottom: 40px; padding-bottom: 40px;
    border-bottom: 1px dashed var(--line);
}

.content h2 {
    color: var(--yellow); font-size: 1.4rem; font-weight: 700;
    margin: 56px 0 20px;
}
.content h3 { color: var(--pink); margin: 40px 0 16px; }
.content p { margin: 0 0 22px; }
.content ul, .content ol { margin: 0 0 22px 3ch; }
.content li { margin-bottom: 6px; }

.highlight { color: var(--pink); font-weight: 700; }

/* callouts -> bordered terminal boxes */
.callout {
    border-left: 3px solid var(--accent);
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    background: var(--bg-soft);
    padding: 22px 26px; margin: 36px 0; border-radius: 0;
}
.callout p { margin: 0; }
.callout.danger { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.callout.danger strong { color: var(--danger); }

/* "framed" emphasis boxes: verdict / cta / signup / book */
.verdict, .cta-box, .signup-section, .book-banner {
    border: 1px solid var(--accent);
    background: none; border-radius: 0;
    padding: 28px; margin: 44px 0; text-align: center;
}
.verdict h3 {
    color: var(--yellow); font-size: 0.9rem; text-transform: uppercase;
    letter-spacing: 0.12em; margin: 0 0 14px; font-weight: 700;
}
.verdict p, .cta-box .subtitle { margin: 0; }
.cta-box .tagline, .signup-label, .tagline {
    display: inline-block; color: var(--pink); font-size: 0.78rem;
    text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700;
    margin-bottom: 12px;
}
.cta-box h3, .signup-title { color: var(--text); font-size: 1.5rem; font-weight: 700; margin: 0 0 12px; }
.cta-box a, .signup-title a { color: inherit; text-decoration: none; }
.subtitle, .signup-desc { color: var(--text-dim); }
.coming { color: var(--footnote); }

/* signup form */
.signup-section .signup-label, .signup-section span:first-child {
    color: var(--pink); font-size: 0.78rem; text-transform: uppercase;
    letter-spacing: 0.18em; font-weight: 700;
}
.email-form, .signup-section form {
    display: flex; gap: 10px; max-width: 460px; margin: 18px auto 14px; flex-wrap: wrap;
}
.email-input, .signup-section input[type="email"] {
    flex: 1; min-width: 200px; padding: 11px 14px;
    font-family: var(--font-mono); font-size: 0.9rem;
    background: var(--bg-soft); border: 1px solid var(--text); color: var(--text);
    border-radius: 0; outline: none;
}
.email-input:focus, .signup-section input:focus { border-color: var(--accent); }
.submit-btn, .signup-section button {
    padding: 11px 22px; font-family: var(--font-mono); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85rem;
    background: none; color: var(--accent);
    border: 2px solid var(--accent); border-radius: 0; cursor: pointer;
}
.submit-btn:hover, .signup-section button:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.signup-bonus { color: var(--footnote); font-size: 0.8rem; margin: 0; }

/* book banner */
.book-banner { text-align: center; }
.book-link { color: var(--accent); font-weight: 700; letter-spacing: 1px; }

/* evidence list (estimating-the-singularity) */
.evidence-list { list-style: none; margin-inline-start: 0; }
.evidence-item { border-left: 3px solid var(--accent); padding: 8px 0 8px 16px; margin: 12px 0; }

/* cta buttons grid */
.cta-buttons { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 24px 0 0; }
.cta-btn {
    display: block; border: 1px solid var(--accent); padding: 16px 20px;
    text-decoration: none; color: var(--text); text-align: left; min-width: 200px;
}
.cta-btn:hover { background: var(--bg-soft); text-decoration: none; }
.cta-btn-title { display: block; color: var(--accent); font-weight: 700; }
.cta-btn-label { display: block; color: var(--footnote); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.cta-btn-desc { display: block; color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    margin-top: 50px; padding: 30px 0 10px;
    border-top: 2px dashed var(--line);
    text-align: center;
    position: static !important; background: none !important;
}
.footer-logo {
    display: inline-block; background: var(--accent); color: var(--bg);
    padding: 4px 10px; font-weight: 700; margin-bottom: 16px;
}
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 16px; }
.footer-links a, .footer-text a { color: var(--accent); }
.footer-text, .copyright { color: var(--footnote); font-size: 0.85rem; }

/* ============================================================
   AGI / SI LIVE ESTIMATE PAGES
   ============================================================ */
.est-eta { color: var(--text-dim); margin: 4px 0 24px; font-size: 1.05rem; }
.est-eta b { color: var(--yellow); }
.countdown { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 34px; }
.cd-unit { background: var(--bg-soft); border: 1px solid var(--cyan); padding: 14px 16px;
           min-width: 82px; text-align: center; box-shadow: 0 0 18px rgba(54,249,246,.10); }
.cd-num { font-size: 2.3rem; font-weight: 700; color: var(--cyan); line-height: 1; }
.cd-lbl { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em;
          color: var(--footnote); margin-top: 8px; }
.meter { margin: 16px 0; }
.meter-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.88rem; }
.meter-head .v { color: var(--pink); font-weight: 700; }
.meter-bar { height: 14px; border: 1px solid var(--line); background: var(--bg-soft); }
.meter-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); transition: width .6s ease; }
.sigs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 14px 0 0; }
.sig { border: 1px solid var(--line); padding: 10px 12px; background: var(--bg-soft); }
.sig.on { border-color: var(--cyan); box-shadow: inset 3px 0 0 var(--cyan); }
.sig.off { opacity: 0.5; }
.sig .nm { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sig .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--footnote); flex: 0 0 auto; }
.sig.on .dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.sig .mn { font-size: 0.8rem; color: var(--text-dim); margin-top: 5px; line-height: 1.4; }
.est-note { color: var(--text-dim); border-left: 3px solid var(--yellow); padding: 12px 16px;
            margin: 26px 0; background: var(--bg-soft); }
.est-gate { color: var(--pink); }
.est-updated { color: var(--footnote); font-size: 0.8rem; margin-top: 22px; }
.est-sub { color: var(--text-dim); margin: 6px 0 26px; }

/* ---------- easter-egg music button (navbar) — cyan music note, link-style ---------- */
.sc-egg {
    background: none; border: none; padding: 0 2px; cursor: pointer;
    color: var(--cyan); font-family: var(--font-mono); font-size: 1.15rem; line-height: 1;
}
.sc-egg:hover { color: var(--text); }
.sc-egg.on { color: var(--pink); text-shadow: 0 0 8px var(--pink); }

/* ---------- appendix: AGI/ASI tracker buttons (index bottom) ---------- */
.appendix { margin: 50px 0 0; }
.appendix-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.big-btn {
    display: block; padding: 22px; text-decoration: none;
    background: var(--bg-soft); border: 1px solid var(--cyan);
    box-shadow: 0 0 0 rgba(54,249,246,0); transition: box-shadow .15s, transform .15s;
}
.big-btn:hover { text-decoration: none; transform: translateY(-2px);
    box-shadow: 0 0 24px rgba(54,249,246,.22); }
.bb-k { display: block; font-size: 1.9rem; font-weight: 700; color: var(--cyan); line-height: 1; }
.bb-t { display: block; color: var(--text); font-weight: 700; margin-top: 8px; }
.bb-d { display: block; color: var(--footnote); font-size: 0.8rem; margin-top: 6px; }
@media (max-width: 560px) { .appendix-btns { grid-template-columns: 1fr; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 684px) {
    body { padding: 20px; }
    nav { margin-left: 0; }
    .navbar-center { order: 3; }
    h1 { font-size: 1.4rem; }
    article h1 { font-size: 1.5rem; }
}
