/* Cobalt: the salesengineer.ai light styling, ported from ai_consultant/site/src/styles.css for the
   public /ai-consulting page (spec docs/superpowers/specs/2026-09-29-ai-consulting-landing-page-design.md §5).

   This file is linked from App.razor and so loads on EVERY page of the app. Every selector is
   therefore gated to a `.cobalt` root, or to `html:has(.cobalt)`, and nothing here applies unless
   ConsultingLayout's `.cobalt` element is in the document. @font-face is the only ungated block.
   CobaltStylesheetTests enforces the gate.

   The `!important` link, button and heading rules exist because a signed-in user's theme forces
   those colours with `!important` (css/themes/presets.css: dracula/one-dark/nord `a:not(.btn)...`
   at (0,4,1), hover (0,5,1); github-dark and solarized-dark `a:not(.btn)` at (0,2,1);
   high-contrast underlines every `a:not(.btn)`; the heading rules at 821, 1065, 1497, 1799).
   Each override below states its specificity. */

/* Self-hosted latin subsets under the SIL Open Font License (licences beside the files in
   wwwroot/fonts/). Renamed so they never collide with the Google-Fonts "Inter" that
   ArticleLayout loads. Each file is offered at 400 to 500 only, so nothing here asks for 600+. */
@font-face {
    font-family: "Cobalt Brygada";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("../fonts/Brygada1918-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Cobalt Inter";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("../fonts/Inter-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Cobalt Geist Mono";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("../fonts/GeistMono-latin.woff2") format("woff2");
}

/* ---------- Root and tokens ---------- */

.cobalt {
    /* Page palette (Cobalt) */
    --bg: #f5f6f8;
    --surface: #ffffff;
    --alt: #fbfcfd;
    --tint: #e9edf8;
    --accent-tint: #eef2fd;
    --footer-bg: #eef0f4;
    --ink: #111318;
    --body: #3b404a;
    --muted: #5e6470;
    --muted-on-tint: #4f5663;
    --rule: #e1e4ea;
    --field-rule: #cfd4dd;
    --accent: #2448d8;
    --on-accent: #ffffff;
    --selection: #d9e1fb;
    --focus-ring: rgba(36, 72, 216, 0.2);
    --shadow: 0 30px 70px -36px rgba(17, 19, 24, 0.5);
    --shadow-soft: 0 20px 50px -34px rgba(17, 19, 24, 0.4);
    --shadow-card: 0 10px 30px -18px rgba(17, 19, 24, 0.3);

    /* Type */
    --serif: "Cobalt Brygada", Georgia, serif;
    --sans: "Cobalt Inter", Helvetica, sans-serif;
    --mono: "Cobalt Geist Mono", ui-monospace, monospace;
    --display-size: clamp(38px, 4.4vw, 62px);

    /* Spacing: content sits in a 1116 px column. */
    --container: 1116px;
    --gutter: clamp(20px, 5vw, 72px);
    --section-pad: clamp(56px, 6vw, 80px);

    min-height: 100vh;
    color: var(--ink);
    font-family: "Cobalt Inter", Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

/* The canvas behind the root. Custom properties declared on .cobalt do not reach html or body,
   so the source's --bg and --ink are literal here. (0,3,1) and (0,3,2) beat the default dark
   preset's `[data-theme="default"][data-bs-theme="dark"] body` (0,2,1). */
html[data-theme][data-bs-theme]:has(.cobalt),
html[data-theme][data-bs-theme]:has(.cobalt) body {
    background: #f5f6f8 !important;
    color: #111318 !important;
}

html:has(.cobalt) {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

/* ---------- Source globals, gated ---------- */

.cobalt a {
    color: var(--ink);
    text-decoration: none !important;
}

.cobalt a:hover {
    color: var(--accent);
}

.cobalt ::selection {
    background: var(--selection);
}

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

.cobalt img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ---------- Theme-proof link, button and heading colours ---------- */

/* General links: (0,7,2), hover (0,8,2). Buttons and footer links are excluded so this never paints
   a button's text in the button's own background colour. */
html:has(.cobalt) .cobalt a:not(.btn):not(.nav-link):not(.dropdown-item):not(.button):not(.footer-link) {
    color: var(--ink) !important;
    text-decoration: none !important;
}

html:has(.cobalt) .cobalt a:not(.btn):not(.nav-link):not(.dropdown-item):not(.button):not(.footer-link):hover {
    color: var(--accent) !important;
}

/* Header nav links: (0,8,2), hover (0,9,2), above the general rule so they keep the body grey.
   `:not(.button)` keeps this off the header CTA, which sits inside .site-nav. */
html:has(.cobalt) .cobalt .site-nav a:not(.btn):not(.nav-link):not(.dropdown-item):not(.button):not(.footer-link) {
    color: var(--body) !important;
    text-decoration: none !important;
}

html:has(.cobalt) .cobalt .site-nav a:not(.btn):not(.nav-link):not(.dropdown-item):not(.button):not(.footer-link):hover {
    color: var(--accent) !important;
}

/* Text links inside running copy keep an underline (0,8,2), so they read as links without relying
   on colour alone (WCAG 1.4.1): the footnote's source link and the hero's "How it works" link. */
html:has(.cobalt) .cobalt .footnote a:not(.btn):not(.nav-link):not(.dropdown-item):not(.button):not(.footer-link),
html:has(.cobalt) .cobalt .hero-copy a:not(.btn):not(.nav-link):not(.dropdown-item):not(.button):not(.footer-link) {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

/* Buttons: (0,6,1), hover (0,7,1). */
html:has(.cobalt) .cobalt .button:not(.btn):not(.nav-link):not(.dropdown-item) {
    color: var(--on-accent) !important;
    text-decoration: none !important;
}

html:has(.cobalt) .cobalt .button:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    color: var(--on-accent) !important;
}

/* Footer links: (0,6,1), hover (0,7,1). Underlined, as the source footer is. */
html:has(.cobalt) .cobalt .footer-link:not(.btn):not(.nav-link):not(.dropdown-item) {
    color: var(--ink) !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

html:has(.cobalt) .cobalt .footer-link:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    color: var(--accent) !important;
}

/* Headings: (0,2,2) beats the presets' `[data-theme="x"] h1` (0,1,1). */
html:has(.cobalt) .cobalt h1,
html:has(.cobalt) .cobalt h2,
html:has(.cobalt) .cobalt h3,
html:has(.cobalt) .cobalt h4,
html:has(.cobalt) .cobalt h5,
html:has(.cobalt) .cobalt h6 {
    color: var(--ink) !important;
}

/* ---------- Shared pieces ---------- */

/* The link that wraps the logo image. */
.cobalt .wordmark {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* (0,2,0) beats the `.cobalt img` reset (0,1,1); the PNG is 930 x 631. */
.cobalt .cobalt-logo {
    height: 28px;
    width: auto;
}

.cobalt .accent {
    color: var(--accent);
}

.cobalt .eyebrow {
    margin: 0 0 14px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.14em;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--muted);
}

.cobalt .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid var(--ink);
    border-radius: 6px;
    background: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 500;
    line-height: normal;
    white-space: nowrap;
    cursor: pointer;
}

.cobalt .button:hover {
    border-color: var(--accent);
    background: var(--accent);
}

.cobalt .button--small {
    padding: 8px 14px;
    font-size: 14px;
}

.cobalt .footnote {
    margin: 24px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

/* ---------- Header ---------- */

/* The padding centres the header's content in the page's column without a wrapper element. */
.cobalt .site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px max(var(--gutter), calc((100% - var(--container)) / 2));
    border-bottom: 1px solid var(--rule);
    background: var(--surface);
}

.cobalt .site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
    font-size: 14px;
}

.cobalt .site-nav a {
    white-space: nowrap;
}

/* Below about 760 px the nav takes its own row and wraps. */
@media (max-width: 760px) {
    .cobalt .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .cobalt .site-nav {
        width: 100%;
        gap: 10px 18px;
        font-size: 13px;
    }
}

/* ---------- Hero ---------- */

/* One column: the source's second 564 px track held a demo visual this page does not have. */
.cobalt .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(32px, 4vw, 54px);
    align-items: center;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin: 0 auto;
    padding: clamp(32px, 4vw, 56px) var(--gutter) clamp(48px, 5vw, 72px);
}

.cobalt .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cobalt .hero-title {
    margin: 0 0 24px;
    font-family: var(--serif);
    font-size: var(--display-size);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

.cobalt .hero-subline {
    max-width: 440px;
    margin: 0 0 30px;
    font-size: clamp(17px, 1.4vw, 18px);
    line-height: 1.55;
    color: var(--body);
    text-wrap: pretty;
}

.cobalt .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(100%, 336px);
    padding: 18px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

/* ---------- Sections ---------- */

.cobalt .section {
    border-top: 1px solid var(--rule);
}

/* A section that follows the one above it without a rule. */
.cobalt .section--flush {
    border-top: none;
}

.cobalt .section--alt {
    background: var(--alt);
}

.cobalt .wrap {
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin: 0 auto;
    padding: var(--section-pad) var(--gutter);
}

/* The eyebrow and the heading, centred over the section. */
.cobalt .section-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    text-align: center;
}

.cobalt .cobalt-section-title {
    max-width: 20em;
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(34px, 3.8vw, 54px);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.012em;
    text-wrap: balance;
}

/* Bordered white cards. */
.cobalt .cards {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 800px) {
    .cobalt .cards--two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .cobalt .cards--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.cobalt .cobalt-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 28px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--surface);
}

