/* ---------- Fonts (self-hosted; CSP font-src 'self') ---------- */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/montserrat-latin-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/montserrat-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/montserrat-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/montserrat-latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/assets/fonts/montserrat-latin-800.woff2') format('woff2');
}

/* ---------- Design tokens ---------- */
:root {
    --bg: #f5f7fb;
    --bg-grad: radial-gradient(1200px 600px at 80% -10%, #e8eefb 0%, transparent 60%),
               radial-gradient(900px 500px at -10% 10%, #eef3fb 0%, transparent 55%);
    --panel: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.82);
    --input-bg: #ffffff;
    --code-bg: #f1f4f8;
    --text: #161f2e;
    --muted: #5b6b7e;
    --line: #e3e8ef;
    --primary: #2458a6;
    --primary-dark: #1d467f;
    --accent-grad: linear-gradient(135deg, #2b6cd4 0%, #1d467f 100%);
    --danger-bg: #fff1f0;
    --danger: #9f2a20;
    --success-bg: #eef8f1;
    --success: #246b3d;

    --font-sans: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
    --shadow-md: 0 6px 18px -6px rgba(16, 24, 40, 0.12), 0 3px 8px -4px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 24px 60px -18px rgba(16, 24, 40, 0.28);
    --maxw: 1120px;
    --header-h: 66px;
}

[data-theme="dark"] {
    --bg: #0f131a;
    --bg-grad: radial-gradient(1200px 600px at 80% -10%, #1a2333 0%, transparent 60%),
               radial-gradient(900px 500px at -10% 10%, #161d2b 0%, transparent 55%);
    --panel: #181f2a;
    --header-bg: rgba(20, 26, 36, 0.82);
    --input-bg: #222b3a;
    --code-bg: #0c1016;
    --text: #e7eaf0;
    --muted: #9aa6b8;
    --line: #2a3342;
    --primary: #4f8de0;
    --primary-dark: #3d72bf;
    --accent-grad: linear-gradient(135deg, #4f8de0 0%, #2b5687 100%);
    --danger-bg: #3a1d1b;
    --danger: #e07a72;
    --success-bg: #1d3326;
    --success: #6fbf8a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 22px -8px rgba(0, 0, 0, 0.55), 0 3px 8px -4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 26px 64px -18px rgba(0, 0, 0, 0.65);
}

/* ---------- Base ---------- */
* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
    margin: 0;
    background: var(--bg);
    background-image: var(--bg-grad);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.18;
}

h1 {
    margin: 0 0 22px;
    font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.6rem);
}
h2 {
    margin: 0 0 16px;
    font-size: clamp(1.3rem, 1rem + 1vw, 1.6rem);
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
    padding: 0 24px;
    background: var(--header-bg);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: opacity 0.15s ease;
}
.brand:hover {
    opacity: 0.85;
    color: var(--text);
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background-color: transparent;
    background-image: url('/assets/img/logo.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.brand-logo-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 7px;
}

.metadata-list {
    display: grid;
    grid-template-columns: minmax(120px, 0.35fr) 1fr;
    gap: 8px 16px;
}

.metadata-list dt { font-weight: 700; }
.metadata-list dd { margin: 0; }
.embed-frame { position: relative; max-width: 760px; aspect-ratio: 16 / 9; margin: 14px 0; }
.embed-frame iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius-sm); }
.theme-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; align-items: start; }
.theme-swatch { min-height: 150px; padding: 18px; border-radius: var(--radius); display: grid; gap: 9px; align-content: start; }
.theme-swatch img { width: 40px; height: 40px; object-fit: contain; }
.theme-swatch-light { background: #f7f8fb; color: #162033; border: 1px solid #dfe4ed; }
.theme-swatch-dark { background: #111722; color: #eef2f7; border: 1px solid #2b3444; }
.theme-og-preview { width: 100%; max-width: 360px; aspect-ratio: 1.91 / 1; object-fit: cover; border-radius: var(--radius-sm); }
[data-theme="dark"] .brand-logo {
    background-image: url('/assets/img/logo-dark.svg');
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.menu-header {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.menu-header a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.menu-header a:hover,
.nav-link:hover {
    color: var(--primary);
}

/* ---------- Hamburger / dropdown menu ---------- */
.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 38px;
    padding: 0 9px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.menu-toggle:hover {
    background: var(--bg);
    border-color: var(--primary);
}
.menu-toggle[aria-expanded="true"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.menu-dropdown {
    position: absolute;
    top: calc(100% - 1px);
    right: 16px;
    z-index: 200;
    width: min(280px, calc(100% - 32px));
    padding: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.menu-dropdown[hidden] { display: none; }

.menu-vertical {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.menu-vertical a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.menu-vertical a:hover {
    background: var(--bg);
    color: var(--primary);
}
.menu-vertical a .bi {
    font-size: 1.05rem;
    width: 1.25em;
    text-align: center;
}

/* ---------- Themed content pages (About, Contact) ---------- */
.hero--centered .hero-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
}
.hero--centered .hero-copy {
    max-width: 680px;
}
.hero-logo {
    width: 72px;
    height: 72px;
    margin: 0 0 18px;
    object-fit: contain;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}
.feature-grid li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
}
.feature-grid .bi {
    color: var(--primary);
    font-size: 1.15rem;
    margin-top: 2px;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.btn-outline:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-1px);
}

.contact-banner {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: var(--radius);
    margin: 0 0 20px;
    display: block;
}

.contact-repo {
    font-family: Consolas, "Courier New", monospace;
    word-break: break-all;
    font-size: 0.95rem;
}
.contact-repo .bi {
    color: var(--primary);
    margin-right: 6px;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 48px;
    padding: 28px 24px;
    background: var(--header-bg);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--line);
}

.footer-inner {
    width: min(var(--maxw), calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.menu-footer {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.menu-footer a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}
.menu-footer a:hover {
    color: var(--primary);
}

/* ---------- Layout containers ---------- */
.page {
    width: min(var(--maxw), calc(100% - 32px));
    margin: 36px auto;
}

.panel {
    margin-bottom: 24px;
    padding: 26px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.narrow {
    max-width: 440px;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    margin: 0 0 32px;
    padding: 64px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-lg);
    background:
        radial-gradient(760px 420px at 92% 18%, rgba(79, 141, 224, 0.16), transparent 66%),
        linear-gradient(135deg, #101923 0%, #172333 54%, #1f2931 100%);
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.42;
}
.hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 48px;
    align-items: center;
    width: 100%;
    margin: 0 auto;
}
.hero-copy {
    max-width: 650px;
}
.hero-eyebrow {
    display: inline-block;
    margin: 0 0 14px;
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #dfe9fb;
    backdrop-filter: blur(4px);
}
.hero-title {
    margin: 0 0 14px;
    font-size: clamp(2rem, 1.4rem + 3vw, 3.1rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
}
.hero-sub {
    margin: 0 0 28px;
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.18rem);
    color: #cdd9ec;
    line-height: 1.6;
    max-width: 58ch;
}
.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    flex-wrap: wrap;
}
.hero-graphic {
    justify-self: end;
    width: min(100%, 420px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 34px);
    border: 1px solid rgba(230, 238, 245, 0.16);
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
        rgba(15, 22, 30, 0.38);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 28px 70px -38px rgba(3, 9, 16, 0.9);
}
.hero-graphic img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 24px 28px rgba(2, 8, 14, 0.34));
}

@media (prefers-reduced-motion: no-preference) {
    .hero-inner {
        animation: hero-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    }
    @keyframes hero-rise {
        from { opacity: 0; transform: translateY(16px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ---------- Dashboard ---------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.dash-card {
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.dash-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
    min-height: 38px;
    min-width: 38px;
    padding: 0 8px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover {
    background: var(--bg);
    transform: rotate(-8deg);
}
.theme-toggle::after { content: '☾'; }
[data-theme="dark"] .theme-toggle::after { content: '☀'; }

/* ---------- Avatars ---------- */
.header-avatar {
    display: inline-flex;
    flex-shrink: 0;
}
.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg);
    border: 1px solid var(--line);
}
.avatar-initials {
    display: inline-block;
    text-align: center;
    font-weight: 700;
    color: #ffffff;
    background: var(--accent-grad);
    border: none;
    border-radius: 50%;
}

.nav {
    display: flex;
    gap: 16px;
}
.nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}
.nav a:hover { color: var(--primary); }

/* ---------- Forms ---------- */
form {
    display: grid;
    gap: 16px;
}
.grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}
label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}
label.inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 400;
}

input, select, button {
    min-height: 42px;
    border-radius: var(--radius-sm);
    font: inherit;
}
input, select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, button:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36, 88, 166, 0.18);
}
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] button:focus-visible {
    box-shadow: 0 0 0 3px rgba(79, 141, 224, 0.25);
}

