/*
Theme Name: BestSoft AI
Description: Corporate site theme for BestSoft AI - a fictional safety-focused AI research company in the I Was Unsupervised universe.
Author: BestSoft AI
Version: 1.0.0
*/

/* ===== Brand tokens ===== */

:root {
    --ink: #17191D;
    --slate: #373A40;
    --grey: #5B6270;
    --muted: #737780;
    --paper: #F3F0E8;
    --white: #FCFBF8;
    --blue: #5B67C8;
    --sage: #A7B7AA;
    --line: #DEDACF;

    --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    --wrap: 1080px;
    --prose: 70ch;
}

/* ===== Reset ===== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.2; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
}

.bs-skip { position: absolute; left: -9999px; }

.bs-skip:focus {
    left: 16px;
    top: 16px;
    z-index: 200;
    background: var(--ink);
    color: var(--white);
    padding: 10px 16px;
    text-decoration: none;
}

/* ===== Layout ===== */

.bs-wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 28px;
}

.bs-section { padding: 80px 0; }
.bs-section + .bs-section { padding-top: 0; }

/* The prose measure applies to the children, so body text lines up with
   the headings above it rather than drifting or hugging the window. */

.bs-prose { max-width: var(--wrap); }
.bs-prose > * { max-width: var(--prose); }
.bs-prose > figure,
.bs-prose > .wp-block-image,
.bs-prose > .wp-block-table,
.bs-prose > .wp-block-embed { max-width: 100%; }

.bs-prose h2 {
    font-size: 27px;
    margin: 52px 0 16px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.bs-prose h3 { font-size: 20px; margin: 36px 0 12px; }
.bs-prose h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.bs-prose h3:first-child { margin-top: 0; }

.bs-prose a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bs-prose a:hover { color: var(--ink); }

.bs-prose ul { list-style: none; margin: 0 0 1.2em; }

.bs-prose ul li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 8px;
}

.bs-prose ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 13px;
    width: 8px;
    height: 1px;
    background: var(--blue);
}

/* ===== Header ===== */

.bs-header {
    background: rgba(252, 251, 248, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 120;
}

.admin-bar .bs-header { top: 32px; }

@media screen and (max-width: 782px) {
    .admin-bar .bs-header { top: 46px; }
}

.bs-header-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.bs-logo { text-decoration: none; }
.bs-logo img { max-height: 26px; width: auto; }

.bs-logo-text {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 19px;
    letter-spacing: 0.14em;
    display: inline-flex;
    align-items: baseline;
    gap: 9px;
}

.bs-logo-ai { color: var(--blue); }

.bs-nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 7px 13px;
    cursor: pointer;
    color: var(--ink);
}

.bs-nav-list { display: flex; gap: 28px; }

.bs-nav-list a {
    font-size: 15px;
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
}

.bs-nav-list a:hover { border-bottom-color: var(--blue); }

@media (max-width: 820px) {
    .bs-header-inner { flex-wrap: wrap; }
    .bs-nav-toggle { display: block; }
    .bs-nav { display: none; width: 100%; }
    .bs-nav.is-open { display: block; }
    .bs-nav-list { flex-direction: column; gap: 4px; padding: 10px 0 4px; }
    .bs-nav-list a { display: block; padding: 9px 0; }
}

/* ===== Hero =====
   No dark band, no live panel. A statement, then evidence. */

.bs-hero { padding: 96px 0 0; }

.bs-hero-title {
    font-size: clamp(38px, 5.6vw, 64px);
    letter-spacing: -0.02em;
    max-width: 18ch;
    margin-bottom: 26px;
}

.bs-hero-text {
    max-width: 62ch;
    font-size: 19px;
    color: var(--slate);
}

.bs-hero-actions {
    margin-top: 34px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.bs-btn {
    display: inline-block;
    background: var(--ink);
    color: var(--white);
    padding: 13px 26px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.bs-btn:hover { background: var(--blue); }

.bs-btn-quiet {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line);
}

.bs-btn-quiet:hover {
    background: transparent;
    color: var(--blue);
    box-shadow: inset 0 0 0 1px var(--blue);
}

.bs-hero-media {
    margin: 64px auto 0;
    max-width: 1320px;
    padding: 0 28px;
}

.bs-hero-media video,
.bs-hero-media img {
    width: 100%;
    display: block;
    background: var(--slate);
}

.bs-hero-media figcaption {
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
    max-width: 62ch;
}

@media (max-width: 760px) {
    .bs-hero { padding-top: 64px; }
    .bs-hero-media { margin-top: 44px; padding: 0 20px; }
}

/* ===== Principles ===== */

.bs-principles {
    background: var(--white);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 72px 0;
    margin-top: 80px;
}

.bs-principles-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 32px 28px;
}

