/* Shared site chrome: theme variables, header, nav, theme toggle.
   Loaded on every page. Image paths are absolute so they work from any depth.
   Per-page styles (breadcrumbs widths, main padding, content styles) stay inline. */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-padding-top: 100px; scroll-behavior: smooth; }

:root {
    --bg: #fff;
    --text: #333;
    --text-strong: #222;
    --text-muted: #555;
    --text-subtle: #888;
    --text-quiet: #777;
    --border: #e5e5e5;
    --border-dashed: #d5d5d5;
    --header-bg: rgba(255, 255, 255, 0.85);
    --shadow-sm: rgba(0, 0, 0, 0.06);
    --shadow-md: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --hover-text: #000;
    --hover-bg: rgba(0, 0, 0, 0.05);
    --tile-bg: #1a1a2e;
    --link: #4a5bd4;
}
[data-theme="dark"] {
    --bg: #0f172a;
    --text: #e2e8f0;
    --text-strong: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-subtle: #94a3b8;
    --text-quiet: #cbd5e1;
    --border: #334155;
    --border-dashed: #475569;
    --header-bg: rgba(30, 41, 59, 0.78);
    --shadow-sm: rgba(0, 0, 0, 0.3);
    --shadow-md: rgba(0, 0, 0, 0.4);
    --shadow-lg: rgba(0, 0, 0, 0.6);
    --hover-text: #fff;
    --hover-bg: rgba(255, 255, 255, 0.08);
    --tile-bg: #1e293b;
    --link: #93a8ff;
}

[data-theme="dark"] .header {
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.7)),
        url('/images/header-bg-dark.png');
    background-size: cover;
    background-position: center;
}

[data-theme="dark"] body {
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.65)),
        url('/images/bg-dark-blackboard.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.2s, color 0.2s;
}

.header {
    position: sticky;
    top: 16px;
    z-index: 10;
    margin: 16px 16px 0;
    padding: 10px 24px 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background-color: var(--header-bg);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.65)),
        url('/images/header-bg-light.png');
    background-size: cover;
    background-position: center;
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 4px 24px var(--shadow-sm);
}

.identity-row, .name-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.name-link {
    text-decoration: none;
    color: inherit;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 1px 4px var(--shadow-sm);
}

.identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
    color: var(--text-strong);
}
.name-link:hover .name { color: var(--hover-text); }

.tagline {
    font-size: 0.8rem;
    color: var(--text-quiet);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.links a, .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s, background 0.2s;
}
[data-theme="dark"] .links a,
[data-theme="dark"] .theme-toggle { color: var(--text-muted); }
.links a:hover, .theme-toggle:hover {
    color: var(--hover-text);
    background: var(--hover-bg);
}
.links a svg, .theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }

.breadcrumbs {
    max-width: 760px;
    margin: 24px auto 0;
    padding: 0 48px;
    font-size: 0.85rem;
    line-height: 1.5;
}
.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}
.breadcrumbs a:hover {
    color: var(--hover-text);
    text-decoration: underline;
}
.breadcrumbs .sep {
    margin: 0 8px;
    color: var(--border);
}
.breadcrumbs .current {
    color: var(--text-subtle);
}

main a {
    color: var(--link);
}

@media (max-width: 600px) {
    .header { padding: 8px 16px 8px 12px; }
    .breadcrumbs { padding: 0 16px; }
    .name { font-size: 1.05rem; }
    .tagline { display: none; }
}
