/* ==========================================================================
   scottliu.com design suite - base.css
   Element defaults, typography, and page-level layout primitives.
   Load AFTER tokens.css and BEFORE components.css. See DESIGN.md.
   ========================================================================== */

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: var(--leading-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* --- Headings ------------------------------------------------------------ */
h1,
h2,
h3,
h4,
.section-head,
.display {
    font-family: var(--font-head);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: 0.02em;
    color: var(--ink);
}

h1 { font-size: var(--text-3xl); margin: 0 0 var(--space-2); }
h2 { font-size: var(--text-2xl); margin: var(--space-3) 0 var(--space-2); }
h3 { font-size: var(--text-xl); margin: var(--space-2) 0 var(--space-1); }
h4 { font-size: var(--text-lg); margin: var(--space-2) 0 var(--space-1); }

/* Hero display type - one per page, above the fold. */
.display {
    font-size: var(--text-display);
    margin: 0 0 var(--space-2);
}

/* Small uppercase divider label that heads a section. */
.section-head {
    font-size: var(--text-md);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--hairline);
    padding-bottom: var(--space-1);
    margin: var(--space-4) 0 var(--space-3);
}

/* --- Brand wordmark ------------------------------------------------------ */
/* The "Scott Liu" identity signature. Use ONLY for the personal wordmark,
   never for generic headings. Optional per site. */
.brand-wordmark {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: var(--text-2xl);
    letter-spacing: normal;
    color: var(--ink);
}

/* --- Prose helpers ------------------------------------------------------- */
.lede {
    font-size: var(--text-lg);
    color: var(--ink-soft);
    max-width: var(--measure);
}

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

/* --- Quotations ---------------------------------------------------------- */
/* Quoted material is set off by an accent rule rather than indentation alone,
   so a quote stays legible when it sits between two paragraphs of prose. */
blockquote {
    margin: var(--space-3) 0;
    padding: var(--space-1) 0 var(--space-1) var(--space-3);
    border-left: 2px solid var(--accent);
    color: var(--ink-soft);
}

blockquote > :first-child { margin-top: 0; }
blockquote > :last-child { margin-bottom: 0; }

/* A source attribution line beneath a quote. */
blockquote cite {
    display: block;
    margin-top: var(--space-1);
    font-family: var(--font-head);
    font-size: var(--text-xs);
    font-style: normal;
    color: var(--ink-soft);
}

/* --- Links --------------------------------------------------------------- */
a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Code (element defaults; see .code-block in components for chrome) --- */
code,
pre,
kbd,
samp {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

:not(pre) > code {
    background: var(--paper-sunken);
    border-radius: var(--radius-sm);
    padding: 0.1em 0.35em;
}

/* --- Site header / nav --------------------------------------------------- */
.site-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--hairline);
}

.site-title {
    font-family: var(--font-head);
    font-size: var(--text-xl);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
}

.site-nav a {
    margin-left: var(--space-3);
    color: var(--ink-soft);
}

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

/* Footer nav (page-bottom link row). */
.page-footer-nav {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    padding: var(--space-4);
    border-top: 1px solid var(--hairline);
    margin-top: var(--space-5);
}

/* --- Page container ------------------------------------------------------ */
/* Centered reading column. Override --page-max locally for wide dashboards. */
.page {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: var(--space-4);
    animation: fade-up var(--dur-base) var(--ease) both;
}

.page-wide { --page-max: 1200px; } /* opt-in wide variant for data-heavy views */

.hero {
    margin-bottom: var(--space-4);
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
