@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,400..700;1,14..32,400..700&family=Lora:wght@400;600;700&family=Fraunces:opsz,wght@9..144,400..700&family=DM+Serif+Display:wght@400&display=swap');

/* ============================================================
   Design tokens
   ============================================================ */
:root {
    --bg-color: #f7f7f5;
    --surface-color: #ffffff;
    --surface-2: #fafaf8;
    --surface-translucent: rgba(255,255,255,.92);
    --text-color: #1a1a1a;
    --secondary-color: #6b7280;
    --tertiary-color: #9ca3af;
    --accent-color: #1a1a1a;
    --link-color: #2563eb;
    --link-hover: #1d4ed8;
    --link-wash: rgba(37,99,235,.08);
    --border-color: #d4d4d4;
    --border-light: #e5e5e5;
    --border-faint: #efefeb;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --heading-font: 'Lora', Georgia, serif;
    --max-width: 900px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 24px rgba(0,0,0,.10);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-pill: 999px;
    --dur: .2s;
    --dur-slow: .25s;
    --focus-ring: 0 0 0 3px rgba(26,26,26,.08);

    --accent-link: var(--link-color);
    --accent-link-hover: var(--link-hover);
    --accent-wash: var(--link-wash);
    --density: 0.85;

    /* Blog masonry gap; column breakpoints use ~300px min card + 1.25rem gaps (viewport media) */
    --post-col-gap: 1.25rem;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-family);
    line-height: 1.65;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    color: var(--text-color);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

a {
    color: var(--accent-link);
    text-decoration: none;
    transition: color var(--dur) ease;
}
a:hover {
    color: var(--accent-link-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.flex-1 { flex: 1; }

/* ============================================================
   Site Header
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface-translucent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: calc(.7rem * var(--density)) 0;
}
.site-header__inner {
    max-width: 66rem;
    margin: 0 auto;
    padding: 0 1.05rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.site-header__brand {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--text-color);
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.site-header__brand a { color: inherit; text-decoration: none; }
.site-header__brand a:hover { color: var(--text-color); text-decoration: none; }
.site-header__brand .dot {
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--accent-link);
    border-radius: 50%;
    margin-right: .45rem;
    vertical-align: middle;
    transform: translateY(-1px);
}

.site-header__end {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.blog-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    transition: background var(--dur), border-color var(--dur);
    flex-shrink: 0;
}
.blog-sidebar-toggle:hover {
    background: rgba(0,0,0,.04);
    border-color: var(--text-color);
}

.top-menu { display: flex; align-items: center; gap: .05rem; flex-wrap: wrap; }
.top-menu__link {
    font-family: var(--font-family);
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--secondary-color);
    padding: .4rem .6rem;
    border-radius: 4px;
    transition: color var(--dur), background var(--dur);
    text-decoration: none;
    cursor: pointer;
}
.top-menu__link:hover {
    color: var(--text-color);
    background: rgba(0,0,0,.04);
    text-decoration: none;
}
.top-menu__link[aria-current="page"] { color: var(--text-color); }
.top-menu__divider { color: var(--border-color); user-select: none; padding: 0 .1rem; }

/* ============================================================
   Page container
   ============================================================ */
.page {
    max-width: 66rem;
    margin: 0 auto;
    padding: calc(2rem * var(--density)) 1.05rem calc(3rem * var(--density));
}

/* ============================================================
   About — Hero
   ============================================================ */
.hero {
    display: grid;
    grid-template-columns: minmax(8rem, 10rem) 1fr;
    gap: 1.25rem;
    align-items: center;
    margin-bottom: calc(2rem * var(--density));
    padding-left: clamp(.35rem, 1vw, .9rem);
}
.hero__avatar {
    width: 100%;
    max-width: 10rem;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}
.hero__eyebrow {
    margin: 0;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent-color);
    font-size: .76rem;
    font-weight: 600;
    font-family: var(--font-family);
}
.hero__title {
    margin: .4rem 0 .5rem;
    font-size: clamp(1.75rem, 3.6vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.015em;
}
.hero__intro {
    margin: 0;
    color: var(--secondary-color);
    font-size: 1.05rem;
    max-width: 42rem;
    line-height: 1.55;
}
.hero__link {
    margin: .75rem 0 0;
    font-size: .95rem;
}
.hero__link a {
    color: var(--accent-color);
    font-weight: 500;
    text-decoration: none;
}
.hero__link a:hover {
    text-decoration: underline;
}
.hero__status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: .9rem;
    padding: .3rem .7rem .3rem .6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: var(--surface-color);
    font-size: .78rem;
    color: var(--text-color);
    font-weight: 500;
    text-decoration: none;
}
.hero__status:hover { text-decoration: none; color: var(--text-color); background: var(--surface-2); }
.hero__status .pulse {
    width: 6px; height: 6px; border-radius: 50%;
    background: #15803d;
    box-shadow: 0 0 0 0 rgba(21,128,61,.5);
    animation: pulse 2.4s ease-out infinite;
    flex-shrink: 0;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(21,128,61,.4); }
    70%  { box-shadow: 0 0 0 8px rgba(21,128,61,0); }
    100% { box-shadow: 0 0 0 0 rgba(21,128,61,0); }
}

/* ============================================================
   About — Era chips
   ============================================================ */
.timeline-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: calc(.9rem * var(--density)) calc(1rem * var(--density));
    align-items: center;
}
.timeline-section__heading {
    position: static;
    align-self: center;
}
.timeline-section__title {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--secondary-color);
    font-family: var(--font-family);
    font-weight: 700;
}
.chips {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0 0 calc(1.25rem * var(--density));
    flex-wrap: wrap;
    padding: .4rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    width: fit-content;
    margin-left: 0;
    box-shadow: var(--shadow-sm);
}
.timeline-wrap {
    grid-column: 1 / -1;
}
.chip {
    font-family: var(--font-family);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
    padding: .4rem .85rem;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--secondary-color);
    border: none;
    cursor: pointer;
    transition: color var(--dur), background var(--dur);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.chip:hover { color: var(--text-color); background: rgba(0,0,0,.04); }