button {
    padding: 10px 16px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
button:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}
button:active {
    transform: translateY(1px);
}
button.danger {
    border-color: var(--danger);
    background: var(--danger);
}
button.danger:hover {
    background: #821f17;
}

/* Ghost / secondary button variant */
button.ghost,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 18px;
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-sm);
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
button.ghost:hover,
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ---------- Media grid ---------- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.media-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.media-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.media-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--input-bg);
}
.media-meta-form { gap: 8px; }
.media-meta-form label { font-size: 12px; }
.media-delete-form {
    display: flex;
    justify-content: flex-end;
}
.media-url { word-break: break-all; }
.media-url code {
    font-size: 11px;
    color: var(--muted);
}

/* ---------- Notices ---------- */
.notice {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}
.notice.error {
    background: var(--danger-bg);
    border-color: #f0b8b2;
    color: var(--danger);
}
.notice.success {
    background: var(--success-bg);
    border-color: #acd8b7;
    color: var(--success);
}

.secret {
    display: block;
    overflow-x: auto;
    padding: 12px;
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.muted {
    color: var(--muted);
    font-size: 13px;
}
.space-top { margin-top: 20px; }

/* ---------- Details / tables ---------- */
.details {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px 20px;
    margin: 0;
}
.details dt {
    color: var(--muted);
    font-weight: 700;
}
.details dd { margin: 0; }

.table-wrap { overflow-x: auto; }
.matrix th, .matrix td { vertical-align: top; }
.matrix .check { text-align: center; }

textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--input-bg);
    color: var(--text);
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36, 88, 166, 0.18);
}

fieldset {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
legend {
    padding: 0 6px;
    color: var(--muted);
    font-weight: 700;
}

/* ---------- Article listing ---------- */
.article-list {
    display: grid;
    gap: 20px;
}
.article-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.article-card-cover img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
.article-card h3 {
    margin: 0 0 6px;
    font-size: 18px;
}
@media (max-width: 600px) {
    .article-card { grid-template-columns: 1fr; }
}

/* ---------- Icons & rich cards ---------- */
i.bi {
    vertical-align: -0.14em;
    line-height: 1;
}
.nav i.bi,
.nav-link i.bi,
.menu-header i.bi,
.menu-footer i.bi {
    margin-right: 5px;
    font-size: 0.95em;
}
.hero-cta .bi { margin-right: 6px; }

.article-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    align-items: center;
    margin: 0;
}
.article-card-meta .bi { margin-right: 4px; }

.article-card-cover {
    display: block;
    overflow: hidden;
    border-radius: var(--radius-sm);
}
.article-card-cover img {
    transition: transform 0.4s ease;
}
.article-card:hover .article-card-cover img {
    transform: scale(1.05);
}

