:root {
    color-scheme: dark;
    --background: #171726;
    --surface: #202032;
    --surface-soft: #1c1c2c;
    --surface-raised: #27263b;
    --text: #f5eee5;
    --body: #c6c0d1;
    --muted: #a19bae;
    --border: #39364c;
    --amber: #f3ba79;
    --sage: #b5cea0;
    --lilac: #c0a9e8;
    --shadow: 0 24px 70px #08081145;
}

[data-theme='light'] {
    color-scheme: light;
    --background: #f8f3eb;
    --surface: #fffaf4;
    --surface-soft: #f0e9df;
    --surface-raised: #ebe2d6;
    --text: #302b3c;
    --body: #60596a;
    --muted: #756b7b;
    --border: #ded4c8;
    --amber: #91571d;
    --sage: #526c40;
    --lilac: #785397;
    --shadow: 0 24px 70px #68534a15;
}

* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
}
body {
    margin: 0;
    background: var(--background);
    color: var(--body);
    font:
        16px/1.65 'Segoe UI',
        system-ui,
        sans-serif;
    -webkit-font-smoothing: antialiased;
}
button,
input {
    font: inherit;
}
button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}
button {
    cursor: pointer;
}
a {
    color: inherit;
    text-decoration: none;
}
img {
    max-width: 100%;
    display: block;
}
button,
input,
a {
    outline-offset: 5px;
}
:focus-visible {
    outline: 2px solid var(--amber);
}
h1,
h2,
h3,
p,
figure {
    margin: 0;
}
h1,
h2,
h3 {
    color: var(--text);
    line-height: 1.15;
}
.wrap {
    max-width: 1200px;
    margin: auto;
    padding: 0 32px;
}
.section {
    padding: 96px 0;
    border-top: 1px solid var(--border);
}
.eyebrow {
    color: var(--amber);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
}
.section-heading {
    margin-bottom: 36px;
}
.section-heading h2 {
    font-size: clamp(30px, 3.6vw, 43px);
    font-weight: 650;
    letter-spacing: -0.035em;
    margin: 13px 0 17px;
}
.section-heading > p {
    max-width: 640px;
}
.split-heading {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 65px;
}
.split-heading > p {
    padding-bottom: 17px;
}
.tinted-section {
    background: var(--surface-soft);
}
.section-footnote {
    color: var(--muted);
    font-size: 13px;
    margin-top: 25px;
    max-width: 840px;
}
.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;
}
.skip-link {
    position: fixed;
    z-index: 100;
    top: -60px;
    left: 20px;
    padding: 10px 20px;
    background: var(--amber);
    color: var(--background);
}
.skip-link:focus {
    top: 10px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 17px 24px;
    background: color-mix(in srgb, var(--background) 88%, transparent);
    backdrop-filter: blur(18px);
}
.nav-shell {
    max-width: 1200px;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    color: var(--text);
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.02em;
}
.brand-secondary {
    color: var(--muted);
    font-weight: 400;
}
.nav-shell nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.nav-shell nav a {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 9px;
    transition:
        color 0.2s,
        background 0.2s;
}
.nav-shell nav a:hover,
.nav-shell nav a.active {
    color: var(--amber);
    background: color-mix(in srgb, var(--amber) 10%, transparent);
}
.theme-toggle {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--amber);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-raised);
}
.theme-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    fill: none;
}
.moon-icon,
[data-theme='light'] .sun-icon {
    display: none;
}
[data-theme='light'] .moon-icon {
    display: block;
}

