/* ============================================================
   riser.management design system
   Voice: authority, trust, accountability, operational maturity.
   See docs/design-system.md for rationale and usage rules.
   ============================================================ */

:root {
    /* Color tokens */
    --ink-900: #0e1c2c;   /* deep navy — primary surfaces, headings */
    --ink-800: #16283c;
    --ink-700: #24384e;
    --ink-600: #3d5268;   /* secondary text on light */
    --ink-100: #dde3e9;
    --paper:   #f6f7f8;   /* page background */
    --white:   #ffffff;
    --accent-600: #135eab; /* GDS blue — actions, links (AA on white) */
    --accent-700: #0f4c8c; /* hover */
    --accent-100: #ddf1fc;
    --brand-cyan: #00aeef; /* GDS logo cyan — accents on dark surfaces only */
    --amber-100: #f7ecd9; /* risk highlight */
    --amber-800: #7a5410;
    --focus: #135eab;

    /* Type scale */
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --fs-sm: 0.875rem;
    --fs-base: 1.0625rem;
    --fs-lg: 1.1875rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 2rem;
    --fs-3xl: clamp(2.1rem, 4.5vw, 3.1rem);

    --radius: 6px;
    --shadow: 0 1px 3px rgba(14, 28, 44, 0.10), 0 8px 24px rgba(14, 28, 44, 0.06);
    --container: 1160px;
}

/* ---------------------------------------------- Base / reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.65;
    color: var(--ink-800);
    background: var(--paper);
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink-900); margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
p { text-wrap: pretty; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
p, ul, ol { margin: 0 0 1em; }
a { color: var(--accent-600); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-700); }
code { background: var(--ink-100); padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.9em; }

/* Accessibility: visible focus everywhere */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--ink-900); color: var(--white); padding: 0.75rem 1.25rem;
}
.skip-link:focus { left: 0; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }

