.challenge-section,
.language-section,
.studio-section,
.site-footer {
    position: relative;
    z-index: 2;
}

.challenge-section {
    padding: 140px 0;
    border-bottom: 1px solid var(--line);
    background: var(--ink-2);
}

.section-title {
    display: grid;
    grid-template-columns: 0.42fr 1.1fr 0.48fr;
    gap: 40px;
    align-items: end;
    margin-bottom: 70px;
}

.section-title > p,
.language-copy > p,
.studio-copy > p {
    margin: 0;
    color: #8f958e;
    font: 500 0.62rem/1.4 var(--mono);
    letter-spacing: 0.14em;
}

.section-title h2,
.language-copy h2,
.studio-copy h2 {
    margin: 0;
    font-size: clamp(3.6rem, 6.6vw, 7.5rem);
    font-weight: 600;
    letter-spacing: -0.08em;
    line-height: 0.88;
}

.section-title h2 span {
    color: var(--coral);
}

.section-title > small {
    max-width: 300px;
    color: #9aa098;
    font-size: 0.86rem;
    line-height: 1.65;
}

.river-preview {
    position: relative;
}

.river-preview .river-stage {
    --river-animation-play-state: running;
}

.river-preview .river-boat,
.river-preview .river-boat-hull {
    top: 69%;
    left: 40%;
}

.river-preview .river-sheep {
    top: 49%;
    left: 17%;
}

.river-preview .river-wolf {
    top: 68%;
    left: 23%;
}

.river-preview .river-hay {
    top: 54%;
    left: 29%;
}

.river-preview .river-speech {
    top: 66.9%;
    left: 37.9%;
    display: grid;
    gap: 14px;
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        visibility 0s linear 180ms;
}

.river-preview .river-speech button {
    position: relative;
    z-index: 1;
    width: fit-content;
    min-width: 72px;
    padding: 9px 14px;
    border: 1px solid #17271f;
    border-radius: 999px;
    box-shadow:
        0 3px 0 rgba(21, 42, 31, 0.24),
        inset 0 1px rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, #3d5b46, #243c31);
    color: #fff9dd;
    cursor: pointer;
    font: 600 0.62rem/1 var(--mono);
    letter-spacing: 0.08em;
}

.river-preview .river-speech button:hover,
.river-preview .river-speech button:focus-visible {
    background: #0a8394;
    outline: 2px solid #fffaf0;
    outline-offset: 2px;
}

.challenge-section[data-challenge-state="accepted"] .river-preview .river-speech,
.challenge-section[data-challenge-state="error"] .river-preview .river-speech {
    visibility: hidden;
    transform: translate(-75%, calc(-100% - 36px)) scale(0.94);
    opacity: 0;
}

.river-preview-error {
    margin: 0;
    padding: 14px 17px;
    border-top: 1px solid rgba(255, 111, 94, 0.48);
    background: rgba(255, 111, 94, 0.1);
    color: #ffafa2;
    font: 500 0.61rem/1.5 var(--mono);
}

.river-preview-error[hidden] {
    display: none;
}

.language-section {
    padding: 150px 0;
    overflow: hidden;
    background: var(--blue);
    color: var(--white);
}

.language-section::before {
    position: absolute;
    top: -300px;
    right: -150px;
    width: 780px;
    height: 780px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    content: "";
}

.language-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(320px, 0.62fr) minmax(580px, 1.38fr);
    gap: clamp(60px, 9vw, 150px);
    align-items: center;
}

.language-copy h2 {
    margin-top: 24px;
    font-size: clamp(3.6rem, 5.9vw, 6.8rem);
}

.language-copy > p {
    color: rgba(255, 255, 255, 0.64);
}

.language-copy > span,
.studio-copy > span {
    display: block;
    max-width: 500px;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.94rem;
    line-height: 1.75;
}

.language-board {
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: var(--ink-1);
    box-shadow: 11px 11px 0 var(--acid);
}

.lab-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--line);
}

.lab-tabs button {
    min-height: 48px;
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    color: #767d75;
    cursor: pointer;
    font: 500 0.62rem/1 var(--mono);
    letter-spacing: 0.11em;
}

.lab-tabs button:last-child {
    border-right: 0;
}

.lab-tabs button[aria-selected="true"] {
    background: var(--acid);
    color: var(--ink);
}

.language-execute {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: flex-end;
    border-bottom: 1px solid var(--line);
    color: #858c84;
    font: 500 0.57rem/1 var(--mono);
    letter-spacing: 0.08em;
}

.language-execute span {
    padding: 0 16px;
}

.language-execute button {
    align-self: stretch;
    min-width: 130px;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--acid);
    color: var(--ink);
    cursor: pointer;
    font: 500 0.58rem/1 var(--mono);
}

.language-execute button:hover:not(:disabled) {
    background: var(--sky);
}

.lab-panel {
    --snippet-frame-height: 280px;
    min-height: 360px;
    padding: 50px;
}

.lab-panel[hidden] {
    display: none;
}

.panel-tag {
    display: block;
    color: #858c84;
    font: 500 0.58rem/1 var(--mono);
    letter-spacing: 0.1em;
}

.lab-panel > :is(.snippet-editor-shell, .snippet-editor) {
    margin-top: 28px;
}

.language-snippet-editor {
    padding: 20px;
    font-size: clamp(0.72rem, 1.15vw, 0.9rem);
}

.language-diagnostics {
    border-right: 0;
    border-left: 0;
}

.lexicon-strip {
    display: flex;
    min-height: 50px;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    overflow: hidden;
    border-top: 1px solid var(--line);
    color: #899087;
    font: 400 0.58rem/1 var(--mono);
    white-space: nowrap;
}