.chip[aria-pressed="true"] { background: var(--text-color); color: #fff; }
.chip__count { font-size: .7rem; font-weight: 500; opacity: .7; }

/* ============================================================
   About — Timeline wrap + year rail
   ============================================================ */
.timeline-wrap {
    display: grid;
    grid-template-columns: 1fr 4.5rem;
    gap: calc(1.25rem * var(--density));
    align-items: start;
}
.year-rail {
    position: sticky;
    top: calc(4rem * var(--density));
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding-top: .5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    scrollbar-width: none;
}
.year-rail::-webkit-scrollbar { display: none; }
.year-rail__item {
    font-family: var(--font-family);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--tertiary-color);
    padding: .25rem .35rem;
    background: transparent;
    border: none;
    text-align: right;
    cursor: pointer;
    border-right: 2px solid var(--border-light);
    transition: color var(--dur), border-color var(--dur);
    font-variant-numeric: tabular-nums;
}
.year-rail__item:hover { color: var(--text-color); border-right-color: var(--text-color); }
.year-rail__item.is-active { color: var(--accent-link); border-right-color: var(--accent-link); font-weight: 700; }

/* ============================================================
   About — Timeline entries
   ============================================================ */
.timeline {
    display: grid;
    gap: calc(1rem * var(--density));
    position: relative;
}
.timeline::before {
    content: '';
    position: absolute;
    left: calc(6rem + 1px);
    top: 0; bottom: 0;
    width: 1px;
    background: var(--border-light);
    pointer-events: none;
    opacity: 0;
}
.timeline.layout-rail::before { opacity: 1; }

.entry {
    position: relative;
    display: grid;
    grid-template-columns: 6rem 1fr;
    gap: calc(1.1rem * var(--density));
    align-items: flex-start;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    padding: calc(1rem * var(--density)) calc(1.15rem * var(--density));
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur), box-shadow var(--dur);
    scroll-margin-top: calc(5rem * var(--density));
}
.entry:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.entry__media {
    width: 6rem;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .55rem;
    overflow: hidden;
    flex-shrink: 0;
}
.entry__media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.entry__media--apple {
    padding: 0;
    background: #000;
}
.entry__media--apple span {
    font-size: 2.8rem;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    color: #fff;
}
.entry__media--apple span::before { content: "\F8FF"; }
.entry__media--stacked {
    padding: .25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .15rem;
    flex-wrap: wrap;
}
.entry__media--stacked img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1px;
    border-radius: 3px;
    background: #fff;
    border: 1px solid var(--border-light);
}

.entry__era {
    position: absolute;
    top: calc(1rem * var(--density));
    right: calc(1.15rem * var(--density));
    z-index: 1;
    margin: 0;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tertiary-color);
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}
.entry__era .era-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--tertiary-color);
    flex-shrink: 0;
}
.entry--work .era-dot     { background: #1a1a1a; }
.entry--study .era-dot    { background: var(--accent-link); }
.entry--adventure .era-dot{ background: #0f766e; }

.entry__title {
    margin: 0;
    padding-right: 5.5rem;
    font-size: 1.2rem;
    line-height: 1.25;
    font-family: var(--heading-font);
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    align-items: baseline;
    gap: .5rem;
    flex-wrap: wrap;
}
.entry__title a { color: var(--text-color); }
.entry__title a:hover { color: var(--accent-link-hover); text-decoration: none; }
.entry__period {
    color: var(--accent-link);
    font-size: .82rem;
    font-family: var(--font-family);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    letter-spacing: 0;
}
.entry__role {
    color: var(--secondary-color);
    font-size: .85rem;
    font-family: var(--font-family);
    margin-top: .1rem;
}
.entry p {
    margin: .6rem 0 0;
    color: var(--text-color);
    line-height: 1.6;
    font-size: .98rem;
}
.entry p + p { margin-top: .5rem; }
.entry blockquote {
    margin: .75rem 0 0;
    padding: .6rem .85rem;
    border-left: 2px solid var(--accent-link);
    border-radius: 0 .35rem .35rem 0;
    background: var(--accent-wash);
    color: var(--text-color);
    font-style: italic;
    line-height: 1.5;
    font-size: .95rem;
}

/* Timeline rail layout */
.timeline.layout-rail .entry {
    grid-template-columns: 5rem 1fr;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: .35rem 0 1rem 0;
    border-bottom: 1px solid var(--border-faint);
}
.timeline.layout-rail .entry__era {
    top: .35rem;
    right: 0;
}
.timeline.layout-rail .entry:hover { transform: none; box-shadow: none; }
.timeline.layout-rail .entry__media {
    width: 3rem;
    height: 3rem;
    margin-left: 1rem;
    position: relative;
    z-index: 1;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.timeline.layout-rail::before { left: calc(1rem + 1.5rem - 0.5px); }

/* Timeline list layout */
.timeline.layout-list { gap: 0; }
.timeline.layout-list .entry {
    grid-template-columns: 1fr;
    background: transparent;
    border: none;
    box-shadow: none;
    border-bottom: 1px solid var(--border-faint);
    border-radius: 0;
    padding: calc(.85rem * var(--density)) 0;
}
.timeline.layout-list .entry__era {
    top: calc(.85rem * var(--density));
    right: 0;
}
.timeline.layout-list .entry:hover { transform: none; box-shadow: none; }
.timeline.layout-list .entry__media { display: none; }
.timeline.layout-list .entry__title { font-size: 1.05rem; }
.timeline.layout-list .entry__period { display: none; }
.timeline.layout-list .entry p:not(.entry__role) { font-size: .92rem; margin-top: .3rem; }
.timeline.layout-list .entry blockquote { display: none; }

/* Entry animation */
@keyframes entryIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.entry { animation: entryIn .35s ease both; }
.timeline > .entry:nth-child(1) { animation-delay: .02s; }
.timeline > .entry:nth-child(2) { animation-delay: .05s; }
.timeline > .entry:nth-child(3) { animation-delay: .08s; }
.timeline > .entry:nth-child(4) { animation-delay: .11s; }
.timeline > .entry:nth-child(5) { animation-delay: .14s; }
.timeline > .entry:nth-child(n+6) { animation-delay: .17s; }

/* ============================================================
   About — Contact block
   ============================================================ */
.contact {
    margin-top: calc(3rem * var(--density));
    padding: calc(2rem * var(--density));
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
}
.contact__eyebrow {
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--secondary-color);
    font-size: .76rem;
    font-weight: 600;
    margin: 0 0 .5rem;
}
.contact__title {
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    margin: 0 0 .5rem;
    letter-spacing: -0.01em;
}
.contact__body {
    color: var(--secondary-color);
    margin: 0;
    font-size: 1rem;
    max-width: 34rem;
    line-height: 1.6;
}
.contact__links {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-width: 14rem;
}
.contact__link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: .9rem;
    color: var(--text-color);
    background: var(--surface-2);
    transition: all var(--dur);
    text-decoration: none;
}
.contact__link:hover {
    border-color: var(--accent-link);
    color: var(--accent-link);
    text-decoration: none;
    background: var(--surface-color);
    transform: translateY(-1px);
}
.contact__link svg { flex-shrink: 0; stroke: var(--secondary-color); }
.contact__link:hover svg { stroke: var(--accent-link); }
.contact__link .link-label {
    display: block;
    font-size: .65rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tertiary-color);
    font-weight: 600;
    line-height: 1.2;
}
.contact__link .link-value { font-family: var(--font-family); font-size: .9rem; line-height: 1.2; }