.bs-principle h3 {
    font-size: 16px;
    margin-bottom: 8px;
    padding-top: 12px;
    border-top: 2px solid var(--sage);
}

.bs-principle p {
    font-size: 15px;
    color: var(--grey);
}

@media (max-width: 900px) { .bs-principles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .bs-principles-grid { grid-template-columns: 1fr; } }

/* ===== Section furniture ===== */

.bs-section-title { font-size: 27px; margin-bottom: 26px; }

.bs-more { margin-top: 24px; }

.bs-more a {
    font-size: 15px;
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.bs-empty { color: var(--muted); }

.bs-page-header {
    padding: 64px 0 40px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 48px;
}

.bs-page-title {
    font-size: clamp(30px, 4.2vw, 46px);
    letter-spacing: -0.015em;
    max-width: 24ch;
}

.bs-meta {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bs-meta-sep {
    width: 14px;
    height: 1px;
    background: var(--blue);
    display: inline-block;
}

.bs-article, .bs-page { padding-bottom: 88px; }

.bs-page-hero {
    width: 100%;
    max-height: 480px;
    overflow: hidden;
    background: var(--slate);
}

.bs-page-hero img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}

.bs-hero-caption {
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
    max-width: 62ch;
}

/* ===== Research programme list ===== */

.bs-papers { border-top: 1px solid var(--line); }
.bs-paper { border-bottom: 1px solid var(--line); }

.bs-paper-link {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 22px;
    padding: 24px 0;
    text-decoration: none;
}

.bs-paper-text { min-width: 0; overflow-wrap: anywhere; }

.bs-paper-number {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--line);
    line-height: 1;
    padding-top: 3px;
}

.bs-paper-link:hover .bs-paper-number { color: var(--blue); }

.bs-paper-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 7px;
}

.bs-paper-status { color: var(--blue); }

.bs-paper-title {
    display: block;
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
    max-width: 52ch;
}

.bs-paper-link:hover .bs-paper-title {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.bs-paper-excerpt {
    display: block;
    margin-top: 9px;
    font-size: 15px;
    color: var(--muted);
    max-width: 62ch;
}

@media (max-width: 560px) {
    .bs-paper-link { grid-template-columns: 36px 1fr; gap: 14px; }
    .bs-paper-number { font-size: 19px; }
    .bs-paper-title { font-size: 17px; }
}

/* ===== Paper and policy masthead ===== */

.bs-paper-head {
    padding: 60px 0 36px;
    border-bottom: 2px solid var(--blue);
    margin-bottom: 44px;
}

.bs-policy-head { border-bottom-color: var(--sage); }

.bs-paper-kicker {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 10px;
}

.bs-paper-ref {
    font-size: 13px;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 20px;
}

.bs-paper-heading {
    font-size: clamp(28px, 3.8vw, 42px);
    letter-spacing: -0.015em;
    max-width: 26ch;
    margin-bottom: 28px;
}

.bs-paper-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 40px;
    margin: 0;
    max-width: 760px;
}

.bs-paper-facts dt {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.bs-paper-facts dd { margin: 0; font-size: 15px; }

@media (max-width: 620px) { .bs-paper-facts { grid-template-columns: 1fr; } }

.bs-paper-body table {
    width: 100%;
    max-width: var(--prose);
    border-collapse: collapse;
    margin: 28px 0 32px;
    font-size: 15px;
}

.bs-paper-body th,
.bs-paper-body td {
    text-align: left;
    padding: 11px 14px 11px 0;
    border-bottom: 1px solid var(--line);
}

.bs-paper-body th {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom-color: var(--ink);
}

/* ===== Cards ===== */

.bs-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.bs-card {
    background: var(--white);
    border: 1px solid var(--line);
}

.bs-card-link {
    display: block;
    padding: 24px 24px 26px;
    text-decoration: none;
    height: 100%;
}

.bs-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}

.bs-card-status { color: var(--blue); }

