/* ==========================================================================
   APEX — Cinematic Dark Card Theme
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0A0A0B;
    --surface: #141416;
    --surface-light: #1C1C1F;
    --border: #222225;
    --accent: #E63946;
    --accent-dim: rgba(230,57,70,0.15);
    --accent-glow: rgba(230,57,70,0.4);
    --text: #E8E6E3;
    --text-dim: #6B6B6F;
    --text-muted: #44444A;
    --white: #FFFFFF;

    --font-heading: 'Oswald', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-ui: 'DM Sans', sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, monospace;
    --font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);

    --page-width: 1280px;
    --entry-width: 720px;
    --margin: clamp(1rem, 4vw, 3rem);
    --gap: clamp(0.75rem, 1.5vw, 1.25rem);
    --radius: 8px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --fast: 0.2s;
    --med: 0.4s;
}

::selection { background: var(--accent); color: var(--white); }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    font-size: var(--font-size);
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--text); text-decoration: none; transition: color var(--fast) var(--ease); }
a:hover { color: var(--accent); }

h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-heading);
    color: var(--white);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
h1 { font-size: clamp(1.75rem, 1.25rem + 2.5vw, 3.25rem); }
h2 { font-size: clamp(1.375rem, 1.1rem + 1.25vw, 2rem); }
h3 { font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem); }
h4 { font-size: 1.125rem; }

.wrapper { max-width: var(--page-width); margin: 0 auto; padding: 0 var(--margin); }
.entry-wrapper { max-width: var(--entry-width); margin: 0 auto; }

/* ==========================================================================
   HEADER — transparent, minimal
   ========================================================================== */

.top {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    transition: background var(--med) var(--ease), box-shadow var(--med) var(--ease);
}

.top.is-scrolled {
    background: rgba(10,10,11,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--border);
}

.top__inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 0 var(--margin);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
}

.top__brand { flex-shrink: 0; }

.top__logo img { max-height: 1.75rem; }

.top__site-name {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.top__site-name:hover { color: var(--accent); }

.top__nav { flex: 1; display: flex; justify-content: flex-end; margin-right: 0.75rem; }

.nav { list-style: none; display: flex; gap: 0.25rem; }

.nav__item { position: relative; }

.nav__item > a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color var(--fast) var(--ease);
}
.nav__item > a:hover, .nav__item.is-active > a { color: var(--white); }

.nav__sub {
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 10rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    list-style: none;
    padding: 0.375rem 0;
    opacity: 0; visibility: hidden;
    transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.nav__item:hover > .nav__sub {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.nav__sub a {
    display: block; padding: 0.4rem 1rem;
    font-size: 0.75rem; color: var(--text-dim);
}
.nav__sub a:hover { color: var(--white); background: rgba(255,255,255,0.04); }

/* Actions */
.top__actions { display: flex; align-items: center; gap: 0.125rem; }

.top__btn {
    background: none; border: none; color: var(--text-dim); cursor: pointer;
    width: 2.25rem; height: 2.25rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.top__btn:hover { color: var(--white); background: rgba(255,255,255,0.06); }

.top__burger { display: none; flex-direction: column; gap: 4px; }
.top__burger span {
    display: block; width: 16px; height: 1.5px; background: currentColor;
    transition: transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}
.top__burger[aria-expanded="true"] span:first-child { transform: translateY(5.5px) rotate(45deg); }
.top__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.top__burger[aria-expanded="true"] span:last-child { transform: translateY(-5.5px) rotate(-45deg); }

/* Search overlay */
.search-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(10,10,11,0.96); backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity var(--med) var(--ease);
}
.search-overlay.is-open { opacity: 1; visibility: visible; }

.search-overlay__box { width: 90%; max-width: 560px; position: relative; }

.search-overlay__input {
    width: 100%;
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: transparent; border: none;
    border-bottom: 2px solid var(--border);
    color: var(--white); padding: 0.5rem 0;
    transition: border-color var(--fast) var(--ease);
}
.search-overlay__input::placeholder { color: var(--text-muted); }
.search-overlay__input:focus { border-color: var(--accent); }

.search-overlay__close {
    position: absolute; top: -2.5rem; right: 0;
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    transition: color var(--fast) var(--ease);
}
.search-overlay__close:hover { color: var(--white); }

/* ==========================================================================
   FEATURED ROW — highlighted post, side-by-side layout
   ========================================================================== */

.featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: center;
    margin-top: clamp(4.5rem, 4rem + 2vw, 5.5rem);
    padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--white);
}