.cobalt .cobalt-card-title {
    margin: 0;
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-wrap: pretty;
}

.cobalt .cobalt-card-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--body);
    text-wrap: pretty;
}

/* ---------- How it works ---------- */

.cobalt .how-panel {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: clamp(14px, 3.4vw, 48px);
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--tint);
}

.cobalt .how-title {
    margin: 0;
    padding: 24px 32px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
    font-family: var(--serif);
    font-size: clamp(32px, 3.2vw, 44px);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.012em;
    text-align: center;
}

/* One column below 1000 px, five from there up. */
.cobalt .steps {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cobalt .step {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--surface);
}

@media (max-width: 480px) {
    .cobalt .step {
        grid-template-columns: 64px minmax(0, 1fr);
    }
}

/* The numeral 01 to 05 is the mark's only content. */
.cobalt .step-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--rule);
    background: var(--accent-tint);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 20px;
    line-height: 1;
}

.cobalt .step-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 22px;
}

/* A five-column step is too narrow for a 96 px side mark, so the mark sits on top instead. */
@media (min-width: 1000px) {
    .cobalt .steps {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .cobalt .step {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 64px auto;
    }

    .cobalt .step-mark {
        border-right: none;
        border-bottom: 1px solid var(--rule);
    }

    .cobalt .step-body {
        padding: 18px 16px;
    }
}

/* ---------- Compare ---------- */

.cobalt .compare {
    display: grid;
    gap: 24px;
    align-items: start;
}

@media (min-width: 800px) {
    .cobalt .compare {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cobalt .compare-col {
    padding: clamp(24px, 3vw, 40px);
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--surface);
}

/* Our column: a light accent tint under a 2 px accent rule (the source's dark "live" column is
   not ported). */
.cobalt .compare-col--ours {
    border-top: 2px solid var(--accent);
    background: var(--accent-tint);
}

.cobalt .compare-title {
    margin-bottom: 20px;
}

.cobalt .compare-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cobalt .compare-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid var(--rule);
    font-size: 16px;
    line-height: 1.5;
    color: var(--body);
}

.cobalt .compare-list li::before {
    content: "";
    flex: none;
    width: 14px;
    height: 1px;
    background: var(--muted);
}

/* ---------- FAQ ---------- */

.cobalt .faq-list {
    max-width: 820px;
    margin: 0 auto;
    border-bottom: 1px solid var(--rule);
}

.cobalt .faq-item {
    border-top: 1px solid var(--rule);
}

.cobalt .faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 0;
    font-family: var(--serif);
    font-size: clamp(19px, 1.8vw, 22px);
    line-height: 1.25;
    letter-spacing: -0.01em;
    list-style: none;
    cursor: pointer;
}

.cobalt .faq-item summary::-webkit-details-marker {
    display: none;
}

.cobalt .faq-item summary:hover {
    color: var(--accent);
}

/* A plus that loses its upright bar once the answer is open. */
.cobalt .faq-item summary::after {
    content: "";
    flex: none;
    width: 14px;
    height: 14px;
    background:
        linear-gradient(var(--accent), var(--accent)) center / 14px 1.5px no-repeat,
        linear-gradient(var(--accent), var(--accent)) center / 1.5px 14px no-repeat;
}

.cobalt .faq-item[open] summary::after {
    background: linear-gradient(var(--accent), var(--accent)) center / 14px 1.5px no-repeat;
}

.cobalt .faq-item p {
    max-width: 40em;
    margin: 0 0 24px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--body);
}

/* ---------- Footer ---------- */

.cobalt .site-footer {
    border-top: 1px solid var(--rule);
    background: var(--footer-bg);
}

.cobalt .footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 32px var(--gutter);
}

.cobalt .footer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
}

.cobalt .footer-link,
.cobalt .footer-note {
    font-size: 14px;
}

.cobalt .footer-note {
    color: var(--muted-on-tint);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html:has(.cobalt) {
        scroll-behavior: auto;
    }
}