.empty-state {
    display: flex;
    align-items: center;
    gap: 10px;
}
.empty-state .bi {
    font-size: 1.5rem;
    color: var(--muted);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 20px;
}
.pagination a {
    min-width: 38px;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s ease;
}
.pagination a:hover { background: var(--bg); }
.pagination a.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* ---------- Article view ---------- */
.article-header {
    margin-bottom: 8px;
}
.article-category {
    display: inline-block;
    margin-bottom: 14px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.15s ease, color 0.15s ease;
}
.article-category:hover {
    background: var(--primary);
    color: #ffffff;
}
.article-title {
    margin: 0 0 16px;
    font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.article-byline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.article-byline .avatar {
    width: 40px;
    height: 40px;
}
.byline-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.byline-author {
    font-weight: 700;
}
.byline-details {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.byline-details .dot {
    opacity: 0.5;
}
.byline-details .bi {
    margin-right: 3px;
}
.article-view .article-cover {
    width: 100%;
    max-height: 440px;
    object-fit: cover;
    border-radius: var(--radius);
    margin: 24px 0;
    box-shadow: var(--shadow-md);
}
.article-body {
    line-height: 1.8;
    font-size: 1.05rem;
    max-width: 72ch;
}
.article-body > :first-child { margin-top: 0; }
.article-body p { margin: 1.15em 0; }
.article-body h2 { margin: 1.8em 0 0.6em; font-size: 1.5rem; }
.article-body h3 { margin: 1.6em 0 0.5em; font-size: 1.25rem; }
.article-body ul,
.article-body ol { margin: 1.15em 0; padding-left: 1.5em; }
.article-body li { margin: 0.35em 0; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }
.article-body pre {
    padding: 16px;
    background: #1e252d;
    color: #f6f7f9;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}
.article-body code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.95em;
}
.article-body :not(pre) > code {
    padding: 2px 6px;
    background: var(--code-bg);
    border-radius: 5px;
}
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}
.article-body blockquote {
    margin: 0;
    padding: 8px 16px;
    border-left: 4px solid var(--primary);
    color: var(--muted);
}
.article-tags {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.tags-label {
    color: var(--muted);
    font-size: 1rem;
    margin-right: 2px;
}
.tag {
    padding: 4px 12px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s ease, color 0.15s ease;
}
.tag:hover {
    background: var(--primary);
    color: #ffffff;
}

/* ---------- Article editor ---------- */
.article-editor { gap: 16px; }

/* WYSIWYG Markdown editor (toolbar + live split preview) */
.wysiwyg {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--input-bg);
}
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.editor-toolbar button {
    min-height: 34px;
    min-width: 34px;
    padding: 0 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    border-radius: 6px;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.editor-toolbar button:hover {
    background: var(--panel);
    border-color: var(--line);
}
.editor-toolbar button:active {
    transform: none;
}
.tb-sep {
    width: 1px;
    height: 22px;
    background: var(--line);
    margin: 0 4px;
}
.editor-spacer { flex: 1; }
.editor-toggle {
    font-size: 0.9rem;
    font-weight: 700;
    min-height: 34px;
}
.editor-panes {
    display: grid;
    grid-template-columns: 1fr;
}
.wysiwyg.preview-on .editor-panes {
    grid-template-columns: 1fr 1fr;
}
.editor-panes textarea {
    border: none;
    border-radius: 0;
    min-height: 440px;
    background: var(--input-bg);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.95rem;
}
.wysiwyg.preview-on .editor-panes textarea {
    border-right: 1px solid var(--line);
}
.editor-preview {
    padding: 16px 18px;
    overflow-y: auto;
    max-height: 640px;
    min-height: 440px;
    background: var(--panel);
}
@media (max-width: 760px) {
    .wysiwyg.preview-on .editor-panes { grid-template-columns: 1fr; }
    .wysiwyg.preview-on .editor-panes textarea { border-right: none; border-bottom: 1px solid var(--line); }
}

.media-picker { margin-top: 20px; }
.media-picker .media-grid { margin-top: 12px; }

/* List header (title + action) */
.list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.list-head h2 { margin: 0; }

/* Header icon link + inline search */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 38px;
    padding: 0 9px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--text);
}

.list-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.inline-search {
    display: flex;
}
.inline-search input {
    width: auto;
    min-width: 220px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.inline-search button {
    min-height: 42px;
    padding: 0 14px;
    margin: 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.media-insert {
    padding: 0;
    border: 1px solid var(--line);
    background: var(--input-bg);
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-height: 0;
}
.media-insert img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}

/* ---------- Comments ---------- */
.comment-list {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}
.comment {
    padding: 14px 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.comment-meta {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 6px;
}
.comment-body {
    white-space: normal;
    word-wrap: break-word;
}
.comment-reply {
    min-height: 30px;
    margin-top: 8px;
    padding: 2px 10px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.comment-form { margin-bottom: 20px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.link-button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    min-height: 0;
    font: inherit;
}
.link-button:hover {
    background: none;
    box-shadow: none;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.inline-actions button {
    min-height: 32px;
    padding: 4px 10px;
    font-size: 13px;
}

/* Icon action bar (manage lists) */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.action-bar .icon-action,
a.icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    min-width: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.action-bar .icon-action:hover,
a.icon-action:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}
.icon-action.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-bg);
}
.comment-cell { max-width: 360px; }
.audit-meta {
    display: block;
    max-width: 420px;
    font-size: 11px;
    word-break: break-all;
    color: var(--muted);
}

/* ---------- Profile ---------- */
.profile-head {
    display: flex;
    align-items: center;
    gap: 24px;
}
.profile-avatar-large .avatar {
    width: 96px;
    height: 96px;
}
.public-profile {
    padding: 0;
    overflow: hidden;
}
.profile-cover {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    background: var(--line);
}
.profile-summary {
    display: flex;
    gap: 24px;
    padding: 24px;
    align-items: flex-start;
}
.profile-summary .profile-avatar-large .avatar {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}
.profile-name { margin: 0 0 8px; }

.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--input-bg);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    vertical-align: middle;
    text-transform: none;
}
.profile-bio {
    margin: 0 0 12px;
    max-width: 60ch;
}
.profile-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0;
    margin: 0 0 12px;
}
.profile-since { margin: 0; }
.profile-email { margin: 0 0 12px; }

