/* OtoCo Ghost Theme - light default, dark optional */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
    color-scheme: light;
    --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "Geist Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --bg: #ffffff;
    --surface: #f7f7f7;
    --surface-2: #f0f0f0;
    --text: rgba(0, 0, 0, 0.92);
    --muted: rgba(0, 0, 0, 0.62);
    --subtle: rgba(0, 0, 0, 0.42);
    --border: rgba(0, 0, 0, 0.10);
    --accent: #58a6ff;
    --accent-2: #307ad6;
    --danger: rgb(203, 102, 61);
    --content-width: 1120px;
    --narrow-width: 760px;
    --radius: 12px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #000000;
    --surface: #0f0f0f;
    --surface-2: #191919;
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.68);
    --subtle: rgba(255, 255, 255, 0.42);
    --border: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }
html {
    font-size: 62.5%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1.7rem;
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; height: auto; display: block; }

.site-inner {
    width: min(var(--content-width), calc(100vw - 48px));
    margin: 0 auto;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}
.site-inner.narrow { width: min(var(--narrow-width), calc(100vw - 48px)); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}
.site-header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav actions";
    align-items: center;
    min-height: 64px;
    gap: 28px;
}
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.site-nav { grid-area: nav; justify-self: end; }
.site-actions { grid-area: actions; display: inline-flex; align-items: center; gap: 10px; justify-self: end; }
.brand-symbol { width: 30px; height: 30px; flex: 0 0 30px; }
.brand-wordmark { width: 104px; height: 22px; object-fit: contain; filter: invert(1); }
html[data-theme="dark"] .brand-wordmark { filter: none; }
.footer-brand .brand-symbol { width: 30px; height: 30px; flex-basis: 30px; }
.footer-brand .brand-wordmark { width: 104px; height: 22px; }

.site-nav .nav,
.footer-nav .nav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.site-nav a,
.footer-nav a {
    color: var(--muted);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.site-nav a:hover,
.footer-nav a:hover { color: var(--text); }
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}
.nav-toggle-bar {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
}
.site-header.is-nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-header.is-nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header.is-nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.search-button,
.theme-toggle,
.button-primary {
    border: 1px solid var(--border);
    background: var(--text);
    color: var(--bg);
    border-radius: 999px;
    font-family: var(--font-sans);
    font-weight: 700;
    cursor: pointer;
}
.search-button { padding: 10px 16px; font-size: 1.3rem; }
.theme-toggle {
    width: 44px;
    height: 28px;
    padding: 3px;
    background: var(--surface-2);
    color: var(--text);
}
.theme-toggle-dot {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text);
    transform: translateX(0);
    transition: transform .2s ease;
}
html[data-theme="dark"] .theme-toggle-dot { transform: translateX(16px); }
.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 22px;
    font-size: 1.5rem;
    margin-top: 28px;
    max-width: 100%;
    text-align: center;
}

.publication-hero {
    position: relative;
    overflow: hidden;
    min-height: 540px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: #000;
    color: #fff;
}
.publication-hero.has-cover-image {
    min-height: auto;
    padding: 32px 0;
    background: var(--bg);
    color: var(--text);
}
html[data-theme="dark"] .publication-hero.has-cover-image {
    background:
        radial-gradient(circle at 72% 44%, rgba(26, 160, 202, 0.10), transparent 42%),
        var(--bg);
}
.publication-cover-card {
    display: block;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    aspect-ratio: 1200 / 400;
    max-height: 300px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.08);
}
html[data-theme="dark"] .publication-cover-card {
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
}
.publication-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.publication-hero:not(.has-cover-image)::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,.38), rgba(0,0,0,.08));
    z-index: 1;
    pointer-events: none;
}
.publication-hero-inner { position: relative; z-index: 2; }
.publication-copy { max-width: 760px; }
.eyebrow,
.post-card-tag {
    display: inline-block;
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.publication-copy h1 {
    margin: 18px 0 0;
    font-size: clamp(4.2rem, 8vw, 9.6rem);
    line-height: .96;
    letter-spacing: -.065em;
    font-weight: 820;
}
.publication-copy p {
    margin: 24px 0 0;
    color: currentColor;
    opacity: .74;
    font-size: clamp(1.9rem, 2.4vw, 2.8rem);
    line-height: 1.35;
    max-width: 860px;
}

.site-main { min-height: 60vh; }
.post-section { padding: 72px 0; }
.post-section + .post-section { border-top: 1px solid var(--border); }
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 36px;
}
.section-heading h2,
.read-next h2 {
    margin: 0;
    font-size: 2.4rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}
