/* ==========================================================================
   segments.css — shared design system for the public audience pages
   (/business, /universities, /government)

   One stylesheet for all three. The only per-page difference is --accent,
   set by a modifier class on <body>.

   The visual language borrows from the subject: a fab process traveler.
   Sections hang off a hairline spine with monospace station labels, and
   figures and codes are set in mono like an instrument readout.
   ========================================================================== */

:root {
    /* Palette shared with pages/intro.ejs so these pages sit in the same world */
    --ink: #020617;
    --panel: #0f172a;
    --panel-raised: #131f38;
    --rule: #1e293b;
    --text: #e2e8f0;
    --text-strong: #f8fafc;
    --muted: #94a3b8;
    --muted-dim: #64748b;

    --font-display: 'Outfit', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    /* Three sizes, not a scale of eleven. */
    --fs-h1: clamp(2rem, 1.2rem + 3vw, 3.25rem);
    --fs-h2: 1.5rem;
    --fs-body: 1rem;

    /* Two radii. */
    --r-sm: 6px;
    --r-md: 10px;

    --page: 1180px;
    --rail: 190px;
    --gutter: clamp(1.25rem, 4vw, 4rem);
    --measure: 62ch;
}

/* Per-page accent. Nothing else changes between the three pages. */
.seg { --accent: #3b82f6; --accent-soft: rgba(59, 130, 246, .12); }
.seg--universities { --accent: #f59e0b; --accent-soft: rgba(245, 158, 11, .12); }
.seg--government { --accent: #ef4444; --accent-soft: rgba(239, 68, 68, .12); }

*, *::before, *::after { box-sizing: border-box; }

.seg {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.seg :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

.seg-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    padding: .75rem 1.25rem;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.seg-skip:focus { left: 0; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */

.seg-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: .875rem var(--gutter);
    background: rgba(2, 6, 23, .85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
}

.seg-back {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--muted);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: .75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: color .18s ease;
}

.seg-back:hover { color: var(--text-strong); }
.seg-back i { font-size: .9rem; }

.seg-mark { height: 34px; width: auto; opacity: .95; }

.seg-topbar-tag {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.seg-hero {
    padding: clamp(3.5rem, 9vw, 7rem) var(--gutter) clamp(3rem, 6vw, 5rem);
    max-width: var(--page);
    margin-inline: auto;
}

.seg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    margin: 0 0 1.5rem;
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--accent);
}

.seg-eyebrow::before {
    content: '';
    width: 28px;
    height: 1px;
    background: var(--accent);
}

.seg-title {
    margin: 0 0 1.5rem;
    max-width: 18ch;
    font-family: var(--font-display);
    font-size: var(--fs-h1);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -.025em;
    color: var(--text-strong);
    text-wrap: balance;
}

.seg-lede {
    margin: 0;
    max-width: 56ch;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--muted);
}

.seg-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .875rem;
    margin-top: 2.5rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.seg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .8rem 1.6rem;
    border: 1px solid var(--accent);
    border-radius: var(--r-sm);
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: filter .18s ease, transform .18s ease;
}

.seg-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }

.seg-btn--ghost {
    background: transparent;
    border-color: var(--rule);
    color: var(--text);
}

.seg-btn--ghost:hover {
    border-color: var(--muted);
    filter: none;
    background: rgba(255, 255, 255, .03);
}

/* An address is a literal string: never upper-case it, and set it in the
   same mono face used elsewhere for machine-readable values. */
.seg-btn--mail {
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: 0;
    text-transform: none;
}

/* ── Section grid: the process spine ─────────────────────────────────────── */

.seg-section {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    gap: 0 clamp(1.5rem, 4vw, 3.5rem);
    padding: clamp(2.75rem, 6vw, 4.5rem) var(--gutter);
    border-top: 1px solid var(--rule);
    max-width: var(--page);
    margin-inline: auto;
}