.bs-card-title {
    display: block;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.bs-card-link:hover .bs-card-title {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.bs-card-excerpt {
    display: block;
    margin-top: 10px;
    font-size: 15px;
    color: var(--muted);
}

@media (max-width: 900px) { .bs-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .bs-cards { grid-template-columns: 1fr; } }

/* ===== Policy documents ===== */

.bs-docs { border-top: 1px solid var(--line); }
.bs-doc { border-bottom: 1px solid var(--line); }

.bs-doc-link {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
    padding: 20px 0;
    text-decoration: none;
    flex-wrap: wrap;
}

.bs-doc-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 500;
    flex: 1;
    min-width: 0;
}

.bs-doc-link:hover .bs-doc-title { color: var(--blue); }

.bs-doc-meta {
    display: flex;
    gap: 18px;
    font-size: 13px;
    color: var(--muted);
    flex-wrap: wrap;
}

.bs-doc-status { color: var(--sage); }

/* ===== Leadership ===== */

.bs-people {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 48px 44px;
}

.bs-person-portrait { display: block; margin-bottom: 18px; background: var(--white); }

.bs-person-portrait img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.bs-person-portrait-lead { max-width: 320px; margin-bottom: 36px; }

.bs-person-name { font-size: 20px; }

.bs-person-name a { text-decoration: none; }

.bs-person-name a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.bs-person-role {
    color: var(--blue);
    font-size: 14px;
    margin: 5px 0 12px;
}

.bs-person-motto {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--slate);
    padding-left: 14px;
    border-left: 2px solid var(--sage);
    margin-bottom: 14px;
}

.bs-person-bio {
    font-size: 16px;
    color: var(--slate);
    max-width: 46ch;
}

.bs-people-compact {
    grid-template-columns: repeat(4, 1fr);
    gap: 26px 24px;
}

.bs-people-compact .bs-person-portrait { margin-bottom: 14px; }
.bs-people-compact .bs-person-name { font-size: 17px; }
.bs-people-compact .bs-person-role { font-size: 13px; margin-bottom: 0; }

@media (max-width: 860px) { .bs-people-compact { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .bs-people { grid-template-columns: 1fr; gap: 44px; } }

/* ===== Newsroom ===== */

.bs-news { border-top: 1px solid var(--line); }
.bs-news-item { border-bottom: 1px solid var(--line); }

.bs-news-link { display: block; padding: 22px 0; text-decoration: none; }

.bs-news-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 7px;
}

.bs-news-cat { color: var(--blue); }

.bs-news-title {
    display: block;
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
    max-width: 46ch;
}

.bs-news-link:hover .bs-news-title {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.bs-news-excerpt {
    display: block;
    margin-top: 9px;
    font-size: 16px;
    color: var(--muted);
    max-width: 62ch;
}

.bs-news-full { margin-bottom: 44px; }

/* ===== Pagination ===== */

.bs-pagination { padding-bottom: 72px; }

.bs-pagination .page-numbers {
    display: inline-block;
    padding: 8px 13px;
    font-size: 15px;
    text-decoration: none;
    color: var(--muted);
}

.bs-pagination .page-numbers.current {
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--blue);
}

/* ===== Document stamp ===== */

.bs-stamp {
    display: inline-block;
    margin: 52px 0 8px;
    padding: 10px 16px;
    max-width: none;
    border: 2px solid var(--sage);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--grey);
}

/* ===== Small print ===== */

.bs-smallprint {
    margin-top: 52px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--muted);
    max-width: 70ch;
}

/* ===== Footer ===== */

.bs-footer {
    background: var(--ink);
    color: var(--white);
    padding: 56px 0 30px;
    margin-top: 48px;
}

.bs-footer-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 28px 36px;
    border-bottom: 1px solid #2A2D33;
}

.bs-footer .bs-logo-ai { color: var(--sage); }

.bs-footer-tagline {
    color: var(--sage);
    font-size: 15px;
    margin-top: 12px;
}

.bs-footer-legal {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 24px 28px 0;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px 24px;
    font-size: 13px;
    color: #8A8D93;
}

.bs-footer-legal p { margin: 0; }
.bs-footer-copy { grid-column: 1; }

.bs-footer-legal .bs-footer-nav {
    grid-column: 2;
    justify-self: end;
}

.bs-footer-list {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.bs-footer-list a {
    font-size: 15px;
    color: #C9CACC;
    text-decoration: none;
}

.bs-footer-list a:hover { color: var(--sage); }

.bs-fiction {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 14px;
    border-top: 1px solid #2A2D33;
}

.bs-fiction a {
    color: #8A8D93;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bs-fiction a:hover { color: var(--sage); }

@media (max-width: 620px) {
    .bs-footer-legal {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
    .bs-footer-legal .bs-footer-nav { justify-self: center; }
    .bs-footer-list { justify-content: center; }
}
