/* ==========================================================================
   MediaSix.ai -- site stylesheet
   Light theme, single teal accent, Roboto (variable) throughout at a light
   weight for titles and paragraphs, hand-rolled grid/flexbox. Flat colour only: no gradients anywhere.
   No CSS framework by design.
   ========================================================================== */

:root {
    /* Ground and surfaces */
    --bg: #ffffff;
    --bg-alt: #f7f8fa;
    --surface: #ffffff;
    --surface-hi: #f4f6f8;
    --surface-tint: #f3f9f8;
    --border: #e3e6ea;
    --border-hi: #cdd3da;
    /* Text */
    --text: #222222;
    --text-dim: #4a5059;
    --text-mute: #6b717a;
    /* Single accent. Deep teal rather than the old bright one, so it clears
       WCAG AA as text on white. */
    --accent: #0f766e;
    --accent-hi: #115e59;
    --accent-dim: #3aa89c;
    --accent-wash: rgba(15, 118, 110, 0.07);
    --accent-edge: rgba(15, 118, 110, 0.28);
    /* Status colours */
    --warn: #8a5a00;
    --warn-wash: rgba(202, 138, 4, 0.10);
    --warn-edge: rgba(202, 138, 4, 0.38);
    --warn-mark: #ca8a04;
    --font-body: "Roboto", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-heading: var(--font-body);
    /* Titles and paragraph text: Roboto at weight 300, width 100.
       --weight-fine is for any text set below 10px; nothing is that small today
       (the smallest, badges, is 11px), so it is defined but not yet applied. */
    --weight-text: 300;
    --weight-title: 500;
    --weight-fine: 200;
    --width-text: 100%;
    --nav-h: 64px;
    --radius: 10px;
    --radius-lg: 14px;
    --maxw: 1120px;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-lift: 0 12px 28px -12px rgba(16, 24, 40, 0.18);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    color-scheme: light;
}

/* --------------------------------------------------------------------------
   Reset and base
   -------------------------------------------------------------------------- */

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

html {
    /* Smooth anchor navigation. scroll-padding-top keeps section headings clear
       of the sticky nav -- without it every anchor target lands underneath it. */
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 12px);
    -webkit-text-size-adjust: 100%;
}

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

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: var(--weight-text);
    font-stretch: var(--width-text);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 {
    margin: 0;
    font-family: var(--font-heading);
    line-height: 1.15;
    letter-spacing: -0.01em;
    font-weight: var(--weight-title);
}

p {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s var(--ease);
}

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

/* Visible keyboard focus everywhere. */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Blazor's <FocusOnNavigate Selector="h1" /> moves focus to the page heading on
   navigation, which is correct for screen-reader users but drew a focus ring
   around the hero wordmark on first load. Headings are not interactive, so the
   ring is suppressed here while the focus itself is left intact. */
h1:focus,
h1:focus-visible {
    outline: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    /* Side gutter set once here, so no section can lose it. */
    padding-inline: 24px;
}

.ext-icon {
    margin-left: 0.35em;
    vertical-align: -1px;
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Sticky nav
   -------------------------------------------------------------------------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding-inline: 24px;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-family: var(--font-heading);
    font-weight: var(--weight-text);
    font-size: 1.0625rem;
    white-space: nowrap;
}

.nav-brand:hover {
    color: var(--text);
}

/* Geometric brand mark: a rotated square with a hollow centre.
   Chosen over any illustrative logo -- no brains, no robots. */
.nav-mark {
    width: 14px;
    height: 14px;
    flex: none;
    transform: rotate(45deg);
    border: 2px solid var(--accent);
    border-radius: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 0.9375rem;
}

.nav-links a {
    color: var(--text-dim);
    position: relative;
    padding-block: 4px;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1.5px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s var(--ease);
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-hi);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: var(--text);
    align-items: center;
    justify-content: center;
}

.nav-toggle-bars {
    display: block;
    position: relative;
    width: 18px;
    height: 12px;
}