.featured__media {
    border-radius: var(--radius);
    overflow: hidden;
}

.featured__img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
}
.featured:hover .featured__img {
    transform: scale(1.03);
    filter: brightness(1.1);
}

.featured__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured__tags { margin-bottom: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.375rem; }

.featured__title {
    font-size: clamp(1.5rem, 1.25rem + 1.5vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

.featured__excerpt {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.featured__meta {
    display: flex; gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: var(--font-ui);
    margin-bottom: 1.25rem;
}

.featured__cta {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    transition: color var(--fast) var(--ease);
}
.featured:hover .featured__cta { color: var(--white); }

/* No-image: body spans full width */
.featured:not(:has(.featured__media)) {
    grid-template-columns: 1fr;
}

/* ==========================================================================
   CARD GRID
   ========================================================================== */

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
    padding: var(--gap) 0 clamp(1.5rem, 4vw, 3rem);
}

.card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.card__link {
    display: block;
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    color: var(--white);
}

.card__img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
}
.card:hover .card__img {
    transform: scale(1.05);
    filter: brightness(1.15);
}

.card__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(
        to top,
        rgba(10,10,11,0.92) 0%,
        rgba(10,10,11,0.7) 25%,
        rgba(10,10,11,0.35) 50%,
        rgba(10,10,11,0.1) 75%,
        transparent 100%
    );
    transition: opacity var(--fast) var(--ease);
}

.card__content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 1.25rem;
    z-index: 1;
}

.card__tags { margin-bottom: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.25rem; }

.card__title {
    font-size: clamp(0.9rem, 0.8rem + 0.5vw, 1.2rem);
    line-height: 1.2;
    letter-spacing: 0.03em;
    margin-bottom: 0.375rem;
}

.card__meta {
    display: flex; gap: 0.75rem;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--font-ui);
}

/* No-image fallback */
.card__link:not(:has(.card__img)) {
    background: var(--surface);
    border: 1px solid var(--border);
}
.card__link:not(:has(.card__img)) .card__overlay {
    display: none;
}
.card__link:not(:has(.card__img))::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent);
}

/* Tag pill */
.tag-pill {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 0.2em 0.5em;
    border-radius: 3px;
}
a.tag-pill:hover { background: var(--accent); color: var(--white); }

/* ==========================================================================
   SINGLE POST
   ========================================================================== */

.post__hero {
    position: relative;
    width: 100%;
    min-height: 55vh;
    max-height: 70vh;
    overflow: hidden;
    margin-top: 3.5rem;
    display: flex;
    align-items: flex-end;
}

.post__hero-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

.post__hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(10,10,11,0.95) 0%, rgba(10,10,11,0.3) 50%, transparent 100%);
}

.post__hero-content {
    position: relative; z-index: 1;
    max-width: var(--page-width);
    width: 100%;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) var(--margin);
}

.post__header {
    max-width: var(--entry-width);
    margin: 0 auto;
    padding: clamp(5rem, 10vw, 8rem) 0 2rem;
    text-align: center;
}

.post__tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 1rem; }
.post__hero-content .post__tags { justify-content: flex-start; }
.post__header .post__tags { justify-content: center; }

.post__title {
    font-size: clamp(1.75rem, 1.25rem + 2.5vw, 3.5rem);
    margin-bottom: 1rem;
    line-height: 1.05;
}

.post__meta {
    display: flex; align-items: center; gap: 1rem;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--text-dim);
}
.post__header .post__meta { justify-content: center; }

.post__author { color: var(--text); font-weight: 500; }
.post__author:hover { color: var(--accent); }

/* ==========================================================================
   ENTRY CONTENT
   ========================================================================== */

