/*
 * humzaimran.com — theme layer.
 * ---------------------------------------------------------------------------
 * Loaded LAST, after app.css / pages.css / lms.css / auth.css / admin.css.
 *
 * It deliberately does not redefine --brand-primary or --brand-accent: those
 * two are written into the page by partials/head-meta.php from the branding
 * settings, and everything here is derived from them with color-mix() so that
 * changing the primary colour in the admin panel actually re-tints the site.
 *
 * Every color-mix() declaration is preceded by a flat fallback, so a browser
 * without it still gets a sensible colour rather than an unstyled element.
 */

/* ============================================================== 1. tokens */

:root {
    /* Typography ------------------------------------------------------- */
    --font-display: "Outfit", "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
    --font-body: "Outfit", "Inter", "Segoe UI", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* A fluid scale. Each step interpolates between a phone and a desktop. */
    --step--1: clamp(0.82rem, 0.79rem + 0.13vw, 0.89rem);
    --step-0: clamp(1rem, 0.96rem + 0.18vw, 1.09rem);
    --step-1: clamp(1.2rem, 1.13rem + 0.35vw, 1.42rem);
    --step-2: clamp(1.44rem, 1.32rem + 0.6vw, 1.85rem);
    --step-3: clamp(1.73rem, 1.53rem + 0.98vw, 2.4rem);
    --step-4: clamp(2.07rem, 1.76rem + 1.55vw, 3.11rem);
    --step-5: clamp(2.49rem, 2rem + 2.42vw, 4.05rem);

    /* Surfaces — deep navy constellation field, glass cards on top. */
    --navy-0: #050814;
    --navy-1: #070b16;
    --navy-2: #0c1222;
    --navy-3: #121a2e;
    --navy-4: #182238;
    --surface: #070b16;
    --surface-alt: #0b1220;
    --surface-sunken: #121a2e;
    --surface-invert: #f4f7fb;
    --surface-glass: rgb(10 16 32 / 78%);
    --border: rgb(255 255 255 / 8%);
    --border-strong: rgb(255 255 255 / 14%);

    /* Ink -------------------------------------------------------------- */
    --ink: #f5f7fb;
    --ink-soft: #c3cad8;
    --ink-muted: #8b95a8;
    --ink-faint: #6b7388;
    --ink-invert: #0b1020;
    --on-brand: #0b1020;

    /* Brand derivations. --brand-primary/--brand-accent come from settings.
       Defaults are gold, mixed into the navy field rather than into white. */
    --brand-ink: #f0c14a;
    --brand-ink: color-mix(in srgb, var(--brand-primary) 82%, #ffffff);
    --brand-soft: #1c2236;
    --brand-soft: color-mix(in srgb, var(--brand-primary) 16%, #121a2e);
    --brand-softer: #141b2c;
    --brand-softer: color-mix(in srgb, var(--brand-primary) 8%, #0c1222);
    --brand-line: #3d3a28;
    --brand-line: color-mix(in srgb, var(--brand-primary) 32%, #1a2238);
    --brand-veil: rgb(240 193 74 / 16%);
    --brand-veil: color-mix(in srgb, var(--brand-primary) 16%, transparent);
    --accent-veil: rgb(246 213 106 / 12%);
    --accent-veil: color-mix(in srgb, var(--brand-accent) 14%, transparent);

    --gradient-brand: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    --gradient-brand-soft: linear-gradient(160deg, var(--brand-softer), var(--brand-soft));
    --gradient-ink: linear-gradient(165deg, #050814 0%, #0b1224 48%, #070b16 100%);

    /* Status ----------------------------------------------------------- */
    --ok: #3dcf96;
    --ok-soft: rgb(61 207 150 / 12%);
    --warn: #f0c14a;
    --warn-soft: rgb(240 193 74 / 12%);
    --danger: #f07178;
    --danger-soft: rgb(240 113 120 / 12%);

    /* Shape and depth --------------------------------------------------- */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgb(0 0 0 / 24%);
    --shadow-sm: 0 8px 24px rgb(0 0 0 / 28%);
    --shadow-md: 0 16px 40px -12px rgb(0 0 0 / 45%);
    --shadow-lg: 0 24px 60px -16px rgb(0 0 0 / 55%);
    --shadow-xl: 0 40px 90px -20px rgb(0 0 0 / 65%);
    --shadow-brand: 0 12px 36px -10px color-mix(in srgb, var(--brand-primary) 45%, transparent);

    --container: 1180px;
    --container-narrow: 760px;
    --gutter: clamp(1.15rem, 4vw, 2.5rem);

    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================================== 2. base type */

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

body {
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.7;
    color: var(--ink-soft);
    background: var(--navy-0);
    font-feature-settings: "cv05" 1, "ss01" 1;
    text-rendering: optimizeLegibility;
    position: relative;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--ink);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.021em;
    text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { text-wrap: pretty; }

a {
    color: var(--brand-ink);
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--brand-line);
    transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}

a:hover {
    color: var(--brand-primary);
    text-decoration-color: currentColor;
}

code, kbd, samp, pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: var(--brand-veil);
    color: var(--brand-ink);
}

/* A restrained scrollbar on the browsers that let us style one. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

/* ==================================================== 2b. constellation */

.starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(1.2px 1.2px at 8% 18%, rgb(255 255 255 / 45%), transparent),
        radial-gradient(1px 1px at 18% 72%, rgb(255 255 255 / 28%), transparent),
        radial-gradient(1.4px 1.4px at 32% 12%, rgb(255 255 255 / 38%), transparent),
        radial-gradient(1px 1px at 46% 84%, rgb(255 255 255 / 22%), transparent),
        radial-gradient(1.2px 1.2px at 62% 22%, rgb(255 255 255 / 40%), transparent),
        radial-gradient(1px 1px at 74% 64%, rgb(255 255 255 / 26%), transparent),
        radial-gradient(1.5px 1.5px at 88% 14%, rgb(255 255 255 / 42%), transparent),
        radial-gradient(1px 1px at 92% 78%, rgb(255 255 255 / 24%), transparent),
        radial-gradient(1.1px 1.1px at 14% 44%, rgb(255 255 255 / 20%), transparent),
        radial-gradient(1px 1px at 54% 38%, rgb(255 255 255 / 18%), transparent),
        radial-gradient(80% 50% at 50% -10%, rgb(240 193 74 / 7%), transparent 58%),
        radial-gradient(40% 40% at 92% 88%, rgb(80 110 200 / 10%), transparent 70%),
        radial-gradient(36% 36% at 6% 90%, rgb(80 110 200 / 8%), transparent 70%),
        var(--navy-0);
}

.starfield__canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.site-header,
main,
.site-footer,
.auth,
.error-page__inner {
    position: relative;
    z-index: 1;
}

/* ==================================================== 3. layout & section */

.section {
    padding: clamp(3.5rem, 8vw, 6.5rem) var(--gutter);
    position: relative;
}

.section--alt {
    background: rgb(8 14 28 / 55%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section__inner {
    max-width: var(--container);
    margin: 0 auto;
}

.section__inner--narrow {
    max-width: var(--container-narrow);
}

.section__head {
    display: block;
    max-width: 44rem;
    margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.section__title {
    margin: 0 0 0.6rem;
    font-size: var(--step-3);
}

.section__sub {
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--step-1);
    line-height: 1.55;
    font-weight: 400;
}

/*
 * Several pages stack two or three titled blocks inside a single section. A
 * heading that follows content needs room above it, but the one inside a
 * section head follows its own eyebrow and must not be pushed down — hence
 * the second rule, which comes later and wins at equal specificity.
 */
.section__title:not(:first-child) {
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.section__head .section__title {
    margin-top: 0;
}

/* A small capitalised label that sits above a heading. */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.9rem;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--brand-primary);
}

.eyebrow::before {
    content: "";
    width: 1.75rem;
    height: 2px;
    border-radius: 2px;
    background: var(--gradient-brand);
}

.eyebrow--center {
    justify-content: center;
}

.section__head--center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section__head--center .section__title,
.section__head--center .section__sub {
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================= 4. buttons */

.btn {
    padding: 0.72rem 1.4rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.005em;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    isolation: isolate;
    transition:
        transform 0.2s var(--ease-out),
        box-shadow 0.25s var(--ease),
        background-color 0.2s var(--ease),
        border-color 0.2s var(--ease),
        color 0.2s var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-lg {
    padding: 0.92rem 1.9rem;
    font-size: 1.02rem;
}

.btn-sm {
    padding: 0.42rem 0.95rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--brand-primary);
    background-image: var(--gradient-brand);
    color: var(--on-brand);
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
    color: var(--on-brand);
    box-shadow: var(--shadow-brand);
}

/* The sheen is a pseudo-element so the gradient underneath stays intact. */
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(135deg, rgb(255 255 255 / 22%), transparent 55%);
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}

.btn-primary:hover::after { opacity: 1; }

.btn-outline {
    background: rgb(255 255 255 / 4%);
    border-color: var(--border-strong);
    color: var(--ink);
    box-shadow: none;
}

.btn-outline:hover {
    border-color: var(--brand-primary);
    color: var(--brand-ink);
    background: var(--brand-softer);
    box-shadow: none;
}

.btn-ghost {
    color: var(--ink-soft);
    background: transparent;
}

.btn-ghost:hover {
    color: var(--ink);
    background: rgb(255 255 255 / 6%);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-block { border-radius: var(--radius-sm); }

/* ======================================================= 5. pills & tags */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: var(--surface-sunken);
    color: var(--ink-soft);
    white-space: nowrap;
}

.pill--success { background: var(--ok-soft); color: var(--ok); }
.pill--warn    { background: var(--warn-soft); color: var(--warn); }
.pill--danger  { background: var(--danger-soft); color: var(--danger); }
.pill--brand   { background: var(--brand-soft); color: var(--brand-ink); }
.pill--muted   { background: var(--surface-sunken); color: var(--ink-muted); }

.tag,
.tag--link {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.8rem;
    border-radius: var(--radius-pill);
    background: var(--brand-softer);
    border: 1px solid var(--brand-line);
    color: var(--brand-ink);
    font-size: 0.81rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.tag--link:hover {
    background: var(--brand-soft);
    border-color: var(--brand-primary);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Filter chips on the research / projects / courses pages. */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filters__chip {
    padding: 0.45rem 1.05rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.18s var(--ease);
}

.filters__chip:hover {
    border-color: var(--brand-line);
    background: var(--brand-softer);
    color: var(--brand-ink);
}

.filters__chip.is-active,
.filters__chip[aria-current="true"] {
    background: var(--brand-primary);
    background-image: var(--gradient-brand);
    border-color: transparent;
    color: var(--on-brand);
    box-shadow: var(--shadow-brand);
}

/* ========================================================== 6. site header */

.site-header {
    background: rgb(7 11 22 / 72%);
    -webkit-backdrop-filter: saturate(140%) blur(18px);
    backdrop-filter: saturate(140%) blur(18px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
        background-color 0.25s var(--ease);
}

/* app.js adds .is-scrolled once the page moves, so the bar only gains a
   shadow when there is content behind it to separate from. */
.site-header.is-scrolled {
    border-bottom-color: var(--border);
    box-shadow: 0 12px 40px -18px rgb(0 0 0 / 70%);
    background: rgb(7 11 22 / 88%);
}

.site-nav {
    max-width: var(--container);
    padding: 0.8rem var(--gutter);
    gap: 1.25rem;
}

.site-nav__brand {
    font-family: var(--font-display);
    font-size: 1.02rem;
    letter-spacing: -0.02em;
    gap: 0.65rem;
}

.site-nav__brand:hover { color: var(--ink); }

.site-nav__mark {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    background: var(--gradient-brand);
    color: var(--on-brand);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand-primary) 18%, transparent),
        var(--shadow-brand);
}

.site-nav__logo {
    display: block;
    height: 38px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.site-nav__list { gap: 0.15rem; }

.site-nav__link {
    position: relative;
    display: block;
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.site-nav__link::after {
    content: "";
    position: absolute;
    left: 0.7rem;
    right: 0.7rem;
    bottom: 0.18rem;
    height: 2px;
    border-radius: 2px;
    background: var(--gradient-brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.28s var(--ease-out);
}

.site-nav__link:hover {
    color: var(--ink);
    background: rgb(255 255 255 / 5%);
}

.site-nav__link.is-active {
    color: var(--brand-ink);
    font-weight: 600;
}

.site-nav__link.is-active::after { transform: scaleX(1); }

.site-nav__actions { gap: 0.4rem; }

.site-nav__user {
    padding: 0.28rem 0.7rem 0.28rem 0.32rem;
    border-radius: var(--radius-pill);
    background: rgb(255 255 255 / 5%);
    border: 1px solid var(--border);
    font-family: var(--font-display);
    transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.site-nav__user:hover {
    border-color: var(--brand-line);
    background: var(--brand-softer);
}

.site-nav__avatar {
    width: 28px;
    height: 28px;
    font-family: var(--font-display);
    font-weight: 700;
    background: var(--gradient-brand);
    color: var(--on-brand);
}

.site-nav__toggle {
    border-radius: var(--radius-sm);
    border-color: var(--border-strong);
    background: rgb(255 255 255 / 4%);
    transition: border-color 0.18s var(--ease);
}

.site-nav__toggle:hover { border-color: var(--brand-primary); }

.skip-link {
    border-radius: 0 0 var(--radius-sm) 0;
    font-family: var(--font-display);
    font-weight: 600;
    background: var(--brand-primary);
}

/* ================================================================ 7. hero */

.hero {
    position: relative;
    overflow: visible;
    padding: clamp(3.25rem, 8vw, 6.5rem) var(--gutter) clamp(3rem, 7vw, 5.5rem);
    background: transparent;
    isolation: isolate;
}

.hero::before,
.hero::after { display: none; }

.hero__inner {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    padding: clamp(2.4rem, 5vw, 3.4rem) clamp(1.5rem, 4vw, 2.75rem) clamp(2rem, 4vw, 2.6rem);
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: var(--radius-xl);
    box-shadow:
        0 0 0 1px rgb(240 193 74 / 4%) inset,
        0 30px 80px -24px rgb(0 0 0 / 70%);
}

.hero__badge {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 1.35rem;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: var(--on-brand);
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    box-shadow:
        0 0 0 8px color-mix(in srgb, var(--brand-primary) 16%, transparent),
        0 12px 28px -8px color-mix(in srgb, var(--brand-primary) 55%, transparent);
}

.hero__title { max-width: none; }
.hero__intro { max-width: 42ch; }

.hero__eyebrow {
    display: block;
    margin: 0 0 0.85rem;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--brand-ink);
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero__eyebrow-dot { display: none; }

.hero__title {
    margin: 0 0 0.7rem;
    font-size: var(--step-5);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.04;
    color: #fff;
}

.hero__title-accent {
    display: block;
    margin-top: 0.35rem;
    background: none;
    color: var(--brand-ink);
    -webkit-text-fill-color: var(--brand-ink);
    font-size: 0.42em;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.hero__intro {
    margin: 0.85rem auto 1.75rem;
    color: var(--ink-muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.hero__actions {
    justify-content: center;
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}

.hero--center .hero__inner { margin: 0 auto; text-align: center; }
.hero--center .hero__intro { margin-left: auto; margin-right: auto; }
.hero--center .hero__actions { justify-content: center; }

/* Hero statistics — countdown tiles from the reference. */

.hero__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 0.7rem;
    max-width: 100%;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
    background: none;
    border: 0;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}

.hero__stat {
    padding: 1rem 0.5rem 0.85rem;
    background: rgb(16 24 42 / 88%);
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 16px;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.hero__stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #fff;
}

.hero__stat-label {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.hero__identity {
    margin: 0;
    padding-top: 0.35rem;
}

.hero__name {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.hero__role {
    margin: 0;
    color: var(--brand-ink);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.55;
}

/* ============================================================ 8. page banner */

.page-banner {
    position: relative;
    overflow: hidden;
    padding: clamp(3.25rem, 7vw, 5.5rem) var(--gutter) clamp(2.5rem, 5vw, 3.75rem);
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.page-banner::before {
    content: "";
    position: absolute;
    inset: -60% -20% auto;
    height: 160%;
    background:
        radial-gradient(48% 50% at 12% 0%, var(--brand-veil), transparent 60%),
        radial-gradient(42% 46% at 88% 0%, var(--accent-veil), transparent 58%);
    pointer-events: none;
}

.page-banner__inner {
    position: relative;
    max-width: var(--container);
    margin: 0 auto;
}

.page-banner__title {
    margin: 0 0 0.7rem;
    font-size: var(--step-4);
    letter-spacing: -0.032em;
}

.page-banner__lead {
    margin: 0;
    max-width: 44rem;
    color: var(--ink-muted);
    font-size: var(--step-1);
    line-height: 1.55;
}

/* ============================================================== 9. cards */

.card-grid {
    display: grid;
    gap: clamp(1rem, 2vw, 1.6rem);
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.card-grid--two {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: clamp(1.4rem, 2.5vw, 1.9rem);
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition:
        transform 0.32s var(--ease-out),
        box-shadow 0.32s var(--ease),
        border-color 0.32s var(--ease);
}

/* A gradient rule that wipes in along the top edge on hover. */
.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--gradient-brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out);
}

.card--hover:hover,
.card--hover:focus-within {
    transform: translateY(-4px);
    border-color: var(--brand-line);
    box-shadow: var(--shadow-lg);
}

.card--hover:hover::before,
.card--hover:focus-within::before {
    transform: scaleX(1);
}

.card--accent {
    background: var(--gradient-brand-soft);
    border-color: var(--brand-line);
}

.card__eyebrow {
    margin: 0 0 0.6rem;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand-primary);
}

.card__title {
    margin: 0 0 0.65rem;
    font-size: var(--step-1);
    letter-spacing: -0.02em;
}

.card__title a {
    color: inherit;
    text-decoration: none;
}

.card__title a:hover { color: var(--brand-ink); }

.card__body {
    margin: 0 0 1.25rem;
    color: var(--ink-muted);
    font-size: 0.96rem;
    line-height: 1.62;
}

/* Push the link to the bottom so cards of differing length still line up. */
.card__link {
    margin-top: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--brand-ink);
    text-decoration: none;
}

.card__link::after {
    content: "\2192";
    transition: transform 0.24s var(--ease-out);
}

.card__link:hover::after { transform: translateX(4px); }

.card__meta {
    margin: 0.6rem 0 0;
    color: var(--ink-faint);
    font-size: 0.83rem;
}

/* A round icon chip for service and research cards. */
.card__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 1.05rem;
    border-radius: 14px;
    background: var(--brand-soft);
    color: var(--brand-primary);
    border: 1px solid var(--brand-line);
}

.card__icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.card--hover:hover .card__icon {
    background: var(--gradient-brand);
    border-color: transparent;
    color: var(--on-brand);
}

/* Tech-stack chips inside a project card. */
.card__tags {
    margin-bottom: 1.15rem;
}

.card__tags .tag {
    font-size: 0.76rem;
    padding: 0.18rem 0.6rem;
}

/* ---------------------------------------------------------- quote cards */

.quote-card {
    margin: 0;
    background: var(--surface);
}

.quote-card__rating {
    margin: 0 0 0.75rem;
    color: #e0a800;
    font-size: 1rem;
    letter-spacing: 0.12em;
}

.quote-card__quote {
    margin: 0 0 1.25rem;
    padding: 0;
    border: 0;
    color: var(--ink);
    font-size: 1.04rem;
    line-height: 1.68;
    font-style: normal;
}

/* A large decorative quote mark, behind the text. */
.quote-card__quote::before {
    content: "C";
    display: block;
    margin-bottom: -0.45em;
    font-family: var(--font-display);
    font-size: 3.2rem;
    line-height: 1;
    color: var(--brand-line);
}

.quote-card__by {
    margin-top: auto;
    display: grid;
    gap: 0.1rem;
    font-size: 0.9rem;
}

.quote-card__by strong {
    font-family: var(--font-display);
    color: var(--ink);
}

.quote-card__by span { color: var(--ink-faint); font-size: 0.85rem; }

/* ------------------------------------------------ the three home pillars */

.pillars {
    padding: clamp(3.5rem, 8vw, 6rem) var(--gutter);
    background: var(--surface-alt);
}

.pillars__inner {
    max-width: var(--container);
    gap: clamp(1rem, 2vw, 1.6rem);
}

.pillar {
    position: relative;
    padding: clamp(1.6rem, 3vw, 2.2rem);
    border-radius: var(--radius-lg);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.32s var(--ease-out), box-shadow 0.32s var(--ease),
        border-color 0.32s var(--ease);
}

.pillar:hover {
    transform: translateY(-4px);
    border-color: var(--brand-line);
    box-shadow: var(--shadow-lg);
}

.pillar__title {
    font-size: var(--step-1);
    letter-spacing: -0.02em;
}

.pillar__body {
    color: var(--ink-muted);
    line-height: 1.62;
}

.pillar__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--brand-ink);
    text-decoration: none;
}

.pillar__link::after {
    content: "\2192";
    transition: transform 0.24s var(--ease-out);
}

.pillar__link:hover { text-decoration: none; }
.pillar__link:hover::after { transform: translateX(4px); }

/* ======================================================= 10. stats & facts */

.stat-row { gap: clamp(0.75rem, 1.5vw, 1.1rem); }

.stat {
    padding: 1.5rem 1.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
}

.stat:hover {
    border-color: var(--brand-line);
    box-shadow: var(--shadow-md);
}

.stat__value {
    font-family: var(--font-display);
    font-size: var(--step-3);
    letter-spacing: -0.035em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--brand-primary);
}

.stat__label {
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.facts {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.facts__item {
    padding: 1.15rem 1.35rem;
    background: var(--surface);
    font-size: 0.92rem;
}

.facts__item strong {
    display: block;
    font-family: var(--font-display);
    color: var(--ink);
}

/* =========================================================== 11. timeline */

.timeline {
    position: relative;
    margin: 0;
    padding: 0 0 0 2rem;
    list-style: none;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(to bottom, var(--brand-line), var(--border), transparent);
}

.timeline__item {
    position: relative;
    padding-bottom: 2.1rem;
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__item::before {
    content: "";
    position: absolute;
    left: -2rem;
    top: 0.55rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface);
    border: 3px solid var(--brand-primary);
    box-shadow: 0 0 0 4px var(--brand-softer);
}

.timeline__period {
    margin: 0 0 0.3rem;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-primary);
}

.timeline__title {
    margin: 0 0 0.2rem;
    font-size: var(--step-1);
}

.timeline__org {
    margin: 0 0 0.55rem;
    color: var(--ink-muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.timeline__body {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.65;
}

/* ============================================================== 12. prose */

.prose {
    color: var(--ink-soft);
    font-size: 1.06rem;
    line-height: 1.78;
}

.prose > * + * { margin-top: 1.15em; }

.prose h2 {
    margin-top: 2.4em;
    margin-bottom: 0.6em;
    font-size: var(--step-2);
    letter-spacing: -0.026em;
}

.prose h3 {
    margin-top: 1.9em;
    margin-bottom: 0.5em;
    font-size: var(--step-1);
}

.prose h2:first-child,
.prose h3:first-child { margin-top: 0; }

.prose a {
    color: var(--brand-ink);
    text-decoration: underline;
    text-decoration-color: var(--brand-line);
}

.prose a:hover { text-decoration-color: currentColor; }

.prose ul,
.prose ol { padding-left: 1.35em; }

.prose li + li { margin-top: 0.45em; }

.prose ul li::marker { color: var(--brand-primary); }

.prose blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 0.4em 0 0.4em 1.5em;
    border-left: 3px solid var(--brand-primary);
    color: var(--ink);
    font-size: 1.12em;
    font-style: italic;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.prose pre {
    padding: 1.15rem 1.35rem;
    border-radius: var(--radius-sm);
    background: var(--surface-invert);
    color: #dbe5f5;
    overflow-x: auto;
    line-height: 1.6;
}

.prose :not(pre) > code {
    padding: 0.15em 0.42em;
    border-radius: 6px;
    background: var(--brand-softer);
    border: 1px solid var(--brand-line);
    color: var(--brand-ink);
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.prose th,
.prose td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.prose th {
    font-family: var(--font-display);
    color: var(--ink);
    background: var(--surface-alt);
}

.prose hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 2.5em 0;
}

/* Ticked feature lists. */
.tick-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.7rem;
}

.tick-list--two {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.7rem 1.6rem;
}

.tick-list li {
    position: relative;
    padding-left: 1.9rem;
    color: var(--ink-soft);
    line-height: 1.6;
}

.tick-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.42em;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
}

.tick-list li::after {
    content: "";
    position: absolute;
    left: 0.34rem;
    top: 0.72em;
    width: 0.42rem;
    height: 0.22rem;
    border-left: 2px solid var(--brand-primary);
    border-bottom: 2px solid var(--brand-primary);
    transform: rotate(-45deg);
}

/* ======================================================== 13. callout & cta */

.callout {
    padding: clamp(1.3rem, 2.5vw, 1.75rem);
    border-radius: var(--radius);
    background: var(--brand-softer);
    border: 1px solid var(--brand-line);
    border-left: 4px solid var(--brand-primary);
}

.callout__title {
    margin: 0 0 0.45rem;
    font-size: 1.02rem;
    color: var(--brand-ink);
}

.cta {
    position: relative;
    overflow: hidden;
    padding: clamp(3.5rem, 8vw, 6rem) var(--gutter);
    background: transparent;
    color: var(--ink);
    isolation: isolate;
}

.cta::before { display: none; }

.cta__inner {
    position: relative;
    max-width: 44rem;
    margin: 0 auto;
    text-align: center;
    padding: clamp(2.2rem, 5vw, 3.2rem) clamp(1.5rem, 4vw, 2.6rem);
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 80px -24px rgb(0 0 0 / 70%);
}

.cta__title {
    margin: 0 0 0.9rem;
    color: #fff;
    font-size: var(--step-3);
    letter-spacing: -0.03em;
}

.cta__body {
    margin: 0 auto 2rem;
    max-width: 38rem;
    color: var(--ink-muted);
    font-size: var(--step-1);
    line-height: 1.6;
}

.cta .btn-primary {
    background: var(--gradient-brand);
    background-image: var(--gradient-brand);
    color: var(--on-brand);
    box-shadow: var(--shadow-brand);
}

.cta .btn-primary:hover { color: var(--on-brand); }
.cta .btn-primary::after { display: none; }

/* ============================================================ 14. forms */

.field { margin-bottom: 1.15rem; }

.contact__form,
.contact__aside {
    padding: clamp(1.4rem, 3vw, 2rem);
    background: var(--surface-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.field__label,
.contact__label {
    display: block;
    margin-bottom: 0.4rem;
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
}

.field__input,
.verify-form input[type="text"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.72rem 0.95rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.97rem;
    line-height: 1.5;
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease),
        background-color 0.18s var(--ease);
}

.field__input:hover,
input:hover,
select:hover,
textarea:hover { border-color: var(--ink-faint); }

.field__input:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px var(--brand-veil);
}

textarea { min-height: 9rem; resize: vertical; }

select {
    appearance: none;
    padding-right: 2.4rem;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
        linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
    background-position: right 1.05rem center, right 0.75rem center;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.field__hint {
    margin: 0.35rem 0 0;
    color: var(--ink-faint);
    font-size: 0.82rem;
}

.field__error {
    margin: 0.35rem 0 0;
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 500;
}

.field__input[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgb(210 45 58 / 10%);
}

.field__optional {
    color: var(--ink-faint);
    font-weight: 400;
    font-size: 0.8rem;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.92rem;
}

input[type="checkbox"],
input[type="radio"] {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    accent-color: var(--brand-primary);
    flex: none;
}

/* ============================================================ 15. alerts */

.alert {
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.93rem;
    line-height: 1.55;
}

.alert--success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: #8eefc4; }
.alert--error   { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: #ffb0b5; }
.alert--info    { background: var(--brand-softer); border-color: var(--brand-line); color: var(--brand-ink); }

/* ============================================================ 16. footer */

.site-footer {
    background: rgb(5 8 20 / 78%);
    background-image: none;
    border-top: 1px solid var(--border);
    color: rgb(238 243 251 / 72%);
}

.site-footer__inner {
    max-width: var(--container);
    padding: clamp(3rem, 6vw, 4.5rem) var(--gutter) 2rem;
    text-align: left;
}

.site-footer__top {
    display: grid;
    gap: clamp(2rem, 5vw, 3.5rem);
    grid-template-columns: minmax(240px, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgb(255 255 255 / 9%);
}

.site-footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.site-footer__mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: var(--on-brand);
    font-size: 0.78rem;
    font-weight: 800;
}

.site-footer__tagline {
    margin: 0 0 1.35rem;
    max-width: 30rem;
    color: rgb(238 243 251 / 62%);
    font-size: 0.94rem;
    line-height: 1.62;
}

.site-footer__col-title {
    margin: 0 0 0.9rem;
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: rgb(255 255 255 / 55%);
}

.site-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.site-footer__list a {
    color: rgb(238 243 251 / 72%);
    font-size: 0.92rem;
    text-decoration: none;
    transition: color 0.18s var(--ease);
}

.site-footer__list a:hover { color: #fff; }

.site-footer__list--inline {
    grid-auto-flow: column;
    justify-content: start;
    gap: 1.35rem;
}

.site-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer__social a {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgb(255 255 255 / 12%);
    background: rgb(255 255 255 / 5%);
    color: var(--brand-ink);
    transition: all 0.2s var(--ease);
}

.site-footer__social a:hover {
    background: var(--gradient-brand);
    border-color: transparent;
    color: var(--on-brand);
    transform: translateY(-2px);
}

.site-footer__social svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 1.5rem;
}

.site-footer__legal {
    margin: 0;
    color: rgb(238 243 251 / 48%);
    font-size: 0.85rem;
}

/* ============================================================== 17. blog */

.blog-layout {
    display: grid;
    gap: clamp(2rem, 4vw, 3.5rem);
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
}

.blog-search {
    display: flex;
    gap: 0.55rem;
    margin-bottom: 1.5rem;
}

.blog-result-count {
    margin: 0 0 1.5rem;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.widget {
    padding: 1.4rem 1.5rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.widget + .widget { margin-top: 1.25rem; }

.widget__title {
    margin: 0 0 0.9rem;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.widget__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.widget__list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.4rem 0.55rem;
    margin: 0 -0.55rem;
    border-radius: var(--radius-xs);
    color: var(--ink-soft);
    font-size: 0.93rem;
    text-decoration: none;
    transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.widget__list a:hover {
    background: var(--surface);
    color: var(--brand-ink);
}

.widget__count {
    flex: none;
    padding: 0.05rem 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--surface-sunken);
    color: var(--ink-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.article__header {
    padding: clamp(3rem, 6vw, 4.5rem) var(--gutter) clamp(1.75rem, 3vw, 2.5rem);
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.article__header-inner {
    max-width: var(--container-narrow);
    margin: 0 auto;
}

.article__title {
    margin: 0.75rem 0 0.85rem;
    font-size: var(--step-4);
    letter-spacing: -0.032em;
}

.article__lead {
    margin: 0 0 1.25rem;
    color: var(--ink-muted);
    font-size: var(--step-1);
    line-height: 1.55;
}

.article__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    color: var(--ink-faint);
    font-size: 0.88rem;
}

/* Comments -------------------------------------------------------------- */

.comments { margin-top: 3.5rem; }

.comment {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
}

.comment__avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: var(--on-brand);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
}

.comment__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
}

.comment__date { color: var(--ink-faint); font-size: 0.82rem; }

.comment__body { margin: 0; color: var(--ink-soft); line-height: 1.65; }

.comment-form {
    margin-top: 2.5rem;
    padding: clamp(1.4rem, 3vw, 2rem);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ======================================================= 18. publications */

.publications { display: grid; gap: 1rem; }

.year-group + .year-group { margin-top: 2.75rem; }

.year-group__year {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1.15rem;
    font-family: var(--font-display);
    font-size: var(--step-2);
    letter-spacing: -0.03em;
    color: var(--ink);
}

.year-group__year::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border), transparent);
}

.publication {
    padding: 1.35rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand-line);
    border-radius: var(--radius-sm);
    transition: border-left-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
        transform 0.25s var(--ease-out);
}

.publication:hover {
    border-left-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
}

.publication__title {
    margin: 0 0 0.4rem;
    font-size: 1.06rem;
    line-height: 1.4;
}

.publication__meta {
    margin: 0 0 0.6rem;
    color: var(--ink-muted);
    font-size: 0.89rem;
}

.publication__abstract {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.93rem;
    line-height: 1.65;
}

.publication__citations {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.55rem;
    border-radius: var(--radius-pill);
    background: var(--brand-softer);
    color: var(--brand-ink);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ============================================================== 19. LMS */

.course-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(3rem, 7vw, 5rem) var(--gutter);
    background: var(--gradient-ink);
    color: var(--ink-invert);
}

.course-hero::before {
    content: "";
    position: absolute;
    inset: -40% -10% auto;
    height: 150%;
    background:
        radial-gradient(45% 55% at 15% 5%, color-mix(in srgb, var(--brand-primary) 48%, transparent), transparent 62%),
        radial-gradient(40% 50% at 85% 0%, color-mix(in srgb, var(--brand-accent) 32%, transparent), transparent 60%);
    pointer-events: none;
}

.course-hero__inner {
    position: relative;
    max-width: var(--container);
    margin: 0 auto;
}

.course-hero__eyebrow {
    color: color-mix(in srgb, var(--brand-accent) 70%, #ffffff);
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.course-hero__title {
    color: #fff;
    font-size: var(--step-4);
    letter-spacing: -0.032em;
}

.course-hero__lead { color: rgb(238 243 251 / 78%); font-size: var(--step-1); }

.course-hero__meta { color: rgb(238 243 251 / 62%); font-size: 0.9rem; }

.course-hero__card {
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    color: var(--ink-soft);
}

.course-hero__price {
    font-family: var(--font-display);
    font-size: var(--step-3);
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--ink);
}

.course-hero__note { color: var(--ink-faint); font-size: 0.84rem; }

.course-card__price {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
}

.curriculum { display: grid; gap: 0.85rem; }

.curriculum__module {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.curriculum__module:hover {
    border-color: var(--brand-line);
    box-shadow: var(--shadow-sm);
}

.curriculum__summary {
    padding: 1.05rem 1.35rem;
    background: var(--surface-alt);
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}

.curriculum__count { color: var(--ink-faint); font-size: 0.84rem; font-weight: 500; }

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

.curriculum__lesson {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1.35rem;
    border-top: 1px solid var(--border);
    font-size: 0.94rem;
}

.curriculum__lesson-type {
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--brand-softer);
    color: var(--brand-primary);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.curriculum__lesson-duration { margin-left: auto; color: var(--ink-faint); font-size: 0.84rem; }

.progress {
    height: 8px;
    background: var(--surface-sunken);
}

.progress__fill {
    background: var(--gradient-brand);
    box-shadow: 0 0 12px -2px var(--brand-primary);
    transition: width 0.6s var(--ease-out);
}

.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }

.order-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.order-item:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }

.order-item__course { margin: 0 0 0.2rem; font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.order-item__meta { margin: 0; color: var(--ink-faint); font-size: 0.85rem; }
.order-item__right { display: flex; align-items: center; gap: 0.75rem; }

.bank-details {
    padding: 1.25rem 1.4rem;
    border-radius: var(--radius-sm);
    background: var(--brand-softer);
    border: 1px solid var(--brand-line);
    font-size: 0.94rem;
}

.result-card {
    padding: clamp(1.75rem, 4vw, 2.75rem);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.result-card__score {
    font-family: var(--font-display);
    font-size: clamp(3rem, 9vw, 4.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--brand-primary);
}

.verify-result {
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}

.verify-result--valid   { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.verify-result--invalid { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); }
.verify-result--revoked { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }

.verify-result__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.question {
    padding: clamp(1.3rem, 3vw, 1.85rem);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

.question + .question { margin-top: 1.1rem; }

.question__number {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--gradient-brand);
    color: var(--on-brand);
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
}

.option {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.option:hover { border-color: var(--brand-line); background: var(--brand-softer); }
.option:has(input:checked) { border-color: var(--brand-primary); background: var(--brand-soft); }

/* ============================================================== 20. empty */

.empty {
    padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
    background: var(--surface-alt);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

.empty__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--ink);
}

.empty__body { color: var(--ink-muted); }

/* ======================================================== 21. error pages */

.error-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: transparent;
}

.error-page__code {
    font-family: var(--font-display);
    font-size: clamp(4.5rem, 16vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--brand-primary);
}

.error-page__title { font-size: var(--step-2); }

/* ============================================================ 22. auth */

.auth__brand {
    position: relative;
    overflow: hidden;
    background: var(--gradient-ink);
}

.auth__brand::before {
    content: "";
    position: absolute;
    inset: -30% -20%;
    background:
        radial-gradient(45% 45% at 25% 20%, color-mix(in srgb, var(--brand-primary) 52%, transparent), transparent 62%),
        radial-gradient(40% 40% at 78% 75%, color-mix(in srgb, var(--brand-accent) 38%, transparent), transparent 60%);
    animation: drift 22s var(--ease) infinite alternate;
}

@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-3%, 3%, 0) scale(1.08); }
}

.auth__brand-inner { position: relative; }

.auth__logo-mark {
    background: var(--gradient-brand);
    color: var(--on-brand);
    font-family: var(--font-display);
    font-weight: 800;
    border-radius: 50%;
    box-shadow: var(--shadow-brand);
}

.auth__pitch-title {
    font-size: var(--step-3);
    letter-spacing: -0.03em;
    color: #fff;
}

.auth__points li::before {
    border-color: var(--brand-primary);
}

.auth__mobile-logo .auth__logo-mark {
    color: var(--on-brand);
}

.auth__panel {
    background: rgb(7 11 22 / 72%);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.auth__pitch-body { color: rgb(238 243 251 / 72%); line-height: 1.65; }

.auth__points li { color: rgb(238 243 251 / 78%); }

.auth__title { font-size: var(--step-3); letter-spacing: -0.03em; }
.auth__subtitle { color: var(--ink-muted); }

.btn-google {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 600;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
}

.btn-google:hover {
    border-color: var(--ink-faint);
    box-shadow: var(--shadow-sm);
}

.strength__bar { background: var(--surface-sunken); border-radius: var(--radius-pill); }
.strength__fill { border-radius: var(--radius-pill); transition: width 0.3s var(--ease-out), background-color 0.3s var(--ease); }

/* ============================================================ 23. admin */

/*
 * theme.css is shared with the admin shell. The public site is dark; the
 * control panel stays a working light surface. These tokens are scoped to
 * .admin-body so they cannot leak back onto marketing pages.
 */
.admin-body {
    color-scheme: light;
    --surface: #ffffff;
    --surface-alt: #f4f6fa;
    --surface-sunken: #eef2f8;
    --surface-invert: #0b1220;
    --surface-glass: #ffffff;
    --border: #e4e9f2;
    --border-strong: #cfd8e6;
    --ink: #0d1524;
    --ink-soft: #3d4a61;
    --ink-muted: #6b7a93;
    --ink-faint: #97a3b8;
    --ink-invert: #eef3fb;
    --on-brand: #0b1020;
    --brand-ink: #16308c;
    --brand-ink: color-mix(in srgb, var(--brand-primary) 72%, #05102e);
    --brand-soft: color-mix(in srgb, var(--brand-primary) 9%, #ffffff);
    --brand-softer: color-mix(in srgb, var(--brand-primary) 4%, #ffffff);
    --brand-line: color-mix(in srgb, var(--brand-primary) 26%, #ffffff);
    --ok: #0f9d6b;
    --ok-soft: #e6f7f0;
    --warn: #b7791f;
    --warn-soft: #fdf5e4;
    --danger: #d22d3a;
    --danger-soft: #fdecee;
    --shadow-xs: 0 1px 2px rgb(13 21 36 / 5%);
    --shadow-sm: 0 1px 2px rgb(13 21 36 / 5%), 0 2px 6px rgb(13 21 36 / 4%);
    --shadow-md: 0 2px 4px rgb(13 21 36 / 4%), 0 10px 22px -6px rgb(13 21 36 / 10%);
    --shadow-lg: 0 4px 8px rgb(13 21 36 / 4%), 0 20px 44px -12px rgb(13 21 36 / 14%);
    background: #f4f6fa;
    color: var(--ink);
}

.admin-body .starfield { display: none; }

.admin-shell,
.admin__main {
    font-family: var(--font-body);
    max-width: none;
    width: 100%;
}

.admin-card,
.panel {
    border-radius: 16px;
    box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
}

.table th {
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

/*
 * This file loads after admin.css, so a modifier defined there at the same
 * specificity as a rule here would lose. Restate the ones that matter rather
 * than reaching for !important.
 */
.field__input--sm {
    padding: 0.34rem 0.55rem;
    font-size: 0.85rem;
    min-width: 130px;
}

.inline-form .btn-sm {
    padding: 0.34rem 0.8rem;
}

/* ======================================================== 24. motion */

/*
 * Reveal-on-scroll.
 *
 * The hidden state is scoped to .js, which an inline script in the layout head
 * adds to <html>. So the only way an element is ever invisible is if scripting
 * is available to make it visible again — with JS off, blocked or broken, the
 * whole page renders normally. app.js then flips .is-visible through an
 * IntersectionObserver.
 */
.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
    will-change: opacity, transform;
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Stagger children of a revealed group. */
.js .reveal-group > .reveal:nth-child(2) { transition-delay: 80ms; }
.js .reveal-group > .reveal:nth-child(3) { transition-delay: 160ms; }
.js .reveal-group > .reveal:nth-child(4) { transition-delay: 240ms; }
.js .reveal-group > .reveal:nth-child(5) { transition-delay: 320ms; }
.js .reveal-group > .reveal:nth-child(6) { transition-delay: 400ms; }

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

    .js .reveal,
    .js .reveal.is-visible {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .auth__brand::before,
    .hero__eyebrow-dot,
    .starfield__canvas { animation: none; }
}

/* ======================================================= 25. responsive */

@media (max-width: 1024px) {
    .blog-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
    .site-nav__menu {
        border-radius: 0 0 var(--radius) var(--radius);
        box-shadow: var(--shadow-lg);
        padding-top: 0.75rem;
        background: rgb(8 13 26 / 96%);
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border);
    }

    .site-nav__link {
        padding: 0.65rem 0.7rem;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }

    .site-nav__link::after { display: none; }

    .site-nav__actions {
        flex-wrap: wrap;
        padding-top: 1rem;
    }

    .site-footer__top { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .hero__actions .btn { width: 100%; }
    .site-footer__bottom { justify-content: flex-start; }
    .order-item { flex-direction: column; align-items: flex-start; }
    .order-item__right { width: 100%; justify-content: space-between; }
}

/* ============================================================ 25b. dashboard tabs */

input.dash-radio[type="radio"] {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    appearance: none;
    pointer-events: none;
}

.dashboard .dash-shell {
    margin-top: 1.6rem;
}

.dashboard .dash-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 0.28rem;
    margin: 0 0 1.5rem;
    background: var(--surface-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.dashboard .dash-tabs__tab {
    flex: 1 1 9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.55rem 1.1rem;
    margin: 0;
    border-radius: 999px;
    color: var(--ink-muted);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.dashboard .dash-tabs__tab:hover {
    color: var(--ink);
    background: rgb(255 255 255 / 4%);
}

.dashboard .dash-tabs__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--brand-soft);
    color: var(--brand-primary);
}

.dashboard .dash-panel {
    display: none;
}

.dashboard .dash-panel .dashboard__section-title:first-child {
    margin-top: 0;
}

#dash-tab-classroom:checked ~ .dash-panel--classroom,
#dash-tab-todo:checked ~ .dash-panel--todo,
#dash-tab-grades:checked ~ .dash-panel--grades,
#dash-tab-calendar:checked ~ .dash-panel--calendar,
#dash-tab-archived:checked ~ .dash-panel--archived,
#dash-tab-courses:checked ~ .dash-panel--courses,
#dash-tab-account:checked ~ .dash-panel--account {
    display: block;
    animation: dash-panel-in 0.28s var(--ease);
}

#dash-tab-classroom:checked ~ .dash-tabs [for="dash-tab-classroom"],
#dash-tab-todo:checked ~ .dash-tabs [for="dash-tab-todo"],
#dash-tab-grades:checked ~ .dash-tabs [for="dash-tab-grades"],
#dash-tab-calendar:checked ~ .dash-tabs [for="dash-tab-calendar"],
#dash-tab-archived:checked ~ .dash-tabs [for="dash-tab-archived"],
#dash-tab-courses:checked ~ .dash-tabs [for="dash-tab-courses"],
#dash-tab-account:checked ~ .dash-tabs [for="dash-tab-account"] {
    background: var(--gradient-brand);
    color: var(--on-brand);
    box-shadow: var(--shadow-brand);
}

#dash-tab-classroom:checked ~ .dash-tabs [for="dash-tab-classroom"] .dash-tabs__count,
#dash-tab-todo:checked ~ .dash-tabs [for="dash-tab-todo"] .dash-tabs__count,
#dash-tab-grades:checked ~ .dash-tabs [for="dash-tab-grades"] .dash-tabs__count,
#dash-tab-calendar:checked ~ .dash-tabs [for="dash-tab-calendar"] .dash-tabs__count,
#dash-tab-archived:checked ~ .dash-tabs [for="dash-tab-archived"] .dash-tabs__count,
#dash-tab-courses:checked ~ .dash-tabs [for="dash-tab-courses"] .dash-tabs__count,
#dash-tab-account:checked ~ .dash-tabs [for="dash-tab-account"] .dash-tabs__count {
    background: rgb(12 16 32 / 22%);
    color: var(--on-brand);
}

.dashboard .stat--tab {
    cursor: pointer;
}

@keyframes dash-panel-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    #dash-tab-classroom:checked ~ .dash-panel--classroom,
    #dash-tab-todo:checked ~ .dash-panel--todo,
    #dash-tab-grades:checked ~ .dash-panel--grades,
    #dash-tab-calendar:checked ~ .dash-panel--calendar,
    #dash-tab-archived:checked ~ .dash-panel--archived,
    #dash-tab-courses:checked ~ .dash-panel--courses,
    #dash-tab-account:checked ~ .dash-panel--account {
        animation: none;
    }
}

/* ============================================================ 26. print */

@media print {
    .site-header,
    .site-footer,
    .cta,
    .skip-link,
    .filters { display: none !important; }

    body { color: #000; background: #fff; }

    .section, .page-banner { padding: 1rem 0; }

    a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
}