/* ============================================================
   Blog — Page header
   ============================================================ */
.blog-header { margin-bottom: calc(1.5rem * var(--density)); }
.blog-header__eyebrow {
    margin: 0;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent-color);
    font-size: .76rem;
    font-weight: 600;
    font-family: var(--font-family);
}
.blog-header h1 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    margin: .25rem 0;
    letter-spacing: -0.015em;
}

.blog-lead {
    margin: 0 0 calc(1rem * var(--density));
    padding-left: clamp(.35rem, 1vw, .9rem);
}
.blog-lead__brand {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    font-family: var(--heading-font);
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0;
    color: var(--text-color);
}
.blog-lead__brand .blog-lead__title {
    flex: 0 0 auto;
    font-weight: 600;
    color: var(--text-color);
}
.blog-lead__sep {
    flex: 0 0 auto;
    color: var(--tertiary-color);
    font-weight: 500;
    user-select: none;
}
.blog-lead__subtitle {
    flex: 1 1 auto;
    min-width: min(100%, 12rem);
    font-family: var(--heading-font);
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--secondary-color);
}

/* ============================================================
   Blog — Layout (main + sidebar)
   ============================================================ */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: start;
    box-sizing: border-box;
    width: 90%;
    max-width: 100%;
    margin: 0 auto;
    padding: calc(2rem * var(--density)) clamp(1.25rem, 4vw, 2.25rem) calc(3rem * var(--density));
}
.blog-main {
    min-width: 0;
}

/* ~300px min card + sidebar: 3×300 + 2 gaps + main/sidebar gap + sidebar ≈ 1440px viewport @ 90% width */
@media (min-width: 1440px) {
    .blog-page .blog-layout {
        grid-template-columns: 1fr minmax(280px, 300px);
        gap: 3rem;
    }
}

/* ============================================================
   Blog — Toolbar (search + count)
   ============================================================ */
.blog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}
.blog-toolbar__count { color: var(--secondary-color); font-size: .85rem; }
.blog-toolbar--meta {
    justify-content: flex-end;
    min-height: 1.5rem;
}
.blog-toolbar__search {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .65rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    transition: border-color var(--dur), box-shadow var(--dur);
}
.blog-toolbar__search:focus-within {
    border-color: var(--text-color);
    box-shadow: var(--focus-ring);
}
.blog-toolbar__search input {
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: .88rem;
    color: var(--text-color);
    width: 180px;
}
.blog-toolbar__search input::placeholder { color: var(--tertiary-color); }
.blog-toolbar__search button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    color: var(--tertiary-color);
}

/* ============================================================
   Blog — Masonry card grid (~300px min card: n×300 + (n−1)×gap → viewport breakpoints)
   ============================================================ */
.post-grid {
    column-count: 1;
    column-gap: var(--post-col-gap);
}
@media (min-width: 640px) {
    .post-grid { column-count: 2; }
}
@media (min-width: 960px) {
    .post-grid { column-count: 3; }
}
@media (min-width: 1280px) {
    .post-grid { column-count: 4; }
}
@media (min-width: 1600px) {
    .post-grid { column-count: 5; }
}
.post-card {
    break-inside: avoid;
    margin-bottom: 1.25rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur), box-shadow var(--dur);
    display: block;
    text-decoration: none;
    color: inherit;
}
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.post-card__image {
    width: 100%;
    aspect-ratio: 16 / 10;
    display: block;
    background-color: var(--surface-2);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-bottom: 1px solid var(--border-light);
}
.post-card__image--contain {
    background-size: contain;
    background-origin: content-box;
    padding: 1rem;
    box-sizing: border-box;
}
.post-card__body { padding: 1rem 1.1rem 1.15rem; }
.post-card__meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--font-family);
    font-size: .73rem;
    color: var(--tertiary-color);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
    margin-bottom: .4rem;
}
.post-card__meta .meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--tertiary-color); }
.post-card__title {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 1.18rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0 0 .45rem;
    color: var(--text-color);
}
.post-card__excerpt {
    margin: 0;
    font-size: .92rem;
    color: var(--secondary-color);
    line-height: 1.55;
}
.blog-empty {
    color: var(--secondary-color);
    font-size: .95rem;
    padding: 2rem 0;
}

/* ============================================================
   Blog — Sidebar widgets
   ============================================================ */
.blog-sidebar-backdrop {
    display: none;
}
.blog-sidebar-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0,0,0,.38);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-self: start;
}

.blog-sidebar__close {
    display: none;
}

@media (max-width: 1439px) {
    .blog-page .blog-sidebar-toggle { display: flex; }
    .blog-page .blog-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: min(22rem, calc(100vw - 1.25rem));
        max-height: 100vh;
        overflow-y: auto;
        z-index: 160;
        margin: 0;
        padding: 3.25rem 1.5rem 1.5rem 1.35rem;
        background: var(--surface-color);
        border: none;
        border-left: 1px solid var(--border-color);
        border-radius: 0;
        box-shadow: var(--shadow-lg);
        transform: translateX(100%);
        transition: transform var(--dur-slow) ease;
        -webkit-overflow-scrolling: touch;
    }
    .blog-page .blog-sidebar.is-open {
        transform: translateX(0);
    }
    .blog-page .blog-sidebar__close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: .85rem;
        right: .85rem;
        width: 2.25rem;
        height: 2.25rem;
        padding: 0;
        border: none;
        border-radius: var(--radius);
        background: transparent;
        color: var(--secondary-color);
        font-size: 1.5rem;
        line-height: 1;
        cursor: pointer;
        transition: color var(--dur), background var(--dur);
    }
    .blog-page .blog-sidebar__close:hover {
        color: var(--text-color);
        background: rgba(0,0,0,.05);
    }
}