.entry { padding: clamp(2rem, 5vw, 4rem) 0; }

.entry > * + * { margin-top: 1.5em; }
.entry h2 { margin-top: 2.5em; margin-bottom: 0.5em; }
.entry h3 { margin-top: 2em; margin-bottom: 0.5em; }

.entry a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(230,57,70,0.3);
    text-underline-offset: 0.15em;
}
.entry a:hover { text-decoration-color: var(--accent); }

.entry blockquote {
    border-left: 2px solid var(--accent);
    padding: 0.25em 0 0.25em 1.25em;
    color: var(--text-dim);
    font-style: italic;
}

.entry .pullquote {
    border: none;
    border-top: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
    padding: 1.5em 0;
    margin: 2.5em 0;
    text-align: center;
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 1rem + 0.75vw, 1.75rem);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--white);
}

.entry code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--surface-light);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

.entry pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    font-size: 0.85rem;
}
.entry pre code { background: none; padding: 0; }

.entry img, .entry figure { border-radius: var(--radius); }
.entry figcaption { font-size: 0.75rem; color: var(--text-muted); text-align: center; padding-top: 0.5rem; }

.entry .image--wide { margin-left: -10%; margin-right: -10%; max-width: 120%; }
.entry .image--full { margin-left: calc(-1 * var(--margin)); margin-right: calc(-1 * var(--margin)); max-width: 100vw; border-radius: 0; }

.entry ul, .entry ol { padding-left: 1.5em; }
.entry li + li { margin-top: 0.25em; }

.entry table { width: 100%; border-collapse: collapse; }
.entry th, .entry td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); }
.entry th { font-family: var(--font-ui); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }

.entry hr { border: none; height: 1px; background: var(--border); margin: 2.5rem 0; }

.entry .highlight-box {
    background: var(--surface);
    border-left: 2px solid var(--accent);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ==========================================================================
   SHARE
   ========================================================================== */

.share {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.share__label {
    font-family: var(--font-ui); font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted);
}

.share__btn {
    display: flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border-radius: 50%;
    color: var(--text-dim); background: var(--surface-light);
    transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.share__btn:hover { background: var(--accent); color: var(--white); transform: scale(1.1); }

/* ==========================================================================
   AUTHOR BIO
   ========================================================================== */

.bio {
    display: flex; gap: 1.25rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    margin: 2rem auto;
    max-width: var(--entry-width);
    border: 1px solid var(--border);
}

.bio__avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.bio__name { font-size: 0.95rem; margin-bottom: 0.375rem; text-transform: uppercase; letter-spacing: 0.04em; }
.bio__name a { color: var(--white); }
.bio__name a:hover { color: var(--accent); }
.bio__text { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; }

/* ==========================================================================
   RELATED
   ========================================================================== */

.related { margin: clamp(2rem, 5vw, 4rem) auto 0; max-width: var(--entry-width); }

.related__heading {
    font-size: 0.8rem; letter-spacing: 0.12em; color: var(--text-muted);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }

.related__card {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}
.related__img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s var(--ease);
}
.related__card:hover .related__img { transform: scale(1.05); }
.related__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(10,10,11,0.9) 0%, transparent 60%);
}
.related__title {
    position: relative; z-index: 1;
    padding: 1rem;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--white);
    line-height: 1.2;
}

/* ==========================================================================
   POST NAV
   ========================================================================== */

.post-nav {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
    margin: clamp(2rem, 5vw, 4rem) auto;
    max-width: var(--entry-width);
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.post-nav__link {
    display: flex; flex-direction: column;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--fast) var(--ease);
}
.post-nav__link:hover { border-color: var(--accent); }
.post-nav__link--next { text-align: right; }

