/* site-wide layout: base canvas, containers and persistent chrome (header / footer) */

:root {
    --bg-page: #171021;      /* smoked plum content background */
    --text-primary: #e4dbea; /* soft lavender text */
    --text-muted: #a99ab8;   /* secondary text */
    --text-faint: #8b7c9c;   /* footer legal text */
    --header-bg: #6d28d9;    /* fallback behind the gradient */
    --header-gradient: linear-gradient(115deg, #6d28d9 0%, #1d4ed8 28%, #10b981 55%, #d946ef 82%, #ec4899 100%);
    --header-ink: #f7efe0;   /* warm ivory ink */
    --header-sub: #e8d7bd;   /* sand subtitle */
    --header-chip-border: #f7efe0;
    --header-chip-bg: #f7efe0;
    --header-chip-ink: #2e1065;
    --header-chip-icon: #5b21b6;
    --header-hover-bg: #2e1065;
    --header-hover-ink: #f7efe0;
    color-scheme: dark;
}

html {
    background-color: var(--bg-page);
    /* don't let the browser's overscroll reveal an unpainted strip */
    overscroll-behavior-y: none;
}

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

body {
    margin: 0;
    overflow-anchor: none; /* keep scroll stable while the header height animates */
    background-color: var(--bg-page);
    color: var(--text-primary);
}

.container {
    max-width: 1200px;   /* limit the maxmium width with large screen */
    margin: 0 auto;      /* horizontal center */
    padding: 0 40px;     /* left right blank */
}

/* full-bleed title bar, pinned to the top while scrolling */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: var(--header-bg);
    background-image: var(--header-gradient);
    color: var(--header-ink);
    padding: 36px 0 40px;
    transition: padding 0.28s ease;
}
/* paint the title-bar colour above the header too: overscroll (or any
   gap) can no longer expose the page background above it */
.site-header::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 100vh;
    background-color: var(--header-bg);
    pointer-events: none;
}

/* keeps the document flow below the fixed header (js/header.js syncs it) */
.header-spacer {
    height: 219px;
}
@media (max-width: 640px) {
    .header-spacer {
        height: 277px;
    }
}
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.site-header h1 {
    margin: 0;
    color: var(--header-ink);
    font-family: "Adwaita Mono", "Liberation Mono", "SFMono-Regular", ui-monospace, monospace;
    font-size: 38px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.6em;
    transition: font-size 0.28s ease;
}
.site-header h2 {
    margin: 4px 0 20px;
    color: var(--header-sub);
}

/* the subtitle + chips block collapses smoothly instead of reflowing */
.header-details {
    display: grid;
    grid-template-rows: 1fr;
    visibility: visible;
    transition: grid-template-rows 0.28s ease, opacity 0.2s ease,
        visibility 0s;
}
.header-details-inner {
    min-height: 0;
    overflow: hidden;
}
.header-actions {
    display: flex;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0s linear 0.28s;
}

/* compact bar after scrolling (js/header.js toggles .is-compact) */
.site-header.is-compact {
    padding: 10px 0;
}
.site-header.is-compact h1 {
    font-size: 20px;
    line-height: 1.2;
}
.site-header.is-compact .header-details {
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows 0.28s ease, opacity 0.2s ease,
        visibility 0s linear 0.28s;
}
.site-header.is-compact .header-actions {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.18s ease 0.1s, visibility 0s;
}

/* icon-only contact links shown in the compact bar */
.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--header-chip-border);
    border-radius: 999px;
    background-color: var(--header-chip-bg);
    color: var(--header-chip-ink);
    transition: color 0.18s ease, background-color 0.18s ease,
        border-color 0.18s ease;
}
.icon-link:hover {
    border-color: var(--header-hover-bg);
    background-color: var(--header-hover-bg);
    color: var(--header-hover-ink);
}
.icon-link:focus-visible {
    outline: 2px solid var(--header-chip-ink);
    outline-offset: 2px;
}
.site-header .icon-link .contact-icon {
    color: inherit;
}

@media (prefers-reduced-motion: reduce) {
    .site-header,
    .site-header h1,
    .header-details,
    .header-actions {
        transition: none;
    }
}

/* header contact links */
.contact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}
.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px 7px 12px;
    border: 1px solid #d5e0ea;
    border-radius: 999px;
    background-color: #fff;
    color: #334155;
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease,
        border-color 0.18s ease, box-shadow 0.18s ease;
}
.contact-link:hover {
    color: #0b1220;
    background-color: #e2edf7;
    border-color: #b9cddd;
    box-shadow: 0 2px 8px rgba(31, 41, 55, 0.08);
}
.contact-link:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
.contact-icon {
    width: 18px;
    height: 18px;
    flex: none;
    color: #64748b;
    transition: color 0.18s ease;
}
.contact-link:hover .contact-icon {
    color: #0f172a;
}

/* contact chips on the title bar */
.site-header .contact-list {
    margin-top: 0;
}
.site-header .contact-link {
    border-color: var(--header-chip-border);
    background-color: var(--header-chip-bg);
    color: var(--header-chip-ink);
}
.site-header .contact-link:hover {
    border-color: var(--header-hover-bg);
    background-color: var(--header-hover-bg);
    color: var(--header-hover-ink);
}
.site-header .contact-link:focus-visible {
    outline-color: var(--header-chip-ink);
}
.site-header .contact-icon {
    color: var(--header-chip-icon);
}
.site-header .contact-link:hover .contact-icon {
    color: var(--header-hover-ink);
}

/* section headings: serif display */
main {
    padding-top: 28px;
}
main h2 {
    margin: 48px 0 26px;
    font-family: "Noto Serif CJK SC", "Noto Serif", Georgia, serif;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: #f7efe0;
}
main h2:first-of-type {
    margin-top: 0;
}

/* awards: a quiet list, no cards */
.award-list {
    margin: 0;
    padding: 0 0 0 1.25em;
    list-style: none;
    font-size: 16px;
    line-height: 1.85;
    color: #b9aec9;
}
.award-list li + li {
    margin-top: 4px;
}
.award-prize {
    color: #d3c8e2;
}

/* footer */
.site-footer {
    margin-top: 120px;
    padding: 24px 0 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: var(--text-muted);
}
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.beian {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
}
.beian-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
}
.beian-link:hover {
    color: #fff;
    text-decoration: underline;
}
.beian-icon {
    width: 16px;
    height: 16px;
    display: block;
}
.beian-divider {
    color: rgba(255, 255, 255, 0.2);
}
.copyright {
    color: var(--text-faint);
}
