:root {
    --bg: #151818;
    --bg-soft: #1b1f1f;
    --panel: #1e2222;
    --panel-2: #232828;
    --line: #303636;
    --line-strong: #414949;
    --text: #e7e7df;
    --muted: #9ca29e;
    --quiet: #737b77;
    --steel: #597a8f;
    --steel-soft: #416278;
    --olive: #76845e;
    --orange: #c6724c;
    --metal: #908d79;
    --danger: #bd665f;
    --radius: 14px;
    --radius-sm: 8px;
    --max: 1220px;
    --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(89, 122, 143, 0.035), transparent 26rem),
        var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .17;
    background-image: linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.01) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img { display: block; max-width: 100%; }
code { font-family: var(--mono); font-size: .92em; }
::selection { background: rgba(198, 114, 76, .34); color: #fff; }

:focus-visible {
    outline: 2px solid var(--steel);
    outline-offset: 3px;
}

.page-shell,
.admin-shell {
    width: min(calc(100% - 40px), var(--max));
    margin: 0 auto;
}

.site-header {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; min-width: 142px; }
.brand img { width: 150px; height: auto; opacity: .95; }
.site-nav, .admin-nav { display: flex; align-items: center; gap: 5px; }
.site-nav a, .admin-nav a {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .02em;
    padding: 9px 11px;
    border-radius: 7px;
    transition: color .18s ease, background-color .18s ease;
}
.site-nav a:hover, .admin-nav a:hover,
.site-nav a[aria-current="page"], .admin-nav a[aria-current="page"] {
    color: var(--text);
    background: rgba(255,255,255,.045);
}

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: transparent;
    border-radius: 7px;
    padding: 7px 10px;
    font-family: var(--mono);
    font-size: 12px;
}

.section-rule { border-bottom: 1px solid var(--line); }
.hero {
    min-height: 570px;
    padding: 92px 0 70px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
    align-items: end;
    gap: 70px;
}
.eyebrow {
    margin: 0 0 18px;
    color: var(--quiet);
    font: 11px/1.3 var(--mono);
    text-transform: uppercase;
    letter-spacing: .12em;
}
.hero h1, .page-heading h1, .project-detail h1, .auth-panel h1, .admin-titlebar h1 {
    margin: 0;
    font-weight: 520;
    letter-spacing: -.055em;
    line-height: .98;
}
.hero h1 { font-size: clamp(58px, 8vw, 108px); max-width: 850px; }
.hero h1 span { color: #aeb2ad; }
.hero-intro {
    max-width: 620px;
    margin: 32px 0 0;
    color: var(--muted);
    font-size: clamp(16px, 1.5vw, 20px);
}
.hero-index {
    align-self: end;
    border-top: 1px solid var(--line-strong);
}
.hero-index div {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 11px;
}
.hero-index span { color: var(--quiet); text-transform: uppercase; letter-spacing: .1em; }
.hero-index strong { font-weight: 500; color: var(--muted); }

.project-section, .principles, .catalogue, .about-grid, .contact-note { padding: 70px 0; }
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 32px;
    margin-bottom: 36px;
}
.section-heading h2 { margin: 0; font-size: clamp(30px, 4vw, 50px); font-weight: 520; letter-spacing: -.04em; }
.text-link, .back-link { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.text-link:hover, .back-link:hover { color: var(--text); }

.project-list { border-top: 1px solid var(--line); }
.project-row { border-bottom: 1px solid var(--line); position: relative; }
.project-row::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: var(--steel);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform .22s ease;
}
.project-row:nth-child(3n + 2)::before { background: var(--olive); }
.project-row:nth-child(3n + 3)::before { background: var(--orange); }
.project-row:hover::before { transform: scaleY(1); }
.project-row-main {
    min-height: 112px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 120px 30px;
    gap: 20px;
    align-items: center;
    padding: 18px 4px 18px 18px;
    transition: background-color .18s ease, padding-left .18s ease;
}
.project-row-main:hover { background: rgba(255,255,255,.018); padding-left: 23px; }
.project-number { color: var(--quiet); font: 11px var(--mono); }
.project-name-wrap { display: flex; flex-direction: column; min-width: 0; gap: 5px; }
.project-name-wrap strong { font-size: clamp(20px, 2.2vw, 29px); font-weight: 510; letter-spacing: -.025em; }
.project-name-wrap span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-runtime { color: var(--quiet); font: 11px var(--mono); text-align: right; text-transform: uppercase; }
.project-arrow { color: var(--metal); font-size: 20px; text-align: right; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project-row > .project-tags { padding: 0 0 16px 90px; }
.project-tags span, .badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--quiet);
    font: 10px/1 var(--mono);
    letter-spacing: .03em;
}
.empty-state {
    padding: 42px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
}
.empty-state p { color: var(--text); margin: 0 0 8px; }
.empty-state span { font-size: 13px; }

.principle-grid, .about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--line);
}
.principle-grid > div, .about-grid > div {
    padding: 30px 30px 16px 0;
    min-height: 170px;
    border-right: 1px solid var(--line);
}
.principle-grid > div + div, .about-grid > div + div { padding-left: 30px; }
.principle-grid > div:last-child, .about-grid > div:last-child { border-right: 0; }
.principle-grid span { color: var(--orange); font: 10px var(--mono); }
.principle-grid p, .about-grid p { max-width: 320px; margin: 32px 0 0; color: var(--muted); }