.nav-toggle-bars span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: currentColor;
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 5.25px; }
.nav-toggle-bars span:nth-child(3) { top: 10.5px; }

.nav-toggle-bars.is-open span:nth-child(1) { transform: translateY(5.25px) rotate(45deg); }
.nav-toggle-bars.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle-bars.is-open span:nth-child(3) { transform: translateY(-5.25px) rotate(-45deg); }

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

.hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(72px, 14vh, 132px) clamp(56px, 10vh, 96px);
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    position: relative;
}

/* Portrait: a 180px circle with a faint accent ring. Stacks above the name on
   narrow screens and moves to the right of the text on desktop. */
.hero-photo {
    display: block;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-edge);
    box-shadow: 0 0 0 6px var(--accent-wash), var(--shadow-lift);
    background: var(--surface-hi);
}

/* Portrait plus the company details beneath it. Always on the right: on narrow
   screens it stacks above the name but stays right-aligned. */
.hero-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 22px;
    margin-bottom: 36px;
}

/* Name and title between the portrait and the company details. The title is a
   long pipe-separated line, so it is capped in width and wraps. */
.hero-identity {
    display: flex;
    flex-direction: column;
    align-items: inherit;
    gap: 4px;
    margin-top: -6px;
}

.hero-identity-name {
    font-size: 1.125rem;
    font-weight: var(--weight-title);
    color: var(--text);
    line-height: 1.3;
}

.hero-identity-title {
    max-width: 34ch;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-dim);
}

/* A phrase never breaks internally; lines wrap at the separators. */
.hero-identity-part {
    white-space: nowrap;
}

.hero-identity-sep {
    color: var(--text-mute);
}

.hero-contact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-style: normal;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-dim);
}

.hero-contact-company {
    color: var(--text);
    font-size: 0.9375rem;
}

.hero-contact a {
    color: var(--accent);
}

@media (min-width: 760px) {
    .hero-inner.has-photo {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 48px;
    }

    /* Right-hand column, centred under the portrait, and lifted 10% of its own
       height above the text column's centre line. */
    .hero-inner.has-photo .hero-aside {
        order: 2;
        align-items: center;
        text-align: center;
        margin-bottom: 0;
        transform: translateY(-10%);
    }

    .hero-inner.has-photo .hero-contact {
        align-items: center;
    }
}

.hero-brand {
    font-size: clamp(2.75rem, 8vw, 5rem);
    letter-spacing: -0.03em;
    font-weight: var(--weight-text);
    xfont-weight: 300;
    color: var(--text);
}

.hero-tagline {
    margin-top: 20px;
    max-width: 46ch;
    font-size: clamp(1.0625rem, 2.2vw, 1.3125rem);
    color: var(--text-dim);
    line-height: 1.5;
}

.hero-creds {
    margin-top: 28px;
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid var(--accent-edge);
    background: var(--accent-wash);
    border-radius: 999px;
    color: var(--accent-hi);
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
}

.hero-ctas {
    margin-top: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* --------------------------------------------------------------------------
   Buttons and link CTAs
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease),
                transform 0.18s var(--ease), color 0.18s var(--ease);
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-hi);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-ghost {
    border-color: var(--border-hi);
    color: var(--text);
    background: transparent;
}

.btn-ghost:hover {
    border-color: var(--accent-edge);
    background: var(--accent-wash);
    color: var(--text);
    transform: translateY(-1px);
}

.link-cta {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
}

.link-muted {
    font-size: 0.875rem;
    color: var(--text-mute);
}

/* --------------------------------------------------------------------------
   Section scaffolding
   -------------------------------------------------------------------------- */

.section {
    padding-block: clamp(64px, 9vh, 104px);
    border-bottom: 1px solid var(--border);
}

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

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
}

.section-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.section-title {
    font-size: clamp(1.625rem, 4vw, 2.25rem);
}

.section-intro {
    margin-top: 14px;
    max-width: 62ch;
    color: var(--text-dim);
    font-size: 1rem;
}

