:root {
    color-scheme: dark;
    /* DESIGN.md hex equivalents:
       --ink #EAF4DE, --muted #B9CDB1, --moss-300 #C7F05B,
       --wood-950 #102018, --wood-900 #1C3326, --wood-800 #284835,
       --amber-300 #D8B86A, --fern-200 #BCEFC9 */
    --wood-950: oklch(0.185 0.030 145);
    --wood-900: oklch(0.245 0.045 142);
    --wood-800: oklch(0.335 0.060 136);
    --moss-800: oklch(0.360 0.095 139);
    --moss-700: oklch(0.500 0.130 137);
    --moss-500: oklch(0.690 0.160 139);
    --moss-300: oklch(0.850 0.150 135);
    --fern-200: oklch(0.885 0.125 150);
    --lichen-100: oklch(0.955 0.045 120);
    --amber-300: oklch(0.790 0.105 76);
    --ink: oklch(0.975 0.015 115);
    --muted: oklch(0.820 0.040 122);
    --shadow: oklch(0.070 0.015 145 / 0.55);
    --radius: 8px;
    --max: 1160px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    min-width: 320px;
    overflow-x: hidden;
    background:
        linear-gradient(90deg, oklch(1 0 0 / 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
        radial-gradient(circle at 18% 0%, oklch(0.620 0.150 138 / 0.34), transparent 34rem),
        radial-gradient(circle at 78% 22%, oklch(0.500 0.120 155 / 0.20), transparent 28rem),
        linear-gradient(135deg, var(--wood-950), var(--wood-900) 52%, oklch(0.175 0.045 128));
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    animation: page-glow 16s ease-in-out infinite alternate;
}

a {
    color: inherit;
}

code,
pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

p code,
li code,
h3 code {
    border-radius: 5px;
    padding: 0.08rem 0.32rem;
    background: oklch(1 0 0 / 0.10);
    color: var(--fern-200);
    font-size: 0.92em;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    width: min(var(--max), calc(100% - 2rem));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    background: oklch(0.175 0.035 145 / 0.84);
    backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 oklch(1 0 0 / 0.10), 0 0 0 100vmax oklch(0.175 0.035 145 / 0.84);
    clip-path: inset(0 -100vmax);
}

.brand,
nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    max-width: 100%;
}

.brand {
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 6px;
    background: linear-gradient(145deg, var(--moss-300), var(--moss-700));
    color: oklch(0.130 0.025 145);
    box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.24), 0 12px 30px var(--shadow);
    animation: mark-breathe 5s ease-in-out infinite;
}

nav a {
    padding: 0.55rem 0.7rem;
    border-radius: 6px;
    color: var(--muted);
    font-size: 0.92rem;
    text-decoration: none;
    transition: color 160ms ease-out, background-color 160ms ease-out, scale 120ms ease-out, translate 160ms ease-out;
}

nav a:active,
.button:active {
    scale: 0.96;
}

.hero {
    position: relative;
    display: grid;
    width: min(var(--max), calc(100% - 2rem));
    min-height: calc(92svh - 4.1rem);
    margin: 0 auto;
    grid-template-columns: minmax(0, 1.08fr) minmax(20rem, 0.72fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
    padding: clamp(3rem, 7vw, 7rem) 0 clamp(2rem, 5vw, 4rem);
    box-shadow: inset 0 -1px 0 oklch(1 0 0 / 0.08);
    overflow: hidden;
}

.doc-hero {
    display: grid;
    width: min(var(--max), calc(100% - 2rem));
    min-height: 62svh;
    margin: 0 auto;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.55fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
    padding: clamp(3rem, 7vw, 6rem) 0 clamp(2rem, 5vw, 4rem);
    box-shadow: inset 0 -1px 0 oklch(1 0 0 / 0.08);
    overflow: hidden;
}

.hero > * {
    position: relative;
    min-width: 0;
}

.doc-hero > * {
    min-width: 0;
}

.hero-inner {
    max-width: 54rem;
    animation: rise-in 720ms cubic-bezier(0.2, 0, 0, 1) both;
}

.eyebrow {
    margin: 0 0 0.9rem;
    color: var(--amber-300);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 13ch;
    margin-bottom: 1.35rem;
    font-size: clamp(3.2rem, 7vw, 5.8rem);
    line-height: 0.88;
    letter-spacing: 0;
    text-wrap: balance;
}

h2 {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 3.6vw, 3.25rem);
    line-height: 1;
    letter-spacing: 0;
    text-wrap: balance;
}

