:root {
    --bg: #040404;
    --panel: rgba(10, 10, 10, 0.78);
    --panel-strong: rgba(10, 10, 10, 0.9);
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 255, 255, 0.3);
    --text: #f4f3ef;
    --muted: #c8c6bf;
    --soft: #9e9c96;
    --glow: rgba(255, 255, 255, 0.1);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    letter-spacing: 0.01em;
    position: relative;
    overflow-x: hidden;
}

.background-layer,
.background-vignette,
.hero-toroid {
    position: fixed;
    pointer-events: none;
}

.background-layer,
.background-vignette {
    inset: 0;
}

.background-layer {
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.72)),
        url("assets/listharmonicsbackground.png") center center / cover no-repeat;
    opacity: 0.34;
    transform: scale(1.03);
    animation: drift 28s ease-in-out infinite alternate;
}

.background-vignette {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 34%),
        radial-gradient(circle at bottom, rgba(0, 0, 0, 0.15), transparent 35%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.78));
}

.hero-toroid {
    top: 22px;
    left: 18px;
    width: min(22vw, 220px);
    aspect-ratio: 1;
    z-index: 1;
    opacity: 0.72;
    filter: drop-shadow(0 0 28px rgba(108, 164, 255, 0.18));
}

.hero-toroid svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.toroid-ring,
.toroid-horn,
.toroid-spine {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toroid-ring {
    stroke: rgba(222, 239, 255, 0.46);
    stroke-width: 1.25;
    stroke-dasharray: 2.6 4.8;
    transform-origin: center;
}

.toroid-ring-outer {
    animation: toroidFlowOuter 7.2s linear infinite;
}

.toroid-ring-mid {
    stroke: rgba(180, 223, 255, 0.36);
    animation: toroidFlowMid 5.4s linear infinite;
}

.toroid-ring-inner {
    stroke: rgba(123, 190, 255, 0.32);
    animation: toroidFlowInner 4.2s linear infinite;
}

.toroid-horn {
    stroke: rgba(232, 241, 255, 0.34);
    stroke-width: 1.1;
    animation: toroidChannel 4.8s ease-in-out infinite;
}

.toroid-spine {
    stroke: rgba(191, 221, 255, 0.34);
    stroke-width: 1.2;
}

.toroid-node {
    fill: rgba(238, 246, 255, 0.92);
    filter: drop-shadow(0 0 10px rgba(164, 210, 255, 0.85));
    animation: toroidNode 4.2s ease-in-out infinite;
}

.hero,
.page,
.footer {
    position: relative;
    z-index: 1;
}

.hero {
    width: min(calc(100% - 40px), var(--max-width));
    margin: 0 auto;
    padding: 56px 0 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    gap: 34px;
    align-items: center;
}

.eyebrow,
.section-kicker,
.repo-label {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: var(--soft);
}

.hero h1 {
    margin: 12px 0 18px;
    font-size: clamp(2.8rem, 5vw, 5.1rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    max-width: 11ch;
}

.hero-text,
.section-intro,
.operations-card p,
.repo-card p,
.signal-card p,
.focus-card p,
.domain-card li,
.stack-list li {
    color: var(--muted);
}

.hero-text {
    max-width: 60ch;
    font-size: 1.05rem;
}

.hero-text-echo {
    margin-top: 14px;
    color: var(--text);
    font-size: 0.98rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 28px 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: transform 220ms ease, background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.button-primary {
    background: rgba(255, 255, 255, 0.92);
    color: #0a0a0a;
}

.button-secondary {
    background: rgba(255, 255, 255, 0.04);
}

.signal-strip {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.signal-strip li {
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    backdrop-filter: blur(10px);
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.hero-banner,
.codex-banner {
    width: 100%;
    height: auto;
    display: block;
}

.hero-banner {
    filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.45));
}

.page {
    width: min(calc(100% - 40px), var(--max-width));
    margin: 0 auto;
    padding-bottom: 60px;
    display: grid;
    gap: 28px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 34px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.panel h2 {
    margin: 12px 0 14px;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1;
    letter-spacing: -0.03em;
    max-width: 15ch;
}

.signal-grid,
.repo-grid,
.focus-grid,
.program-grid,
.domain-grid,
.operations-grid {
    display: grid;
    gap: 18px;
}

.signal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 26px;
}

.signal-card,
.repo-card,
.focus-card,
.program-card,
.domain-card,
.operations-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 22px;
    transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.signal-card:hover,
.repo-card:hover,
.focus-card:hover,
.program-card:hover,
.domain-card:hover,
.operations-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
}

.signal-card h3,
.repo-card h3,
.focus-card h3,
.program-card h3,
.domain-card h3,
.operations-card h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.quote-block {
    margin: 28px 0 0;
    padding: 22px 26px;
    border-left: 3px solid rgba(255, 255, 255, 0.55);
    border-radius: 0 18px 18px 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
    font-size: 1.08rem;
    color: var(--text);
}

.codex-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
    gap: 26px;
    align-items: center;
}

.codex-art {
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.4);
}

.stack-list {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
    display: grid;
    gap: 14px;
}

.stack-list li {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.stack-list strong,
.domain-card strong {
    color: var(--text);
}

.meta-band {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.meta-band span {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 0.92rem;
}

.repo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
}

.repo-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.repo-card a,
.operations-card a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
    width: fit-content;
}