.section-head-note {
    flex: none;
    padding-bottom: 6px;
}

.live-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-wash);
    animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* --------------------------------------------------------------------------
   Pills / badges
   -------------------------------------------------------------------------- */

.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
}

.pills-lg {
    margin-bottom: 36px;
}

.pill {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--surface-hi);
    border: 1px solid var(--border);
    color: var(--text-dim);
    white-space: nowrap;
}

.badge {
    flex: none;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 5px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-code,
.badge-done {
    background: var(--accent-wash);
    border-color: var(--accent-edge);
    color: var(--accent-hi);
}

/* Case study reads as a different kind of thing from a code link, so it gets
   its own colour rather than a variant of the open-source badge. */
.badge-case {
    background: rgba(71, 85, 105, 0.08);
    border-color: rgba(71, 85, 105, 0.28);
    color: #3f4a5a;
}

.badge-soon,
.badge-progress {
    background: var(--warn-wash);
    border-color: var(--warn-edge);
    color: var(--warn);
}

/* --------------------------------------------------------------------------
   Featured work
   -------------------------------------------------------------------------- */

/* Two columns rather than auto-fit. With exactly four cards, auto-fit packed
   three across on a wide screen and left a lone card stranded on the second
   row; a 2x2 block sits squarely above the full-width case study banner and
   gives the longer descriptions room to breathe. */
.work-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 760px) {
    .work-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.work-wide-row {
    margin-top: 20px;
}

.work-card {
    display: flex;
    flex-direction: column;
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease),
                box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}

.work-card:hover {
    border-color: var(--border-hi);
    background: var(--surface-hi);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
}

.work-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.work-card-head h3 {
    font-size: 1.0625rem;
}

.work-card-body {
    margin-top: 14px;
    color: var(--text-dim);
    font-size: 0.9375rem;
}

.work-card-foot {
    margin-top: auto;
    padding-top: 20px;
    /* A case study card can carry two links: its summary section and its full page. */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 24px;
}

/* The case study banner: full width, distinct left accent edge. */
.work-card.is-wide {
    padding: 32px;
}

.work-card.is-case-study {
    border-left: 3px solid var(--accent-dim);
    background: var(--surface-tint);
}

.work-card.is-case-study:hover {
    background: var(--surface-tint);
}

.work-card.is-wide .work-card-head h3 {
    font-size: 1.25rem;
}

.work-card.is-wide .work-card-body {
    max-width: 72ch;
}

/* --------------------------------------------------------------------------
   Open source repo cards
   -------------------------------------------------------------------------- */

/* One card per row, so the order in content.json reads top to bottom. */
.repo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.repo-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease),
                background-color 0.2s var(--ease);
}

.repo-card:hover {
    border-color: var(--border-hi);
    background: var(--surface-hi);
    transform: translateY(-2px);
}

/* An unpublished repo is dimmed rather than hidden: it signals that work is
   coming without pretending the repo is already there. */
.repo-card.is-soon {
    opacity: 0.62;
    border-style: dashed;
}

.repo-card.is-soon:hover {
    transform: none;
}

.repo-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

/* A title, so it takes the title face and weight; the owner/name slug beneath
   stays monospace. */
.repo-name {
    font-size: 1rem;
    font-weight: 600;
}

.repo-name a {
    color: var(--text);
}

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

.repo-slug {
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-mute);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.repo-desc {
    margin-top: 14px;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.repo-meta {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 0.8125rem;
    color: var(--text-mute);
}

.repo-meta li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lang-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
}

.repo-stale {
    font-style: italic;
}

/* Loading skeletons, sized to match a real card so the grid does not jump. */
.repo-card.is-skeleton {
    min-height: 168px;
    gap: 12px;
}

.skeleton {
    height: 11px;
    border-radius: 4px;
    background: var(--border);
    animation: pulse 1.4s var(--ease) infinite;
}

