/* =========================================================
   Nestor theme — design tokens
   ========================================================= */
:root {
    --color-bg: #ffffff;
    --color-surface: #f8fafc;
    --color-surface-2: #f1f5f9;
    --color-ink: #0b1220;
    --color-ink-2: #1e293b;
    --color-muted: #64748b;
    --color-border: #e2e8f0;
    --color-accent: #2e7cf6;
    --color-accent-dark: #1d5bcc;
    --color-accent-soft: #e8f0ff;
    --color-success: #10b981;
    --color-warn: #f59e0b;
    --color-danger: #ef4444;
    --color-dark: #0b1220;
    --color-dark-2: #111a2e;

    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 4px 16px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, .12);

    --container: 1200px;
    --container-narrow: 760px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --ease: cubic-bezier(.2, .8, .2, 1);
}

/* =========================================================
   Base reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-ink);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--color-accent-dark); }
h1, h2, h3, h4 { color: var(--color-ink); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
.screen-reader-text, .sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: -9999px;
    background: var(--color-ink); color: #fff; padding: .5em 1em;
    z-index: 9999;
}
.skip-link:focus { left: 1em; top: 1em; }

/* =========================================================
   Layout helpers
   ========================================================= */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.container.narrow { max-width: var(--container-narrow); }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-accent);
    margin: 0 0 .75rem;
}
.lede { font-size: 1.15rem; color: var(--color-muted); max-width: 60ch; }
.section-head { margin-bottom: 3rem; max-width: 720px; }
.section-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; max-width: none; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    padding: .7em 1.25em;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .95rem;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s var(--ease);
    text-align: center;
}
.btn-lg { padding: .95em 1.6em; font-size: 1rem; }
.btn-primary {
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 6px 20px rgba(46, 124, 246, .25);
}
.btn-primary:hover { background: var(--color-accent-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost {
    background: transparent;
    color: var(--color-ink);
    border-color: var(--color-border);
}
.btn-ghost:hover { background: var(--color-surface); border-color: var(--color-ink); color: var(--color-ink); }

/* =========================================================
   Header / nav (dark — matches brand "white logo on dark")
   ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 18, 32, 0.92);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    gap: 1.5rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -.01em;
}
.brand-logo {
    height: 32px;
    width: auto;
    display: block;
}
.site-footer .brand-logo { height: 36px; }
.site-nav { display: flex; align-items: center; }
.nav-panel { display: flex; align-items: center; gap: 1.5rem; }
.nav-menu {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    align-items: center;
    gap: 1.75rem;
}
.nav-menu a {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    font-size: .95rem;
}
.nav-menu a:hover { color: #fff; }
.nav-cta { white-space: nowrap; }
.nav-toggle {
    display: none;
    background: none; border: none;
    flex-direction: column; gap: 4px;
    cursor: pointer;
    padding: .4rem;
}
.nav-toggle .bar {
    width: 22px; height: 2px; background: #fff; border-radius: 2px;
    transition: transform .2s var(--ease), opacity .2s var(--ease);
}

@media (max-width: 880px) {
    .nav-toggle { display: inline-flex; }
    .nav-panel {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--color-dark);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1rem 1.5rem 1.5rem;
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: transform .2s var(--ease), opacity .2s var(--ease);
    }
    .nav-panel.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .nav-menu { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-menu li { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
    .nav-menu a { display: block; padding: 1rem 0; }
    .nav-cta { margin-top: 1rem; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
    position: relative;
    padding: 6rem 0 5rem;
    overflow: hidden;
    background: radial-gradient(ellipse at top left, var(--color-accent-soft) 0%, transparent 50%),
                radial-gradient(ellipse at top right, #f0fbff 0%, transparent 50%),
                #fff;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(transparent 95%, rgba(46, 124, 246, .05) 95%),
        linear-gradient(90deg, transparent 95%, rgba(46, 124, 246, .05) 95%);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at center top, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center top, #000 30%, transparent 75%);
    z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero-title { margin-bottom: 1.25rem; }
.hero-title .dot { color: var(--color-accent); }
.hero-sub { font-size: 1.2rem; max-width: 60ch; color: var(--color-ink-2); margin-bottom: 2rem; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.hero-meta {
    display: inline-flex; flex-wrap: wrap; gap: .65rem;
    color: var(--color-muted); font-size: .9rem; font-weight: 500;
}
.hero-meta .sep { color: var(--color-border); }

/* =========================================================
   Logos strip
   ========================================================= */
.logos { padding: 2.5rem 0; border-bottom: 1px solid var(--color-border); }
.logos-label { text-align: center; color: var(--color-muted); font-size: .85rem; margin-bottom: 1.5rem; }
.logos-row {
    display: flex; justify-content: space-around; flex-wrap: wrap; gap: 2rem;
    color: var(--color-muted); font-weight: 700; letter-spacing: .15em; font-size: .9rem;
    opacity: .55;
}

/* =========================================================
   Sections
   ========================================================= */
.features, .how, .comparison, .latest, .blog-archive, .lexicon-archive, .contact, .single-post, .page, .lexicon-single { padding: 5rem 0; }

.features { background: var(--color-surface); }
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.feature-card {
    background: #fff;
    padding: 2rem 1.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-accent-soft);
}
.feature-card.highlight {
    background: linear-gradient(135deg, var(--color-dark), var(--color-dark-2));
    color: #f8fafc;
    border-color: transparent;
}
.feature-card.highlight h3 { color: #fff; }
.feature-card.highlight p { color: rgba(248, 250, 252, .8); }
.feature-card .icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
}
.feature-card.highlight .icon {
    background: rgba(46, 124, 246, .2);
    color: #82b3ff;
}
.feature-card p { color: var(--color-muted); margin: 0; }
.feature-card.highlight p { color: rgba(248, 250, 252, .75); }

/* =========================================================
   How it works
   ========================================================= */
.steps {
    list-style: none; padding: 0; margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    counter-reset: step;
}
.steps li {
    position: relative;
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}
.step-num {
    display: inline-block;
    font-size: .85rem; font-weight: 700;
    color: var(--color-accent);
    letter-spacing: .1em;
    margin-bottom: .75rem;
}
.steps h3 { margin-bottom: .5rem; }
.steps p { color: var(--color-muted); margin: 0; }

/* =========================================================
   Comparison
   ========================================================= */
.comparison { background: var(--color-surface); }
.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.compare-col {
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--color-border);
}
.compare-col h3 { margin-bottom: 1.25rem; font-size: 1.1rem; }
.compare-col ul { list-style: none; padding: 0; margin: 0; }
.compare-col li {
    padding: .85rem 0 .85rem 2rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-ink-2);
    position: relative;
}
.compare-col li:first-child { border-top: none; }
.compare-old li::before {
    content: "✕"; position: absolute; left: 0; top: .85rem;
    color: var(--color-danger); font-weight: 700;
}
.compare-new {
    background: linear-gradient(135deg, var(--color-dark), var(--color-dark-2));
    color: #f8fafc;
    border-color: transparent;
}
.compare-new h3 { color: #fff; }
.compare-new li { color: rgba(248, 250, 252, .9); border-color: rgba(255, 255, 255, .08); }
.compare-new li::before {
    content: "✓"; position: absolute; left: 0; top: .85rem;
    color: var(--color-success); font-weight: 700;
}

/* =========================================================
   Latest posts (homepage)
   ========================================================= */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.post-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
    overflow: hidden;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-card-link {
    display: block;
    padding: 1.75rem;
    color: inherit;
}
.post-card-link:hover { color: inherit; }
.post-card h2, .post-card h3 { font-size: 1.2rem; margin: .25rem 0 .75rem; }
.post-meta {
    font-size: .8rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0 0 .5rem;
    font-weight: 600;
}
.post-card p { color: var(--color-muted); margin: 0 0 1rem; }
.read-more {
    color: var(--color-accent);
    font-weight: 600;
    font-size: .9rem;
}

/* =========================================================
   CTA band
   ========================================================= */
.cta-band {
    background: linear-gradient(135deg, var(--color-dark), var(--color-dark-2));
    color: #fff;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}
.cta-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 50%, rgba(46, 124, 246, .25), transparent 60%);
    pointer-events: none;
}
.cta-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.cta-band h2 { color: #fff; margin-bottom: .5rem; }
.cta-band p { color: rgba(255, 255, 255, .75); margin: 0; max-width: 50ch; }

/* =========================================================
   Page head / generic page
   ========================================================= */
.page-head {
    padding: 5rem 0 3rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.page-head h1 { margin-bottom: 1rem; }
.page-content { font-size: 1.05rem; color: var(--color-ink-2); }
.page-content h2 { margin-top: 2rem; }
.page-content h3 { margin-top: 1.5rem; }
.page-content ul li { margin-bottom: .35rem; }

/* =========================================================
   Single post
   ========================================================= */
.post-header { margin-bottom: 2.5rem; }
.post-content {
    font-size: 1.075rem;
    color: var(--color-ink-2);
    line-height: 1.75;
}
.post-content p { margin-bottom: 1.25em; }
.post-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding: .5em 0 .5em 1.25em;
    margin: 1.5em 0;
    color: var(--color-ink-2);
    font-style: italic;
    background: var(--color-accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.post-content code {
    background: var(--color-surface-2);
    padding: .15em .4em;
    border-radius: 4px;
    font-size: .9em;
}
.post-nav {
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--color-border);
}

/* =========================================================
   Lexicon
   ========================================================= */
.lexicon-letters {
    display: flex; flex-wrap: wrap; gap: .35rem;
    margin-bottom: 3rem;
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    position: sticky;
    top: 80px;
    z-index: 10;
    backdrop-filter: blur(10px);
}
.lexicon-letters a {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-ink);
    font-weight: 700;
    font-size: .85rem;
    transition: all .15s var(--ease);
}
.lexicon-letters a:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    transform: translateY(-2px);
}
.lexicon-section { margin-bottom: 3rem; scroll-margin-top: 140px; }
.lexicon-letter-head {
    font-size: 3.5rem;
    color: var(--color-accent);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: .25rem;
    margin-bottom: 1.5rem;
}
.lexicon-list { margin: 0; }
.lexicon-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
}
.lexicon-item:last-child { border-bottom: none; }
.lexicon-item dt {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: .35rem;
}
.lexicon-item dt a { color: var(--color-ink); }
.lexicon-item dt a:hover { color: var(--color-accent); }
.lexicon-item dd { margin: 0; color: var(--color-muted); }
.back-link { margin-bottom: 1.5rem; }
.back-link a { color: var(--color-muted); font-weight: 500; }
.back-link a:hover { color: var(--color-accent); }