.seg-section-label {
    position: relative;
    align-self: stretch;
    padding-right: clamp(1.5rem, 4vw, 3.5rem);
    border-right: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: .72rem;
    line-height: 1.5;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--muted-dim);
}

/* The marker rides the spine and fills with the accent once its section has
   been reached. This is the page's one moment of motion. */
.seg-section-label::after {
    content: '';
    position: absolute;
    top: .35rem;
    right: -4px;
    width: 7px;
    height: 7px;
    background: var(--rule);
    transform: rotate(45deg);
    transition: background-color .4s ease;
}

.seg-section.is-reached .seg-section-label::after { background: var(--accent); }

.seg-section-body > *:first-child { margin-top: 0; }
.seg-section-body > *:last-child { margin-bottom: 0; }

.seg-h2 {
    margin: 0 0 1.25rem;
    font-family: var(--font-display);
    font-size: var(--fs-h2);
    font-weight: 600;
    letter-spacing: -.015em;
    color: var(--text-strong);
}

.seg-prose {
    max-width: var(--measure);
    margin: 0 0 2rem;
    color: var(--muted);
    line-height: 1.75;
}

/* ── Definition list: replaces the identical-tile grids ──────────────────── */

.seg-deflist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.25rem 3rem;
    margin: 0;
}

.seg-def { margin: 0; }

.seg-def-term {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    margin-bottom: .6rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-strong);
}

.seg-def-term i {
    font-size: .95rem;
    color: var(--accent);
    flex-shrink: 0;
}

.seg-def-desc {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.65;
}

.seg-def-points {
    list-style: none;
    margin: .85rem 0 0;
    padding: 0;
}

.seg-def-points li {
    position: relative;
    padding-left: 1.1rem;
    margin-bottom: .3rem;
    font-size: .875rem;
    color: var(--text);
}

.seg-def-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .62em;
    width: 4px;
    height: 1px;
    background: var(--accent);
}

/* ── Plain checked list ──────────────────────────────────────────────────── */

.seg-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: var(--measure);
}

.seg-list li {
    display: flex;
    gap: .85rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--rule);
    color: var(--text);
    font-size: .95rem;
    line-height: 1.6;
}

.seg-list li:first-child { padding-top: 0; }
.seg-list li:last-child { border-bottom: 0; padding-bottom: 0; }

.seg-list i {
    flex-shrink: 0;
    margin-top: .25rem;
    font-size: .85rem;
    color: var(--accent);
}

/* ── Figures, set as instrument readouts rather than cards ───────────────── */

.seg-figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    overflow: hidden;
}

.seg-figure { background: var(--panel); padding: 1.5rem 1.4rem; }

.seg-figure-value {
    font-family: var(--font-mono);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    letter-spacing: -.02em;
}

.seg-figure-label {
    margin-top: .55rem;
    font-size: .82rem;
    color: var(--muted);
}

/* ── Cards, only where the content is genuinely distinct ─────────────────── */

.seg-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.seg-card {
    padding: 1.4rem;
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    transition: border-color .2s ease, background-color .2s ease;
}

.seg-card:hover {
    border-color: var(--accent);
    background: var(--panel-raised);
}

.seg-card-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 .55rem;
    font-family: var(--font-display);
    font-size: .98rem;
    font-weight: 600;
    color: var(--text-strong);
}

.seg-card-title i { color: var(--accent); font-size: .95rem; }

.seg-card-desc {
    margin: 0;
    font-size: .88rem;
    line-height: 1.6;
    color: var(--muted);
}

/* ── Compliance codes ────────────────────────────────────────────────────── */

.seg-codes {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.seg-codes li {
    padding: .5rem .85rem;
    border: 1px solid var(--rule);
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: .74rem;
    letter-spacing: .06em;
    color: var(--text);
}

/* ── Callout ─────────────────────────────────────────────────────────────── */

.seg-callout {
    padding: 1.5rem 1.6rem;
    background: var(--panel);
    border: 1px solid var(--rule);
    border-left: 2px solid var(--accent);
    border-radius: 0 var(--r-md) var(--r-md) 0;
}

.seg-callout-title {
    margin: 0 0 1rem;
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--accent);
}