.skeleton-title {
    height: 15px;
    width: 58%;
    margin-bottom: 8px;
}

.skeleton-line { width: 100%; }
.skeleton-line.short { width: 72%; }

/* --------------------------------------------------------------------------
   Engineering & tooling -- compact rows, deliberately not the card grid
   -------------------------------------------------------------------------- */

.eng-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
}

.eng-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.18s var(--ease);
}

.eng-item:last-child {
    border-bottom: none;
}

.eng-item:hover {
    background: var(--surface-hi);
}

.eng-name {
    font-size: 1rem;
}

.eng-desc {
    margin-top: 5px;
    font-size: 0.875rem;
    color: var(--text-dim);
    max-width: 72ch;
}

.eng-item-action {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.eng-note {
    font-size: 0.75rem;
    color: var(--text-mute);
    padding: 4px 10px;
    border: 1px dashed var(--border-hi);
    border-radius: 6px;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Credentials timeline
   -------------------------------------------------------------------------- */

.cred-timeline {
    position: relative;
    padding-left: 28px;
}

/* The spine. Drawn on the list rather than per item so it is continuous. */
.cred-timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--border-hi);
}

.cred-item {
    position: relative;
    padding-bottom: 36px;
}

.cred-item:last-child {
    padding-bottom: 0;
}

.cred-marker {
    position: absolute;
    left: -28px;
    top: 7px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg-alt);
    border: 2px solid var(--border-hi);
}

.cred-item.is-done .cred-marker {
    background: var(--accent);
    border-color: var(--accent);
}

.cred-item.is-progress .cred-marker {
    border-color: var(--warn-mark);
    background: var(--bg-alt);
}

.cred-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.cred-title {
    font-size: 1.125rem;
}

.cred-issuer {
    margin-top: 6px;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.cred-sep {
    margin-inline: 8px;
    color: var(--text-mute);
}

.cred-date {
    color: var(--text-mute);
}

.cred-details {
    margin-top: 14px;
    display: grid;
    gap: 7px;
}

.cred-details li {
    position: relative;
    padding-left: 18px;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.cred-details li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: var(--accent-dim);
}

.cred-body .link-cta {
    margin-top: 14px;
}

/* --------------------------------------------------------------------------
   Case study
   -------------------------------------------------------------------------- */

.study-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 24px;
}

.study-block {
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    border-top: 2px solid var(--accent-dim);
}

.study-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.study-body {
    margin-top: 14px;
    font-size: 0.9375rem;
    color: var(--text-dim);
}

.study-cta {
    margin-top: 32px;
}

/* --------------------------------------------------------------------------
   Case study page (/case-studies/{slug})
   -------------------------------------------------------------------------- */

.cs-back {
    display: inline-block;
    margin-bottom: 28px;
    font-size: 0.875rem;
    font-weight: 500;
}

.cs-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}

.cs-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: var(--weight-title);
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.cs-subtitle {
    margin-top: 16px;
    max-width: 62ch;
    font-size: 1.1875rem;
    color: var(--text);
}

.cs-lede {
    margin-top: 16px;
    max-width: 66ch;
    color: var(--text-dim);
}

.cs-hero-image {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    max-width: 100%;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
}

.cs-hero-image img {
    width: 80%;
    height: auto;
    object-fit: contain;
}

.cs-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 0;
    margin: 48px 0 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.cs-fact {
    padding: 20px 24px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    /* Tucks the outer row and column borders under the container's own edge. */
    margin: 0 -1px -1px 0;
}

.cs-fact-value {
    font-size: 1.75rem;
    font-weight: var(--weight-title);
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.cs-fact-label {
    margin: 4px 0 0;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.cs-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: start;
}

.cs-prose {
    max-width: 68ch;
}

.cs-paragraph {
    margin-top: 18px;
    color: var(--text-dim);
}

.cs-bullets {
    margin-top: 20px;
    display: grid;
    gap: 12px;
}

.cs-bullets li {
    position: relative;
    padding-left: 22px;
    color: var(--text-dim);
}

.cs-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.8em;
    width: 10px;
    height: 2px;
    background: var(--accent-dim);
}

