/* =========================================================================
   antáma library — liquid-glass layer on top of Headline's built CSS.
   Tokens mirror antama.io (Layout.css): ink/indigo/violet/mint, Manrope,
   26px blur + 180% saturation glass, aurora background.
   Note: Ghost sets html { font-size: 62.5% }, so 1rem = 10px here.
   ========================================================================= */

html:root {
    --ink: #0b1129;
    --ink2: #121730;
    --ind: #273059;
    --mut: #5a5b6a;
    --mist: #ebecf2;
    --vio: #6646e8;
    --mint: #00f0a0;
    --r: 28px;
    --bg: #fff;
    --aurora: radial-gradient(40vw 40vw at 8% 8%, #6646e829, transparent 70%),
              radial-gradient(36vw 36vw at 95% 38%, #00f0a024, transparent 70%),
              radial-gradient(45vw 45vw at 18% 95%, #27305914, transparent 70%);
    --glass-bg: #ffffff8c;
    --glass-border: #ffffffbf;
    --glass-shadow: inset 0 1px 0 #fffffff2, inset 0 -1px 0 #2730590d, 0 10px 40px -12px #27305938;
    --btn-bg: #fff9;
    --btn-border: #ffffffb3;
    --btn-shadow: inset 0 1px 0 #fff, 0 6px 18px -8px #2730594d;
    --hover: #6646e814;
    --current: #6646e81f;
    --tint: #6646e81a;
    --menu-bg: #ffffffe0;
    --cta-bg: linear-gradient(145deg, #0b1129f2, #273059eb);
    --line: #27305924;

    /* Map Ghost/Headline variables onto the antáma palette */
    --ghost-accent-color: var(--vio);
    --color-primary-text: var(--ink);
    --color-darker-gray: var(--ink);
    --color-dark-gray: var(--ind);
    --color-secondary-text: var(--mut);
    --color-light-gray: var(--line);
    --color-lighter-gray: var(--tint);
    --color-mid-gray: var(--line);
    --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --gh-font-heading: var(--font-sans);
    --gh-font-body: var(--font-sans);
    --container-width: 1120px;
    --wrap: min(1120px, 92vw);
}

@media (prefers-color-scheme: dark) {
    html:root {
        color-scheme: dark;
        --ink: #fff;
        --ind: #c9cbe0;
        --mut: #a9abba;
        --vio: #a99bff;
        --bg: #0b1129;
        --aurora: radial-gradient(40vw 40vw at 8% 8%, #6646e84d, transparent 70%),
                  radial-gradient(36vw 36vw at 95% 38%, #00f0a017, transparent 70%),
                  linear-gradient(180deg, #0b1129, #121730 60%, #0b1129);
        --glass-bg: linear-gradient(145deg, #ffffff1c, #ffffff09 55%, #ffffff0f);
        --glass-border: #ffffff1f;
        --glass-shadow: inset 0 1px 0 #ffffff38, inset 0 -1px 0 #ffffff0d, 0 24px 60px -20px #030616b3;
        --btn-bg: #ffffff14;
        --btn-border: #ffffff29;
        --btn-shadow: inset 0 1px 0 #fff3, 0 6px 18px -8px #03061699;
        --hover: #ffffff14;
        --current: #a99bff29;
        --tint: #a99bff24;
        --menu-bg: #121730f0;
        --cta-bg: linear-gradient(145deg, #6646e861, #2730598c);
        --line: #ffffff24;
        --color-white: #0b1129;
        --mist: #1e2448;
    }
}

/* ---------- Base ---------- */

body {
    font-family: var(--font-sans);
    font-size: 1.7rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--aurora);
    pointer-events: none;
}

.gh-site { background: transparent; }

h1, h2, h3, h4, .gh-article-title, .gh-card-title, .gh-pagehead-title {
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
    font-weight: 700;
}

a { color: var(--vio); }
:focus-visible { outline: 2px solid var(--vio); outline-offset: 3px; }

.ah-wrap { width: var(--wrap); margin-inline: auto; }
.ah-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--r);
    box-shadow: var(--glass-shadow);
}

.glass.dark {
    background: var(--cta-bg);
    border-color: #ffffff2e;
    color: #fff;
}
.glass.dark p { color: var(--mist); }

.btn {
    display: inline-flex;
    gap: .5em;
    align-items: center;
    justify-content: center;
    padding: .75em 1.4em;
    border-radius: 999px;
    font: 600 1.5rem/1.2 var(--font-sans);
    text-decoration: none;
    white-space: nowrap;
    color: var(--ink);
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: var(--btn-shadow);
    cursor: pointer;
    transition: transform .2s;
}
.btn:hover { transform: translateY(-1px); opacity: 1; }
.btn svg { width: 1.1em; height: 1.1em; }
.btn.pri {
    color: #fff;
    background: linear-gradient(180deg, #7a5cf0, #6646e8);
    border-color: #ffffff59;
    box-shadow: inset 0 1px 0 #ffffff73, 0 8px 22px -8px #6646e8b3;
}

/* ---------- Header: floating glass pill, as on antama.io ---------- */

.ah-hdr {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 4vw 0;
}

.ah-nav {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: min(1120px, 100%);
    margin: auto;
    padding: 6px 10px 6px 22px;
    border-radius: 999px;
}

.ah-brand { display: flex; align-items: center; flex: none; text-decoration: none; }
.ah-brand img { height: 40px; width: auto; }

/* Naxito mascot stacked above the site title as a text wordmark */
.ah-brand-stack { flex-direction: column; justify-content: center; gap: 0; line-height: 1; }
.ah-brand-stack .ah-mascot { width: 40px; height: 40px; object-fit: contain; filter: none; margin-bottom: -1px; }
.ah-wordmark {
    margin: 0;
    font: 800 1.7rem/1 var(--font-sans);
    letter-spacing: .02em;
    color: var(--vio);
    white-space: nowrap;
}
.ah-brand-stack:hover .ah-mascot { transform: rotate(-6deg); }
.ah-mascot { transition: transform .25s cubic-bezier(.34, 1.4, .5, 1); }
.ah-ftr-brand { align-items: center; justify-self: center; }
.ah-ftr-brand .ah-mascot { width: 112px; height: 112px; margin-bottom: 4px; }
.ah-ftr-brand .ah-wordmark { font-size: 2.6rem; }

.ah-links { flex: 1; display: flex; justify-content: center; min-width: 0; }
.ah-links .nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.ah-links .nav a {
    display: block;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--ink);
    font-size: 1.45rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.ah-links .nav a:hover { background: var(--hover); opacity: 1; }
.ah-links .nav-current a { background: var(--current); color: var(--vio); }

.ah-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.ah-link { padding: 8px 12px; color: var(--ink); font-weight: 600; font-size: 1.45rem; text-decoration: none; }
.ah-icon-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
}
.ah-icon-btn:hover { background: var(--hover); }
.ah-icon-btn svg { width: 20px; height: 20px; }
.ah-actions .btn { padding: .65em 1.2em; font-size: 1.4rem; }

.ah-burger {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
}
.ah-burger span,
.ah-burger span::before,
.ah-burger span::after {
    position: absolute;
    left: 11px;
    width: 18px;
    height: 1.5px;
    background: var(--ink);
    border-radius: 2px;
    content: "";
}
.ah-burger span { top: 19px; }
.ah-burger span::before { left: 0; top: -6px; }
.ah-burger span::after { left: 0; top: 6px; }

@media (max-width: 1080px) {
    .ah-burger { display: block; }
    .ah-links {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        padding: 12px;
        background: var(--menu-bg);
        -webkit-backdrop-filter: blur(26px);
        backdrop-filter: blur(26px);
        border-radius: 24px;
        box-shadow: 0 20px 40px -12px #2730594d;
    }
    .ah-links.is-open { display: block; }
    .ah-links .nav { flex-direction: column; align-items: stretch; }
    .ah-links .nav a { font-size: 1.6rem; padding: 12px 16px; }
    .ah-nav { justify-content: space-between; }
}
@media (max-width: 560px) {
    .ah-link { display: none; }
    .ah-brand-stack .ah-mascot { width: 30px; height: 30px; }
    .ah-wordmark { font-size: 1.5rem; }
    .ah-nav { padding-left: 16px; }
}

/* ---------- Home: Guardian-style sections, one per tag ---------- */

.ah-home { padding: clamp(28px, 5vw, 56px) 0 clamp(40px, 6vw, 80px); }

.ah-section { margin-bottom: clamp(40px, 6vw, 72px); }

.ah-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 20px;
    padding-top: 12px;
    margin-bottom: 20px;
    border-top: 3px solid var(--sec-accent, var(--vio));
}
.ah-section-title {
    margin: 0;
    font-size: clamp(2.4rem, 3vw, 3.2rem);
    line-height: 1.1;
    color: var(--sec-accent, var(--vio));
}
.ah-section-title a { color: inherit; text-decoration: none; }
.ah-section-title a:hover { opacity: .8; }
.ah-section-desc { margin: 0; color: var(--mut); font-size: 1.5rem; }

.ah-section-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-auto-rows: auto;
    gap: 16px;
}
.ah-card.is-lead { grid-row: span 2; }

.ah-card {
    min-width: 0;
    border-radius: 22px;
    overflow: hidden;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: transform .25s cubic-bezier(.34, 1.4, .5, 1);
}
.ah-card:hover { transform: translateY(-2px); }
.ah-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.ah-card-link:hover { opacity: 1; }
.ah-card-img { margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, var(--mist), #6646e82e 60%, #00f0a033); }
.ah-card-img img { width: 100%; height: 100%; object-fit: cover; }
.ah-card-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 16px 18px 18px; }
.ah-kicker { font-size: 1.2rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--vio); }
.ah-card-title { margin: 0; font-size: 1.8rem; line-height: 1.25; letter-spacing: -.01em; }
.ah-card.is-lead .ah-card-title { font-size: clamp(2.4rem, 2.6vw, 3rem); line-height: 1.15; }
.ah-card.is-lead .ah-card-body { padding: 22px 26px 26px; }
.ah-card-excerpt { margin: 0; color: var(--mut); font-size: 1.6rem; }
.ah-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; color: var(--mut); font-size: 1.3rem; }
.ah-lock { padding: 0 .7em; border-radius: 999px; background: var(--tint); color: var(--vio); font-weight: 600; }

.ah-section-foot { margin-top: 16px; text-align: right; }
.ah-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    box-shadow: var(--btn-shadow);
    color: var(--ink);
    font-weight: 600;
    font-size: 1.45rem;
    text-decoration: none;
}
.ah-more svg { width: 14px; height: 14px; }
.ah-more:hover { color: var(--vio); opacity: 1; }

/* Sections with only one or two posts: avoid empty columns */
.ah-section-grid:has(> .ah-card:only-child) { grid-template-columns: 1fr; }
.ah-section-grid:has(> .ah-card:only-child) .ah-card-link { flex-direction: row; }
.ah-section-grid:has(> .ah-card:only-child) .ah-card-img { flex: 0 0 50%; aspect-ratio: auto; min-height: 280px; }
.ah-section-grid:has(> .ah-card:nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
.ah-section-grid:has(> .ah-card:nth-child(2):last-child) .ah-card.is-lead { grid-row: auto; }

@media (max-width: 960px) {
    .ah-section-grid { grid-template-columns: 1fr 1fr; }
    .ah-card.is-lead { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 560px) {
    .ah-section-grid { grid-template-columns: 1fr; }
    .ah-card:not(.is-lead) .ah-card-img { display: none; }
    .ah-section-grid:has(> .ah-card:only-child) .ah-card-link { flex-direction: column; }
    .ah-section-grid:has(> .ah-card:only-child) .ah-card-img { min-height: 0; aspect-ratio: 16 / 9; }
}

/* ---------- Posts and pages ---------- */

.gh-main { padding-top: clamp(24px, 4vw, 48px); }

.gh-article {
    width: var(--wrap);
    margin: 0 auto;
    padding: clamp(32px, 5vw, 64px) 0;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--r);
    box-shadow: var(--glass-shadow);
}
.gh-article .gh-canvas { --gap: clamp(20px, 4vw, 40px); }
.gh-article-tag { color: var(--vio); }
.gh-article-excerpt { color: var(--mut); }
.gh-content { font-family: var(--font-sans); }
.gh-content > * + * { margin-top: max(2.4vmin, 2.4rem); }
.gh-content a { color: var(--vio); }
.gh-article-image img, .gh-content img { border-radius: 18px; }
.gh-button-share { border-radius: 999px; }

.gh-read-next { margin-top: clamp(32px, 5vw, 56px); }

/* Archive cards (tag, author, paginated index) as glass tiles */
.gh-feed .gh-card,
.gh-read-next .gh-card {
    padding: 16px;
    border-radius: 22px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}
.gh-card-image img { border-radius: 14px; }
.gh-card-title { opacity: 1; }
.gh-pagehead { border-color: var(--line); }
.gh-topic-grid .gh-topic-content { gap: 16px; }

/* ---------- Pre-footer calls to action (every post) ---------- */

.ah-ctas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: clamp(40px, 6vw, 72px);
}
.ah-cta {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 16px 18px;
    padding: clamp(24px, 3.5vw, 36px);
}
.ah-cta h3 { margin: 0 0 6px; font-size: 2rem; line-height: 1.2; }
.ah-cta p { margin: 0; color: var(--mut); font-size: 1.55rem; }
.ah-cta .btn { grid-column: 2; justify-self: start; }
.ah-chip {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--tint);
    color: var(--vio);
}
.ah-chip svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.glass.dark .ah-chip { background: #ffffff1f; color: var(--mint); }
.glass.dark h3 { color: #fff; }

@media (max-width: 760px) {
    .ah-ctas { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */

.ah-ftr { padding: clamp(32px, 5vw, 64px) 0 40px; }
.ah-ftr .ah-wrap { display: grid; gap: 20px; }
.ah-subscribe {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    padding: clamp(24px, 4vw, 40px);
}
.ah-subscribe h3 { margin: 0 0 4px; font-size: 2.2rem; }
.ah-subscribe p { margin: 0; color: var(--mut); max-width: 60ch; }
.ah-subscribe .btn svg { width: 18px; height: 18px; }
.ah-ftr-card { display: grid; gap: 14px; padding: 28px 32px; }
.ah-ftr-menu .nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 0; padding: 0; list-style: none; }
.ah-ftr-menu a { color: var(--ind); font-weight: 500; text-decoration: none; }
.ah-social { display: flex; justify-content: center; gap: 12px; }
.ah-social:empty { display: none; }
.ah-social a { color: var(--ind); }
.ah-social svg { width: 20px; height: 20px; }
.ah-copy { margin: 0; color: var(--mut); font-size: 1.4rem; text-align: center; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