/* ---------------------------------------------- Buttons */
.btn {
    display: inline-block; padding: 0.7rem 1.4rem; border-radius: var(--radius);
    font-weight: 600; font-size: var(--fs-base); text-decoration: none;
    border: 2px solid transparent; cursor: pointer; text-align: center;
}
.btn-lg { padding: 0.9rem 1.8rem; font-size: var(--fs-lg); }
.btn-primary { background: var(--accent-600); color: var(--white); }
.btn-primary:hover { background: var(--accent-700); color: var(--white); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.section-dark .btn-ghost, .hero .btn-ghost, .cta-band .btn-ghost { color: var(--white); }
.btn-ghost:hover { background: rgba(19, 94, 171, 0.08); }
.link-button {
    background: none; border: none; padding: 0; font: inherit;
    color: var(--accent-600); text-decoration: underline; cursor: pointer;
}
.text-link { font-weight: 600; }

/* ---------------------------------------------- Utility bar (phones) */
.utility-bar { background: var(--ink-900); color: #91a3b5; font-size: 0.85rem; }
.utility-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 34px; }
.utility-phones { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.utility-phones a { color: var(--white); text-decoration: none; font-weight: 600; }
.utility-phones a:hover { color: var(--brand-cyan); text-decoration: underline; }
.utility-region { color: var(--brand-cyan); font-weight: 700; }
@media (max-width: 680px) {
    .utility-tag { display: none; }
    .utility-inner { justify-content: center; }
}

/* ---------------------------------------------- Header */
/* White header so the GDS logo renders in true brand color. */
.site-header {
    background: var(--white); color: var(--ink-900);
    position: sticky; top: 0; z-index: 50;
    border-bottom: 3px solid var(--brand-cyan);
    box-shadow: 0 1px 3px rgba(14, 28, 44, 0.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 74px; }
.brand { display: flex; align-items: center; gap: 0.9rem; color: var(--ink-900); text-decoration: none; }
.brand-logo { height: 44px; width: auto; display: block; }
.brand-text {
    font-size: 1.15rem; letter-spacing: 0.01em; color: var(--ink-800);
    border-left: 1px solid var(--ink-100); padding-left: 0.9rem; line-height: 1.25;
}
.brand-text strong { color: var(--ink-900); }
.brand-tag { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--ink-600); }
.site-nav { display: flex; align-items: center; }
.nav-menu { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav-menu a:not(.btn) {
    color: var(--ink-700); text-decoration: none; font-weight: 500; padding: 0.4rem 0;
    border-bottom: 2px solid transparent;
}
.nav-menu a:not(.btn):hover, .nav-menu a[aria-current="page"] { color: var(--accent-700); border-bottom-color: var(--brand-cyan); }
.btn-nav { padding: 0.55rem 1.1rem; font-size: var(--fs-sm); }
.nav-toggle { display: none; background: none; border: 2px solid var(--ink-600); border-radius: var(--radius); padding: 0.5rem 0.65rem; cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 22px; height: 2px; background: var(--ink-800); content: ""; position: relative;
}
.nav-toggle-bars::before { position: absolute; top: -7px; }
.nav-toggle-bars::after { position: absolute; top: 7px; }

@media (max-width: 980px) {
    .brand-text { display: none; } /* logo alone on tight widths */
}
@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .brand-text { display: block; }
    .nav-menu {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--white); padding: 0.75rem 1.25rem 1.25rem;
        border-bottom: 3px solid var(--brand-cyan);
        box-shadow: var(--shadow);
    }
    .nav-menu.is-open { display: flex; }
    .nav-menu li { padding: 0.35rem 0; }
    .btn-nav { margin-top: 0.75rem; }
}
@media (max-width: 560px) {
    .brand-logo { height: 36px; }
    .brand-text { display: none; }
}

/* ---------------------------------------------- Hero / page hero */
.hero, .page-hero { background: var(--ink-900); color: var(--ink-100); padding: 4.5rem 0 4rem; }
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: center; }
.hero-art { max-height: 460px; width: auto; justify-self: center; }
.page-art { max-height: 210px; justify-self: end; }
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-art { display: none; } /* keep mobile hero fast and focused */
}
.page-hero { padding: 3rem 0 2.5rem; }
.hero h1, .page-hero h1 { color: var(--white); max-width: 21ch; }
.page-hero h1 { max-width: 30ch; }
.hero-kicker, .section-kicker {
    text-transform: uppercase; letter-spacing: 0.14em; font-size: var(--fs-sm);
    font-weight: 700; color: var(--brand-cyan); margin-bottom: 1rem;
}
.hero-lead { font-size: var(--fs-lg); max-width: 62ch; }
.hero-question { font-style: italic; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 1.6rem 0 1rem; }
.hero-proof { font-size: var(--fs-sm); color: #91a3b5; }
.hero-proof a { color: var(--brand-cyan); }
.footer-offices a { color: var(--ink-100); }

.breadcrumbs { font-size: var(--fs-sm); margin-bottom: 1.25rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.5rem; color: #5c7186; }
.breadcrumbs a { color: #a9bccd; }
.breadcrumbs [aria-current="page"] { color: var(--ink-100); }

/* ---------------------------------------------- Sections */
.section { padding: 4rem 0; }
.section-alt { background: var(--white); border-block: 1px solid var(--ink-100); }
.section-dark { background: var(--ink-800); color: var(--ink-100); padding: 4rem 0; }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-title { margin-bottom: 0.5rem; }
.section-lead { font-size: var(--fs-lg); color: var(--ink-600); max-width: 68ch; margin-bottom: 2rem; }
.section-footlink { margin-top: 2rem; font-size: var(--fs-lg); }
.split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------------------------------------------- Grids & cards */
.grid { display: grid; gap: 1.4rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
    background: var(--white); border: 1px solid var(--ink-100); border-radius: var(--radius);
    padding: 1.6rem; box-shadow: var(--shadow);
    position: relative; /* anchor for the stretched card link */
}
.section-alt .card { box-shadow: none; }
.card-title { font-size: var(--fs-xl); margin-bottom: 0.5rem; }
.card-title a { color: var(--ink-900); text-decoration: none; }
.card-title a:hover { color: var(--accent-700); text-decoration: underline; }
/* Stretched link: the title link covers the whole card, so "Read more →"
   and the rest of the card are clickable. */
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card:has(.card-title a):hover { border-color: var(--accent-600); }
.card:has(.card-title a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.card:hover .card-more { text-decoration: underline; }
/* Links inside card body/footer stay independently clickable above the overlay. */
.card-text a, .card-more a, .card-kicker a { position: relative; z-index: 1; }
.card-question { font-style: italic; color: var(--ink-600); }
.card-text { color: var(--ink-600); }
.card-kicker { font-size: var(--fs-sm); color: var(--ink-600); margin-bottom: 0.6rem; }
.card-more { font-weight: 600; color: var(--accent-600); margin-bottom: 0; }
.question-card h3, .question-card h2 { color: var(--accent-700); font-size: var(--fs-lg); text-transform: uppercase; letter-spacing: 0.08em; }
.question-card ul { padding-left: 1.1rem; color: var(--ink-600); }
.question-card li { margin-bottom: 0.5rem; }

.card-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 9px;
    background: var(--accent-100); color: var(--accent-700);
    margin-bottom: 0.9rem;
}

.badge {
    display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.badge-article    { background: var(--accent-100); color: var(--accent-700); }
.badge-guide      { background: #dfe9f5; color: #1f4e7d; }
.badge-checklist  { background: var(--amber-100); color: var(--amber-800); }
.badge-built     { background: var(--amber-100); color: var(--amber-800); }
.badge-wired     { background: #dfe9f5; color: #1f4e7d; }
.badge-secured   { background: var(--accent-100); color: var(--accent-700); }

/* ---------------------------------------------- Narrative pages */
.narrative { max-width: 76ch; }
.narrative h2 { margin-top: 2.2rem; }
.narrative ul, .narrative ol { padding-left: 1.3rem; }
.narrative li { margin-bottom: 0.45rem; }
.step-label { color: var(--accent-700); }
.check-list { list-style: none; padding-left: 0 !important; }
.check-list li { padding-left: 1.9rem; position: relative; margin-bottom: 0.7rem; }
.check-list li::before {
    content: "✓"; position: absolute; left: 0; top: 0;
    color: var(--accent-600); font-weight: 700;
}
.risk-list li::before { content: "⚠"; color: var(--amber-800); }
.link-list { list-style: none; padding-left: 0 !important; }
.link-list li { margin-bottom: 0.8rem; padding-left: 1.1rem; border-left: 3px solid var(--accent-600); }

.faq { border: 1px solid var(--ink-100); border-radius: var(--radius); background: var(--white); margin-bottom: 0.8rem; }
.faq summary { padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; }
.faq summary:hover { color: var(--accent-700); }
.faq p { padding: 0 1.25rem 1rem; color: var(--ink-600); }

.podcast-callout, .next-step {
    background: var(--white); border: 1px solid var(--ink-100); border-left: 4px solid var(--accent-600);
    border-radius: var(--radius); padding: 1.4rem 1.6rem; margin: 2rem 0;
}
.next-step h2 { margin-top: 0; font-size: var(--fs-xl); }

/* ---------------------------------------------- Lifecycle / stats */
.lifecycle { background: var(--white); border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.lifecycle-title { font-size: var(--fs-lg); text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-700); }
.lifecycle-list { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.lifecycle-list li {
    counter-increment: step; padding: 0.8rem 0 0.8rem 2.6rem; position: relative;
    border-bottom: 1px solid var(--ink-100);
}
.lifecycle-list li:last-child { border-bottom: 0; }
.lifecycle-list li::before {
    content: counter(step); position: absolute; left: 0; top: 0.8rem;
    width: 1.8rem; height: 1.8rem; border-radius: 50%;
    background: var(--accent-600); color: var(--white);
    display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm);
}
.lifecycle-list strong { display: block; color: var(--ink-900); }
.lifecycle-list span { font-size: var(--fs-sm); color: var(--ink-600); }

.stat-stack { display: grid; gap: 1rem; }
.stat {
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius); padding: 1.2rem 1.4rem;
}
.section-alt .stat, .section .stat { }
.stat strong { display: block; font-size: var(--fs-2xl); color: var(--brand-cyan); line-height: 1.1; }
.stat span { color: inherit; }
.section-alt .stat { background: var(--paper); border-color: var(--ink-100); }
.section-alt .stat strong { color: var(--accent-700); }

/* ---------------------------------------------- Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.filter-chip {
    padding: 0.4rem 1rem; border-radius: 999px; border: 1.5px solid var(--ink-600);
    color: var(--ink-800); text-decoration: none; font-weight: 600; font-size: var(--fs-sm);
}
.filter-chip:hover { border-color: var(--accent-600); color: var(--accent-700); }
.filter-chip.is-active { background: var(--ink-900); border-color: var(--ink-900); color: var(--white); }

/* ---------------------------------------------- CTA band */
.cta-band { background: linear-gradient(135deg, var(--ink-900), var(--ink-700)); color: var(--ink-100); padding: 3.5rem 0; }
.cta-band h2 { color: var(--white); }
.cta-inner { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 2.5rem; align-items: center; }
.cta-actions { display: grid; gap: 0.8rem; }
.cta-phone { font-size: var(--fs-sm); color: #a9bccd; margin: 0.2rem 0 0; text-align: center; }
.cta-phone a { color: var(--white); font-weight: 700; text-decoration: none; }
.cta-phone a:hover { color: var(--brand-cyan); text-decoration: underline; }
@media (max-width: 860px) { .cta-inner { grid-template-columns: 1fr; } }

/* ---------------------------------------------- Forms */
.lead-form { background: var(--white); border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.lead-form fieldset { border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1.25rem; }
.lead-form legend { font-weight: 700; padding-inline: 0.4rem; }
.radio-row { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.radio-row label { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.field { margin-bottom: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 680px) { .field-row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.optional { font-weight: 400; color: var(--ink-600); font-size: var(--fs-sm); }
.field input, .field textarea {
    width: 100%; padding: 0.65rem 0.8rem; font: inherit;
    border: 1.5px solid var(--ink-600); border-radius: var(--radius); background: var(--white);
}
.field input:focus, .field textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--accent-600); }
.field [aria-invalid="true"] { border-color: #a4262c; }
.field-error, .form-error { color: #a4262c; font-weight: 600; font-size: var(--fs-sm); margin: 0.3rem 0 0; }
.form-error { margin-bottom: 1rem; }
.form-privacy { font-size: var(--fs-sm); color: var(--ink-600); }
.hp-field { position: absolute; left: -9999px; height: 1px; overflow: hidden; }
.contact-aside h2 { font-size: var(--fs-xl); margin-top: 1.5rem; }
.contact-aside h2:first-child { margin-top: 0; }

/* ---------------------------------------------- Footer */
.site-footer { background: var(--ink-900); color: var(--ink-100); padding: 3.5rem 0 1.5rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
@media (max-width: 980px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-heading { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.12em; color: var(--brand-cyan); margin-bottom: 0.8rem; }
.footer-col ul { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.footer-col li { margin-bottom: 0.45rem; }
.footer-col a { color: var(--ink-100); text-decoration: none; }
.footer-col a:hover { color: var(--white); text-decoration: underline; }
.footer-wordmark { font-size: 1.3rem; color: var(--ink-100); margin-bottom: 0.4rem; }
.footer-wordmark strong { color: var(--white); }
.footer-offices { font-size: var(--fs-sm); color: #91a3b5; }
.footer-legal {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
    border-top: 1px solid var(--ink-700); margin-top: 2.5rem; padding-top: 1.5rem;
    font-size: var(--fs-sm); color: #91a3b5;
}
.footer-legal a, .footer-legal .link-button { color: var(--ink-100); }

/* ---------------------------------------------- Consent banner */
.consent-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: var(--white); border-top: 3px solid var(--accent-600);
    box-shadow: 0 -6px 24px rgba(14, 28, 44, 0.18);
}
.consent-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; padding-block: 1.25rem; }
.consent-inner > div:first-child { flex: 1 1 380px; }
.consent-inner h2 { font-size: var(--fs-lg); margin-bottom: 0.25rem; }
.consent-inner p { margin: 0; font-size: var(--fs-sm); color: var(--ink-600); }
.consent-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.consent-actions .btn-ghost { color: var(--ink-800); }

/* ---------------------------------------------- Print */
@media print {
    .site-header, .site-footer, .cta-band, .consent-banner, .hero-actions { display: none; }
    body { background: #fff; color: #000; }
}
