:root {
    --ink: #18201b;
    --muted: #5d6a63;
    --paper: #f7f5ef;
    --panel: #ffffff;
    --line: #d9ded6;
    --green: #1f7a58;
    --blue: #2e67b1;
    --red: #c73d32;
    --gold: #c9942e;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

a {
    color: inherit;
    text-decoration: none;
}

.hero {
    position: relative;
    min-height: 88svh;
    display: flex;
    align-items: center;
    padding: 86px clamp(20px, 6vw, 88px) 72px;
    color: white;
    overflow: hidden;
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 24, 20, 0.72);
    z-index: -2;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("assets/nyc_map.png");
    background-size: cover;
    background-position: center;
    opacity: 0.36;
    z-index: -3;
}

.topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px clamp(20px, 6vw, 88px);
}

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

.navlinks {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 18px;
    font-size: 0.94rem;
    color: rgba(255, 255, 255, 0.78);
}

.navlinks a:hover {
    color: white;
}

.hero-content {
    max-width: 760px;
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(3.2rem, 9vw, 7.4rem);
    line-height: 0.92;
    letter-spacing: 0;
}

h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: 0;
}

h3 {
    margin: 0 0 10px;
    font-size: 1.08rem;
    letter-spacing: 0;
}

.lead {
    max-width: 640px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 6px;
    font-weight: 800;
}

.button.primary {
    background: white;
    color: var(--ink);
}

.button.secondary {
    color: white;
}

.button:hover {
    border-color: white;
}

.hero-lines {
    position: absolute;
    right: -8vw;
    bottom: -18vh;
    width: min(720px, 70vw);
    height: auto;
    opacity: 0.58;
    pointer-events: none;
}

.hero-lines path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-lines path:first-child {
    stroke: rgba(255, 255, 255, 0.34);
    stroke-width: 10;
}

.hero-lines path:last-child {
    stroke: var(--gold);
    stroke-width: 7;
}

.solver-preview {
    position: relative;
    aspect-ratio: 1 / 1;
    width: min(660px, 100%);
    margin: -18px 0 44px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 70px rgba(24, 32, 27, 0.18);
}

.solver-preview img,
.solver-preview svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.solver-preview img {
    object-fit: cover;
}

.solver-preview svg {
    background: rgba(255, 255, 255, 0.16);
}

.solver-preview path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ant-path {
    stroke: rgba(46, 103, 177, 0.46);
    stroke-width: 12;
}

.ant-path.soft {
    stroke: rgba(31, 122, 88, 0.36);
    stroke-width: 10;
}

.best-path {
    stroke: var(--blue);
    stroke-width: 8;
}

.solver-preview circle {
    fill: var(--ink);
    stroke: white;
    stroke-width: 4;
}

.section {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 74px 0;
}

.section-heading {
    max-width: 720px;
}

.section-heading p:not(.eyebrow),
.profile-band p,
.feature-grid p,
.architecture-list span,
.demo-controls label,
.note {
    color: var(--muted);
}

.demo-section {
    width: min(1280px, calc(100% - 40px));
}

.demo-app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
    margin-top: 30px;
}

.demo-canvas-wrap {
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

#acoCanvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    background: #f8f6ef;
}

.demo-status {
    margin: 0;
    padding: 12px 16px;
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.94rem;
    border-top: 1px solid var(--line);
}

.demo-controls {
    display: grid;
    gap: 12px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.demo-controls label {
    display: grid;
    gap: 6px;
    font-size: 0.86rem;
    font-weight: 750;
}

.demo-controls input,
.demo-controls select,
.demo-controls button {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #cbd3cc;
    border-radius: 6px;
    color: var(--ink);
    background: white;
    font: inherit;
}

.demo-controls input[type="range"] {
    padding: 0;
}

.check-row {
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

.demo-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.demo-controls button {
    min-height: 42px;
    border-color: var(--ink);
    background: var(--ink);
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.demo-controls button:disabled {
    border-color: #d1d6d0;
    background: #d1d6d0;
    color: #788078;
    cursor: default;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 30px;
}

.feature-grid article {
    min-height: 180px;
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.feature-grid p {
    margin: 0;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
    gap: clamp(24px, 6vw, 80px);
    align-items: start;
}

.architecture-list {
    display: grid;
    gap: 10px;
}

.architecture-list div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 18px;
    align-items: baseline;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.architecture-list strong {
    color: var(--green);
}

.profile-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
    gap: clamp(24px, 6vw, 80px);
    align-items: center;
    background: #eef4ef;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: clamp(28px, 5vw, 56px);
}

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

.metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.metrics div {
    min-height: 142px;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metrics span {
    display: block;
    color: var(--red);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 900;
    line-height: 1;
}

.metrics p {
    margin: 12px 0 0;
    font-size: 0.94rem;
}

.run-section pre {
    margin: 28px 0 10px;
    padding: 20px;
    overflow-x: auto;
    background: #18201b;
    color: #f7f5ef;
    border-radius: 8px;
    border: 1px solid #2b3a30;
}

.note {
    margin: 0;
}

footer {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0 48px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
    .split,
    .profile-band,
    .demo-app {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 92svh;
        padding-top: 112px;
    }

    .hero-lines {
        right: -28vw;
        width: 94vw;
    }

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

@media (max-width: 620px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .navlinks {
        justify-content: flex-start;
    }

    .feature-grid,
    .metrics,
    .architecture-list div,
    .demo-buttons {
        grid-template-columns: 1fr;
    }

    .section {
        width: min(100% - 28px, 1120px);
        padding: 52px 0;
    }

    .hero {
        padding-left: 14px;
        padding-right: 14px;
    }

    .button {
        width: 100%;
        justify-content: center;
    }
}
