/* ============================================================
   Bleugates Research — public site styles
   Built on the IBM Carbon Design language (IBM Plex, square
   corners, Carbon greys) with the Bleugates blue as the brand
   interactive colour.
   ============================================================ */

:root {
    /* Brand */
    --bg-brand:        #061a9c;
    --bg-brand-hover:  #0a23c4;
    --bg-brand-active: #03114f;
    --brand-light:     #e8ebfb;

    /* Carbon greys */
    --black:      #161616;
    --gray-100:   #161616;
    --gray-90:    #262626;
    --gray-80:    #393939;
    --gray-70:    #525252;
    --gray-60:    #6f6f6f;
    --gray-50:    #8d8d8d;
    --gray-30:    #c6c6c6;
    --gray-20:    #e0e0e0;
    --gray-10:    #f4f4f4;
    --white:      #ffffff;

    --text:        var(--gray-100);
    --text-soft:   var(--gray-70);
    --text-muted:  var(--gray-60);
    --border:      var(--gray-20);
    --surface:     var(--white);
    --surface-alt: var(--gray-10);

    --support-error:   #da1e28;
    --support-success: #198038;
    --support-warning: #f1c21b;

    --container: 1312px;
    --nav-h: 64px;

    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--surface);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--bg-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-mono { font-family: var(--font-mono); }
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bg-brand);
    font-weight: 500;
    margin-bottom: 1rem;
}

/* ----------------------------------------------------------
   Buttons (Carbon-style, square corners)
   ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.2;
    padding: 0.875rem 3.5rem 0.875rem 1rem;
    min-height: 48px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    text-decoration: none;
    position: relative;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--bg-brand); color: #fff; }
.btn--primary:hover { background: var(--bg-brand-hover); color: #fff; }
.btn--primary:active { background: var(--bg-brand-active); }
.btn--secondary { background: var(--gray-80); color: #fff; }
.btn--secondary:hover { background: var(--gray-70); color: #fff; }
.btn--tertiary {
    background: transparent;
    color: var(--bg-brand);
    border-color: var(--bg-brand);
}
.btn--tertiary:hover { background: var(--bg-brand); color: #fff; }
.btn--ghost { background: transparent; color: var(--bg-brand); padding-right: 1rem; }
.btn--ghost:hover { background: var(--brand-light); }
.btn--block { width: 100%; justify-content: space-between; }
.btn .btn__icon { position: absolute; right: 1rem; }
.btn--ghost .btn__icon { position: static; }

/* ----------------------------------------------------------
   Top navigation
   ---------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}
.nav {
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.nav__brand { display: flex; align-items: center; gap: 0.625rem; }
.nav__brand img { height: 28px; width: auto; }
.nav__brand-text {
    font-weight: 600;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
    color: var(--black);
}
.nav__brand-text b { color: var(--bg-brand); }
.nav__links { display: flex; align-items: center; gap: 0.25rem; }
.nav__links a {
    color: var(--text-soft);
    font-size: 0.875rem;
    padding: 0 1rem;
    height: var(--nav-h);
    display: inline-flex;
    align-items: center;
    border-bottom: 2px solid transparent;
}
.nav__links a:hover { color: var(--black); background: var(--gray-10); text-decoration: none; }
.nav__links a.is-active { color: var(--black); border-bottom-color: var(--bg-brand); }
.nav__cta { margin-left: 0.5rem; }
.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--black);
}

/* ----------------------------------------------------------
   Hero
   ---------------------------------------------------------- */
.hero {
    position: relative;
    background:
        linear-gradient(180deg, #fff 0%, #fff 60%, var(--gray-10) 100%),
        radial-gradient(circle at 1px 1px, var(--gray-20) 1px, transparent 0);
    background-size: cover, 24px 24px;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.hero__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 6rem 1.5rem 5rem;
}
.hero__grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
    align-items: center;
}
.hero h1 {
    font-size: clamp(2.75rem, 6vw, 4.25rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--black);
    margin-bottom: 1.5rem;
}
.hero h1 .accent { color: var(--bg-brand); }
.hero__lead {
    font-size: 1.25rem;
    color: var(--text-soft);
    max-width: 36rem;
    margin-bottom: 2.5rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 1px; }
