/* =========================================================
   GLOBAL
   ========================================================= */

:root {
    --bg: #f7f7f7;
    --fg: #222;
    --card-bg: #ffffff;
    --border: #dddddd;
    --accent: #4a6cf7;
    --text-secondary: #6b7280;

    /* Logo (light mode) */
    --logo-bg: #f0f0f0;
    --logo-border: #d0d0d0;
    --logo-shadow: rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1e1e1e;
        --fg: #eeeeee;
        --card-bg: #2a2a2a;
        --border: #444444;
        --accent: #6c8dff;
        --text-secondary: #9aa0a6;

        /* Logo (dark mode) */
        --logo-bg: #161616;
        --logo-border: #2c2c2c;
        --logo-shadow: rgba(0, 0, 0, 0.35);
    }
}

body {
    margin: 0;
    padding: 2rem;
    font-family: system-ui, sans-serif;
    line-height: 1.6;
    background: var(--bg);
    color: var(--fg);
}

/* =========================================================
   SITE HEADER
   ========================================================= */

.site-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.title-row {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transform: translateX(-4px); /* Optical adjustment */
}

.site-header .site-icon {
    width: 46px;
    height: 46px;
}

/* Logo container (theme-aware) */

.site-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--logo-bg);
    border: 1px solid var(--logo-border);
    box-shadow: 0 2px 6px var(--logo-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Logo mark */

.site-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    opacity: 0.95;
}

.site-header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.tagline {
    margin-top: 0.6rem;
    font-size: 1.1rem;
    opacity: 0.85;
    color: var(--text-secondary);
}

/** =========================================================
   Text modifiers
   ========================================================= */
.muted {
    color: var(--text-secondary);
}

/* =========================================================
   META NAV
   ========================================================= */

.meta-nav {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.meta-nav a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* =========================================================
   CONTENT CARDS
   ========================================================= */

.card {
    background: var(--card-bg);
    padding: 1.2rem 1.5rem;
    margin: 1.5rem auto;
    max-width: 700px;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* =========================================================
   HEADINGS
   ========================================================= */

h1 {
    margin-bottom: 0.2rem;
    font-size: 2.2rem;
}

h2 {
    margin-top: 0;
}

h3 {
    margin-top: 2.2rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #90caf9;
}

/* Contextual heading behavior inside cards */

.card h3 {
    margin-top: 0.8rem;
    margin-bottom: 0.4rem;
    padding-bottom: 0.25rem;
    border-bottom: 0.5px solid var(--border);
}

.card h3:first-child {
    margin-top: 0;
}

.card h3 + p {
    margin-top: 0.3rem;
}

/* =========================================================
   BODY TEXT (CARD-SCOPED)
   ========================================================= */

.card p {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

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

/* =========================================================
   LISTS (CARD-SCOPED)
   ========================================================= */

.card ul {
    margin-top: 0.4rem;
    margin-bottom: 0.8rem;
    padding-left: 1.25rem;
}

.card li {
    margin-bottom: 0.35rem;
}

.card li:last-child {
    margin-bottom: 0;
}

/* =========================================================
   LINKS & BUTTONS
   ========================================================= */

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

a:hover {
    text-decoration: underline;
}

.button {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: #ffffff;
    border-radius: 6px;
    text-decoration: none;
}

.button:hover {
    opacity: 0.9;
}

.button.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
    .button.secondary:hover {
        background: rgba(255, 255, 255, 0.06);
    }
}

/* =========================================================
   BLOCKS & TYPOGRAPHY
   ========================================================= */

pre {
    background: #272822;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

.card hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.2rem 0 1.6rem;
}

.card p.note {
    margin-top: 0.75rem;
}

.card .button {
    margin-top: 2rem;
}

.card p + ul {
    margin-top: 0.3rem;
}

.thesis {
    margin: 1.25rem 0;
    font-weight: 500;
}

.list-label {
    margin-top: 1.1rem;
}

/* =========================================================
   BLOCKQUOTES
   ========================================================= */

.card blockquote {
    margin: 0;
    padding: 1.25rem 1.75rem;
    border-left: 3px solid rgba(0, 0, 0, 0.15);
    font-style: italic;
    color: var(--fg);
}

@media (prefers-color-scheme: dark) {
    .card blockquote {
        border-left-color: rgba(255, 255, 255, 0.15);
        color: rgba(255, 255, 255, 0.85);
    }
}

.card blockquote p {
    margin: 0;
}

.card blockquote footer {
    margin-top: 0.75rem;
    font-style: normal;
    font-size: 0.9em;
    color: var(--text-secondary);
    text-align: right;
}

/* Quote-only card */

.card > blockquote:only-child {
    padding: 0;
    border-left: none;
    text-align: center;
}

.card > blockquote:only-child p {
    margin: 0 auto;
    max-width: 42rem;
}

.card > blockquote:only-child footer {
    margin-top: 1rem;
    text-align: center;
}

/* =========================================================
   FOOTER
   ========================================================= */

footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

footer p {
    margin: 0.25rem 0;
    line-height: 1.4;
}

footer a {
    color: inherit;
    text-decoration: none;
}

footer a:hover,
footer a:focus {
    text-decoration: underline;
}