.section-heading a { color: var(--muted); font-size: 1.4rem; font-weight: 700; }
.post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 40px; }
.post-grid.compact { grid-template-columns: repeat(2, 1fr); gap: 42px 40px; }
.post-card { min-width: 0; word-break: break-word; overflow-wrap: anywhere; }
.post-card.large { grid-column: 1 / -1; padding-bottom: 48px; border-bottom: 1px solid var(--border); }
.post-card-link { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.post-card.large .post-card-link { grid-template-columns: minmax(420px, 614px) 1fr; gap: 40px; }
.post-grid.compact .post-card-link {
    grid-template-columns: 1fr;
    gap: 18px;
}
.post-grid.compact .post-card-image::before { padding-bottom: 60%; }
.post-card-image {
    position: relative;
    overflow: hidden;
    margin: 0;
    border-radius: 0;
    background: var(--surface);
}
.post-card-image::before { display: block; content: ""; padding-bottom: 60%; }
.post-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.post-card-title {
    margin: 8px 0 0;
    color: var(--text);
    font-size: 2.2rem;
    line-height: 1.15;
    letter-spacing: -0.035em;
    font-weight: 800;
}
.post-card.large .post-card-title { font-size: clamp(2.8rem, 4vw, 4.2rem); }
.post-grid.compact .post-card-title { font-size: clamp(2.3rem, 2.8vw, 3rem); }
.post-card-excerpt {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1.6rem;
    line-height: 1.55;
}
.post-card-meta,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    color: var(--subtle);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.post-card-meta > * + *::before,
.article-meta > * + *::before { content: "•"; margin-right: 8px; }

.archive-header { padding: 56px 0 20px; }
.archive-header .eyebrow {
    font-size: 1.1rem;
    letter-spacing: .12em;
}
.archive-header h1 {
    margin: 12px 0 0;
    font-size: clamp(2.8rem, 4.5vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -.04em;
    font-weight: 800;
}
.archive-header p {
    margin: 14px 0 0;
    max-width: 640px;
    color: var(--muted);
    font-size: 1.6rem;
    line-height: 1.55;
    opacity: 1;
}
.pagination {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 64px;
    color: var(--muted);
    font-weight: 700;
}
.pagination a { color: var(--text); }

.article-header { padding: 72px 0 32px; }
.article-header h1 {
    margin: 14px 0 0;
    font-size: clamp(2.8rem, 4vw, 4.4rem);
    line-height: 1.08;
    letter-spacing: -.03em;
    font-weight: 800;
}
.article-excerpt {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: clamp(1.7rem, 2vw, 2rem);
    line-height: 1.45;
    max-width: 680px;
}
.article-image {
    width: min(614px, calc(100vw - 48px));
    margin-bottom: 52px;
}
.article-image img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    background: var(--surface);
}
.article-content {
    color: var(--text);
    font-size: 1.8rem;
    line-height: 1.7;
}
.gh-content > * { margin-top: 0; margin-bottom: 2.4rem; }
.gh-content h2,
.gh-content h3,
.gh-content h4 {
    margin-top: 4rem;
    margin-bottom: 1.4rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 800;
}
.gh-content h2 { font-size: 2.6rem; }
.gh-content h3 { font-size: 2.1rem; }
.gh-content h4 { font-size: 1.8rem; }
.gh-content p { margin-bottom: 2.2rem; }
.gh-content a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.gh-content blockquote {
    margin: 3.2rem 0;
    padding: 0 0 0 2.2rem;
    border-left: 3px solid var(--accent);
    color: var(--muted);
    font-size: 1.9rem;
    line-height: 1.5;
}
.gh-content ul,
.gh-content ol { padding-left: 2.4rem; }
.gh-content li + li { margin-top: .8rem; }
.gh-content hr { border: 0; border-top: 1px solid var(--border); margin: 4.8rem 0; }
.gh-content img {
    max-width: 100%;
    height: auto;
}
.read-next { padding: 80px 0; border-top: 1px solid var(--border); }
.read-next h2 { margin-bottom: 32px; }

.home-cta {
    padding: 84px 0;
    border-top: 1px solid var(--border);
}
.home-cta-card {
    position: relative;
    overflow: hidden;
    padding: clamp(36px, 6vw, 72px);
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at 86% 18%, rgba(88, 166, 255, 0.16), transparent 34%),
        linear-gradient(135deg, var(--surface), var(--bg));
}
.home-cta-card h2 {
    max-width: 820px;
    margin: 18px 0 0;
    font-size: clamp(3.4rem, 6vw, 7.2rem);
    line-height: .98;
    letter-spacing: -.06em;
    font-weight: 820;
}
.home-cta-card p:not(.eyebrow) {
    max-width: 680px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: clamp(1.8rem, 2.2vw, 2.4rem);
    line-height: 1.35;
}