.hero__visual {
    border: 1px solid var(--border);
    background: var(--white);
    padding: 2rem;
    box-shadow: 0 12px 40px rgba(6, 26, 156, 0.08);
}
.hero__visual h4 { font-size: 0.75rem; font-family: var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1.25rem; }
.stat-row { display: flex; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid var(--gray-10); }
.stat-row:last-child { border-bottom: none; }
.stat-row .stat-num { font-weight: 600; color: var(--bg-brand); font-family: var(--font-mono); }

/* ----------------------------------------------------------
   Sections
   ---------------------------------------------------------- */
.section { padding: 5rem 0; }
.section--alt { background: var(--surface-alt); }
.section--dark { background: var(--black); color: #fff; }
.section__head { max-width: 46rem; margin-bottom: 3rem; }
.section__head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: inherit;
    margin-bottom: 1rem;
}
.section p.section__sub { font-size: 1.125rem; color: var(--text-soft); }
.section--dark p.section__sub { color: var(--gray-30); }

/* Feature tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: var(--border); }
.tile {
    background: var(--white);
    padding: 2.5rem 2rem;
    transition: background .15s, transform .15s;
}
.tile:hover { background: var(--gray-10); }
.tile__icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    color: var(--bg-brand);
    border: 1px solid var(--bg-brand);
    margin-bottom: 1.5rem;
}
.tile h3 { font-size: 1.375rem; font-weight: 600; margin-bottom: 0.75rem; letter-spacing: -0.01em; }
.tile p { color: var(--text-soft); }

/* Quote */
.quote {
    border-left: 4px solid var(--bg-brand);
    padding: 0.5rem 0 0.5rem 2rem;
    margin: 0;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    line-height: 1.4;
    font-weight: 400;
    color: var(--black);
}
.quote cite { display: block; margin-top: 1.25rem; font-size: 0.9375rem; color: var(--text-muted); font-style: normal; font-family: var(--font-mono); }
.section--dark .quote { color: #fff; border-color: #fff; }

/* Prose (about text & article body) */
.prose { max-width: 44rem; font-size: 1.0625rem; color: var(--text-soft); }
.prose > * + * { margin-top: 1.25rem; }
.prose p { line-height: 1.7; }
.prose h2 { font-size: 1.75rem; margin-top: 2.5rem; color: var(--black); }
.prose h3 { font-size: 1.375rem; margin-top: 2rem; color: var(--black); }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin-top: 0.5rem; }
.prose blockquote { border-left: 4px solid var(--bg-brand); padding-left: 1.5rem; color: var(--black); font-style: italic; }
.prose img { margin: 1.5rem 0; border: 1px solid var(--border); }
.prose code { font-family: var(--font-mono); background: var(--gray-10); padding: 0.1em 0.4em; font-size: 0.9em; }
.prose pre { background: var(--gray-100); color: #f4f4f4; padding: 1.25rem; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose a { text-decoration: underline; }

/* ----------------------------------------------------------
   Cards (research / blog listing)
   ---------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.card {
    border: 1px solid var(--border);
    background: var(--white);
    display: flex;
    flex-direction: column;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: var(--bg-brand); box-shadow: 0 8px 28px rgba(6,26,156,0.08); transform: translateY(-2px); }
.card__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--gray-10); border-bottom: 1px solid var(--border); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media--placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--bg-brand) 0%, var(--bg-brand-active) 100%);
    color: rgba(255,255,255,0.85);
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    font-size: 0.875rem;
}
.card__body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card__meta { display: flex; gap: 0.75rem; align-items: center; font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 0.75rem; }
.card h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.625rem; letter-spacing: -0.01em; }
.card h3 a { color: var(--black); }
.card h3 a:hover { color: var(--bg-brand); text-decoration: none; }
.card p { color: var(--text-soft); font-size: 0.9375rem; flex: 1; }
.card__footer { margin-top: 1.25rem; display: flex; align-items: center; justify-content: space-between; }

/* Tags */
.tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--bg-brand);
    font-weight: 500;
    line-height: 1.6;
}
.tag--gray { background: var(--gray-20); color: var(--gray-80); }

/* ----------------------------------------------------------
   Article header
   ---------------------------------------------------------- */