.post-nav__label {
    font-family: var(--font-ui); font-size: 0.6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.post-nav__title {
    font-family: var(--font-heading); font-size: 0.85rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.02em; color: var(--text); line-height: 1.2;
}
.post-nav__link:hover .post-nav__title { color: var(--accent); }

/* ==========================================================================
   ARCHIVE HEADERS
   ========================================================================== */

.archive-header {
    padding: clamp(5rem, 10vw, 8rem) 0 2rem;
    text-align: center;
    max-width: var(--entry-width);
    margin: 0 auto;
}

.archive-header__avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; }
.archive-header__title { margin-bottom: 0.75rem; }
.archive-header__desc { font-size: 0.9rem; color: var(--text-dim); line-height: 1.5; max-width: 45ch; margin: 0 auto 0.75rem; }
.archive-header__count { font-family: var(--font-ui); font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.06em; }
.archive-header__meta { display: flex; justify-content: center; gap: 1.5rem; margin-top: 0.5rem; font-size: 0.8rem; color: var(--text-dim); }

/* ==========================================================================
   TAGS GRID
   ========================================================================== */

.tags-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap); padding-bottom: 3rem; }

.tags-grid__item {
    position: relative; display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
}
.tags-grid__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.tags-grid__item:hover .tags-grid__img { transform: scale(1.05); }
.tags-grid__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,10,11,0.9), transparent 70%); }
.tags-grid__body { position: absolute; bottom: 0; left: 0; right: 0; padding: 1rem; z-index: 1; }
.tags-grid__name { font-family: var(--font-heading); font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--white); }
.tags-grid__item:hover .tags-grid__name { color: var(--accent); }
.tags-grid__count { font-size: 0.7rem; color: var(--text-dim); }

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pag { display: flex; justify-content: space-between; padding: 1.5rem 0 3rem; max-width: var(--entry-width); margin: 0 auto; }

.pag__link {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-heading); font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.pag__link:hover { border-color: var(--accent); color: var(--accent); }
.pag__link--next { margin-left: auto; }

/* ==========================================================================
   404
   ========================================================================== */

.error-page {
    text-align: center; padding: clamp(6rem, 15vw, 12rem) 0;
    display: flex; flex-direction: column; align-items: center;
}
.error-page__code {
    font-family: var(--font-heading); font-size: clamp(6rem, 5rem + 5vw, 12rem);
    font-weight: 800; color: var(--surface-light); line-height: 1;
}
.error-page__title { font-size: clamp(1.25rem, 1rem + 1vw, 2rem); margin-bottom: 0.75rem; }
.error-page__text { color: var(--text-dim); margin-bottom: 2rem; max-width: 30ch; }
.error-page__link {
    font-family: var(--font-heading); font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--bg); background: var(--accent);
    padding: 0.6rem 1.5rem; border-radius: var(--radius);
    transition: background var(--fast) var(--ease);
}
.error-page__link:hover { background: #ff4757; color: var(--bg); }

/* ==========================================================================
   FOOTER — barely there
   ========================================================================== */

.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
}

.footer__inner {
    max-width: var(--page-width);
    margin: 0 auto; padding: 0 var(--margin);
    display: flex; align-items: center; justify-content: center;
    gap: 1.5rem; flex-wrap: wrap;
    font-family: var(--font-ui); font-size: 0.7rem; color: var(--text-muted);
}

.footer__nav { display: flex; gap: 1.25rem; }
.footer__nav a { color: var(--text-muted); }
.footer__nav a:hover { color: var(--text); }
.footer__rss { color: var(--text-muted); }
.footer__rss:hover { color: var(--accent); }

/* MISC */
.subpages { list-style: none; max-width: var(--entry-width); margin: 1rem auto; }
.subpages li { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.subpages a { color: var(--text); font-weight: 500; }
.subpages a:hover { color: var(--accent); }

.empty { text-align: center; padding: 4rem 0; color: var(--text-muted); }

/* ==========================================================================
   BACK TO TOP
   ========================================================================== */

.btt {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    width: 2.5rem; height: 2.5rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-light); color: var(--text-dim);
    border: 1px solid var(--border); border-radius: 50%;
    cursor: pointer;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity var(--fast) var(--ease), visibility var(--fast) var(--ease), transform var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
    z-index: 50;
}
.btt.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.btt:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   FORMS
   ========================================================================== */