.repo-card a:hover,
.operations-card a:hover,
.button:hover {
    border-color: rgba(255, 255, 255, 0.85);
}

.focus-grid,
.operations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
}

.program-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 24px;
}

.program-card {
    overflow: hidden;
}

.program-media {
    margin: 0 0 16px;
    height: 132px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
        radial-gradient(circle at top, rgba(116, 169, 255, 0.14), transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(5, 7, 14, 0.78));
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.program-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    filter: saturate(0.88) contrast(1.08) brightness(0.92);
    opacity: 0.92;
}

.program-media--bench-left img {
    object-position: 28% 42%;
}

.program-media--bench-right img {
    object-position: 72% 40%;
}

.program-media--bench-full img {
    object-position: 50% 39%;
}

.program-media--device-shot {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 30%, rgba(255, 72, 72, 0.16), transparent 36%),
        radial-gradient(circle at 50% 70%, rgba(50, 122, 255, 0.1), transparent 52%),
        linear-gradient(180deg, rgba(10, 10, 12, 0.9), rgba(10, 10, 12, 0.98));
}

.program-media--device-shot img {
    object-fit: contain;
    filter: saturate(0.92) contrast(1.04) brightness(0.95);
    opacity: 0.96;
}

.program-media--arc15-full img {
    object-position: center center;
}

.program-media--cutout {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 82, 82, 0.26), transparent 40%),
        radial-gradient(circle at 50% 45%, rgba(41, 119, 255, 0.12), transparent 62%),
        linear-gradient(180deg, rgba(24, 8, 8, 0.92), rgba(6, 8, 12, 0.92));
}

.program-media--cutout img {
    object-fit: contain;
    filter: drop-shadow(0 14px 32px rgba(255, 74, 74, 0.22));
}

.domain-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
}

.node-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.node-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(160, 208, 255, 0.24);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(92, 144, 255, 0.05));
    color: var(--text);
    letter-spacing: 0.04em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 24px rgba(0, 0, 0, 0.16);
}

.lattice-note {
    margin: 20px 0 0;
    color: var(--muted);
}

.domain-card ul {
    margin: 14px 0 0;
    padding-left: 18px;
}

.operations-panel h2 {
    max-width: 12ch;
}

.footer {
    width: min(calc(100% - 40px), var(--max-width));
    margin: 0 auto;
    padding: 0 0 42px;
    color: var(--soft);
    text-align: center;
}

.footer p {
    margin: 0;
}

.footer-note {
    margin-top: 10px;
    color: var(--muted);
}

@keyframes drift {
    from {
        transform: scale(1.03) translate3d(-8px, -8px, 0);
    }
    to {
        transform: scale(1.08) translate3d(8px, 12px, 0);
    }
}

@keyframes toroidFlowOuter {
    0% {
        stroke-dashoffset: 0;
        opacity: 0.32;
        transform: scaleX(0.92) scaleY(0.86);
    }
    50% {
        opacity: 0.76;
        transform: scaleX(1.04) scaleY(1.1);
    }
    100% {
        stroke-dashoffset: -62;
        opacity: 0.32;
        transform: scaleX(1.12) scaleY(1.24);
    }
}

@keyframes toroidFlowMid {
    0% {
        stroke-dashoffset: 0;
        opacity: 0.28;
        transform: scaleX(0.94) scaleY(0.9);
    }
    50% {
        opacity: 0.66;
        transform: scaleX(1.02) scaleY(1.04);
    }
    100% {
        stroke-dashoffset: -48;
        opacity: 0.24;
        transform: scaleX(1.08) scaleY(1.14);
    }
}

@keyframes toroidFlowInner {
    0% {
        stroke-dashoffset: 0;
        opacity: 0.34;
        transform: scaleX(0.98) scaleY(0.94);
    }
    50% {
        opacity: 0.7;
        transform: scaleX(1.02) scaleY(1.04);
    }
    100% {
        stroke-dashoffset: -36;
        opacity: 0.2;
        transform: scaleX(1.04) scaleY(1.12);
    }
}

@keyframes toroidChannel {
    0%,
    100% {
        opacity: 0.22;
    }
    50% {
        opacity: 0.66;
    }
}

@keyframes toroidNode {
    0%,
    100% {
        transform: scale(0.72);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.12);
        opacity: 1;
    }
}

@media (max-width: 1100px) {
    .hero,
    .codex-panel {
        grid-template-columns: 1fr;
    }

    .hero h1,
    .panel h2 {
        max-width: none;
    }

    .hero-toroid {
        width: min(24vw, 180px);
        top: 16px;
        left: 10px;
        opacity: 0.5;
    }
}

@media (max-width: 780px) {
    .hero,
    .page,
    .footer {
        width: min(calc(100% - 24px), var(--max-width));
    }

    .hero {
        padding-top: 30px;
        gap: 24px;
    }

    .panel {
        padding: 24px 18px;
    }

    .signal-grid,
    .repo-grid,
    .focus-grid,
    .program-grid,
    .domain-grid,
    .operations-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-toroid {
        width: 108px;
        top: 10px;
        left: 8px;
        opacity: 0.34;
    }
}