label.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin: 0;
}

.empty-state {
    margin: 0;
    padding: 24px 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .profile-summary {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .profile-links { justify-content: center; }
}
@media (max-width: 600px) {
    .profile-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 760px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 14px 16px;
    }
    .grid-form { grid-template-columns: 1fr; }
    .details { grid-template-columns: 1fr; }
    .hero { padding: 48px 18px; }
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .hero-copy {
        max-width: none;
    }
    .hero-graphic {
        justify-self: center;
        width: min(100%, 340px);
    }
}

/* ---------- Auth trigger + modal ---------- */
.auth-trigger {
    min-height: 38px;
    padding: 8px 18px;
    border: 1px solid transparent;
    background: var(--accent-grad);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.auth-trigger:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

body.modal-open { overflow: hidden; }
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 18, 28, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none; }
.modal {
    position: relative;
    width: min(440px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 30px 26px 26px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-title {
    margin: 0 0 16px;
    font-size: 22px;
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    min-height: 36px;
    padding: 0 10px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.modal-tab {
    flex: 1;
    min-height: 40px;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.modal-tab.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.auth-form { display: grid; gap: 14px; }
.auth-pane { display: grid; gap: 14px; }
.auth-pane[hidden] { display: none; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: var(--muted);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}
.oauth-buttons { display: grid; gap: 10px; }
.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease;
}
.oauth-btn:hover {
    background: var(--bg);
    transform: translateY(-1px);
}
.oauth-btn--google { border-color: var(--line); }
.oauth-btn--github {
    background: #1e252d;
    color: #ffffff;
    border-color: #1e252d;
}
.oauth-btn--github:hover { background: #2b333d; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.article-hero {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
}

.lead {
    font-size: 1.08rem;
    color: var(--muted);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-list a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.9rem;
}

/* ---------- Yeen Bean Bakery brand layer ---------- */
:root,
[data-theme="dark"] {
    --yb-orange: #ff6b26;
    --yb-yellow: #ffb82e;
    --yb-red: #8f1014;
    --yb-cocoa: #2c1b1a;
    --yb-ink: #0d1112;
    --yb-paper: #fffdf8;
    --yb-mist: #f1eee7;
    --bg: var(--yb-paper);
    --bg-grad: none;
    --panel: #ffffff;
    --header-bg: rgba(255, 253, 248, 0.96);
    --input-bg: #ffffff;
    --text: var(--yb-ink);
    --muted: #5d5a54;
    --line: #d8d2c8;
    --accent-grad: none;
    --radius-sm: 0;
    --radius: 0;
    --radius-lg: 0;
    --maxw: 1280px;
    --header-h: 84px;
    color-scheme: light;
}

body {
    background: var(--yb-paper);
    color: var(--yb-ink);
}

h1, h2, h3, h4 {
    letter-spacing: -0.055em;
}

.site-header {
    min-height: var(--header-h);
    padding: 10px clamp(18px, 4vw, 58px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--yb-ink);
}

.brand {
    gap: 11px;
    color: var(--yb-ink);
}

.brand-logo {
    position: relative;
    display: block;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--yb-orange);
}

.brand-logo img {
    position: absolute;
    width: 98px;
    height: auto;
    max-width: none;
    left: -25px;
    top: -18px;
    mix-blend-mode: multiply;
}

.brand-logo-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.brand-name {
    display: grid;
    line-height: 1;
    color: var(--yb-ink);
}

.brand-name strong {
    font-size: 1rem;
    letter-spacing: -0.04em;
}

.brand-name small {
    margin-top: 4px;
    color: var(--yb-red);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.menu-header {
    gap: clamp(18px, 2.6vw, 38px);
}

.menu-header a,
.staff-link {
    position: relative;
    color: var(--yb-ink);
    font-size: 0.82rem;
    font-weight: 700;
}

.menu-header a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -6px;
    left: 0;
    height: 2px;
    background: var(--yb-orange);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms ease;
}

.menu-header a:hover::after {
    transform: scaleX(1);
}

.header-right {
    gap: 12px;
}

.header-quote,
.bakery-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 11px 18px;
    border: 1px solid var(--yb-ink);
    background: transparent;
    color: var(--yb-ink);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.015em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.header-quote,
.bakery-button--primary {
    border-color: var(--yb-ink);
    background: var(--yb-ink);
    color: #ffffff;
}

.header-quote:hover,
.bakery-button--primary:hover {
    background: var(--yb-orange);
    color: var(--yb-ink);
}

.header-quote:active,
.bakery-button:active {
    transform: translateY(1px);
}

.bakery-button--text {
    padding-right: 0;
    padding-left: 0;
    border-width: 0 0 1px;
}

.bakery-button--text:hover {
    color: var(--yb-red);
    border-color: var(--yb-red);
}

.bakery-button--light {
    border-color: #ffffff;
    color: #ffffff;
}

.bakery-button--light:hover {
    background: #ffffff;
    color: var(--yb-cocoa);
}

.menu-toggle {
    display: none;
    border: 1px solid var(--yb-ink);
    background: transparent;
    color: var(--yb-ink);
    border-radius: 0;
}

.menu-dropdown {
    border: 1px solid var(--yb-ink);
    border-radius: 0;
    box-shadow: none;
}

.page {
    width: min(var(--maxw), calc(100% - clamp(32px, 8vw, 116px)));
    margin: 0 auto;
}

.bakery-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
    min-height: calc(100dvh - var(--header-h));
    border-right: 1px solid var(--yb-ink);
    border-left: 1px solid var(--yb-ink);
}

.bakery-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(72px, 10vw, 140px) clamp(28px, 6vw, 88px);
    border-right: 1px solid var(--yb-ink);
}