.site-footer { border-top: 1px solid var(--border); padding: 48px 0 calc(40px + env(safe-area-inset-bottom, 0)); }
.site-footer-inner { display: grid; gap: 28px; }
.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px 32px;
}
.footer-nav .nav { flex-wrap: wrap; gap: 12px 24px; }
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.copyright { margin: 0; color: var(--subtle); font-size: 1.3rem; }
.footer-cta {
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 700;
}
.footer-cta:hover { color: var(--accent-2); }

/* Homepage and archive investor isolation: investor posts remain available under /tag/investor/. */
.home-template .post-card.tag-investor,
.archive-main .post-card.tag-investor { display: none !important; }

@media (max-width: 991px) {
    .site-header-inner {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand actions"
            "nav nav";
        gap: 0 16px;
        align-items: center;
    }
    .brand { grid-area: brand; }
    .site-actions { grid-area: actions; }
    .site-nav {
        grid-area: nav;
        justify-self: stretch;
        width: 100%;
    }
    .post-grid,
    .post-grid.compact { grid-template-columns: 1fr; gap: 32px; }
    .post-card.large { grid-column: auto; padding-bottom: 32px; }
    .post-card-link,
    .post-card.large .post-card-link { grid-template-columns: 1fr; gap: 16px; }
    .post-card-image::before { padding-bottom: 60%; }
    .publication-hero { min-height: 420px; }
    .publication-hero.has-cover-image { padding: 28px 0; }
    .archive-header { padding-top: 40px; }
    .article-header { padding-top: 56px; }
    .read-next { padding: 56px 0; }
    .home-cta { padding: 56px 0; }
}