@media (min-width: 1440px) {
    .blog-page .blog-sidebar__close {
        display: none;
    }
    .blog-page .blog-sidebar {
        position: sticky;
        top: 5rem;
        padding-right: 1.5rem;
        transform: none;
        width: auto;
        max-height: calc(100vh - 6rem);
        overflow-y: hidden;
        overflow-x: hidden;
        box-shadow: none;
        background: transparent;
        border: none;
        scrollbar-gutter: stable;
    }
    .blog-page .blog-sidebar:hover,
    .blog-page .blog-sidebar:focus-within {
        overflow-y: auto;
    }
    .blog-page .blog-sidebar-backdrop {
        display: none !important;
    }
}

body.blog-sidebar-open {
    overflow: hidden;
}
.widget {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow-sm);
}
.widget__title {
    margin: 0 0 .75rem;
    font-family: var(--font-family);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-color);
}
.tags-cloud { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag-pill {
    font-family: var(--font-family);
    font-size: .72rem;
    padding: .2rem .6rem;
    border-radius: var(--radius-pill);
    background: var(--accent-wash);
    color: var(--accent-link);
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all var(--dur);
    display: inline-block;
}
.tag-pill:hover {
    border-color: var(--accent-link);
    text-decoration: none;
    color: var(--accent-link);
}
.tag-pill.is-active {
    background: var(--text-color);
    color: #fff;
    border-color: var(--text-color);
}

.archive-year { border-bottom: 1px solid var(--border-faint); }
.archive-year:last-child { border-bottom: none; }
.archive-year__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}
.archive-year__toggle:hover { color: var(--accent-link); }
.archive-year__count { color: var(--tertiary-color); font-weight: 500; font-size: .8rem; margin-left: auto; margin-right: .5rem; }
.archive-year__chev { transition: transform var(--dur-slow) ease; color: var(--tertiary-color); font-size: .7rem; }
.archive-year.is-open .archive-year__chev { transform: rotate(180deg); }
.archive-year__months { display: flex; flex-direction: column; gap: .1rem; padding: 0 0 .5rem 0; }
.archive-year__months a.is-active {
    font-weight: 600;
    color: var(--accent-link);
}
.archive-year__months a {
    font-size: .85rem;
    color: var(--secondary-color);
    padding: .25rem .35rem;
    display: flex;
    justify-content: space-between;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}
.archive-year__months a:hover { background: var(--accent-wash); color: var(--accent-link); text-decoration: none; }

.subscribe-body {
    margin: 0 0 .65rem;
    font-size: .88rem;
    color: var(--secondary-color);
    line-height: 1.55;
}
.rss-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: .85rem;
    color: var(--text-color);
    background: var(--surface-2);
    text-decoration: none;
    transition: all var(--dur);
}
.rss-link:hover { border-color: var(--accent-link); color: var(--accent-link); text-decoration: none; }

/* ============================================================
   Blog — Pagination
   ============================================================ */
.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    gap: 1rem;
}

/* ============================================================
   Blog — Single post
   ============================================================ */
.post-full {
    max-width: none;
    width: 100%;
    margin: 0;
}
.post-full__back {
    font-size: .8rem;
    color: var(--secondary-color);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    text-decoration: none;
}
.post-full__back:hover { color: var(--accent-link); text-decoration: none; }
.post-full__title {
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    line-height: 1.15;
    margin: 0 0 .6rem;
    letter-spacing: -0.015em;
}
.post-full__meta {
    font-size: .85rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
}
.post-full__meta .meta-dot { width: 3px; height: 3px; background: var(--tertiary-color); border-radius: 50%; }
.post-full__meta a { color: var(--secondary-color); }
.post-full__meta a:hover { color: var(--accent-link); }
.post-full__edit-link {
    display: inline-block;
    margin-left: .5rem;
    font-size: .8rem;
    color: var(--link-color);
    padding: .2rem .5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    transition: all var(--dur);
}
.post-full__edit-link:hover { background: var(--link-color); color: #fff; border-color: var(--link-color); text-decoration: none; }
.post-full__hero {
    width: 100%;
    max-width: min(100%, calc(100vw - 2rem));
    max-height: min(70vh, 520px);
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    margin: 1.25rem 0 2rem;
    background: var(--surface-2);
    display: block;
}
.post-full__hero--contain { object-fit: contain; padding: 2rem; }
.post-full__body {
    font-family: var(--heading-font);
    font-size: clamp(1rem, 0.35vw + 0.94rem, 1.125rem);
    line-height: 1.72;
    color: var(--text-color);
}
.post-full__body p { margin: 0 0 1rem; }
.post-full__body blockquote {
    margin: 1.25rem 0;
    padding: .2rem 0 .2rem 1.1rem;
    border-left: 2px solid var(--accent-link);
    font-style: italic;
    color: var(--text-color);
    opacity: .85;
    background: transparent;
}
.post-full__body img {
    display: block;
    width: auto;
    max-width: min(100%, calc(100vw - 2rem));
    max-height: 75vh;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    margin: 1rem auto;
}
.post-full__body iframe {
    display: block;
    width: min(100%, calc(100vw - 2rem));
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    margin: 1rem auto;
}
.post-full__body video {
    display: block;
    width: min(100%, calc(100vw - 2rem));
    max-width: 100%;
    height: auto;
    border: 0;
    margin: 1rem auto;
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}
.post-nav__item {
    display: flex;
    gap: .85rem;
    padding: .9rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all var(--dur);
    color: var(--text-color);
    text-decoration: none;
    align-items: center;
}
.post-nav__item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-link);
    text-decoration: none;
    color: var(--text-color);
}
.post-nav__label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--secondary-color);
    font-weight: 600;
}
.post-nav__title {
    font-family: var(--heading-font);
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: .15rem;
}
.post-nav__next { text-align: right; flex-direction: row-reverse; }

/* ============================================================
   Chat card (inline, about + blog)
   ============================================================ */