h3 {
    margin-bottom: 0.6rem;
    color: var(--lichen-100);
    font-size: 1.08rem;
}

.hero-copy,
.section-heading p,
.split p,
.suite-grid p,
.signal-grid p,
.budget-grid p,
.workflow-steps p,
.variant-list p,
.doctrine li,
footer {
    color: var(--muted);
    text-wrap: pretty;
}

.hero-copy {
    max-width: 46rem;
    margin-bottom: 1.5rem;
    font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.button {
    display: inline-flex;
    min-height: 2.8rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    padding: 0.78rem 1rem;
    font-weight: 800;
    text-decoration: none;
    transition: background-color 160ms ease-out, color 160ms ease-out, scale 120ms ease-out, box-shadow 160ms ease-out, translate 160ms ease-out;
}

.button.primary {
    background: var(--moss-300);
    color: var(--wood-950);
    box-shadow: 0 14px 36px oklch(0.080 0.020 145 / 0.38);
}

.button.secondary {
    background: oklch(1 0 0 / 0.09);
    color: var(--ink);
}

.hero-panel,
.code-block,
.suite-grid article,
.signal-grid article,
.budget-grid article,
.workflow-steps article,
.variant-list article,
.doc-grid article,
.doc-section {
    border-radius: var(--radius);
    background: linear-gradient(145deg, oklch(0.300 0.065 139 / 0.94), oklch(0.180 0.036 145 / 0.94));
    box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.10), 0 24px 70px var(--shadow);
    transition: box-shadow 220ms ease-out, translate 220ms ease-out, scale 220ms ease-out;
}

.hero-panel {
    padding: 1rem;
    overflow: hidden;
    animation: rise-in 820ms 120ms cubic-bezier(0.2, 0, 0, 1) both;
}


.panel-image,
.card-image,
.section-image,
.doc-hero-image {
    display: block;
    width: 100%;
    object-fit: cover;
    border-radius: 7px;
    box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.10), 0 10px 28px oklch(0.070 0.015 145 / 0.22);
    transform-origin: center;
    transition: scale 360ms cubic-bezier(0.2, 0, 0, 1), filter 360ms ease-out;
}


.panel-image {
    aspect-ratio: 3 / 1;
    margin-bottom: 1rem;
}

.panel-label {
    margin-bottom: 0.7rem;
    color: var(--moss-300);
    font-size: 0.82rem;
    font-weight: 800;
}

pre {
    margin: 0;
    overflow-x: auto;
    white-space: pre-wrap;
}

.hero-panel code,
.code-block code {
    color: var(--lichen-100);
    font-size: 0.88rem;
}

.section {
    width: min(var(--max), calc(100% - 2rem));
    margin: 0 auto;
    padding: clamp(3rem, 7vw, 6rem) 0;
    box-shadow: inset 0 -1px 0 oklch(1 0 0 / 0.08);
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 620ms ease-out, transform 720ms cubic-bezier(0.2, 0, 0, 1);
}

.suite-grid article.reveal:nth-child(2),
.signal-grid article.reveal:nth-child(2),
.budget-grid article.reveal:nth-child(2),
.workflow-steps article.reveal:nth-child(2),
.variant-list article.reveal:nth-child(2) {
    transition-delay: 80ms;
}