input[type="text"], input[type="email"], input[type="url"],
input[type="search"], input[type="tel"], input[type="number"],
textarea, select {
    font-family: var(--font-body); font-size: 0.9rem; color: var(--text);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.6rem 0.8rem; width: 100%;
    transition: border-color var(--fast) var(--ease);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

button, input[type="submit"] {
    font-family: var(--font-heading); font-size: 0.8rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--bg); background: var(--accent); border: none;
    border-radius: var(--radius); padding: 0.65rem 1.5rem; cursor: pointer;
    transition: background var(--fast) var(--ease);
}
button:hover, input[type="submit"]:hover { background: #ff4757; }

/* ==========================================================================
   CUSTOM ELEMENTS — drop cap, messages
   ========================================================================== */

.entry .dropcap::first-letter {
    float: left;
    font-family: var(--font-heading);
    font-size: 3.5em;
    font-weight: 700;
    line-height: 0.8;
    margin: 0.05em 0.12em 0 0;
    color: var(--accent);
    text-transform: uppercase;
}

.entry .msg {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border-left: 3px solid;
    margin: 1.5em 0;
    font-size: 0.9rem;
    line-height: 1.5;
}
.entry .msg--info {
    background: rgba(56, 152, 236, 0.08);
    border-color: #3898ec;
    color: #a0c8f0;
}
.entry .msg--warning {
    background: rgba(240, 180, 40, 0.08);
    border-color: #f0b428;
    color: #e8d49c;
}
.entry .msg--success {
    background: rgba(56, 200, 120, 0.08);
    border-color: #38c878;
    color: #90dbb0;
}

/* ==========================================================================
   HOME GRID — offset for fixed header when no hero card
   ========================================================================== */

.is-home .grid { padding-top: clamp(4.5rem, 4rem + 2vw, 5.5rem); }
.is-home .featured ~ .grid { padding-top: var(--gap); }

/* ==========================================================================
   EMBEDS & MEDIA
   ========================================================================== */

.entry iframe, .entry video, .entry embed, .entry object {
    max-width: 100%;
    border-radius: var(--radius);
}
.entry .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap); }
.entry .gallery img { aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }

/* ==========================================================================
   SCROLL REVEAL
   ========================================================================== */

.reveal {
    transform: translateY(20px);
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible { transform: translateY(0); clip-path: inset(0 0 0 0); }

/* Fallback: show content if JS hasn't run */
@keyframes reveal-fallback { to { clip-path: inset(0 0 0 0); transform: translateY(0); } }
.reveal { animation: reveal-fallback 0s 1s forwards; }

.grid .reveal:nth-child(3n+2) { transition-delay: 0.06s; }
.grid .reveal:nth-child(3n+3) { transition-delay: 0.12s; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 56.25em) {
    .top__nav { display: none; }
    .top__burger { display: flex; }

    .top__nav.is-open {
        display: block; position: fixed;
        top: 3.5rem; left: 0; right: 0; bottom: 0;
        background: var(--bg); padding: 1rem var(--margin);
        overflow-y: auto;
    }
    .top__nav.is-open .nav { flex-direction: column; }
    .top__nav.is-open .nav__item > a { padding: 0.8rem 0; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
    .top__nav.is-open .nav__sub { position: static; transform: none; background: transparent; border: none; opacity: 1; visibility: visible; padding-left: 1rem; }

    .featured { grid-template-columns: 1fr; }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .related__grid { grid-template-columns: repeat(2, 1fr); }
    .post-nav { grid-template-columns: 1fr; }
    .bio { flex-direction: column; text-align: center; align-items: center; }
}

@media (max-width: 37.5em) {
    .grid { grid-template-columns: 1fr; }
    .card__link { aspect-ratio: 4 / 3; }
    .related__grid { grid-template-columns: 1fr 1fr; }
    .featured__img { aspect-ratio: 4 / 3; }
    .footer__inner { flex-direction: column; }
    .entry .image--wide { margin-left: 0; margin-right: 0; max-width: 100%; }
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
    .top, .footer, .share, .post-nav, .related, .btt, .search-overlay, .pag { display: none; }
    body { color: #000; background: #fff; }
    .entry a::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