.chat-card {
    display: flex;
    flex-direction: column;
    margin: 0 0 calc(1.25rem * var(--density));
    max-width: 100%;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
    overflow: hidden;
}
.blog-main .chat-card {
    margin-bottom: calc(1.25rem * var(--density));
}
.chat-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light, #eee);
    font-weight: 600;
    flex-shrink: 0;
}
.chat-card--collapsed .chat-card__header {
    border-bottom: none;
}
.chat-card__title {
    font-size: 0.95rem;
    color: var(--text-color);
    min-width: 0;
}
.chat-card__header-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}
.chat-card__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--secondary-color);
    cursor: pointer;
    transition: background var(--dur), color var(--dur);
}
.chat-card__icon-btn:hover {
    background: var(--link-wash, rgba(37, 99, 235, 0.08));
    color: var(--text-color);
}
.chat-card__icon-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}
.chat-card__collapse .chat-card__chev {
    display: block;
    transition: transform var(--dur-slow) ease;
    transform: rotate(180deg);
}
.chat-card--collapsed .chat-card__collapse .chat-card__chev {
    transform: rotate(0deg);
}
.chat-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.chat-card--collapsed .chat-card__body {
    display: none;
}
.chat-card .chat-log {
    resize: vertical;
    flex: 0 1 auto;
    align-self: stretch;
    width: 100%;
    min-height: 0;
    height: auto;
    max-height: min(60vh, 32rem);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-sizing: border-box;
}
.chat-msg {
    padding: 0.55rem 0.75rem;
    border-radius: 0.8rem;
    max-width: 85%;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.chat-msg.user {
    background: var(--text-color);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 0.2rem;
}
.chat-msg.bot {
    background: var(--bg-color, #f5f5f5);
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 0.2rem;
}
.chat-msg.error {
    color: #b91c1c;
    font-style: italic;
}
.chat-form {
    border-top: 1px solid var(--border-light, #eee);
    padding: 0.5rem;
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}
.chat-form input[type="text"] {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
}
.chat-form input[type="text"]:focus {
    outline: none;
    border-color: var(--text-color);
}
.chat-form button {
    background: var(--text-color);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0 0.9rem;
    cursor: pointer;
    font-weight: 500;
}
.chat-form button:disabled {
    opacity: 0.5;
    cursor: wait;
}
.chat-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ============================================================
   Site Footer
   ============================================================ */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
    padding: 1.5rem 0;
    color: var(--secondary-color);
    font-size: .82rem;
}
.site-footer__inner {
    max-width: 66rem;
    margin: 0 auto;
    padding: 0 1.05rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}
.site-footer__inner p { margin: 0; }
.site-footer a { color: var(--secondary-color); }
.site-footer a:hover { color: var(--text-color); }

/* ============================================================
   Inline SVG icon helper
   ============================================================ */
.ic { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic-lg { width: 18px; height: 18px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
    .timeline-section {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .timeline-wrap { grid-template-columns: 1fr; }
    .year-rail { display: none; }
    .chips { margin-left: 0; }
}
@media (max-width: 720px) {
    .contact { grid-template-columns: 1fr; padding: 1.5rem; }
}
@media (max-width: 600px) {
    .hero {
        grid-template-columns: 1fr;
        gap: .85rem;
        padding-left: 0;
    }
    .hero__avatar { max-width: 7rem; }
    .entry { grid-template-columns: 1fr; }
    .entry__media { width: 5rem; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav__next { text-align: left; flex-direction: row; }
    .blog-lead { padding-left: 0; }
}

/* ============================================================
   Admin Area Styles  (unchanged)
   ============================================================ */
body.admin-dashboard main,
body.admin-editor main,
body.admin-page main {
    max-width: 1200px;
    padding: 0 2rem;
    margin: 0 auto;
}

body.admin-dashboard header,
body.admin-editor header {
    background: #1e293b;
    color: #e2e8f0;
    border-bottom: 1px solid #334155;
}

body.admin-dashboard header h1,
body.admin-editor header h1 { color: #f1f5f9; }

body.admin-dashboard header a,
body.admin-editor header a { color: #94a3b8; transition: color .2s ease; }

body.admin-dashboard header a:hover,
body.admin-editor header a:hover { color: #fff; text-decoration: none; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}
.table-responsive { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    overflow: hidden;
}
th, td { text-align: left; padding: 1rem; border-bottom: 1px solid var(--border-color); }
th { background-color: var(--bg-color); font-weight: 600; color: var(--secondary-color); text-transform: uppercase; font-size: .8rem; letter-spacing: .06em; }
tr:hover { background-color: rgba(0,0,0,.02); }

.status-badge { padding: .25rem .75rem; border-radius: 50px; font-size: .85rem; font-weight: 500; }
.status-published { background-color: #d4edda; color: #155724; }
.status-draft { background-color: #ffeeba; color: #856404; }

.btn { display: inline-block; padding: .5rem 1rem; border-radius: 6px; text-decoration: none; font-weight: 500; cursor: pointer; border: none; transition: background-color .2s ease, transform .1s ease; }
.btn-primary { background-color: var(--text-color); color: white; }
.btn-primary:hover { background-color: #333; text-decoration: none; }
.btn-secondary { background-color: var(--secondary-color); color: white; }
.btn-secondary:hover { background-color: #4b5563; text-decoration: none; }
.btn-sm { padding: .25rem .5rem; font-size: .875rem; border-radius: 3px; text-decoration: none; }
.btn-edit { background-color: #e2e6ea; color: #333; border: 1px solid #ced4da; }
.btn-edit:hover { background-color: #dae0e5; }
.btn-delete { background-color: #dc3545; color: white; border: none; }
.btn-delete:hover { background-color: #c82333; }
.btn-large { padding: .75rem 2rem; font-size: 1.1rem; }

.editor-form { background: var(--surface-color); padding: 2.5rem; border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.form-row { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group .flex-1, .flex-1.form-group { flex: 1; }
.flex-2 { flex: 2; }
.form-group label { display: block; margin-bottom: .5rem; font-weight: 600; color: var(--text-color); }
.form-group input[type="text"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select { width: 100%; padding: .75rem; border: 1px solid var(--border-color); border-radius: 6px; font-family: inherit; font-size: 1rem; transition: border-color .2s ease, box-shadow .2s ease; background: var(--surface-color); }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--text-color); box-shadow: 0 0 0 3px rgba(26,26,26,.08); }
.form-group textarea { min-height: 500px; line-height: 1.6; font-family: 'Courier New', Courier, monospace; }
.checkbox-group { display: flex; align-items: center; padding-top: 2rem; }
.checkbox-group label { font-weight: normal; cursor: pointer; display: flex; align-items: center; gap: .5rem; }
.image-preview { margin-top: 1rem; padding: 1rem; background: var(--bg-color); border-radius: 6px; border: 1px dashed var(--border-color); }
.image-preview img { max-width: 200px; display: block; margin-bottom: .5rem; box-shadow: 0 2px 4px rgba(0,0,0,.1); }
.help-text { font-size: .85rem; color: var(--secondary-color); margin: 0; }
.form-actions { display: flex; gap: 1rem; align-items: center; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border-color); }
.alert { padding: 1rem; margin-bottom: 1.5rem; border-radius: 4px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.editor-container { max-width: 900px !important; margin: 0 auto; padding: 0 1.5rem; }
@media (max-width: 1200px) {
    .editor-container { padding: 0 1.25rem; }
    .editor-grid { grid-template-columns: 1fr; height: auto; overflow: visible; }
    .editor-container-fluid { padding: 0 1rem; }
    .preview-pane { margin-top: 2rem; height: 500px; }
}

/* Admin legacy header overrides */
header:not(.site-header) {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
}
header:not(.site-header) nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    font-size: .9rem;
}
header:not(.site-header) h1 {
    max-width: var(--max-width);
    margin: .5rem auto 0;
    padding: 0 1rem;
    font-size: 1.5rem;
}
header:not(.site-header) h1 a { color: var(--text-color); text-decoration: none; }

/* ============================================================
   Admin top-nav tabs (shared by /admin/*.php)
   ============================================================ */
.admin-header-bar { background: #1e293b; color: #e2e8f0; border-bottom: 1px solid #334155; padding: .25rem 0; margin-bottom: 1.5rem; }
.admin-header-bar .site-header__inner { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; padding: .5rem 1.25rem; max-width: 1200px; margin: 0 auto; }
.admin-header-bar h1 { color: #f1f5f9; font-family: var(--heading-font); font-size: 1.15rem; margin: 0; flex-shrink: 0; }
.admin-tabs { display: flex; align-items: center; gap: .35rem; flex: 1; flex-wrap: wrap; font-size: .9rem; }
.admin-tab-spacer { flex: 1; min-width: 0; }
.admin-tab { color: #cbd5e1; padding: .4rem .75rem; border-radius: 6px; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.admin-tab:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.admin-tab.is-active { background: rgba(255,255,255,.12); color: #fff; }
.admin-tab--util { color: #94a3b8; font-size: .85rem; }
.admin-tab--util:hover { color: #fff; }

/* ============================================================
   Admin dark-mode (system preference) — scoped so public pages stay light
   ============================================================ */
@media (prefers-color-scheme: dark) {
    body.admin-dashboard,
    body.admin-editor,
    body.admin-page {
        --bg-color: #0f0f12;
        --surface-color: #18181b;
        --surface-2: #1f1f23;
        --surface-translucent: rgba(24,24,27,.92);
        --text-color: #ededed;
        --secondary-color: #a1a1aa;
        --tertiary-color: #71717a;
        --accent-color: #ededed;
        --link-color: #60a5fa;
        --link-hover: #93c5fd;
        --link-wash: rgba(96,165,250,.12);
        --border-color: #2e2e33;
        --border-light: #26262b;
        --border-faint: #1f1f23;
        --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
        --shadow-md: 0 4px 12px rgba(0,0,0,.5);
        --shadow-lg: 0 10px 24px rgba(0,0,0,.55);
        --focus-ring: 0 0 0 3px rgba(96,165,250,.25);
        background: var(--bg-color);
        color: var(--text-color);
    }
    body.admin-dashboard table tr:hover,
    body.admin-editor table tr:hover { background-color: rgba(255,255,255,.04); }
    body.admin-dashboard .status-published { background-color: #14532d; color: #d1fae5; }
    body.admin-dashboard .status-draft { background-color: #7c2d12; color: #fed7aa; }
    body.admin-dashboard .alert-success,
    body.admin-editor .alert-success { background: #14532d; color: #d1fae5; border-color: #166534; }
    body.admin-dashboard .alert-error,
    body.admin-editor .alert-error,
    body.admin-page .alert-error { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }
    body.admin-dashboard .btn-edit,
    body.admin-editor .btn-edit { background-color: #2e2e33; color: #ededed; border-color: #3f3f46; }
    body.admin-dashboard .btn-edit:hover,
    body.admin-editor .btn-edit:hover { background-color: #3f3f46; }
    body.admin-dashboard .btn-primary,
    body.admin-editor .btn-primary { background-color: #ededed; color: #18181b; }
    body.admin-dashboard .btn-primary:hover,
    body.admin-editor .btn-primary:hover { background-color: #fff; }
    body.admin-page .login-container { box-shadow: 0 4px 24px rgba(0,0,0,.5); }
}

/* ============================================================
   Admin mobile responsiveness
   ============================================================ */
@media (max-width: 720px) {
    .admin-header-bar { margin-bottom: 1rem; }
    .admin-header-bar .site-header__inner { gap: .5rem; padding: .5rem .75rem; }
    .admin-header-bar h1 { font-size: 1rem; width: 100%; }
    .admin-tabs { width: 100%; gap: .25rem; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .admin-tab { padding: .35rem .6rem; font-size: .85rem; white-space: nowrap; }
    .admin-tab-spacer { display: none; }
    body.admin-dashboard main,
    body.admin-editor main,
    body.admin-page main { padding: 0 1rem; }
    .admin-header { flex-direction: column; align-items: stretch; gap: .75rem; }
    .admin-header h2 { font-size: 1.15rem; }
    th, td { padding: .65rem .5rem; font-size: .9rem; }
    .actions { display: flex; gap: .35rem; flex-wrap: wrap; }
    .form-row { flex-direction: column; gap: 0; }
    .editor-form { padding: 1.25rem; }
    .login-container { margin: 2rem 1rem; padding: 1.5rem; }
}

/* ============================================================
   iAi museum compatibility layer — keeps the archive HTML visually aligned
   with lucaslongo.com blog/about while preserving the iAi identity.
   ============================================================ */
#hero,
section {
    width: 100%;
}
#hero {
    position: relative;
    overflow: hidden;
    padding: clamp(3rem, 7vw, 6rem) 1.05rem clamp(2.5rem, 6vw, 5rem);
    border-bottom: 1px solid var(--border-light);
    background:
        radial-gradient(circle at 12% 20%, rgba(37,99,235,.10), transparent 32rem),
        linear-gradient(180deg, #fff, var(--bg-color));
}
#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .12;
    pointer-events: none;
}
.hero-content,
.section-inner,
footer > div {
    position: relative;
    max-width: 66rem;
    margin: 0 auto;
}
.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(18rem, .98fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
}
.hero-copy { min-width: 0; }
.hero-kicker {
    margin: 0 0 .75rem;
    color: var(--secondary-color);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.hero-logos {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.hero-logo {
    max-height: 4.4rem;
    max-width: min(18rem, 100%);
    object-fit: contain;
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: .65rem .8rem;
    box-shadow: var(--shadow-sm);
}
#hero h1 {
    margin: 0;
    font-family: var(--heading-font);
    font-size: clamp(2.15rem, 5.4vw, 5.1rem);
    line-height: 1;
    letter-spacing: -.04em;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.hero-subtitle,
.hero-slogan {
    margin: .55rem 0 0;
    color: var(--secondary-color);
    font-size: clamp(1rem, 2vw, 1.35rem);
    max-width: 100%;
    overflow-wrap: anywhere;
}
.hero-slogan { color: var(--text-color); font-weight: 700; }
.hero-manifesto {
    max-width: 42rem;
    margin: 1rem 0 0;
    color: var(--secondary-color);
    font-size: 1.05rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.hero-actions,
.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin-top: 1.25rem;
}
.hero-actions a,
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .62rem .95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: var(--surface-color);
    color: var(--text-color);
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}
.hero-actions a:hover,
.cta-button:hover { background: var(--surface-2); text-decoration: none; }
.hero-archive {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}
.archive-plate {
    margin: 0;
    padding: .5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    box-shadow: var(--shadow-md);
}
.archive-plate-large { grid-row: span 2; }
.archive-plate img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 9rem;
    object-fit: cover;
    border-radius: calc(var(--radius-lg) - 5px);
}
.archive-plate figcaption {
    padding: .5rem .15rem 0;
    color: var(--secondary-color);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
section:not(#hero) {
    padding: clamp(2.5rem, 5.5vw, 4.5rem) 1.05rem;
    border-bottom: 1px solid var(--border-faint);
}
.section-title {
    margin: 0 0 1.35rem;
    font-family: var(--heading-font);
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: -.025em;
}
.about-intro,
.pillars,
.stats,
.timeline,
.evolution-grid,
.courses-grid,
.portfolio-grid,
.media-grid {
    display: grid;
    gap: 1rem;
}
.about-intro { grid-template-columns: minmax(16rem, .8fr) minmax(0, 1.2fr); align-items: start; }
.about-photo img,
.lightbox-trigger {
    cursor: zoom-in;
}
.about-photo img,
.pillar,
.stat,
.timeline-item,
.evolution-card,
.course-card,
.portfolio-item,
.media-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
}
.about-photo img { display:block; width:100%; height:auto; padding:.45rem; }
.about-text .lead { font-size: 1.1rem; color: var(--text-color); }
blockquote {
    margin: 1.25rem 0 0;
    padding: 1rem 1.15rem;
    border-left: 3px solid var(--text-color);
    background: var(--surface-2);
    color: var(--secondary-color);
    font-family: var(--heading-font);
}
.pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1.25rem; }
.pillar { padding: 1.15rem; }
.pillar-icon { width: 2.4rem; height: 2.4rem; color: var(--text-color); }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1rem; }
.stat { padding: 1rem; text-align: center; }
.stat-number { display:block; font-family:var(--heading-font); font-size:2rem; line-height:1; }
.stat-label { color:var(--secondary-color); font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; font-weight:700; }

/* iAi media sections */
.section-subtitle {
    margin: -.75rem 0 1.75rem;
    color: var(--secondary-color);
    max-width: 44rem;
}

.espaco-gallery,
.pixelpark-gallery {
    max-width: 66rem;
    margin: 0 auto;
    padding: 0 1.05rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.espaco-item,
.pp-item {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    aspect-ratio: 4 / 3;
}

.espaco-wide,
.pp-wide {
    grid-column: span 2;
}

.espaco-item img,
.pp-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-lg) - 1px);
}

.espaco-item span {
    position: absolute;
    left: .55rem;
    right: .55rem;
    bottom: .55rem;
    display: inline-flex;
    width: fit-content;
    max-width: calc(100% - 1.1rem);
    padding: .32rem .55rem;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,.88);
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.origem-story,
.courses-list {
    max-width: 66rem;
    margin: 0 auto;
}

.origem-block,
.origem-adventure {
    display: grid;
    gap: 1rem;
}

.origem-block {
    grid-template-columns: minmax(14rem, .65fr) minmax(0, 1fr);
    align-items: start;
}

.origem-photo img,
.timeline-img,
.escola-card img,
.portfolio-item img,
.media-card img,
.evolution-card img {
    display: block;
    width: 100%;
    object-fit: cover;
}

.origem-photo img,
.origem-adventure,
.timeline-card,
.escola-card,
.portfolio-item,
.media-card,
.evolution-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
}

.origem-photo img { height: auto; padding: .45rem; }
.origem-adventures { display: grid; gap: .75rem; margin-top: 1rem; }
.origem-adventure { grid-template-columns: 6rem minmax(0, 1fr); padding: 1rem; }
.origem-year,
.timeline-year,
.evo-label,
.media-outlet {
    color: var(--secondary-color);
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

#origem .origem-story {
    display: grid;
    grid-template-columns: minmax(16rem, .78fr) minmax(0, 1.22fr);
    gap: 1.25rem;
    align-items: start;
}

#origem .origem-block {
    position: sticky;
    top: 5.25rem;
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
}

#origem .origem-photo img {
    height: clamp(15rem, 26vw, 21rem);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#origem .origem-text {
    padding: 1.05rem;
}

#origem .origem-text h3 {
    margin: 0 0 .6rem;
    color: var(--text-color);
    font-family: var(--heading-font);
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    letter-spacing: 0;
}

#origem .origem-text p {
    margin: .65rem 0 0;
    color: var(--muted-text);
    font-size: .96rem;
    line-height: 1.65;
}

#origem .origem-adventures {
    position: relative;
    display: grid;
    gap: .75rem;
    margin-top: 0;
    padding-left: 1.35rem;
}

#origem .origem-adventures::before {
    content: '';
    position: absolute;
    top: .9rem;
    bottom: .9rem;
    left: .34rem;
    width: 1px;
    background: var(--border-color);
}

#origem .origem-adventure {
    position: relative;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    border-color: var(--border-light);
}

#origem .origem-adventure::before {
    content: '';
    position: absolute;
    top: 1.25rem;
    left: -1.3rem;
    width: .62rem;
    height: .62rem;
    border: 2px solid var(--secondary-color);
    border-radius: 50%;
    background: var(--background-color);
}

#origem .origem-adventure p {
    margin: 0;
    color: var(--text-color);
    line-height: 1.6;
}

#origem .origem-year {
    padding-top: .12rem;
    color: var(--secondary-color);
    font-variant-numeric: tabular-nums;
}

#origem .origem-adventure:last-child {
    border-color: rgba(37, 99, 235, .24);
    background: linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(255, 255, 255, .92));
}

#origem .origem-founding {
    font-weight: 700;
}

.timeline {
    max-width: 66rem;
    margin: 0 auto;
    grid-template-columns: 1fr;
}
.timeline-line,
.timeline-dot { display: none; }
.timeline-item { min-width: 0; }
.timeline-card { padding: 1rem; }
.timeline-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.timeline-img { max-height: 19rem; border-radius: calc(var(--radius-lg) - 2px); }

.escola-grid,
.media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}

.escola-featured,
.media-featured {
    grid-column: span 2;
}

.escola-card {
    position: relative;
    overflow: hidden;
}

.escola-card img {
    height: 13rem;
}

.escola-featured img {
    height: 27rem;
}

.escola-card-text {
    position: absolute;
    left: .55rem;
    right: .55rem;
    bottom: .55rem;
    padding: .7rem .8rem;
    border-radius: var(--radius);
    background: rgba(255,255,255,.9);
    box-shadow: var(--shadow-sm);
}

.course-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.course-tag,
.filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .42rem .7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: var(--surface-color);
    color: var(--text-color);
    font-size: .78rem;
    font-weight: 700;
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    justify-content: center;
    max-width: 66rem;
    margin: 0 auto 1rem;
}

.portfolio-grid {
    max-width: 66rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}

.portfolio-group {
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
}

.portfolio-group-summary {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: .8rem;
    padding: .8rem 1rem;
    cursor: pointer;
    list-style: none;
}

.portfolio-group-summary::-webkit-details-marker { display: none; }
.portfolio-group-summary::after {
    content: "+";
    width: 1.6rem;
    height: 1.6rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--secondary-color);
    font-weight: 700;
}
.portfolio-group[open] .portfolio-group-summary::after { content: "-"; }

.portfolio-group-preview {
    width: 2.5rem;
    height: 2.5rem;
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    background: var(--surface-2);
}
.portfolio-group-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portfolio-group-title { font-family: var(--heading-font); font-size: 1.35rem; font-weight: 700; }
.portfolio-group-count { color: var(--secondary-color); font-size: .78rem; font-weight: 800; }

.portfolio-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: .75rem;
    padding: 0 1rem 1rem;
}

.portfolio-item {
    overflow: hidden;
}

.portfolio-item img {
    height: 11rem;
    object-fit: contain;
    background: var(--surface-2);
}
.portfolio-item span { display: block; padding: .55rem .7rem; color: var(--text-color); font-weight: 700; font-size: .82rem; }

.evolution-track {
    max-width: 66rem;
    margin: 0 auto;
    display: flex;
    gap: .85rem;
    overflow-x: auto;
    padding-bottom: .75rem;
    scroll-snap-type: x mandatory;
}
.evolution-card {
    flex: 0 0 min(18rem, 78vw);
    overflow: hidden;
    scroll-snap-align: start;
}
.evolution-card img { height: 22rem; object-position: top; }
.evo-label { display:block; padding:.65rem .75rem; }

.media-card {
    overflow: hidden;
}
.media-card img { max-height: 20rem; object-fit: cover; }
.media-card-text,
.media-outlet-logo { padding: 1rem; }
.media-text-only { display: grid; align-content: start; }

footer {
    padding: 2.5rem 1.05rem;
    background: var(--surface-color);
    border-top: 1px solid var(--border-light);
    text-align: center;
}
footer img { max-width: 12rem; margin: 0 auto 1rem; }

@media (max-width: 820px) {
    html, body { overflow-x: hidden; }
    .site-header { overflow: hidden; }
    .site-header__inner {
        align-items: center;
        gap: .75rem;
        overflow: hidden;
    }
    .site-header__brand { flex: 0 0 auto; }
    .site-header__end {
        min-width: 0;
        flex: 1 1 auto;
        overflow: hidden;
    }
    .hero-copy,
    .hero-content,
    .section-inner,
    footer > div,
    .hero-manifesto,
    .hero-subtitle,
    .hero-slogan {
        width: 100%;
        max-width: calc(100vw - 3rem);
        min-width: 0;
    }
    .hero-content,
    .about-intro { grid-template-columns: minmax(0, 1fr); }
    .hero-archive,
    .pillars,
    .stats,
    .espaco-gallery,
    .pixelpark-gallery,
    #origem .origem-story,
    .origem-block,
    .escola-grid,
    .media-grid { grid-template-columns: 1fr; }
    .espaco-wide,
    .pp-wide,
    .escola-featured,
    .media-featured { grid-column: span 1; }
    .timeline-gallery,
    .portfolio-section-grid { grid-template-columns: 1fr; }
    #origem .origem-block { position: static; }
    #origem .origem-adventures { padding-left: 1rem; }
    #origem .origem-adventure { grid-template-columns: 1fr; gap: .45rem; }
    #origem .origem-adventure::before { left: -1rem; }
    .escola-card img,
    .escola-featured img { height: 14rem; }
    #hero {
        padding-top: 2rem;
        overflow-x: hidden;
    }
    #hero h1 {
        font-size: clamp(1.78rem, 8.6vw, 2.7rem);
        letter-spacing: -.03em;
        line-height: 1.04;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
    }
    .hero-manifesto { font-size: 1rem; }
    .hero-actions a,
    .cta-button { padding-inline: .85rem; }
    .top-menu {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .top-menu::-webkit-scrollbar { display: none; }
    .top-menu__link { white-space: nowrap; font-size: .72rem; padding-inline: .5rem; }
    .top-menu__link[href*="docs.google.com"],
    .top-menu__divider:has(+ .top-menu__link[href*="docs.google.com"]) { display: none; }
}

@media (max-width: 420px) {
    .page,
    #hero,
    section:not(#hero) { padding-left: 1rem; padding-right: 1rem; }
    #hero h1 { font-size: clamp(1.72rem, 8.1vw, 2.35rem); }
    .hero-copy,
    .hero-manifesto,
    .hero-subtitle,
    .hero-slogan { max-width: min(100%, 20rem); }
    .hero-logos { gap: .55rem; }
    .hero-logo { max-width: min(10.5rem, 45vw); max-height: 4rem; }
    .hero-actions,
    .cta-buttons { gap: .55rem; }
}