.article-hero { border-bottom: 1px solid var(--border); padding: 4rem 0 2.5rem; }
.article-hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; max-width: 48rem; margin: 1rem 0; }
.article-meta { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--text-muted); font-size: 0.875rem; font-family: var(--font-mono); }
.article-cover { margin: 0 0 2.5rem; border: 1px solid var(--border); }
.breadcrumb { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.breadcrumb a { color: var(--text-muted); }

/* ----------------------------------------------------------
   Forms
   ---------------------------------------------------------- */
.form-row { margin-bottom: 1.5rem; }
.form-label { display: block; font-size: 0.75rem; color: var(--text-soft); margin-bottom: 0.5rem; font-weight: 500; }
.form-control {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-10);
    border: none;
    border-bottom: 1px solid var(--gray-50);
    color: var(--text);
    transition: outline .1s, background .15s;
}
.form-control:focus { outline: 2px solid var(--bg-brand); outline-offset: -2px; background: var(--white); }
textarea.form-control { min-height: 9rem; resize: vertical; }
.form-help { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.375rem; }

/* Alerts */
.alert { padding: 1rem 1.25rem; border-left: 3px solid; margin-bottom: 1.5rem; font-size: 0.9375rem; background: var(--white); }
.alert--success { border-color: var(--support-success); background: #defbe6; }
.alert--error   { border-color: var(--support-error); background: #fff1f1; }
.alert--warning { border-color: var(--support-warning); background: #fcf4d6; }
.alert--info    { border-color: var(--bg-brand); background: var(--brand-light); }

/* Pagination */
.pagination { display: flex; gap: 1px; margin-top: 3rem; background: var(--border); width: fit-content; }
.pagination a, .pagination span {
    min-width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--white); color: var(--text); font-size: 0.875rem;
    padding: 0 0.75rem;
}
.pagination a:hover { background: var(--gray-10); text-decoration: none; }
.pagination .is-active { background: var(--bg-brand); color: #fff; }
.pagination .is-disabled { color: var(--gray-30); }

/* Empty state */
.empty-state { text-align: center; padding: 5rem 1.5rem; border: 1px dashed var(--border); color: var(--text-muted); }
.empty-state h3 { color: var(--text-soft); margin-bottom: 0.5rem; }

/* CTA band */
.cta-band { background: var(--bg-brand); color: #fff; }
.cta-band .container { padding-top: 4rem; padding-bottom: 4rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2rem; }
.cta-band h2 { color: #fff; margin-bottom: 0.5rem; }
.cta-band p { color: rgba(255,255,255,0.8); max-width: 32rem; }
.cta-band .btn--primary { background: #fff; color: var(--bg-brand); }
.cta-band .btn--primary:hover { background: var(--gray-10); color: var(--bg-brand); }

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */
.site-footer { background: var(--black); color: var(--gray-30); padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 2.5rem; }
.site-footer h5 { color: #fff; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-mono); margin-bottom: 1.25rem; }
.site-footer a { color: var(--gray-30); display: block; padding: 0.3rem 0; font-size: 0.9375rem; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-brand { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 1rem; }
.footer-brand img { height: 28px; }
.footer-brand span { color: #fff; font-weight: 600; font-size: 1.0625rem; }
.footer-about { font-size: 0.9375rem; max-width: 22rem; line-height: 1.6; }
.footer-sub-form { display: flex; margin-top: 1rem; }
.footer-sub-form input { flex: 1; background: var(--gray-90); border: 1px solid var(--gray-80); color: #fff; padding: 0.75rem; font-size: 0.875rem; }
.footer-sub-form input:focus { outline: 2px solid var(--bg-brand); outline-offset: -2px; }
.footer-sub-form button { background: var(--bg-brand); color: #fff; border: none; padding: 0 1.25rem; cursor: pointer; font-size: 0.875rem; }
.footer-sub-form button:hover { background: var(--bg-brand-hover); }
.footer-bottom { border-top: 1px solid var(--gray-80); margin-top: 3rem; padding-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: 0.8125rem; color: var(--gray-50); }
.footer-tagline { color: var(--bg-brand); font-style: italic; }

/* Utilities */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.section-actions { margin-top: 2.5rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 960px) {
    .hero__grid { grid-template-columns: 1fr; }
    .hero__visual { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .nav__links {
        position: fixed;
        top: var(--nav-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 0;
        display: none;
    }
    .nav__links.open { display: flex; }
    .nav__links a { height: 48px; padding: 0 1.5rem; border-bottom: none; }
    .nav__links a.is-active { border-left: 3px solid var(--bg-brand); border-bottom: none; }
    .nav__cta { margin: 0.5rem 1.5rem; }
    .nav__toggle { display: inline-flex; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero__inner { padding: 3.5rem 1.5rem; }
    .section { padding: 3.5rem 0; }
    .cta-band .container { flex-direction: column; align-items: flex-start; }
}