.hero {
    padding: 57px 0 0;
    background: radial-gradient(ellipse at 80% 35%, #8c5ca815, transparent 60%);
}
.hero-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.12fr;
    align-items: center;
    gap: 48px;
}
.hero-copy {
    padding-bottom: 15px;
}
.little-star {
    color: var(--sage);
    margin-right: 5px;
}
h1 {
    font-size: clamp(39px, 4.7vw, 62px);
    font-weight: 680;
    letter-spacing: -0.05em;
    margin: 23px 0;
}
h1 > span {
    color: var(--amber);
}
.hero-description {
    font-size: 17px;
    line-height: 1.8;
    max-width: 480px;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 17px;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 12px 17px;
    font-size: 13px;
    font-weight: 650;
    transition:
        transform 0.2s,
        border-color 0.2s;
}
.button:hover {
    transform: translateY(-2px);
    border-color: var(--amber);
}
.primary {
    background: #efb878;
    border-color: #efb878;
    color: #302039;
}
.secondary {
    background: var(--surface);
    color: var(--text);
}
.hero-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.status-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sage);
}
.room-figure {
    transform: rotate(1deg);
}
.image-frame {
    border: 1px solid #79604f;
    border-radius: 23px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #24213a;
}
.image-frame img {
    width: 100%;
    height: auto;
}
.room-figure figcaption {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    margin: 14px 4px 0;
    color: var(--muted);
}
.caption-mark {
    color: var(--amber);
    font-size: 15px;
}
.caption-right {
    margin-left: auto;
    font-size: 9px;
    letter-spacing: 0.12em;
}
.quick-facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border);
    margin-top: 62px;
    padding: 30px 0 38px;
}
.quick-facts > div {
    display: flex;
    flex-direction: column;
    padding-left: 30px;
    border-left: 1px solid var(--border);
}
.quick-facts > div:first-child {
    padding-left: 0;
    border-left: none;
}
.quick-facts strong {
    color: var(--text);
    font-size: 30px;
    font-weight: 550;
    line-height: 1.2;
    letter-spacing: -0.04em;
}
.quick-facts small {
    font-size: 15px;
    color: var(--muted);
}
.quick-facts span {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
}

.node-grid,
.stack-grid,
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.node-card,
.stack-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 26px;
    border-radius: 15px;
}
.node-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
}
.node-icon {
    color: var(--sage);
    font-size: 24px;
}
.node-role {
    font:
        10px ui-monospace,
        monospace;
    letter-spacing: 0.1em;
    color: var(--muted);
}
.node-card h3 {
    font:
        600 17px ui-monospace,
        monospace;
}
.node-card p {
    font-size: 13px;
    margin: 14px 0 23px;
}
.node-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 10px;
    color: var(--muted);
}
.stack-card {
    padding: 26px;
}
.stack-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 24px;
    margin-bottom: 22px;
}
.amber {
    color: var(--amber);
    background: color-mix(in srgb, var(--amber) 12%, transparent);
}
.sage {
    color: var(--sage);
    background: color-mix(in srgb, var(--sage) 12%, transparent);
}
.lilac {
    color: var(--lilac);
    background: color-mix(in srgb, var(--lilac) 12%, transparent);
}
.stack-card h3 {
    font-size: 16px;
    font-weight: 600;
}
.stack-card p {
    font-size: 13px;
    margin: 10px 0 20px;
}
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.tags span {
    font-size: 10px;
    color: var(--body);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 7px;
    background: var(--surface-soft);
}

.architecture-controls {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px;
    margin-bottom: 21px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
}
.architecture-controls button {
    border: 0;
    border-radius: 7px;
    padding: 8px 15px;
    background: transparent;
    color: var(--body);
    font-size: 12px;
}
.architecture-controls button.active {
    background: var(--surface-raised);
    color: var(--amber);
}
.diagram-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    background: var(--surface-soft);
}
.diagram-scroll {
    overflow-x: auto;
    scrollbar-color: var(--border) transparent;
}
.architecture-svg {
    display: block;
    width: 100%;
    min-width: 810px;
}
.cluster-boundary {
    fill: var(--surface);
    stroke: var(--border);
    stroke-dasharray: 5 5;
}
.boundary-label {
    fill: var(--muted);
    font-size: 11px;
    letter-spacing: 0.1em;
    font-family: ui-monospace, monospace;
}
.tiny-text {
    fill: var(--muted);
    font-size: 11px;
}
.diagram-node rect {
    fill: var(--surface-raised);
    stroke: var(--border);
}
.node-title {
    fill: var(--text);
    font-size: 14px;
    font-weight: 600;
}
.node-subtitle {
    fill: var(--body);
    font-size: 11px;
}
.edge-label {
    fill: var(--muted);
    font-size: 10px;
}
.flow-edge {
    fill: none;
    stroke-width: 2;
    stroke-dasharray: 5 4;
    animation: flow 2s linear infinite;
}
.traffic .flow-edge {
    stroke: var(--amber);
}
.delivery .flow-edge {
    stroke: var(--lilac);
}
.recovery .flow-edge {
    stroke: var(--sage);
}
.arrow-traffic {
    fill: var(--amber);
}
.arrow-delivery {
    fill: var(--lilac);
}
.arrow-recovery {
    fill: var(--sage);
}
.flow-layer {
    opacity: 0.19;
    transition: opacity 0.25s;
}
[data-focus='traffic'] .traffic,
[data-focus='delivery'] .delivery,
[data-focus='recovery'] .recovery {
    opacity: 1;
}
.diagram-caption {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 16px 10px 2px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}
@keyframes flow {
    to {
        stroke-dashoffset: -18;
    }
}