.suite-grid article.reveal:nth-child(3),
.signal-grid article.reveal:nth-child(3),
.budget-grid article.reveal:nth-child(3),
.workflow-steps article.reveal:nth-child(3) {
    transition-delay: 140ms;
}

.suite-grid article.reveal:nth-child(4),
.signal-grid article.reveal:nth-child(4),
.budget-grid article.reveal:nth-child(4),
.workflow-steps article.reveal:nth-child(4) {
    transition-delay: 200ms;
}

.suite-grid article.reveal:nth-child(5) {
    transition-delay: 260ms;
}

.section-heading {
    max-width: 56rem;
    margin-bottom: 1.5rem;
}

.section-heading p,
.pest-layout p {
    max-width: 44rem;
    font-size: 1.08rem;
}

.suite-grid,
.signal-grid,
.budget-grid,
.workflow-steps,
.variant-list,
.doc-grid {
    display: grid;
    gap: 0.85rem;
}

.suite-grid {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.signal-grid,
.budget-grid,
.workflow-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.variant-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.suite-grid article,
.signal-grid article {
    min-height: 14rem;
    padding: 1rem;
}

.budget-grid article,
.workflow-steps article,
.variant-list article,
.doc-grid article {
    padding: 1rem;
}

.card-image {
    aspect-ratio: 1 / 1;
    margin-bottom: 1rem;
}

.section-image {
    aspect-ratio: 16 / 10;
    margin-bottom: 1rem;
}

.doc-hero-image {
    aspect-ratio: 4 / 3;
}

.doc-section {
    max-width: min(var(--max), calc(100% - 2rem));
    margin: clamp(2rem, 5vw, 4rem) auto;
    padding: clamp(2rem, 4vw, 3rem);
}

.doc-section.wide {
    max-width: min(var(--max), calc(100% - 2rem));
}

.doc-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.76fr) minmax(13rem, 0.24fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.doc-nav {
    position: sticky;
    top: 5.25rem;
    display: grid;
    gap: 0.55rem;
}

.doc-nav a {
    padding: 0.55rem 0.7rem;
    border-radius: 6px;
    background: oklch(1 0 0 / 0.07);
    text-decoration: none;
}

.doc-callout,
.example-card,
.signal-list article {
    border-radius: var(--radius);
    background: oklch(1 0 0 / 0.07);
    box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.08);
}

.doc-callout,
.example-card,
.signal-list article {
    padding: 1rem;
}

.doc-callout {
    margin: 1.25rem 0;
}

.signal-list,
.example-grid {
    display: grid;
    gap: 1rem;
}

.signal-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.example-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pest-doc .signal-list,
.pest-doc .example-grid {
    grid-template-columns: 1fr;
}

.pest-doc .signal-list article,
.pest-doc .example-card {
    padding: 1.15rem;
}

.pest-doc .example-card pre {
    margin-top: 0.85rem;
}

.doc-section pre + p,
.doc-section p + pre,
.doc-section ul + pre {
    margin-top: 1rem;
}

.doc-section h2:not(:first-child) {
    margin-top: 2rem;
}

.doc-section li + li {
    margin-top: 0.55rem;
}

.link-row,
.repo-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.link-row a,
.repo-list a,
.doc-grid a,
.variant-list a,
.doc-section a,
.pest-layout a,
footer a {
    color: var(--fern-200);
    font-weight: 800;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.22em;
}

.repo-list {
    margin-top: 1.25rem;
}

.repo-list a {
    padding: 0.55rem 0.7rem;
    border-radius: 999px;
    background: oklch(1 0 0 / 0.08);
    text-decoration: none;
}

.section-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.46fr);
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: center;
    margin-bottom: 1.5rem;
}

.split,
.pest-layout,
.doctrine {
    display: grid;
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: start;
}

.split {
    grid-template-columns: minmax(0, 0.9fr) minmax(18rem, 0.7fr);
}