.score-card {
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lift);
}

.score-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.score-card-index {
    border-left: 3px solid var(--text);
    padding-left: 16px;
}

.score-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.score-card-value {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    margin-block: 6px 4px;
    font-variant-numeric: tabular-nums;
}

.score-card-tier {
    font-size: 0.9375rem;
    color: var(--text-dim);
}

.score-card-subject {
    display: grid;
    justify-items: end;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-dim);
    text-align: right;
}

.score-lines {
    margin-top: 26px;
    display: grid;
    gap: 14px;
}

.score-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    align-items: baseline;
}

.score-line-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.score-line-value {
    font-size: 0.875rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.score-line-value small {
    color: var(--text-mute);
    font-size: 0.75rem;
    font-weight: var(--weight-text);
}

.score-bar {
    grid-column: 1 / -1;
    height: 6px;
    border-radius: 3px;
    background: var(--surface-hi);
    overflow: hidden;
}

.score-bar span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--accent);
}

.score-card-caption {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-mute);
}

.cs-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 32px;
}

.cs-foot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

@media (min-width: 900px) {
    .cs-hero-grid.has-image {
        grid-template-columns: 1.3fr 0.7fr;
    }

    .cs-split.has-aside {
        grid-template-columns: 1.1fr 0.9fr;
        gap: 56px;
    }
}

@media (max-width: 520px) {
    .score-card {
        padding: 22px;
    }

    .score-card-subject {
        justify-items: start;
        text-align: left;
    }
}

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

.footer {
    background: var(--bg-alt);
    padding-top: 56px;
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
    padding-bottom: 40px;
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: var(--weight-text);
    color: var(--text);
}

.footer-tagline {
    margin-top: 8px;
    max-width: 46ch;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9375rem;
}

.footer-legal {
    border-top: 1px solid var(--border);
    padding-block: 22px 28px;
    font-size: 0.8125rem;
    color: var(--text-mute);
}

.notfound {
    text-align: left;
    padding-block: 40px;
}

.notfound .btn {
    margin-top: 28px;
}

/* --------------------------------------------------------------------------
   Blazor boot screen and error UI
   Restyled to the site palette, so the boot screen matches the page it becomes.
   -------------------------------------------------------------------------- */

#app {
    min-height: 100vh;
}

.loading-progress {
    position: fixed;
    display: block;
    width: 6rem;
    height: 6rem;
    top: calc(50vh - 3rem);
    left: calc(50vw - 3rem);
}

.loading-progress circle {
    fill: none;
    stroke: var(--border-hi);
    stroke-width: 0.5rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141592653589793 * var(--blazor-load-percentage, 0%));
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: fixed;
    text-align: center;
    inset: calc(50vh - 0.8rem) 0 auto 0.9rem;
    color: var(--text-dim);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading");
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 14px 24px;
    background: #fff8e6;
    color: #5c3d00;
    border-top: 1px solid #f0c36d;
    box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.12);
    font-size: 0.875rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
    padding-left: 16px;
}

#blazor-error-ui .reload {
    color: var(--accent-hi);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .eng-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
}

@media (max-width: 720px) {
    .nav-toggle {
        display: inline-flex;
    }

    /* Collapsed menu: a full-width panel dropping below the nav bar. */
    .nav-links {
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg-alt);
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
        display: none;
        box-shadow: var(--shadow-lift);
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links a {
        padding: 13px 24px;
        color: var(--text);
        font-size: 1rem;
    }

    .nav-links a::after {
        display: none;
    }

    .nav-links a:active {
        background: var(--surface-hi);
    }

    .container,
    .nav-inner {
        padding-inline: 20px;
    }

    .hero-ctas .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .work-card,
    .work-card.is-wide {
        padding: 22px;
    }

    .study-block {
        padding: 22px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 24px;
    }
}