.workflow-grid {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 25px;
}
.workflow-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.workflow-tabs button {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding: 13px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--body);
}
.workflow-tabs button.active {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
.step-number {
    font:
        12px ui-monospace,
        monospace;
    color: var(--muted);
}
.active .step-number {
    color: var(--amber);
}
.workflow-tabs strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}
.workflow-tabs small {
    display: block;
    font-size: 11px;
    margin-top: 3px;
    color: var(--muted);
}
.step-arrow {
    margin-left: auto;
    color: var(--amber);
    opacity: 0;
}
.active .step-arrow {
    opacity: 1;
}
.workflow-panel {
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
}
.pill {
    display: inline-block;
    font:
        10px ui-monospace,
        monospace;
    letter-spacing: 0.08em;
    color: var(--sage);
    border: 1px solid color-mix(in srgb, var(--sage) 30%, var(--border));
    padding: 5px 9px;
    border-radius: 5px;
}
.workflow-panel h3 {
    font-size: 27px;
    letter-spacing: -0.03em;
    margin-top: 23px;
}
.workflow-panel > p {
    font-size: 14px;
    margin-top: 16px;
}
.code-window {
    margin-top: 26px;
    background: #161523;
    border: 1px solid #373345;
    border-radius: 10px;
    overflow: hidden;
}
.code-top {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    color: #aaa1b7;
    font:
        10px ui-monospace,
        monospace;
    border-bottom: 1px solid #373345;
}
.code-top i {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #645865;
    border-radius: 50%;
    margin-right: 5px;
}
.code-top i:first-child {
    background: #be8475;
}
.code-top i:nth-child(2) {
    background: #cbaa77;
}
.code-top i:last-child {
    background: #879d79;
}
pre {
    margin: 0;
    padding: 20px 17px;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
pre code {
    font:
        12px/1.9 ui-monospace,
        SFMono-Regular,
        Consolas,
        monospace;
    color: #d8c7e7;
}
.workflow-note {
    color: var(--muted);
    font-size: 12px !important;
}

.project-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin: 10px 0 24px;
}
.project-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.project-filters button {
    color: var(--body);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
}
.project-filters button.active {
    background: color-mix(in srgb, var(--amber) 10%, transparent);
    color: var(--amber);
    border-color: color-mix(in srgb, var(--amber) 40%, var(--border));
}
#project-count {
    margin-left: 6px;
    opacity: 0.7;
}
.search-label {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
}
.search-label > span:first-child {
    color: var(--muted);
    font-size: 19px;
}
.search-label input {
    width: 155px;
    min-width: 0;
    color: var(--text);
    border: 0;
    background: transparent;
    font-size: 12px;
}
.search-label input::placeholder {
    color: var(--muted);
}
.project-card {
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 26px;
    min-height: 252px;
    transition:
        transform 0.2s,
        border-color 0.2s;
}
.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--amber);
}
.project-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}
.project-symbol {
    font-size: 25px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    background: var(--surface-raised);
    border-radius: 12px;
}
.project-health {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--sage);
    font-size: 10px;
}
.project-health.unavailable {
    color: var(--muted);
}
.project-health.unavailable .status-dot {
    background: var(--muted);
}
.project-card h3 {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.project-card p {
    font-size: 13px;
    margin: 12px 0 25px;
}
.project-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.project-type {
    font:
        10px ui-monospace,
        monospace;
    color: var(--muted);
}
.project-link {
    color: var(--amber);
    font-size: 12px;
    font-weight: 650;
}
.project-feed-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 23px;
}
.project-feed-footer p {
    color: var(--muted);
    font-size: 11px;
}
.project-feed-footer button {
    border: 0;
    padding: 5px;
    background: transparent;
    color: var(--amber);
    font-size: 11px;
}
.feed-message {
    grid-column: 1 / -1;
    border: 1px dashed var(--border);
    padding: 40px 20px;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
}
.site-footer {
    border-top: 1px solid var(--border);
    padding: 29px 0;
}
.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
}
.footer-row p,
.footer-row > a:last-child {
    font-size: 11px;
    color: var(--muted);
}
.footer-row strong {
    font-weight: 500;
    color: var(--body);
}