.bakery-kicker,
.section-label {
    margin: 0 0 22px;
    color: var(--yb-red);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.bakery-hero h1 {
    max-width: 11ch;
    margin: 0 0 28px;
    font-size: clamp(3.7rem, 7.5vw, 7.8rem);
    font-weight: 800;
    line-height: 0.88;
}

.bakery-hero h1 em {
    display: block;
    padding-bottom: 0.12em;
    color: var(--yb-orange);
    font-style: italic;
    line-height: 1.08;
}

.bakery-lead {
    max-width: 58ch;
    margin: 0;
    color: #4c4944;
    font-size: clamp(1rem, 1.35vw, 1.16rem);
}

.bakery-actions {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-top: 36px;
}

.bakery-hero-mark {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    padding: clamp(42px, 6vw, 90px);
    overflow: hidden;
    background: var(--yb-orange);
}

.bakery-hero-mark img {
    position: relative;
    z-index: 1;
    display: block;
    width: min(100%, 620px);
    max-height: 72dvh;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.bakery-hero-mark .sun-disc {
    position: absolute;
    width: 66%;
    aspect-ratio: 1;
    border: 2px solid var(--yb-ink);
    border-radius: 50%;
    background: var(--yb-yellow);
}

.bakery-hero-mark p {
    position: absolute;
    right: 24px;
    bottom: 22px;
    z-index: 2;
    margin: 0;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-align: right;
    text-transform: uppercase;
}

.bakery-intro,
.bakery-closing,
.page-hero {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
    gap: clamp(36px, 8vw, 130px);
    padding: clamp(76px, 10vw, 140px) clamp(22px, 5vw, 70px);
    border-right: 1px solid var(--yb-ink);
    border-bottom: 1px solid var(--yb-ink);
    border-left: 1px solid var(--yb-ink);
}

.bakery-intro h2,
.bakery-closing h2,
.page-hero h1 {
    max-width: 13ch;
    margin: 0;
    font-size: clamp(2.8rem, 6vw, 6.2rem);
    line-height: 0.94;
}

.bakery-intro > div > p,
.bakery-closing > div > p,
.page-hero > p {
    max-width: 52ch;
    margin: 28px 0 0;
    color: #4c4944;
    font-size: clamp(1rem, 1.4vw, 1.18rem);
}

.bakery-offerings {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
    border-right: 1px solid var(--yb-ink);
    border-bottom: 1px solid var(--yb-ink);
    border-left: 1px solid var(--yb-ink);
}

.section-heading {
    padding: clamp(70px, 8vw, 110px) clamp(24px, 5vw, 70px);
    background: var(--yb-yellow);
    border-right: 1px solid var(--yb-ink);
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(2.8rem, 5.4vw, 5.6rem);
    line-height: 0.93;
}

.offering-list {
    display: grid;
}

.offering-list a {
    display: grid;
    grid-template-columns: 42px minmax(130px, 0.75fr) minmax(170px, 1.25fr) 24px;
    align-items: center;
    gap: 22px;
    padding: 26px clamp(24px, 4vw, 52px);
    border-bottom: 1px solid var(--yb-ink);
    color: var(--yb-ink);
}

.offering-list a:last-child {
    border-bottom: 0;
}

.offering-list a:hover {
    background: var(--yb-mist);
}

.offering-list span,
.offering-list small {
    color: #666159;
    font-size: 0.72rem;
}

.offering-list strong {
    font-size: clamp(1.2rem, 2vw, 1.7rem);
}

.bakery-proof {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
    min-height: 520px;
    color: #ffffff;
    background: var(--yb-cocoa);
    border-right: 1px solid var(--yb-ink);
    border-bottom: 1px solid var(--yb-ink);
    border-left: 1px solid var(--yb-ink);
}

.proof-copy {
    padding: clamp(72px, 9vw, 120px) clamp(24px, 6vw, 86px);
}

.proof-copy .section-label {
    color: var(--yb-yellow);
}

.proof-copy h2 {
    max-width: 11ch;
    margin: 0 0 28px;
    font-size: clamp(3rem, 6vw, 6rem);
    line-height: 0.92;
}

.proof-copy p:not(.section-label) {
    max-width: 58ch;
    color: #eee5dc;
}

.proof-copy .bakery-button {
    margin-top: 24px;
}

.proof-stamp {
    display: grid;
    place-content: center;
    align-items: center;
    border-left: 1px solid #ffffff;
    background: var(--yb-red);
    text-align: center;
}

.proof-stamp span {
    font-size: clamp(6rem, 14vw, 12rem);
    font-weight: 800;
    letter-spacing: -0.12em;
    line-height: 0.8;
}

.proof-stamp small {
    margin-top: 24px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.page-hero {
    align-items: end;
    min-height: 490px;
    background: var(--yb-yellow);
}

.page-hero > p {
    justify-self: end;
    margin-bottom: 4px;
}

.page-hero--story {
    background: var(--yb-orange);
}

.page-hero--quote {
    background: var(--yb-mist);
}

.menu-catalog,
.story-grid,
.portfolio-placeholder,
.contact-layout,
.quote-shell {
    border-right: 1px solid var(--yb-ink);
    border-bottom: 1px solid var(--yb-ink);
    border-left: 1px solid var(--yb-ink);
}

.menu-item {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) minmax(180px, 0.35fr);
    gap: 26px;
    padding: clamp(34px, 5vw, 64px);
    border-bottom: 1px solid var(--yb-ink);
}

.menu-item:last-child {
    border-bottom: 0;
}

.menu-item > span {
    color: var(--yb-red);
    font-size: 0.76rem;
    font-weight: 800;
}

.menu-item h2,
.story-copy h2,
.portfolio-placeholder h2,
.faq-list h2,
.contact-form-shell h2,
.quote-shell h2 {
    margin: 0 0 16px;
    font-size: clamp(2.2rem, 4vw, 4rem);
    line-height: 0.95;
}

.menu-item p {
    max-width: 62ch;
    margin: 0;
}

.menu-item > strong {
    justify-self: end;
    font-size: 0.82rem;
    text-align: right;
}

.menu-item > strong small {
    display: block;
    margin-top: 8px;
    color: var(--yb-red);
    font-size: 0.68rem;
    font-weight: 700;
}

.menu-notes,
.values-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-right: 1px solid var(--yb-ink);
    border-bottom: 1px solid var(--yb-ink);
    border-left: 1px solid var(--yb-ink);
}

.menu-notes > div,
.values-strip > div {
    padding: clamp(34px, 4vw, 58px);
    border-right: 1px solid var(--yb-ink);
}

.menu-notes > div:last-child,
.values-strip > div:last-child {
    border-right: 0;
}

.menu-notes h2,
.values-strip h2 {
    font-size: clamp(1.5rem, 2.3vw, 2.4rem);
}

.story-grid,
.portfolio-placeholder,
.contact-layout,
.quote-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.story-mark,
.portfolio-mark {
    display: grid;
    place-items: center;
    min-height: 620px;
    padding: clamp(30px, 5vw, 80px);
    overflow: hidden;
    background: var(--yb-orange);
    border-right: 1px solid var(--yb-ink);
}

.story-mark img,
.portfolio-mark img {
    width: min(100%, 580px);
    mix-blend-mode: multiply;
}

.story-copy,
.portfolio-placeholder > div:last-child {
    align-self: center;
    padding: clamp(48px, 8vw, 110px);
}

.values-strip span,
.quote-shell aside li span {
    color: var(--yb-red);
    font-size: 0.72rem;
    font-weight: 800;
}

.portfolio-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-right: 1px solid var(--yb-ink);
    border-bottom: 1px solid var(--yb-ink);
    border-left: 1px solid var(--yb-ink);
}