.seg-callout .seg-list li { border-bottom-color: rgba(255, 255, 255, .06); }

/* ── Engagement steps: the one place numbering is real ───────────────────── */

.seg-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.75rem;
    margin: 0 0 2.5rem;
    padding: 0;
    list-style: none;
    counter-reset: seg-step;
}

.seg-step { counter-increment: seg-step; }

.seg-step::before {
    content: '0' counter(seg-step);
    display: block;
    margin-bottom: .7rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .1em;
    color: var(--accent);
}

.seg-step-title {
    margin: 0 0 .35rem;
    font-family: var(--font-display);
    font-size: .98rem;
    font-weight: 600;
    color: var(--text-strong);
}

.seg-step-desc {
    margin: 0;
    font-size: .88rem;
    line-height: 1.6;
    color: var(--muted);
}

.seg-contact-note {
    margin: 1.25rem 0 0;
    font-size: .85rem;
    color: var(--muted-dim);
}

.seg-contact-note a { color: var(--muted); }

/* ── Dialog ──────────────────────────────────────────────────────────────── */

.seg-dialog {
    width: min(30rem, calc(100vw - 2rem));
    padding: 0;
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    color: var(--text);
}

.seg-dialog::backdrop { background: rgba(2, 6, 23, .78); }

.seg-dialog-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--rule);
}

.seg-dialog-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-strong);
}

.seg-dialog-close {
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: var(--r-sm);
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    transition: color .18s ease, border-color .18s ease;
}

.seg-dialog-close:hover { color: var(--text-strong); border-color: var(--muted); }

.seg-form { padding: 1.4rem; }

.seg-field { margin-bottom: 1rem; }

.seg-label {
    display: block;
    margin-bottom: .4rem;
    font-family: var(--font-mono);
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

.seg-input {
    width: 100%;
    padding: .65rem .8rem;
    background: var(--ink);
    border: 1px solid var(--rule);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: .92rem;
}

.seg-input:focus { border-color: var(--accent); outline: none; }
.seg-input:user-invalid { border-color: #f87171; }

.seg-form-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.4rem;
}

.seg-form-actions .seg-btn { flex: 1; }

.seg-form-note {
    margin: 1rem 0 0;
    font-size: .78rem;
    line-height: 1.5;
    color: var(--muted-dim);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

/* The shared sponsor footer partial leans on Bootstrap's .container and
   .text-center, which these pages no longer load, and sets its own rule and
   spacing inline. Scope replacements to this wrapper rather than redefining
   Bootstrap's class names globally. */
.seg-footer { padding: 0 var(--gutter); }

.seg-footer > footer {
    margin-top: 0 !important;
    border-top-color: var(--rule) !important;
    padding-bottom: 1rem !important;
}

.seg-footer .container {
    max-width: var(--page);
    margin: 0 auto;
    text-align: center;
}

/* ── Reveal ──────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
    .seg-js .seg-section {
        opacity: 0;
        transform: translateY(12px);
        transition: opacity .5s ease, transform .5s ease;
    }

    .seg-js .seg-section.is-reached {
        opacity: 1;
        transform: none;
    }
}

/* ── Narrow ──────────────────────────────────────────────────────────────── */

@media (max-width: 860px) {
    .seg-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
    }

    .seg-section-label {
        align-self: start;
        padding-right: 0;
        padding-left: 1rem;
        border-right: 0;
        border-left: 1px solid var(--rule);
    }

    .seg-section-label::after {
        top: .35rem;
        right: auto;
        left: -4px;
    }

    .seg-title { max-width: none; }
    .seg-actions .seg-btn { flex: 1 1 100%; }
}