@media (max-width: 1000px) {
    .brand-secondary {
        display: none;
    }
    .nav-shell nav a {
        padding: 7px 9px;
        font-size: 12px;
    }
    .hero-grid {
        gap: 28px;
    }
    .hero-description {
        font-size: 15px;
    }
    .hero-actions {
        gap: 8px;
    }
    .button {
        font-size: 12px;
        gap: 10px;
        padding: 11px 13px;
    }
    .stack-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .split-heading {
        gap: 35px;
    }
    .quick-facts > div {
        padding-left: 20px;
    }
    .node-card {
        padding: 20px;
    }
    .node-card h3 {
        font-size: 14px;
    }
    .caption-right {
        display: none;
    }
}

@media (max-width: 720px) {
    .wrap {
        padding: 0 22px;
    }
    .section {
        padding: 65px 0;
    }
    .site-header {
        padding: 10px 12px;
    }
    .nav-shell {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 9px;
        padding: 10px 12px;
    }
    .nav-shell nav {
        grid-row: 2;
        grid-column: 1 / -1;
        margin: 0;
        justify-content: space-between;
        gap: 0;
    }
    .nav-shell nav a {
        padding: 6px;
        font-size: 11px;
    }
    .theme-toggle {
        grid-column: 2;
        grid-row: 1;
        width: 31px;
        height: 31px;
    }
    .brand img {
        width: 30px;
        height: 30px;
    }
    .brand-secondary {
        display: inline;
    }
    .hero {
        padding-top: 38px;
    }
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 33px;
    }
    .hero-copy {
        padding-bottom: 0;
    }
    h1 {
        font-size: clamp(40px, 9vw, 59px);
        margin: 20px 0;
    }
    .hero-description {
        max-width: 540px;
        font-size: 16px;
    }
    .hero-note {
        font-size: 10px;
    }
    .room-figure {
        margin: 0 3px;
    }
    .caption-right {
        display: inline;
    }
    .quick-facts {
        grid-template-columns: repeat(2, 1fr);
        gap: 26px 0;
        margin-top: 35px;
        padding: 28px 0;
    }
    .quick-facts > div:nth-child(3) {
        border-left: none;
        padding-left: 0;
    }
    .quick-facts strong {
        font-size: 28px;
    }
    .quick-facts span {
        font-size: 10px;
        max-width: 145px;
    }
    .split-heading {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .split-heading > p {
        padding: 0;
    }
    .node-grid,
    .project-grid {
        grid-template-columns: 1fr;
    }
    .node-card h3 {
        font-size: 17px;
    }
    .node-top {
        margin-bottom: 15px;
    }
    .stack-grid {
        gap: 12px;
    }
    .stack-card {
        padding: 19px 16px;
    }
    .stack-card h3 {
        font-size: 15px;
    }
    .stack-card p {
        font-size: 12px;
    }
    .tags {
        gap: 5px;
    }
    .tags span {
        font-size: 9px;
        padding: 3px 5px;
    }
    .architecture-controls {
        display: flex;
    }
    .architecture-controls button {
        flex: 1;
        padding: 8px 5px;
        font-size: 10px;
    }
    .diagram-card {
        padding: 10px;
    }
    .diagram-caption {
        font-size: 12px;
    }
    .workflow-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .workflow-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .workflow-tabs button {
        padding: 12px 9px;
        gap: 9px;
        border: 1px solid var(--border);
    }
    .workflow-tabs strong {
        font-size: 11px;
    }
    .workflow-tabs small,
    .step-arrow {
        display: none;
    }
    .workflow-panel {
        padding: 25px 22px;
    }
    .workflow-panel h3 {
        font-size: 24px;
    }
    .search-label {
        width: 100%;
    }
    .search-label input {
        width: 100%;
    }
    .project-card {
        min-height: 230px;
    }
    .footer-row {
        flex-wrap: wrap;
        gap: 17px;
    }
    .footer-row p {
        order: 3;
        width: 100%;
    }
}

@media (max-width: 380px) {
    .wrap {
        padding: 0 17px;
    }
    .stack-grid {
        grid-template-columns: 1fr;
    }
    .eyebrow {
        font-size: 9px;
    }
    .caption-right {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