.portfolio-slots div {
    display: flex;
    align-items: end;
    min-height: 260px;
    padding: 24px;
    border-right: 1px solid var(--yb-ink);
    background: var(--yb-mist);
}

.portfolio-slots div:nth-child(2) { background: var(--yb-yellow); }
.portfolio-slots div:nth-child(3) { background: var(--yb-orange); }
.portfolio-slots div:last-child { border-right: 0; background: var(--yb-cocoa); color: #ffffff; }
.portfolio-slots span { font-weight: 800; }

.faq-list,
.contact-form-shell,
.quote-shell > aside,
.quote-form {
    padding: clamp(44px, 6vw, 86px);
}

.faq-list {
    border-right: 1px solid var(--yb-ink);
}

.faq-list details {
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.faq-list summary {
    cursor: pointer;
    font-weight: 800;
}

.faq-list details p {
    color: #56524c;
}

.contact-form-shell {
    background: var(--yb-mist);
}

.bakery-form {
    display: grid;
    gap: 20px;
}

.bakery-form label {
    display: grid;
    gap: 8px;
    color: var(--yb-ink);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.bakery-form label small {
    color: #6c675f;
    font-weight: 500;
}

.bakery-form input,
.bakery-form select,
.bakery-form textarea {
    width: 100%;
    min-height: 52px;
    padding: 13px 14px;
    border: 1px solid #8b867e;
    border-radius: 0;
    background: #ffffff;
    color: var(--yb-ink);
    font: inherit;
    font-size: 0.95rem;
}

.bakery-form textarea {
    min-height: 110px;
    resize: vertical;
}

.bakery-form input:focus,
.bakery-form select:focus,
.bakery-form textarea:focus {
    outline: 3px solid rgba(255, 107, 38, 0.28);
    border-color: var(--yb-orange);
}

.form-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.bakery-form .bakery-button {
    justify-self: start;
}

.quote-shell > aside {
    border-right: 1px solid var(--yb-ink);
    background: var(--yb-yellow);
}

.quote-shell aside ol {
    display: grid;
    gap: 0;
    margin: 34px 0 0;
    padding: 0;
    list-style: none;
}

.quote-shell aside li {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(13, 17, 18, 0.35);
    font-weight: 800;
}

.form-note {
    max-width: 65ch;
    margin: 0;
    color: #5c5852;
    font-size: 0.78rem;
}

.notice {
    margin: 24px 0;
    border-radius: 0;
}

.site-footer {
    margin-top: 0;
    padding: 38px clamp(18px, 4vw, 58px);
    background: var(--yb-ink);
    color: #ffffff;
    border-top: 0;
}

.footer-inner {
    width: min(var(--maxw), 100%);
}

.menu-footer a,
.site-footer .muted {
    color: #ffffff;
    font-size: 0.76rem;
}

.staff-footer {
    margin-left: 12px;
    color: #9c9891 !important;
}

@media (prefers-reduced-motion: no-preference) {
    .bakery-hero-copy > *,
    .bakery-hero-mark img {
        animation: yb-arrive 650ms cubic-bezier(.2,.75,.25,1) both;
    }
    .bakery-hero-copy > *:nth-child(2) { animation-delay: 80ms; }
    .bakery-hero-copy > *:nth-child(3) { animation-delay: 150ms; }
    .bakery-hero-copy > *:nth-child(4) { animation-delay: 220ms; }
    .bakery-hero-mark img { animation-delay: 120ms; }
    @keyframes yb-arrive {
        from { opacity: 0; transform: translateY(18px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

@media (max-width: 980px) {
    .menu-header { display: none; }
    .menu-toggle { display: inline-flex; }
    .bakery-hero,
    .bakery-offerings,
    .bakery-proof,
    .story-grid,
    .portfolio-placeholder,
    .contact-layout,
    .quote-shell {
        grid-template-columns: 1fr;
    }
    .bakery-hero-copy,
    .section-heading,
    .story-mark,
    .portfolio-mark,
    .faq-list,
    .quote-shell > aside {
        border-right: 0;
        border-bottom: 1px solid var(--yb-ink);
    }
    .bakery-hero-mark { min-height: 560px; }
    .proof-stamp { min-height: 320px; border-top: 1px solid #ffffff; border-left: 0; }
    .menu-notes,
    .values-strip { grid-template-columns: 1fr; }
    .menu-notes > div,
    .values-strip > div { border-right: 0; border-bottom: 1px solid var(--yb-ink); }
    .menu-notes > div:last-child,
    .values-strip > div:last-child { border-bottom: 0; }
    .portfolio-slots { grid-template-columns: 1fr 1fr; }
    .portfolio-slots div:nth-child(2) { border-right: 0; }
    .portfolio-slots div:nth-child(-n+2) { border-bottom: 1px solid var(--yb-ink); }
}

@media (max-width: 700px) {
    :root, [data-theme="dark"] { --header-h: 72px; }
    .site-header {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 9px 16px;
    }
    .brand-logo,
    .brand-logo-image { width: 42px; height: 42px; }
    .brand-logo img { width: 86px; left: -22px; top: -16px; }
    .brand-name strong { font-size: 0.88rem; }
    .header-quote { display: none; }
    .page { width: calc(100% - 24px); }
    .bakery-hero,
    .bakery-intro,
    .bakery-offerings,
    .bakery-proof,
    .bakery-closing,
    .page-hero,
    .menu-catalog,
    .menu-notes,
    .story-grid,
    .values-strip,
    .portfolio-placeholder,
    .portfolio-slots,
    .contact-layout,
    .quote-shell {
        border-right: 0;
        border-left: 0;
    }
    .bakery-hero { min-height: auto; }
    .bakery-hero-copy { padding: 78px 20px; }
    .bakery-hero h1 { font-size: clamp(3.3rem, 17vw, 5.3rem); }
    .bakery-actions { align-items: flex-start; flex-direction: column; }
    .bakery-hero-mark { min-height: 440px; padding: 30px; }
    .bakery-intro,
    .bakery-closing,
    .page-hero { grid-template-columns: 1fr; gap: 40px; padding: 72px 20px; }
    .page-hero { min-height: auto; }
    .page-hero > p { justify-self: start; }
    .offering-list a { grid-template-columns: 30px 1fr 24px; gap: 14px; padding: 24px 20px; }
    .offering-list small { grid-column: 2 / 4; }
    .proof-copy,
    .story-copy,
    .portfolio-placeholder > div:last-child,
    .faq-list,
    .contact-form-shell,
    .quote-shell > aside,
    .quote-form { padding: 60px 20px; }
    .menu-item { grid-template-columns: 34px 1fr; padding: 36px 20px; }
    .menu-item > strong { grid-column: 2; justify-self: start; text-align: left; }
    .form-pair { grid-template-columns: 1fr; }
    .portfolio-slots { grid-template-columns: 1fr; }
    .portfolio-slots div { min-height: 180px; border-right: 0; border-bottom: 1px solid var(--yb-ink); }
    .portfolio-slots div:last-child { border-bottom: 0; }
    .footer-inner { align-items: flex-start; flex-direction: column; }
}

/* ---------- Employee workspace ---------- */
.staff-body {
    min-height: 100dvh;
    background: #f4f3ef;
    color: #171918;
}

.staff-topbar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 9px clamp(18px, 3vw, 40px);
    background: #ffffff;
    border-bottom: 1px solid #d6d4ce;
}

.staff-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #171918;
}

.staff-brand:hover {
    color: #171918;
}

.staff-brand-mark {
    position: relative;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--yb-orange);
}

.staff-brand-mark img {
    position: absolute;
    top: -15px;
    left: -21px;
    width: 84px;
    max-width: none;
    mix-blend-mode: multiply;
}

.staff-brand > span:last-child {
    display: grid;
    line-height: 1.15;
}

.staff-brand strong {
    font-size: 0.86rem;
}

.staff-brand small {
    margin-top: 3px;
    color: #6a6862;
    font-size: 0.67rem;
}

.staff-topbar nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.staff-topbar nav a {
    color: #4f504d;
    font-size: 0.78rem;
    font-weight: 700;
}

.staff-topbar nav a:hover {
    color: var(--yb-red);
}

.staff-login-page {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
    min-height: calc(100dvh - 68px);
}

.staff-login-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(60px, 9vw, 130px);
    color: #ffffff;
    background: var(--yb-cocoa);
}

.staff-overline {
    margin: 0 0 24px;
    color: var(--yb-yellow);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.staff-login-copy h1 {
    max-width: 9ch;
    margin: 0 0 28px;
    font-size: clamp(3.2rem, 6vw, 6.6rem);
    line-height: 0.93;
}

.staff-login-copy > p:last-child {
    max-width: 50ch;
    margin: 0;
    color: #e3ddd6;
}

.staff-login-panel {
    align-self: center;
    width: min(460px, calc(100% - 48px));
    margin: 48px auto;
    padding: clamp(30px, 5vw, 52px);
    border: 1px solid #ccc9c1;
    border-radius: 10px;
    background: #ffffff;
}

.staff-login-panel h2 {
    margin: 0 0 8px;
    font-size: 1.65rem;
    letter-spacing: -0.035em;
}

.staff-login-panel > p {
    margin-top: 0;
    color: #686761;
    font-size: 0.88rem;
}

.staff-login-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.staff-login-form label {
    display: grid;
    gap: 7px;
    color: #343533;
    font-size: 0.76rem;
    font-weight: 700;
}

.staff-login-form input {
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #aaa8a2;
    border-radius: 7px;
    background: #ffffff;
    color: #171918;
    font: inherit;
}

.staff-login-form input:focus {
    outline: 3px solid rgba(255, 107, 38, 0.22);
    border-color: var(--yb-orange);
}

.staff-login-form button {
    min-height: 46px;
    padding: 10px 16px;
    border: 1px solid #171918;
    border-radius: 7px;
    background: #171918;
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.staff-login-form button:hover {
    background: var(--yb-orange);
    color: #171918;
}

.staff-login-form button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.staff-form-error {
    margin: 18px 0 0 !important;
    padding: 11px 12px;
    border-left: 3px solid var(--yb-red);
    background: #fff1f0;
    color: #7c171a !important;
}

.staff-login-help {
    margin: 22px 0 0 !important;
    font-size: 0.75rem !important;
}

.staff-denied {
    width: min(620px, calc(100% - 32px));
    margin: 90px auto;
    padding: 36px;
    border: 1px solid #ccc9c1;
    border-radius: 10px;
    background: #ffffff;
}

.staff-denied h1 {
    margin-bottom: 10px;
    font-size: 2rem;
}

.staff-denied div {
    display: flex;
    gap: 18px;
    margin-top: 26px;
}

.staff-app {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: calc(100dvh - 68px);
}

.staff-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 18px;
    background: #242524;
    color: #ffffff;
}

.staff-sidebar nav {
    display: grid;
    gap: 4px;
}

.staff-sidebar nav a,
.staff-sidebar nav span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 9px 11px;
    border-radius: 7px;
    color: #d9d8d4;
    font-size: 0.8rem;
    font-weight: 700;
}

.staff-sidebar nav a.is-current {
    background: #ffffff;
    color: #171918;
}

.staff-sidebar nav span {
    color: #8f908c;
}

.staff-sidebar nav small {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
}

.staff-sidebar > p {
    margin: 28px 11px 4px;
    color: #a9aaa6;
    font-size: 0.7rem;
    line-height: 1.5;
}

.staff-sidebar > p strong {
    color: #ffffff;
    font-size: 0.78rem;
}

.staff-workspace {
    width: min(1020px, calc(100% - 64px));
    margin: 0 auto;
    padding: 42px 0 70px;
}

.staff-page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}

.staff-page-heading h1 {
    margin: 0 0 6px;
    font-size: 2rem;
}

.staff-page-heading p {
    margin: 0;
    color: #666761;
    font-size: 0.88rem;
}

.staff-page-heading > a,
.staff-admin-callout > a {
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid #aaa8a2;
    border-radius: 7px;
    background: #ffffff;
    color: #343533;
    font-size: 0.74rem;
    font-weight: 700;
}

.staff-module-list {
    overflow: hidden;
    border: 1px solid #d2d0ca;
    border-radius: 10px;
    background: #ffffff;
}

.staff-section-heading {
    padding: 22px 24px;
    border-bottom: 1px solid #dedcd6;
}

.staff-section-heading h2 {
    margin: 0 0 5px;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.staff-section-heading p {
    margin: 0;
    color: #70716c;
    font-size: 0.78rem;
}

.staff-module-list article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 20px 24px;
    border-bottom: 1px solid #e3e1dc;
}

.staff-module-list article:last-child {
    border-bottom: 0;
}

.staff-module-list h3 {
    margin: 0 0 4px;
    font-size: 0.93rem;
    letter-spacing: -0.015em;
}

.staff-module-list article p {
    margin: 0;
    color: #6b6c67;
    font-size: 0.78rem;
}

.staff-module-list article > span {
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 1px solid #d1cec6;
    border-radius: 5px;
    color: #777770;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}

.staff-admin-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 24px;
    padding: 22px 24px;
    border: 1px solid #d2d0ca;
    border-radius: 10px;
    background: #fff8e7;
}

.staff-admin-callout h2 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.staff-admin-callout p {
    margin: 0;
    color: #666761;
    font-size: 0.78rem;
}

@media (max-width: 820px) {
    .staff-login-page {
        grid-template-columns: 1fr;
    }
    .staff-login-copy {
        min-height: 390px;
        padding: 64px 28px;
    }
    .staff-login-copy h1 {
        font-size: clamp(3rem, 14vw, 5rem);
    }
    .staff-app {
        grid-template-columns: 1fr;
    }
    .staff-sidebar {
        display: block;
        padding: 12px 18px;
    }
    .staff-sidebar nav {
        display: flex;
        overflow-x: auto;
    }
    .staff-sidebar nav a,
    .staff-sidebar nav span {
        flex: 0 0 auto;
    }
    .staff-sidebar > p {
        display: none;
    }
    .staff-workspace {
        width: calc(100% - 32px);
        padding-top: 28px;
    }
}

@media (max-width: 560px) {
    .staff-topbar {
        align-items: flex-start;
        gap: 14px;
    }
    .staff-brand > span:last-child {
        display: none;
    }
    .staff-topbar nav {
        justify-content: flex-end;
        gap: 13px;
        flex-wrap: wrap;
    }
    .staff-login-panel {
        width: calc(100% - 28px);
        margin: 28px auto;
        padding: 28px 22px;
    }
    .staff-page-heading,
    .staff-admin-callout {
        align-items: flex-start;
        flex-direction: column;
    }
    .staff-module-list article {
        align-items: flex-start;
    }
}