.lexicon-strip > span {
    color: var(--coral);
}

.lexicon-strip pre {
    margin: 0;
    overflow: hidden;
    color: var(--acid);
    font: inherit;
    text-overflow: ellipsis;
}

.studio-section {
    padding: 150px 0;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: var(--ink);
}

.studio-shell {
    display: grid;
    grid-template-columns: minmax(600px, 1.35fr) minmax(320px, 0.65fr);
    gap: clamp(60px, 8vw, 130px);
    align-items: center;
}

.studio-window {
    border: 1px solid #515851;
    background: var(--ink-1);
    box-shadow: 10px 10px 0 var(--coral);
}

.studio-bar {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    min-height: 46px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    font: 500 0.58rem/1 var(--mono);
}

.studio-bar span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
}

.studio-bar img {
    width: 24px;
    height: 24px;
}

.studio-bar i {
    color: #7e857d;
    font-style: normal;
}

.studio-bar button {
    align-self: stretch;
    display: grid;
    place-items: center;
    padding: 0 15px;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--acid);
    color: var(--ink);
    cursor: pointer;
}

.studio-bar button:hover:not(:disabled) {
    background: var(--sky);
}

.studio-body {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr) 170px;
    min-height: 430px;
}

.studio-files,
.studio-output {
    padding: 18px 12px;
    font: 400 0.55rem/1.5 var(--mono);
}

.studio-files {
    border-right: 1px solid var(--line);
    color: #6f766e;
}

.studio-files strong {
    display: block;
    margin-top: 20px;
    color: #d2d6d0;
    font-weight: 400;
}

.studio-files strong::first-letter {
    color: var(--acid);
}

.studio-code {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
}

.studio-code > :is(.snippet-editor-shell, .snippet-editor) {
    flex: 1;
    min-height: 0;
}

.studio-snippet-editor {
    padding: 35px 20px;
    font-size: 0.67rem;
    line-height: 1.9;
}

.studio-diagnostics {
    flex: none;
}

.studio-output {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--line);
    background: #0a0c0a;
    color: #737a72;
}

.studio-output strong {
    margin: auto 0 0;
    color: var(--sky);
    font-size: 4rem;
    letter-spacing: -0.08em;
}

.studio-output small {
    color: var(--acid);
    font: 400 0.55rem/1 var(--mono);
}

.studio-copy h2 {
    margin-top: 24px;
    font-size: clamp(3.6rem, 5.7vw, 6.5rem);
}

.studio-copy > span {
    color: #a3a9a1;
}

.studio-signals {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 28px;
}

.studio-signals i {
    padding: 7px 9px;
    border: 1px solid #424942;
    color: #969d95;
    font: 400 0.56rem/1 var(--mono);
    letter-spacing: 0.06em;
    font-style: normal;
}

.studio-copy > a {
    display: flex;
    max-width: 270px;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    margin-top: 35px;
    padding: 0 15px;
    border: 1px solid #747b73;
    font: 500 0.68rem/1 var(--mono);
    transition: background-color 140ms ease, color 140ms ease;
}

.studio-copy > a span {
    color: var(--acid);
}

.studio-copy > a:hover {
    background: var(--white);
    color: var(--ink);
}

.install-section {
    position: relative;
    padding: 125px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(133, 220, 255, 0.06), transparent 38%),
        var(--ink);
}

.install-section::before {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 52px 52px;
    content: "";
    pointer-events: none;
}

.install-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(260px, 0.68fr) minmax(560px, 1.32fr);
    gap: 80px;
    align-items: start;
}

.install-copy h2 {
    margin: 24px 0 22px;
    font-size: clamp(2.4rem, 4.2vw, 5rem);
    line-height: 0.94;
    letter-spacing: -0.07em;
}

.install-copy h2 em {
    color: var(--sky);
    font-style: normal;
}

.install-copy > span {
    display: block;
    max-width: 430px;
    color: #a3a9a1;
    line-height: 1.7;
}

.install-options {
    display: grid;
    gap: 10px;
}

.install-card {
    position: relative;
    display: grid;
    min-height: 116px;
    grid-template-columns: 1fr auto;
    align-content: center;
    gap: 9px 28px;
    padding: 24px 28px;
    border: 1px solid #343a35;
    background: rgba(15, 18, 16, 0.92);
    transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.install-card:hover {
    transform: translateX(5px);
    border-color: var(--sky);
    background: #151a17;
}

.install-card-primary {
    border-color: #596158;
}

.install-card small {
    grid-column: 1;
    color: #7d857d;
    font: 500 0.55rem/1 var(--mono);
    letter-spacing: 0.09em;
}

.install-card strong {
    grid-column: 1;
    color: var(--white);
    font-size: 1.2rem;
}

.install-card > span {
    grid-column: 1;
    color: #969d95;
    font: 400 0.64rem/1.4 var(--mono);
}

.install-card i {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
    color: var(--acid);
    font: 400 1.35rem/1 var(--mono);
    font-style: normal;
}

.site-footer {
    padding: 45px 0;
    background: var(--ink-1);
}

.footer-inner {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 60px;
    align-items: center;
}

.footer-inner > p {
    margin: 0;
    color: #7f867e;
    font-size: 0.73rem;
}

.footer-inner nav {
    display: flex;
    gap: 24px;
    color: #a0a69f;
    font-size: 0.68rem;
}

.footer-inner nav a:hover {
    color: var(--sky);
}

.footer-state {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #798078;
    font: 500 0.55rem/1 var(--mono);
    letter-spacing: 0.08em;
}

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

.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 520ms ease, transform 520ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