@media (max-width: 767px) {
    .site-header-inner {
        min-height: 60px;
        gap: 0 12px;
    }
    .publication-hero.has-cover-image { padding: 20px 0 28px; }
    .publication-cover-card { max-height: 200px; aspect-ratio: 3 / 2; }
    .footer-top { gap: 18px; }
    .footer-bottom { padding-top: 20px; gap: 10px; }
    .site-nav {
        display: none;
        padding: 16px 0 8px;
        border-top: 1px solid var(--border);
        margin-top: 12px;
    }
    .site-header.is-nav-open .site-nav { display: block; }
    .site-nav .nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        overflow: visible;
        width: 100%;
    }
    .site-nav a {
        display: block;
        width: 100%;
        padding: 4px 0;
        font-size: 1.5rem;
    }
    .nav-toggle { display: inline-flex; }
    .search-button { display: none; }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 28px;
    }
    .section-heading h2,
    .read-next h2 { font-size: 2rem; }
    .section-heading a { font-size: 1.3rem; }

    .publication-copy h1 {
        font-size: clamp(3.2rem, 11vw, 5.6rem);
        line-height: 1;
        letter-spacing: -.05em;
    }
    .publication-copy p {
        font-size: clamp(1.6rem, 4.5vw, 2rem);
        margin-top: 18px;
    }
    .article-header h1 {
        font-size: clamp(2.4rem, 6.5vw, 3.2rem);
        line-height: 1.1;
        letter-spacing: -.02em;
    }
    .article-excerpt {
        font-size: 1.6rem;
        margin-top: 14px;
    }
    .archive-header h1 {
        font-size: clamp(2.4rem, 7vw, 3.2rem);
        letter-spacing: -.035em;
    }
    .archive-header p {
        font-size: 1.5rem;
        line-height: 1.5;
        margin-top: 12px;
    }
    .publication-hero { min-height: auto; padding: 48px 0; }
    .publication-hero.has-cover-image { padding: 28px 0 36px; }
    .publication-cover-card { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06); }

    .post-section { padding: 44px 0; }
    .post-card.large { padding-bottom: 28px; }
    .post-card-title { font-size: 2rem; }
    .post-card.large .post-card-title { font-size: clamp(2.4rem, 7vw, 3.2rem); }
    .post-grid.compact .post-card-title { font-size: clamp(2rem, 5.5vw, 2.6rem); }
    .post-card-excerpt { font-size: 1.5rem; }
    .post-card-meta,
    .article-meta { font-size: 1.1rem; gap: 6px; }

    .archive-header { padding: 36px 0 10px; }
    .article-header { padding: 48px 0 28px; }
    .article-image {
        width: 100%;
        margin-bottom: 36px;
    }
    .article-image img { max-height: none; }
    .article-content { font-size: 1.7rem; line-height: 1.65; }
    .gh-content h2 { font-size: 2.2rem; margin-top: 3.4rem; }
    .gh-content h3 { font-size: 1.9rem; margin-top: 2.8rem; }
    .gh-content h4 { font-size: 1.7rem; }
    .gh-content blockquote {
        font-size: 1.8rem;
        margin: 2.8rem 0;
        padding-left: 1.6rem;
    }
    .gh-content ul,
    .gh-content ol { padding-left: 1.8rem; }
    .gh-content > * { margin-bottom: 2.2rem; }
    .gh-content .kg-width-wide,
    .gh-content .kg-width-full {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        transform: none;
    }

    .home-cta-card { padding: 28px 24px; }
    .home-cta-card h2 {
        font-size: clamp(2.6rem, 8vw, 4.2rem);
        letter-spacing: -.05em;
    }
    .home-cta-card p:not(.eyebrow) {
        font-size: clamp(1.6rem, 4vw, 1.9rem);
        margin-top: 16px;
    }
    .home-cta-card .button-primary,
    .publication-copy .button-primary {
        width: 100%;
        margin-top: 22px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 40px;
        font-size: 1.4rem;
    }
    .read-next { padding: 44px 0; }
    .site-footer { padding: 40px 0 calc(40px + env(safe-area-inset-bottom, 0)); }
}

@media (max-width: 480px) {
    html { font-size: 58%; }
    .site-inner,
    .site-inner.narrow { width: min(var(--content-width), calc(100vw - 24px)); }
    .site-header-inner { min-height: 56px; }
    .brand { gap: 7px; }
    .brand-symbol { width: 26px; height: 26px; flex-basis: 26px; }
    .brand-wordmark { width: 92px; height: 20px; }
    .theme-toggle { width: 40px; height: 26px; }
    .theme-toggle-dot { width: 18px; height: 18px; }
    html[data-theme="dark"] .theme-toggle-dot { transform: translateX(14px); }
    .nav-toggle { width: 40px; height: 40px; }
    .eyebrow,
    .post-card-tag { font-size: 1.1rem; letter-spacing: .12em; }
    .post-grid,
    .post-grid.compact { gap: 28px; }
    .home-cta-card { padding: 24px 18px; }
    .copyright { font-size: 1.2rem; line-height: 1.5; }
}

/* Ghost editor width classes */
.gh-content .kg-width-wide {
    width: min(var(--content-width), calc(100vw - 48px));
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}
.gh-content .kg-width-full {
    width: min(var(--content-width), calc(100vw - 48px));
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}
.gh-content .kg-width-wide img,
.gh-content .kg-width-full img {
    width: 100%;
}

/* Ghost custom font hooks: keep OtoCo sans as the baseline while respecting Admin selections. */
.gh-font-heading,
.gh-font-heading * {
    font-family: var(--gh-font-heading, var(--font-sans));
}
.gh-font-body,
.gh-font-body * {
    font-family: var(--gh-font-body, var(--font-sans));
}
.has-serif-title :is(h1,h2,h3,h4,h5,h6,.post-card-title) {
    font-family: var(--gh-font-heading, var(--font-sans));
}
.has-serif-body :is(body,.gh-content,.post-card-excerpt) {
    font-family: var(--gh-font-body, var(--font-sans));
}
