/* --- Minimal garden: OpenAI research-blog vibe --- */
:root {
    color-scheme: dark;
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-muted: #8e8e8e;
    --text-body: #ffffff;
    --border-color: rgba(255, 255, 255, 0.08);
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 44rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-stack);
    line-height: 1.65;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100dvh;
}

.starfield {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100svh;
    pointer-events: none;
    z-index: 0;
}

/* --- Layout --- */
.site-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    height: 3.5rem;
    padding: 0 12px;
    background-color: transparent;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px 5rem;
    width: 100%;
}

@media (min-width: 640px) {
    .container {
        padding-left: 32px;
        padding-right: 32px;
    }
}

.site-header {
    padding: 2rem 0 2.5rem;
}

@media (min-width: 640px) {
    .site-header {
        padding-top: 3rem;
        padding-bottom: 3.5rem;
    }
}

.brand {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.brand:hover {
    color: var(--text-muted);
    text-decoration: none;
}

/* --- Navigation --- */
.menu-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: -4px;
}

.menu-icon {
    display: block;
    width: 20px;
    height: 12px;
    background: linear-gradient(
        to bottom,
        var(--text-primary) 0,
        var(--text-primary) 2px,
        transparent 2px,
        transparent 5px,
        var(--text-primary) 5px,
        var(--text-primary) 7px,
        transparent 7px,
        transparent 10px,
        var(--text-primary) 10px,
        var(--text-primary) 12px
    );
}

/* --- Page fade (menu nav + first paint) --- */
.page-veil {
    position: fixed;
    inset: 0;
    background-color: var(--bg-color);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.33, 1, 0.68, 1);
}

.page-veil.is-visible {
    opacity: 1;
    pointer-events: auto;
}

html.nav-transition .page-veil {
    opacity: 1;
    transition: none;
}

html.is-loading .site-shell {
    opacity: 0;
}

.site-shell {
    transition: opacity 0.35s cubic-bezier(0.33, 1, 0.68, 1);
}

.site-shell.is-visible {
    opacity: 1;
}

body.menu-open {
    overflow: hidden;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    visibility: hidden;
    pointer-events: none;
    z-index: 160;
    display: flex;
    align-items: center;
    padding-left: 10%;
}

.menu-overlay.active {
    visibility: visible;
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .page-veil,
    .site-shell {
        transition-duration: 0.01ms;
    }
}

.menu-close {
    position: absolute;
    top: 40px;
    right: 40px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
}

.menu-close:hover {
    color: var(--text-muted);
}

.menu-links {
    list-style: none;
}

.menu-links li {
    margin: 24px 0;
}