/* =========================================================
   Contact
   ========================================================= */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: flex-start;
}
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; } }
.contact-info h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.contact-list { list-style: none; padding: 0; margin: 2rem 0; }
.contact-list li {
    padding: 1rem 0;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.contact-list li:last-child { border-bottom: 1px solid var(--color-border); }
.contact-list .label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--color-muted);
    font-weight: 600;
}
.contact-quote {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--color-surface);
    border-left: 3px solid var(--color-accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.contact-quote p { font-style: italic; color: var(--color-ink-2); margin-bottom: .5rem; }
.contact-quote span { color: var(--color-muted); font-size: .85rem; }

.contact-form-wrap {
    background: #fff;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}
.contact-form label {
    display: block;
    margin-bottom: 1.25rem;
}
.contact-form label > span {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: .4rem;
    color: var(--color-ink-2);
}
.contact-form label em { color: var(--color-accent); font-style: normal; }
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: .8rem 1rem;
    font: inherit;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.field-row label { margin-bottom: 1.25rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; gap: 0; } }
.form-fineprint { font-size: .8rem; color: var(--color-muted); margin-top: 1rem; margin-bottom: 0; }
.form-flash {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.form-flash-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.form-flash-ok strong { display: block; margin-bottom: .25rem; }
.form-flash-ok p { margin: 0; color: #065f46; }
.form-flash-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
    background: var(--color-dark);
    color: #cbd5e1;
    padding: 4rem 0 2rem;
    margin-top: 0;
}
.site-footer .brand { color: #fff; }
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}
@media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .footer-brand { grid-column: 1 / -1; }
}
.footer-tag { color: rgba(203, 213, 225, .65); margin-top: 1rem; max-width: 30ch; }
.footer-col h4 {
    color: #fff;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 1rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: .6rem; }
.footer-col a { color: rgba(203, 213, 225, .8); font-size: .95rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-top: 1.5rem;
    color: rgba(203, 213, 225, .55);
    font-size: .85rem;
}

/* =========================================================
   Pagination
   ========================================================= */
.pagination { margin-top: 3rem; display: flex; justify-content: center; }
.pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px;
    padding: 0 .75rem;
    margin: 0 .15rem;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-ink-2);
    font-weight: 600;
    text-decoration: none;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
