/* Stylesheet for William Zhong's personal homepage.
 *
 * Deliberately small: no framework, no JavaScript, no web fonts.
 * Every colour lives in the custom properties below, so restyling the
 * site means editing this block. Dark mode follows the visitor's system
 * setting.
 */

:root {
    color-scheme: light dark;

    --bg: #fcfcfa;
    --fg: #1a1a1a;
    --muted: #6b6b6b;
    --accent: #1a5fb4;
    --line: #e4e4df;

    --measure: 40rem;
    --gap: 1.5rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #17171a;
        --fg: #e9e9e7;
        --muted: #9c9c9a;
        --accent: #7fb0ff;
        --line: #2d2d33;
    }
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* Page frame --------------------------------------------------------- */

.page,
.page-footer {
    max-width: var(--measure);
    margin: 0 auto;
    padding-left: var(--gap);
    padding-right: var(--gap);
}

.page {
    padding-top: 4.5rem;
}

.page-footer {
    margin-top: 4rem;
    padding-top: 1.25rem;
    padding-bottom: 3rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

.page-footer p {
    margin: 0;
}

/* Header ------------------------------------------------------------- */

.intro {
    margin-bottom: 3rem;
}

.intro h1 {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.intro .tagline {
    margin: 0.3rem 0 0;
    color: var(--muted);
}

/* Sections ----------------------------------------------------------- */

section + section {
    margin-top: 3rem;
}

h2 {
    margin: 0 0 0.85rem;
    font-size: 0.78rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--muted);
}

p {
    margin: 0 0 0.9rem;
}

p:last-child {
    margin-bottom: 0;
}

/* Link lists --------------------------------------------------------- */

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

.links li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    align-items: baseline;
    padding: 0.55rem 0;
    border-top: 1px solid var(--line);
}

.links li:last-child {
    border-bottom: 1px solid var(--line);
}

.note {
    color: var(--muted);
    font-size: 0.9rem;
}

/* Empty state (shown while no service is listed) --------------------- */

.empty-state {
    padding: 1.1rem 1.25rem;
    border: 1px dashed var(--line);
    border-radius: 10px;
    color: var(--muted);
}

.empty-state p:first-child {
    color: var(--fg);
}

/* Links -------------------------------------------------------------- */

a {
    color: var(--accent);
    text-decoration: none;
    text-underline-offset: 0.18em;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Small screens ------------------------------------------------------ */

@media (max-width: 30rem) {
    .page {
        padding-top: 3rem;
    }

    .intro h1 {
        font-size: 1.6rem;
    }
}