.site-footer {
    min-height: 105px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    color: var(--quiet);
    font: 11px var(--mono);
}
.site-footer > div { display: flex; align-items: center; gap: 9px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--olive); box-shadow: 0 0 0 3px rgba(118,132,94,.08); }
.footer-meta { gap: 20px !important; }
.footer-meta a:hover { color: var(--text); }

.page-heading {
    padding: 96px 0 72px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 50px;
    align-items: end;
}
.page-heading .eyebrow { grid-column: 1 / -1; margin-bottom: -20px; }
.page-heading h1 { font-size: clamp(58px, 8vw, 104px); }
.page-heading > p:not(.eyebrow) { margin: 0 0 8px; max-width: 520px; color: var(--muted); font-size: 18px; }
.contact-link { margin-top: 22px !important; }
.contact-link a { color: var(--text); border-bottom: 1px solid var(--line-strong); }

.catalogue-tools {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 28px;
}
.search-field { width: min(100%, 460px); }
.search-field span, .stack-form label > span {
    display: block;
    margin-bottom: 8px;
    color: var(--quiet);
    font: 10px var(--mono);
    text-transform: uppercase;
    letter-spacing: .09em;
}
input, textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #181b1b;
    color: var(--text);
    padding: 12px 13px;
    outline: none;
    transition: border-color .16s ease, background-color .16s ease;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, textarea:focus { border-color: var(--steel); background: #1a1e1e; }
input::placeholder, textarea::placeholder { color: #606865; }
.filter-status { color: var(--quiet); font: 11px var(--mono); }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.project-card {
    min-height: 300px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255,255,255,.012);
    overflow: hidden;
    transition: border-color .2s ease, transform .2s ease, background-color .2s ease;
}
.project-card:hover { border-color: var(--line-strong); transform: translateY(-2px); background: rgba(255,255,255,.02); }
.project-card[hidden] { display: none; }
.project-card-link { min-height: 300px; padding: 23px; display: flex; flex-direction: column; justify-content: space-between; }
.project-card-topline, .project-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.project-card-topline { color: var(--quiet); font: 10px var(--mono); text-transform: uppercase; }
.project-card h2 { margin: 0 0 12px; font-weight: 520; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.045em; }
.project-card p { margin: 0; max-width: 500px; color: var(--muted); }
.project-card-footer > span { color: var(--metal); }

.project-detail { padding: 90px 0 80px; }
.project-detail-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 50px;
    padding-bottom: 64px;
}
.project-detail .back-link { display: inline-block; margin-bottom: 48px; }
.project-detail h1 { font-size: clamp(52px, 8vw, 98px); max-width: 900px; }
.project-lede { max-width: 760px; margin: 25px 0 0; color: var(--muted); font-size: clamp(17px, 2vw, 22px); }
.project-actions { display: flex; flex-direction: column; gap: 8px; min-width: 160px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: 11px var(--mono);
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.button:hover { background: rgba(255,255,255,.045); border-color: #56605e; }
.button:active { transform: translateY(1px); }
.button--primary { background: #d6d7ce; color: #161919; border-color: #d6d7ce; }
.button--primary:hover { background: #ecece5; border-color: #ecece5; }
.button--quiet { color: var(--muted); border-color: var(--line); }
.project-detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 80px; padding-top: 56px; border-top: 1px solid var(--line); }
.prose { max-width: 740px; color: #c2c5c0; }
.prose p { margin: 0 0 1.4em; }
.project-meta { border-top: 1px solid var(--line-strong); }
.project-meta dl, .detail-list { margin: 0; }
.project-meta dl > div, .detail-list > div { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--quiet); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.project-tags--detail { margin-top: 24px; }
.contact-note { color: var(--quiet); font-family: var(--mono); font-size: 12px; }
.error-page .button { width: fit-content; margin-top: 18px; }

/* Admin */
.admin-body { background: #121515; }
.admin-shell { width: min(calc(100% - 32px), 1280px); }
.admin-header {
    min-height: 78px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
    border-bottom: 1px solid var(--line);
}
.brand--admin { gap: 10px; }
.brand--admin img { width: 118px; }
.brand--admin span { padding-left: 10px; border-left: 1px solid var(--line-strong); color: var(--quiet); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.admin-nav { justify-self: center; }
.inline-form { display: inline; margin: 0; }
.admin-main { padding: 54px 0 90px; }
.notice {
    margin: 18px 0;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255,255,255,.018);
    font-size: 13px;
}
.notice--success { border-color: rgba(118,132,94,.6); }
.notice--error { border-color: rgba(189,102,95,.65); }
.notice--warning { border-color: rgba(198,114,76,.55); }
.notice strong { color: var(--text); }
.notice ul { margin: 8px 0 0 18px; padding: 0; }

.auth-panel {
    width: min(100%, 520px);
    margin: 9vh auto 0;
    padding: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}
.auth-panel h1 { font-size: 42px; }
.auth-panel > p:not(.eyebrow) { color: var(--muted); margin: 16px 0 26px; }
.stack-form { display: flex; flex-direction: column; gap: 18px; }
.stack-form small { display: block; margin-top: 6px; color: var(--quiet); font-size: 11px; }

.admin-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 30px;
    margin-bottom: 34px;
}
.admin-titlebar h1 { font-size: clamp(42px, 5vw, 70px); }
.admin-titlebar p:not(.eyebrow) { margin: 12px 0 0; color: var(--muted); }
.admin-titlebar .back-link { display: inline-block; margin-bottom: 28px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 38px; }
.stat-grid > div { min-height: 130px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); display: flex; flex-direction: column; justify-content: space-between; }
.stat-grid span { color: var(--quiet); font: 10px var(--mono); text-transform: uppercase; }
.stat-grid strong { font: 500 38px var(--sans); letter-spacing: -.04em; }
.admin-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 24px; }
.admin-card-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.admin-card-heading h2 { margin: 0; font-size: 25px; font-weight: 520; }
.admin-meta-line { margin: 0 0 16px; color: var(--quiet); font: 10px var(--mono); }

.admin-project-list { border-top: 1px solid var(--line); }
.admin-project-row {
    min-height: 118px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}
.order-controls { display: grid; grid-template-columns: 22px; justify-content: center; gap: 1px; text-align: center; }
.order-controls form { margin: 0; }
.order-controls button { width: 22px; height: 22px; padding: 0; border: 0; background: transparent; color: var(--quiet); cursor: pointer; }
.order-controls button:hover:not(:disabled) { color: var(--text); }
.order-controls button:disabled { opacity: .18; cursor: default; }
.order-controls span { color: #606865; font: 8px var(--mono); }
.admin-project-main { min-width: 0; }
.admin-project-titleline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.admin-project-titleline strong { font-size: 18px; font-weight: 520; }
.admin-project-titleline code { color: var(--quiet); font-size: 10px; }
.admin-project-main p { margin: 5px 0 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-row { display: flex; flex-wrap: wrap; gap: 5px; }
.badge--ok { border-color: rgba(118,132,94,.5); color: #aeb99b; }
.badge--warn { border-color: rgba(198,114,76,.5); color: #ca9178; }
.badge--danger { border-color: rgba(189,102,95,.55); color: #cd817b; }
.badge--public { border-color: rgba(89,122,143,.6); color: #8caabd; }
.admin-project-actions { display: flex; align-items: center; gap: 7px; }
.admin-project-actions form { margin: 0; }

.admin-edit-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, .6fr); gap: 18px; align-items: start; }
.form-grid { display: grid; gap: 14px; }
.form-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-row { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 10px 0; }
.check-control { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.check-control input { width: 16px; height: 16px; accent-color: var(--steel); }
.form-actions { display: flex; gap: 8px; align-items: center; padding-top: 4px; }
.diagnostic-card { position: sticky; top: 18px; }
.fine-print { margin: 20px 0 0; color: var(--quiet); font-size: 12px; }
.settings-form { max-width: 760px; }

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: 55px; min-height: auto; padding: 76px 0 60px; }
    .hero-index { width: 100%; }
    .project-detail-head, .project-detail-grid, .page-heading { grid-template-columns: 1fr; }
    .project-actions { flex-direction: row; flex-wrap: wrap; }
    .project-detail-grid { gap: 42px; }
    .principle-grid, .about-grid { grid-template-columns: 1fr; }
    .principle-grid > div, .about-grid > div, .principle-grid > div + div, .about-grid > div + div { min-height: auto; padding: 26px 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .project-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-header { grid-template-columns: auto 1fr; }
    .admin-nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; overflow-x: auto; padding-bottom: 10px; }
    .admin-header > .inline-form { grid-column: 2; grid-row: 1; justify-self: end; }
    .admin-edit-grid { grid-template-columns: 1fr; }
    .diagnostic-card { position: static; }
}

@media (max-width: 680px) {
    .page-shell { width: min(calc(100% - 28px), var(--max)); }
    .site-header { min-height: 76px; position: relative; }
    .brand img { width: 126px; }
    .nav-toggle { display: inline-flex; }
    .site-nav {
        display: none;
        position: absolute;
        top: 66px;
        right: 0;
        z-index: 20;
        width: min(250px, 78vw);
        padding: 8px;
        flex-direction: column;
        align-items: stretch;
        border: 1px solid var(--line-strong);
        border-radius: 10px;
        background: #1a1e1e;
        box-shadow: 0 18px 50px rgba(0,0,0,.3);
    }
    .site-nav[data-open="true"] { display: flex; }
    .hero h1 { font-size: clamp(50px, 18vw, 78px); }
    .hero { padding-top: 58px; }
    .section-heading { align-items: start; flex-direction: column; }
    .project-row-main { grid-template-columns: 36px minmax(0, 1fr) 22px; gap: 12px; }
    .project-runtime { display: none; }
    .project-row > .project-tags { padding-left: 48px; }
    .page-heading { padding: 66px 0 54px; gap: 26px; }
    .page-heading h1 { font-size: clamp(52px, 18vw, 78px); }
    .catalogue-tools { align-items: stretch; flex-direction: column; }
    .project-section, .principles, .catalogue, .about-grid, .contact-note { padding: 52px 0; }
    .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 13px; }
    .project-detail { padding-top: 60px; }
    .project-detail .back-link { margin-bottom: 34px; }
    .project-detail-head { padding-bottom: 44px; }
    .project-actions .button { flex: 1; }
    .admin-shell { width: min(calc(100% - 20px), 1280px); }
    .admin-header { gap: 10px; }
    .brand--admin span { display: none; }
    .admin-nav { gap: 0; }
    .admin-nav a { padding-left: 8px; padding-right: 8px; }
    .admin-main { padding-top: 36px; }
    .admin-titlebar { align-items: flex-start; flex-direction: column; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .admin-project-row { grid-template-columns: 40px minmax(0, 1fr); }
    .admin-project-actions { grid-column: 2; flex-wrap: wrap; }
    .admin-project-actions .button { min-height: 34px; }
    .form-grid--two { grid-template-columns: 1fr; }
    .auth-panel { padding: 26px 20px; }
    .admin-card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* --------------------------------------------------------------------------
   Overhaul V1 — public identity, homepage composition and blog
   -------------------------------------------------------------------------- */

body {
    background:
        radial-gradient(circle at 12% -10%, rgba(89, 122, 143, .09), transparent 32rem),
        radial-gradient(circle at 88% 4%, rgba(118, 132, 94, .055), transparent 28rem),
        radial-gradient(circle at 52% 24%, rgba(198, 114, 76, .025), transparent 34rem),
        var(--bg);
}

body::before {
    opacity: .12;
    background-size: 52px 52px;
}

.page-shell { position: relative; }
.page-shell::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 3%, rgba(89,122,143,.58) 24%, rgba(118,132,94,.43) 50%, rgba(198,114,76,.52) 76%, transparent 97%);
    opacity: .72;
}

.site-header {
    min-height: 210px;
    padding: 34px 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: minmax(112px, auto) auto;
    align-items: center;
    gap: 12px 24px;
    border-bottom: 1px solid var(--line);
}

.brand--public {
    --logo-rx: 0deg;
    --logo-ry: 0deg;
    --logo-lift: 0px;
    position: relative;
    grid-column: 2;
    grid-row: 1;
    width: clamp(260px, 31vw, 455px);
    min-width: 0;
    justify-self: center;
    perspective: 900px;
    isolation: isolate;
}

.brand--public img {
    width: 100%;
    height: auto;
    opacity: .98;
    position: relative;
    z-index: 2;
    transform: perspective(900px) rotateX(var(--logo-rx)) rotateY(var(--logo-ry)) translate3d(0, var(--logo-lift), 0);
    transform-style: preserve-3d;
    transform-origin: center;
    filter:
        drop-shadow(-7px 0 14px rgba(89,122,143,.08))
        drop-shadow(7px 0 14px rgba(198,114,76,.065));
    transition: transform .22s cubic-bezier(.2,.75,.2,1), filter .25s ease, opacity .2s ease;
    will-change: transform;
}

.brand--public:hover img,
.brand--public:focus-visible img {
    --logo-lift: -2px;
    filter:
        drop-shadow(-10px 2px 20px rgba(89,122,143,.18))
        drop-shadow(0 5px 20px rgba(118,132,94,.10))
        drop-shadow(10px 2px 20px rgba(198,114,76,.14));
}

.brand-halo {
    position: absolute;
    z-index: 1;
    inset: 20% 10%;
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(89,122,143,.12), rgba(118,132,94,.08), rgba(198,114,76,.11));
    filter: blur(28px);
    opacity: 0;
    transform: scale(.88);
    transition: opacity .25s ease, transform .35s ease;
    pointer-events: none;
}
.brand--public:hover .brand-halo,
.brand--public:focus-visible .brand-halo { opacity: .8; transform: scale(1); }

.site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    gap: 2px;
}
.site-nav a {
    position: relative;
    padding: 9px 13px 10px;
    background: transparent !important;
}
.site-nav a::after {
    content: "";
    position: absolute;
    left: 13px;
    right: 13px;
    bottom: 4px;
    height: 1px;
    background: linear-gradient(90deg, var(--steel), var(--olive), var(--orange));
    transform: scaleX(0);
    opacity: .9;
    transition: transform .18s ease;
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a:hover { color: #f1f1ea; }

.hero-copy-section {
    padding: 68px 0 64px;
    max-width: 980px;
}
.hero-copy-section .eyebrow { margin-bottom: 18px; }
.hero-copy-section h1 {
    margin: 0;
    max-width: 940px;
    font-size: clamp(48px, 7vw, 96px);
    font-weight: 510;
    letter-spacing: -.055em;
    line-height: .99;
}
.hero-copy-section .hero-intro {
    max-width: 700px;
    margin: 27px 0 0;
    color: var(--muted);
    font-size: clamp(16px, 1.45vw, 20px);
}

.project-section,
.blog-section { padding: 66px 0; }

.section-heading { position: relative; }
.section-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -15px;
    width: 74px;
    height: 1px;
    background: linear-gradient(90deg, var(--steel), var(--olive), var(--orange));
    opacity: .66;
}

.project-row-main:hover {
    background: linear-gradient(90deg, rgba(89,122,143,.028), rgba(118,132,94,.016) 55%, rgba(198,114,76,.022));
}
.project-row:nth-child(3n + 1) .project-arrow { color: #7795a8; }
.project-row:nth-child(3n + 2) .project-arrow { color: #94a27b; }
.project-row:nth-child(3n + 3) .project-arrow { color: #ce7d58; }

.blog-list { border-top: 1px solid var(--line); }
.blog-row { border-bottom: 1px solid var(--line); position: relative; }
.blog-row::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: linear-gradient(180deg, var(--steel), var(--olive), var(--orange));
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform .2s ease;
}
.blog-row:hover::before { transform: scaleY(1); }
.blog-row > a {
    min-height: 110px;
    padding: 20px 5px 20px 18px;
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr) 28px;
    gap: 22px;
    align-items: center;
    transition: background-color .18s ease, padding-left .18s ease;
}
.blog-row > a:hover {
    padding-left: 23px;
    background: linear-gradient(90deg, rgba(89,122,143,.025), transparent 72%);
}
.blog-row time {
    color: var(--quiet);
    font: 10px var(--mono);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.blog-row-copy { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.blog-row-copy strong { font-size: clamp(20px, 2.1vw, 28px); font-weight: 510; letter-spacing: -.025em; }
.blog-row-copy > span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blog-arrow { color: var(--orange); font-size: 19px; }
.blog-row--large > a { min-height: 138px; }
.blog-row--large .blog-row-copy strong { font-size: clamp(25px, 3vw, 38px); }
.blog-section--index { padding-top: 54px; }
.empty-state--quiet { padding: 26px 0; border: 0; border-radius: 0; }

.page-heading--compact { grid-template-columns: minmax(0, 1fr) minmax(260px, .65fr); min-height: 310px; }
.page-heading--compact h1 { font-size: clamp(52px, 7vw, 88px); }

.post-detail { padding: 72px 0 90px; max-width: 940px; margin: 0 auto; }
.post-detail > .back-link { display: inline-block; margin-bottom: 38px; }
.post-detail-head { padding-bottom: 48px; }
.post-detail-head h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(48px, 7vw, 88px);
    font-weight: 510;
    letter-spacing: -.052em;
    line-height: 1;
}
.post-lede { margin: 24px 0 0; max-width: 760px; color: var(--muted); font-size: clamp(17px, 2vw, 21px); }
.post-prose { padding: 52px 0 0; max-width: 760px; font-size: 16px; line-height: 1.75; }
.post-prose h2, .post-prose h3 { color: var(--text); font-weight: 520; letter-spacing: -.025em; }
.post-prose h2 { margin: 2em 0 .7em; font-size: 30px; }
.post-prose h3 { margin: 1.7em 0 .6em; font-size: 22px; }
.post-prose blockquote {
    margin: 1.8em 0;
    padding: 4px 0 4px 20px;
    border-left: 2px solid var(--olive);
    color: #b7bcb3;
}
.post-prose a { color: #91adbf; border-bottom: 1px solid rgba(89,122,143,.45); }
.post-prose ul { margin: 1.4em 0; padding-left: 1.4em; }
.bb-code {
    margin: 1.7em 0;
    padding: 18px 20px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #101313;
    color: #c8cdc8;
    white-space: pre;
}
.bb-code code { font-size: 13px; }

.site-footer { border-top: 0; }
.footer-meta { color: #67706c; }

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #181b1b;
    color: var(--text);
    padding: 12px 13px;
    outline: none;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
select { appearance: auto; }
input:focus, textarea:focus, select:focus {
    border-color: var(--steel);
    background: #1a1e1e;
    box-shadow: 0 0 0 2px rgba(89,122,143,.08);
}

.button {
    position: relative;
    overflow: hidden;
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease, color .16s ease, box-shadow .16s ease;
}
.button:hover {
    border-color: rgba(89,122,143,.72);
    background: rgba(89,122,143,.07);
    box-shadow: inset 0 -1px 0 rgba(118,132,94,.25);
}
.button--primary {
    background: #d8d9d1;
    color: #151818;
    border-color: #d8d9d1;
}
.button--primary:hover {
    color: #f4f4ef;
    border-color: rgba(89,122,143,.78);
    background: linear-gradient(105deg, rgba(65,98,120,.92), rgba(101,117,77,.90) 52%, rgba(177,91,57,.90));
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.button--danger { color: #d99a94; border-color: rgba(189,102,95,.48); }
.button--danger:hover { background: rgba(189,102,95,.10); border-color: rgba(189,102,95,.75); }

.admin-header { border-top: 1px solid transparent; }
.admin-nav a:hover,
.admin-nav a[aria-current="page"] {
    color: var(--text);
    background: linear-gradient(90deg, rgba(89,122,143,.08), rgba(118,132,94,.045), rgba(198,114,76,.06));
}
.stat-grid--five { grid-template-columns: repeat(5, 1fr); }
.settings-stack { display: grid; gap: 14px; max-width: 900px; }
.settings-form { max-width: none; }
.settings-form .admin-card-heading { margin-bottom: 0; }
.form-help { margin: -4px 0 2px; color: var(--quiet); font-size: 12px; }
.form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-savebar {
    position: sticky;
    bottom: 12px;
    z-index: 8;
    display: flex;
    justify-content: flex-end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(18,21,21,.92);
    backdrop-filter: blur(10px);
}
.editor-textarea { min-height: 390px; font-family: var(--mono); font-size: 13px; line-height: 1.55; }
.bb-help { display: grid; gap: 8px; }
.bb-help code { display: block; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #171a1a; color: var(--muted); }
.admin-divider { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
.admin-post-list { border-top: 1px solid var(--line); }
.admin-post-row {
    min-height: 112px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.admin-post-copy { min-width: 0; }
.admin-post-copy p { margin: 6px 0 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
    .stat-grid--five { grid-template-columns: repeat(3, 1fr); }
    .form-grid--three { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
    .site-header {
        min-height: 156px;
        padding: 25px 0 14px;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
    }
    .brand--public {
        grid-column: 1 / -1;
        width: min(78vw, 340px);
    }
    .nav-toggle {
        display: inline-flex;
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        margin-top: 2px;
    }
    .site-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        top: auto;
        bottom: auto;
        margin-top: 42px;
        right: 0;
    }
    .hero-copy-section { padding: 48px 0 46px; }
    .hero-copy-section h1 { font-size: clamp(44px, 15vw, 68px); }
    .project-section, .blog-section { padding: 50px 0; }
    .blog-row > a { grid-template-columns: 1fr 22px; gap: 10px; padding-left: 8px; }
    .blog-row time { grid-column: 1; margin-bottom: -2px; }
    .blog-row-copy { grid-column: 1; }
    .blog-arrow { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
    .blog-row-copy > span { white-space: normal; }
    .page-heading--compact { min-height: auto; }
    .post-detail { padding-top: 54px; }
    .stat-grid--five { grid-template-columns: 1fr 1fr; }
    .form-grid--three { grid-template-columns: 1fr; }
    .admin-post-row { grid-template-columns: 1fr; gap: 14px; }
    .admin-project-actions { grid-column: auto; }
    .settings-savebar { bottom: 6px; }
}

/* --------------------------------------------------------------------------
   Refinement V2 — logo motion, centered footer, blog naming, accent system
   -------------------------------------------------------------------------- */

.brand--public {
    --logo-rx: 0deg;
    --logo-ry: 0deg;
    --logo-px: 0px;
    --logo-py: 0px;
    padding: 13px 22px;
    border-radius: 19px;
}

.brand--public::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 2px 4px;
    border: 1px solid rgba(89, 122, 143, .15);
    border-radius: 17px;
    box-shadow:
        inset 0 0 0 1px rgba(118, 132, 94, .035),
        -7px 0 24px rgba(89, 122, 143, .045),
        7px 0 24px rgba(198, 114, 76, .038);
    opacity: 0;
    transform: scale(.982);
    transition:
        opacity .28s ease,
        transform .38s cubic-bezier(.2,.8,.2,1),
        border-color .28s ease,
        box-shadow .35s ease;
    pointer-events: none;
}

.brand--public:hover::before,
.brand--public:focus-visible::before {
    opacity: .86;
    transform: scale(1);
    border-color: rgba(111, 143, 163, .29);
    box-shadow:
        inset 0 0 0 1px rgba(126, 145, 97, .07),
        -9px 0 28px rgba(89, 122, 143, .085),
        0 7px 30px rgba(118, 132, 94, .045),
        9px 0 28px rgba(198, 114, 76, .07);
}

.brand--public img {
    transform:
        perspective(900px)
        rotateX(var(--logo-rx))
        rotateY(var(--logo-ry))
        translate3d(var(--logo-px), var(--logo-py), 0);
    transition: filter .28s ease, opacity .2s ease;
}

.brand--public:hover img,
.brand--public:focus-visible img {
    animation: logo-jelly-orbit 6.4s ease-in-out infinite;
}

@keyframes logo-jelly-orbit {
    0%, 100% {
        transform:
            perspective(900px)
            rotateX(var(--logo-rx))
            rotateY(var(--logo-ry))
            translate3d(calc(var(--logo-px) + 0px), calc(var(--logo-py) - 1px), 0)
            rotateZ(-.10deg)
            scale(1, 1);
    }
    22% {
        transform:
            perspective(900px)
            rotateX(var(--logo-rx))
            rotateY(var(--logo-ry))
            translate3d(calc(var(--logo-px) + 4px), calc(var(--logo-py) - 3px), 0)
            rotateZ(.24deg)
            scale(1.006, .996);
    }
    46% {
        transform:
            perspective(900px)
            rotateX(var(--logo-rx))
            rotateY(var(--logo-ry))
            translate3d(calc(var(--logo-px) + 2px), calc(var(--logo-py) + 2px), 0)
            rotateZ(-.18deg)
            scale(.998, 1.005);
    }
    70% {
        transform:
            perspective(900px)
            rotateX(var(--logo-rx))
            rotateY(var(--logo-ry))
            translate3d(calc(var(--logo-px) - 4px), calc(var(--logo-py) + 1px), 0)
            rotateZ(.20deg)
            scale(1.004, .998);
    }
    86% {
        transform:
            perspective(900px)
            rotateX(var(--logo-rx))
            rotateY(var(--logo-ry))
            translate3d(calc(var(--logo-px) - 2px), calc(var(--logo-py) - 3px), 0)
            rotateZ(-.15deg)
            scale(.999, 1.003);
    }
}

.site-footer {
    justify-content: center;
    align-content: center;
    text-align: center;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.site-footer > div {
    justify-content: center;
}

.footer-meta {
    gap: 12px !important;
}

.footer-meta::before {
    content: "·";
    color: var(--line-strong);
    margin-right: 2px;
}

/* Per-load theme accents are assigned by app.js. */
body:not(.admin-body) [data-theme-title] {
    color: var(--accent-base, var(--text));
    text-shadow: 0 0 18px var(--accent-glow, transparent);
    transition: color .22s ease, text-shadow .22s ease;
}

body:not(.admin-body) a[data-theme-link]:not(.brand--public):not(.button) {
    color: var(--accent-base, inherit);
    transition:
        color .18s ease,
        border-color .18s ease,
        text-shadow .18s ease,
        background-color .18s ease,
        box-shadow .18s ease;
}

body:not(.admin-body) a[data-theme-link]:not(.brand--public):not(.button):hover,
body:not(.admin-body) a[data-theme-link]:not(.brand--public):not(.button):focus-visible {
    color: var(--accent-hover, var(--text));
    text-shadow: 0 0 14px var(--accent-glow, transparent);
}

body:not(.admin-body) a[data-theme-link]:hover [data-theme-title],
body:not(.admin-body) a[data-theme-link]:focus-visible [data-theme-title] {
    color: var(--accent-hover, var(--text));
}

body:not(.admin-body) a.button[data-theme-link]:hover,
body:not(.admin-body) a.button[data-theme-link]:focus-visible {
    border-color: var(--accent-line, var(--steel));
    box-shadow:
        inset 0 -1px 0 var(--accent-glow, transparent),
        0 4px 18px rgba(0,0,0,.12);
}

body:not(.admin-body) a.button[data-theme-link]:not(.button--primary):hover,
body:not(.admin-body) a.button[data-theme-link]:not(.button--primary):focus-visible {
    color: var(--accent-hover, var(--text));
}

/* Persistent active-page underline, with the same assigned accent family. */
.site-nav a::after {
    height: 1px;
    background: var(--accent-line, var(--steel));
    opacity: .62;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
    transform: scaleX(1);
    opacity: .9;
}

.site-nav a[aria-current="page"]::after {
    height: 2px;
    transform: scaleX(1);
    opacity: 1;
    box-shadow: 0 0 9px var(--accent-glow, rgba(89,122,143,.12));
}

body:not(.admin-body) .site-nav a[data-theme-link]:hover,
body:not(.admin-body) .site-nav a[data-theme-link]:focus-visible,
body:not(.admin-body) .site-nav a[data-theme-link][aria-current="page"] {
    color: var(--accent-hover, var(--text));
}

@media (max-width: 720px) {
    .brand--public {
        padding: 10px 12px;
    }

    .site-footer {
        flex-direction: column;
        gap: 5px;
        padding: 24px 0;
    }

    .footer-meta::before {
        display: none;
    }

}

@media (prefers-reduced-motion: reduce) {
    .brand--public:hover img,
    .brand--public:focus-visible img {
        animation: none;
    }
}


/* --------------------------------------------------------------------------
   Public refinement V3 — quieter headings and sentence-case public metadata
   -------------------------------------------------------------------------- */
.page-heading {
    padding-top: 76px;
    padding-bottom: 60px;
}
.page-heading h1,
.page-heading--compact h1 {
    font-size: clamp(42px, 5.4vw, 74px);
    letter-spacing: -.045em;
}
.project-detail h1,
.post-detail-head h1 {
    font-size: clamp(42px, 5.8vw, 76px);
}
.hero-copy-section h1 {
    font-size: clamp(42px, 5.9vw, 78px);
}
.search-field span,
.project-runtime,
.project-card-topline,
.blog-row time,
.project-meta dt,
.detail-list dt {
    text-transform: none;
    letter-spacing: .02em;
}
.post-date {
    display: block;
    margin: 0 0 16px;
    color: var(--quiet);
    font: 11px/1.4 var(--mono);
    letter-spacing: .02em;
}
.project-card-link[target="_blank"] .project-card-footer > span {
    color: var(--steel);
}

@media (max-width: 680px) {
    .page-heading { padding-top: 54px; padding-bottom: 44px; }
    .page-heading h1,
    .page-heading--compact h1,
    .project-detail h1,
    .post-detail-head h1,
    .hero-copy-section h1 {
        font-size: clamp(38px, 12vw, 58px);
    }
}

/* --------------------------------------------------------------------------
   Public polish V5 — fluid index, shared project stream, clean project detail
   -------------------------------------------------------------------------- */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Homepage sections should read as one continuous surface, not mini landing pages. */
.project-section,
.blog-section {
    padding: 38px 0 54px;
}

.section-heading--rail {
    min-height: 34px;
    margin-bottom: 14px;
    align-items: center;
}

.section-heading--rail h2 {
    font-size: clamp(18px, 2vw, 23px);
    letter-spacing: -.025em;
    font-weight: 510;
}

.section-heading--rail::after {
    display: none;
}

.section-heading--rail.section-heading--untitled {
    justify-content: flex-end;
    min-height: 24px;
    margin-bottom: 10px;
}

.section-heading--rail .text-link {
    margin-left: auto;
    font-size: 11px;
}

/* One shared public project language: compact horizontal cards everywhere. */
.project-list {
    display: grid;
    gap: 10px;
    border-top: 0;
}

.project-row {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background:
        linear-gradient(110deg, rgba(255,255,255,.014), transparent 48%),
        rgba(255,255,255,.008);
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.project-row::before {
    top: 0;
    bottom: 0;
    width: 2px;
    transform: scaleY(.72);
    transform-origin: center;
}

.project-row:hover,
.project-row:focus-within {
    border-color: var(--line-strong);
    background:
        linear-gradient(110deg, rgba(89,122,143,.045), rgba(118,132,94,.018) 55%, rgba(198,114,76,.022)),
        rgba(255,255,255,.012);
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(0,0,0,.09);
}

.project-row-main {
    grid-template-columns: 42px minmax(0, 1fr) 28px;
    gap: 16px;
    padding: 24px 20px 20px;
}

.project-row-main:hover {
    padding-left: 20px;
    background: transparent;
}

.project-name-wrap strong {
    font-size: clamp(20px, 2.35vw, 30px);
}

.project-name-wrap span {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: 850px;
}

.project-arrow {
    align-self: center;
}

.project-row > .project-tags {
    padding: 0 20px 18px 78px;
}

/* Full project index is the same visual system, simply denser and unbounded. */
.catalogue--stream {
    padding: 54px 0 72px;
}

.catalogue--stream .catalogue-tools {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.catalogue--stream .search-field {
    width: min(420px, 100%);
}

.catalogue--stream .filter-status {
    align-self: end;
    padding-bottom: 11px;
}

.project-list--catalogue .project-row-main {
    padding-top: 22px;
    padding-bottom: 17px;
}

.project-list--catalogue .project-row > .project-tags {
    padding-bottom: 16px;
}

/* Public project profile: catalogue metadata stays in admin, not on the public page. */
.project-detail--clean {
    padding: 64px 0 78px;
}

.project-detail--clean > .back-link {
    display: inline-block;
    margin: 0 0 24px;
}

.project-profile-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 44px;
    align-items: end;
    padding: clamp(26px, 4vw, 46px);
    border: 1px solid var(--line);
    border-radius: 10px;
    background:
        linear-gradient(115deg, rgba(89,122,143,.035), transparent 42%, rgba(118,132,94,.018) 70%, rgba(198,114,76,.022)),
        rgba(255,255,255,.009);
}

.project-detail--clean h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(38px, 5vw, 66px);
}

.project-detail--clean .project-lede {
    margin-top: 16px;
    max-width: 760px;
    font-size: clamp(16px, 1.8vw, 20px);
}

.project-detail--clean .project-tags--detail {
    margin-top: 24px;
}

.project-detail--clean .project-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

.project-description {
    max-width: 880px;
    padding: 34px 2px 0;
}

.project-description p:first-child {
    margin-top: 0;
}

/* The old technical public metadata is intentionally no longer part of the layout. */
.project-meta,
.project-runtime {
    display: none !important;
}

@media (max-width: 760px) {
    .project-section,
    .blog-section {
        padding: 30px 0 42px;
    }

    .section-heading--rail {
        flex-direction: row;
        align-items: center;
    }

    .project-row-main,
    .project-list--catalogue .project-row-main {
        grid-template-columns: 30px minmax(0, 1fr) 20px;
        gap: 11px;
        padding: 20px 15px 16px;
    }

    .project-row-main:hover {
        padding-left: 15px;
    }

    .project-row > .project-tags,
    .project-list--catalogue .project-row > .project-tags {
        padding: 0 15px 15px 56px;
    }

    .catalogue--stream {
        padding-top: 34px;
    }

    .project-profile-card {
        grid-template-columns: 1fr;
        gap: 28px;
        align-items: start;
    }

    .project-detail--clean .project-actions {
        justify-content: flex-start;
    }
}

/* Project page v6: restored detail layout with admin-controlled content. */
.project-detail--custom {
    padding: 64px 0 80px;
}

.project-detail--custom > .back-link {
    display: inline-block;
    margin: 0 0 24px;
}

.project-detail--custom .project-profile-card {
    margin-bottom: 0;
}

.project-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr);
    gap: clamp(38px, 6vw, 82px);
    align-items: start;
    margin-top: 34px;
    padding-top: 38px;
    border-top: 1px solid var(--line);
}

.project-content-grid--main-only {
    grid-template-columns: minmax(0, 880px);
}

.project-content-grid .project-description {
    max-width: 880px;
    padding: 0;
}

.project-description--empty {
    min-height: 1px;
}

.project-content-grid .prose h2,
.project-content-grid .prose h3 {
    color: var(--text);
    font-weight: 520;
    letter-spacing: -.025em;
}

.project-content-grid .prose h2 {
    margin: 2em 0 .75em;
    font-size: clamp(24px, 2.6vw, 34px);
}

.project-content-grid .prose h3 {
    margin: 1.65em 0 .65em;
    font-size: 20px;
}

.project-content-grid .prose a {
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 52%, transparent);
    text-underline-offset: 3px;
}

.project-content-grid .prose blockquote {
    margin: 1.5em 0;
    padding: 4px 0 4px 18px;
    border-left: 2px solid var(--olive);
    color: var(--muted);
}

.project-content-grid .bb-code {
    overflow: auto;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0,0,0,.18);
}

.project-page-sidebar {
    position: relative;
    padding: 22px 22px 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background:
        linear-gradient(145deg, rgba(89,122,143,.028), transparent 45%, rgba(118,132,94,.016) 72%, rgba(198,114,76,.02)),
        rgba(255,255,255,.008);
}

.project-page-sidebar::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 22px;
    width: 2px;
    height: 42px;
    border-radius: 2px;
    background: linear-gradient(var(--steel), var(--olive), var(--orange));
    opacity: .8;
}

.project-page-sidebar > h2 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 520;
    letter-spacing: -.02em;
}

.project-sidebar-copy {
    color: var(--muted);
    font-size: 14px;
}

.project-sidebar-copy > :first-child { margin-top: 0; }
.project-sidebar-copy > :last-child { margin-bottom: 0; }

.project-custom-facts,
.project-technical dl {
    margin: 20px 0 0;
}

.project-custom-facts > div,
.project-technical dl > div {
    display: grid;
    grid-template-columns: minmax(72px, .65fr) minmax(0, 1fr);
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.project-custom-facts > div:first-child,
.project-technical dl > div:first-child {
    border-top: 1px solid var(--line);
}

.project-custom-facts dt,
.project-technical dt {
    color: var(--quiet);
    font: 10px var(--mono);
    letter-spacing: .02em;
    text-transform: none;
}

.project-custom-facts dd,
.project-technical dd {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.project-technical {
    margin-top: 20px;
    border-top: 1px solid var(--line);
}

.project-technical summary {
    padding: 14px 0 0;
    cursor: pointer;
    color: var(--quiet);
    font: 11px var(--mono);
    list-style: none;
}

.project-technical summary::-webkit-details-marker { display: none; }
.project-technical summary::after { content: " +"; }
.project-technical[open] summary::after { content: " −"; }

/* Keep the admin editor readable as project-page controls grow. */
.admin-form-section {
    display: grid;
    gap: 14px;
    padding: 0 0 26px;
    margin: 0 0 24px;
    border-bottom: 1px solid var(--line);
}

.admin-form-section:last-of-type {
    margin-bottom: 0;
}

.admin-form-section h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 560;
    letter-spacing: -.02em;
}

.admin-form-section > .fine-print {
    margin: -8px 0 0;
}

@media (max-width: 860px) {
    .project-content-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .project-description--empty {
        display: none;
    }
}