.boundary-list {
    display: grid;
    gap: 0.65rem;
}

.boundary-list span {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: oklch(1 0 0 / 0.08);
    color: var(--lichen-100);
    box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.08);
}

.pest-band {
    background:
        linear-gradient(135deg, oklch(0.355 0.095 136 / 0.78), transparent),
        oklch(0.170 0.036 145 / 0.55);
}

.pest-layout {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.46fr);
    align-items: center;
    margin-bottom: 1.25rem;
}

.pest-points {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    gap: 0.55rem;
    margin-top: 1.2rem;
}

.pest-points span {
    padding: 0.55rem 0.7rem;
    border-radius: 999px;
    background: oklch(0.850 0.150 135 / 0.16);
    color: var(--fern-200);
    font-size: 0.88rem;
    font-weight: 800;
}

.code-block {
    max-width: 52rem;
    padding: 1rem;
}

.budget-grid {
    margin-top: 1rem;
}

.workflow-steps span {
    display: inline-flex;
    margin-bottom: 1.25rem;
    color: var(--amber-300);
    font-size: 0.84rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.variant-list strong {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--fern-200);
    font-size: 1.05rem;
}

.doctrine {
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr);
}

.doctrine ol {
    margin: 0;
    padding-left: 1.25rem;
}

.doctrine li + li {
    margin-top: 0.9rem;
}

footer {
    display: flex;
    width: min(var(--max), calc(100% - 2rem));
    margin: 0 auto;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 0;
    font-size: 0.92rem;
}

footer span:first-child {
    color: var(--ink);
    font-weight: 800;
}

@media (hover: hover) and (pointer: fine) {
    nav a:hover {
        background: oklch(1 0 0 / 0.08);
        color: var(--ink);
        translate: 0 -1px;
    }

    .button:hover {
        translate: 0 -2px;
    }

    .suite-grid article:hover,
    .signal-grid article:hover,
    .budget-grid article:hover,
    .workflow-steps article:hover,
    .variant-list article:hover {
        translate: 0 -4px;
        box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.14), 0 30px 86px oklch(0.070 0.015 145 / 0.66);
    }

    .hero-panel:hover .panel-image,
    .suite-grid article:hover .card-image,
    .signal-grid article:hover .card-image,
    .section-image:hover {
        scale: 1.025;
        filter: saturate(1.08) brightness(1.04);
    }
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mark-breathe {
    0%,
    100% {
        box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.24), 0 12px 30px var(--shadow);
    }

    50% {
        box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.30), 0 12px 34px oklch(0.690 0.160 139 / 0.28);
    }
}

@keyframes page-glow {
    from {
        background-position: 0 0, 0 0, 0 0, 0 0;
    }

    to {
        background-position: 12px 0, 2rem 0, -2rem 1rem, 0 0;
    }
}

@media (max-width: 980px) {
    .hero,
    .doc-hero,
    .split,
    .doctrine,
    .pest-layout,
    .section-intro,
    .doc-layout {
        grid-template-columns: 1fr;
    }

    .suite-grid,
    .signal-grid,
    .budget-grid,
    .workflow-steps,
    .doc-grid,
    .signal-list,
    .example-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .doc-nav {
        position: static;
    }

    .pest-points {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scrollbar-width: thin;
    }

    h1 {
        max-width: 100%;
        font-size: clamp(2.75rem, 14vw, 3.4rem);
    }

    .hero-copy {
        font-size: 1.08rem;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .button {
        width: 100%;
    }

    .suite-grid,
    .signal-grid,
    .budget-grid,
    .workflow-steps,
    .variant-list,
    .doc-grid,
    .signal-list,
    .example-grid {
        grid-template-columns: 1fr;
    }

    .suite-grid article,
    .signal-grid article {
        min-height: auto;
    }

    footer {
        flex-direction: column;
    }
}

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

    .reveal {
        opacity: 1;
        transform: none;
    }
}