.menu-links a {
    color: var(--text-muted);
    font-size: 1.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.menu-links a:hover,
.menu-links a.active {
    color: var(--text-primary);
}

/* --- Typography --- */
.page-title {
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 12px;
}

@media (min-width: 640px) {
    .page-title {
        font-size: 2.25rem;
    }
}

.page-intro {
    margin-bottom: 3rem;
    color: var(--text-muted);
}

.intro-block {
    padding-bottom: 1rem;
}

@media (min-width: 640px) {
    .intro-block {
        padding-bottom: 4rem;
    }
}

.intro-line {
    color: var(--text-body);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.intro-line:last-child {
    margin-bottom: 0;
}

.prose p {
    color: var(--text-body);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.prose p strong {
    color: var(--text-primary);
}

a {
    color: var(--text-primary);
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

/* --- Sections & lists (no borders) --- */
section {
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
    padding-top: 1rem;
    padding-bottom: 0rem;
}

@media (min-width: 640px) {
    .section-title {
        padding-top: 1.5rem;
        padding-bottom: 0rem;
    }
}

.year-section:first-child .section-title {
    padding-top: 0;
}

.year-section .section-title {
    font-size: 1.5rem;
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    font-weight: 600;
}

.entry-list {
    list-style: none;
}

/* --- List entries (ideas, library, home) --- */
.item-row {
    display: block;
    text-decoration: none;
    padding: 0.75rem 0;
    transition: color 0.2s ease;
}

@media (min-width: 640px) {
    .item-row {
        padding: 0.625rem 0;
    }
}

.item-row:hover {
    text-decoration: none;
}

.item-row:hover .item-title {
    text-decoration-color: var(--border-color);
}

.item-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    transition: text-decoration-color 0.2s ease;
}

.item-meta {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.external-arrow::after {
    content: " ↗";
    font-size: 0.85rem;
    color: var(--text-muted);
}

.empty-note {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.empty-note code {
    font-size: 0.9em;
}

/* --- Article pages --- */
.writing-back {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 2rem;
}

.writing-back:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.writing-title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
    .writing-title {
        font-size: 2.5rem;
    }
}

.writing-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    letter-spacing: 0.01em;
}

.writing-body h2 {
    font-size: 1.2rem;
    margin: 2.5rem 0 1rem;
}

.writing-body h3 {
    font-size: 1.05rem;
    margin: 2rem 0 0.75rem;
}

.writing-body p {
    color: var(--text-body);
    margin-bottom: 1.25rem;
}

.writing-body ul {
    margin: 0 0 1.5rem 1.25rem;
    color: var(--text-body);
}

.writing-body li {
    margin-bottom: 0.5rem;
}

.writing-body blockquote {
    border-left: 2px solid var(--border-color);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: var(--text-body);
}

.writing-body blockquote p {
    margin-bottom: 0;
}

.writing-body a {
    text-decoration: underline;
}

.writing-body code {
    font-size: 0.9em;
    color: var(--text-muted);
}

.writing-figure {
    margin: 2rem 0;
}

.writing-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.writing-figure figcaption {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.writing-figure-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 2rem auto;
    max-width: 34rem;
}

.writing-figure-pair .writing-figure {
    margin: 0;
}

@media (max-width: 540px) {
    .writing-figure-pair {
        grid-template-columns: 1fr;
        max-width: none;
    }
}

.writing-embed {
    margin: 2rem 0;
}

.writing-embed-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 4px;
    background: #000;
}

.writing-embed-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.writing-embed figcaption {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.writing-embed--article .writing-embed-article {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem 1.35rem 1rem;
    background: rgba(255, 255, 255, 0.02);
}

.writing-embed-article-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

.writing-embed-article-title {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin-bottom: 0.85rem;
}

.writing-embed-article-preview {
    position: relative;
    max-height: 14rem;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.writing-embed-article-preview::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 4.5rem;
    background: linear-gradient(to bottom, transparent, var(--bg-color));
    pointer-events: none;
}

.writing-embed-article-preview p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-body);
    margin-bottom: 0.85rem;
}

.writing-embed-article-preview p:last-child {
    margin-bottom: 0;
}

.writing-embed-article-link {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Writing dashboards --- */
.writing-dashboard-mount {
    margin: 2rem 0 2.5rem;
}

.writing-dashboard {
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem 1.15rem 1.35rem;
    background: rgba(255, 255, 255, 0.02);
}

.dash-header {
    margin-bottom: 1.25rem;
}

.dash-period {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.dash-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.dash-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
    margin-bottom: 1.35rem;
}

@media (min-width: 480px) {
    .dash-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.dash-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dash-kpi-value {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.dash-kpi-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dash-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
}

.dash-toggle-group {
    display: flex;
    gap: 0.35rem;
}

.dash-toggle {
    appearance: none;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.dash-toggle:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.18);
}

.dash-toggle--active {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
}

.dash-forecast-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.dash-forecast-toggle input {
    accent-color: #fff;
    width: 0.9rem;
    height: 0.9rem;
    cursor: pointer;
}

.dash-tooltip {
    min-height: 3.25rem;
    margin-bottom: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.dash-tooltip--idle .dash-tooltip-label {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.dash-tooltip-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dash-tooltip-value {
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.dash-tooltip-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-chart-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 0.75rem;
}

.dash-chart {
    display: block;
    width: 100%;
    height: auto;
}

.dash-chart-overlay {
    position: absolute;
    inset: 0;
    cursor: crosshair;
}

.dash-chart-grid {
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 1;
}

.dash-chart-axis {
    fill: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-stack);
}

.dash-chart-axis--x {
    font-size: 9px;
}

.dash-chart-area {
    fill: rgba(255, 255, 255, 0.06);
}

.dash-chart-line {
    stroke: #fff;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.dash-chart-line--forecast {
    stroke: var(--text-muted);
    stroke-width: 1.5;
    opacity: 0.85;
}

.dash-chart-dot {
    fill: #fff;
    stroke: #000;
    stroke-width: 1.5;
    pointer-events: none;
}

.dash-chart-dot--forecast {
    fill: var(--text-muted);
}

.dash-chart-dot--active {
    fill: #fff;
    stroke: #fff;
    stroke-width: 2;
}

.dash-chart-hover-line {
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    pointer-events: none;
}

.dash-forecast-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.dash-mix {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.dash-mix-title {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.dash-mix-row {
    display: grid;
    grid-template-columns: 3.5rem 1fr 2.5rem;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
}

.dash-mix-row--other {
    grid-template-columns: minmax(4.5rem, auto) 1fr 2.5rem;
}

.dash-mix-group {
    margin-bottom: 0.15rem;
}

.dash-mix-disclosure {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
    text-align: left;
}

.dash-mix-disclosure:hover,
.dash-mix-disclosure[aria-expanded="true"] {
    color: var(--text-primary);
}

.dash-mix-chevron {
    display: block;
    width: 0.35rem;
    height: 0.35rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.dash-mix-disclosure[aria-expanded="true"] .dash-mix-chevron {
    transform: rotate(45deg);
}

.dash-mix-disclosure-text {
    white-space: nowrap;
}

.dash-mix-children {
    padding-left: 0.85rem;
    margin-bottom: 0.35rem;
    border-left: 1px solid var(--border-color);
}

.dash-mix-row--child {
    grid-template-columns: 5.75rem 1fr 2.5rem;
    font-size: 0.72rem;
    margin-bottom: 0.35rem;
}

.dash-mix-row--child .dash-mix-fill {
    background: rgba(255, 255, 255, 0.35);
}

.dash-mix-label {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.dash-mix-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.dash-mix-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.dash-mix-pct {
    text-align: right;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.dash-error {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Ideas page (scroll-reveal side nav + carousel + list) --- */
.ideas-page .page-intro {
    margin-bottom: 2.5rem;
}

.ideas-list-zone {
    position: relative;
}

.ideas-side-nav {
    list-style: none;
}

.ideas-side-nav-list {
    list-style: none;
}

.ideas-side-nav-item--all {
    margin-bottom: 0.85rem;
}

.ideas-side-nav-link {
    display: block;
    padding: 0.35rem 0;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 400;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.ideas-side-nav-link:hover {
    color: var(--text-primary);
}

.ideas-side-nav-link.is-active {
    color: var(--text-primary);
    font-weight: 600;
}

@media (min-width: 900px) {
    .ideas-side-nav {
        position: fixed;
        z-index: 5;
        width: 13.75rem;
        left: max(1rem, calc(50% - 44rem + 3rem));
        top: 50vh;
        transform: translateY(-50%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.45s ease, visibility 0.45s ease;
    }

    .ideas-side-nav.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

@media (max-width: 899px) {
    .ideas-side-nav {
        margin-bottom: 1.5rem;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transition: opacity 0.35s ease, max-height 0.35s ease;
    }

    .ideas-side-nav.is-visible {
        opacity: 1;
        max-height: 20rem;
    }

    .ideas-side-nav-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem 1.25rem;
    }

    .ideas-side-nav-item--all {
        flex: 0 0 100%;
        margin-bottom: 0.5rem;
    }

    .ideas-side-nav-link {
        padding: 0.2rem 0;
        font-size: 0.8125rem;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ideas-side-nav {
        transition: none;
    }
}

.ideas-featured {
    margin-bottom: 2.5rem;
}

.ideas-carousel-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.ideas-carousel-card.is-changing {
    animation: ideas-fade 2.0s ease;
}

@keyframes ideas-fade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.ideas-carousel-excerpt {
    padding: 1.25rem 1.25rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.65;
}

@media (min-width: 640px) {
    .ideas-carousel-excerpt {
        padding: 1.5rem 1.5rem 1.25rem;
    }
}

.ideas-carousel-footer {
    border-top: 1px solid var(--border-color);
    padding: 0.3rem 1.25rem 0.3rem;
}

@media (min-width: 640px) {
    .ideas-carousel-footer {
        padding: 0.3rem 1.5rem 0.3rem;
    }
}

.ideas-carousel-footer-meta {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.ideas-carousel-title {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--border-color);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.ideas-carousel-title:hover {
    color: var(--text-muted);
    text-decoration-color: var(--text-primary);
}

.ideas-carousel-section {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.4;
}

.ideas-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
}

.ideas-carousel-dot {
    width: 6px;
    height: 6px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.ideas-carousel-dot.is-active {
    width: 7px;
    height: 7px;
    background-color: var(--text-muted);
}

.ideas-carousel-dot:focus-visible {
    outline: 2px solid var(--text-muted);
    outline-offset: 2px;
}

.ideas-all-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
}

.ideas-all-group {
    margin-bottom: 0.25rem;
}

.ideas-all-group .section-title {
    padding-top: 0.5rem;
}

.ideas-all-list {
    list-style: none;
}

.ideas-all-link {
    display: block;
    padding: 0.65rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--border-color);
    text-underline-offset: 4px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.ideas-all-link:hover {
    color: var(--text-muted);
    text-decoration-color: var(--text-primary);
}

.ideas-all-link--plain {
    text-decoration: none;
    color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .ideas-carousel-card.is-changing {
        animation: none;
    }
}

/* --- Connect footer --- */
.site-connect {
    margin-top: 4rem;
}

@media (min-width: 640px) {
    .site-connect {
        margin-top: 5rem;
    }
}

.site-connect .section-title {
    padding-top: 0;
}

.connect-text {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-primary);
}

.connect-link {
    color: inherit;
    text-decoration: none;
}

.connect-link:hover {
    color: var(--text-muted);
    text-decoration: none;
}

.connect-link strong {
    font-weight: 600;
}

/* --- Places --- */
.places-country-container {
    max-width: 52rem;
}

.places-world-map {
    width: 100%;
    aspect-ratio: 2.25 / 1;
    margin: 0 0 1.75rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #000000;
}

#places-world-map.leaflet-container {
    background: #000000 !important;
}

.places-world-map .places-map-marker {
    cursor: pointer;
}

.places-index-excerpt {
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 38rem;
}

.places-index-group {
    margin-bottom: 2rem;
}

.places-country-meta {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 0.75rem;
}

.places-country-summary {
    color: var(--text-body);
    margin-bottom: 1.5rem;
    max-width: 40rem;
}

.places-map {
    width: 100%;
    height: min(420px, 58vh);
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #0a0a0a;
    z-index: 1;
}

.places-map.places-map-poster {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #7a1f2b;
    border-color: rgba(0, 0, 0, 0.45);
    padding: 2.5rem 1.5rem;
}

.places-poster-inner {
    text-align: center;
    color: #f4efe6;
    max-width: 20rem;
}

.places-poster-crown {
    font-size: 2.75rem;
    line-height: 1;
    margin-bottom: 1.25rem;
    opacity: 0.92;
}

.places-poster-line {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.2;
    margin: 0;
    text-transform: uppercase;
}

.places-poster-line-main {
    font-size: clamp(1.6rem, 5vw, 2.15rem);
    margin-bottom: 0.4rem;
}

.places-poster-line:not(.places-poster-line-main) {
    font-size: clamp(1.05rem, 3.5vw, 1.4rem);
}

.places-poster-sub {
    margin: 1.25rem 0 0;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.75;
}

.places-map-marker {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(0, 0, 0, 0.65);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}

.places-map-tooltip {
    background: rgba(0, 0, 0, 0.92);
    color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.82rem;
    box-shadow: none;
}

.places-cities {
    margin-bottom: 2rem;
}

.places-cities-list {
    list-style: none;
    display: grid;
    gap: 0.35rem;
}

@media (min-width: 640px) {
    .places-cities-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1.5rem;
    }
}

.places-city-name {
    color: var(--text-primary);
    font-weight: 500;
}

.places-country-body {
    margin-top: 0.5rem;
}

.places-photo-carousel {
    margin: 1.5rem auto 2rem;
    max-width: 34rem;
}

.places-photo-carousel-card {
    transition: opacity 0.35s ease;
}

.places-photo-carousel-card.is-changing {
    animation: places-photo-fade 0.45s ease;
}

@keyframes places-photo-fade {
    from { opacity: 0.35; }
    to { opacity: 1; }
}

.places-photo-carousel-figure {
    margin: 0;
}

.places-photo-carousel-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.places-photo-carousel-caption {
    margin-top: 0.75rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
}

.places-photo-carousel-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1rem;
}

.places-photo-carousel-dot {
    width: 0.45rem;
    height: 0.45rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
}

.places-photo-carousel-dot.is-active {
    background: var(--text-primary);
    transform: scale(1.2);
}

.places-photo-carousel-dot:focus-visible {
    outline: 2px solid var(--text-muted);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .places-photo-carousel-card.is-changing {
        animation: none;
    }
}

.places-country-body .writing-figure,
.places-country-body .writing-figure-pair {
    max-width: 34rem;
    margin-left: auto;
    margin-right: auto;
}

.places-related {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.places-timeline {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.places-timeline-heading {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.places-timeline-list {
    list-style: none;
    display: grid;
    gap: 0.85rem;
}

.places-timeline-item {
    display: grid;
    grid-template-columns: 3.5rem 1fr;
    gap: 0.75rem 1rem;
    align-items: start;
}

@media (min-width: 640px) {
    .places-timeline-item {
        grid-template-columns: 4.5rem 1fr auto;
    }
}

.places-timeline-date {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}

.places-timeline-text {
    color: var(--text-body);
    font-size: 0.95rem;
}

.places-timeline-country {
    font-size: 0.88rem;
}

.places-timeline-country a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.places-timeline-country a:hover {
    color: var(--text-primary);
}

.leaflet-container {
    background: #0a0a0a;
    font-family: var(--font-stack);
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.72) !important;
    color: var(--text-muted) !important;
    font-size: 0.68rem !important;
}

.leaflet-control-attribution a {
    color: var(--text-muted) !important;
}
