.hero {
    padding: 70px 0 42px
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 44px;
    align-items: center
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--green2);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase
}

.hero h1 {
    font-size: clamp(2.55rem, 6vw, 5rem);
    line-height: .98;
    letter-spacing: -.055em;
    margin: 0;
    max-width: 820px
}

.hero h1 span {
    color: var(--green2)
}

.hero-copy {
    max-width: 730px;
    font-size: 1.13rem;
    color: #c7d0c9;
    margin: 22px 0
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 22px
}

.trust-row span {
    font-size: .85rem;
    border: 1px solid #2c3c30;
    background: #111a13;
    padding: 7px 10px;
    border-radius: 999px;
    color: #cad5cb
}

.hero-preview {
    background: linear-gradient(160deg, #18231a, #0e150f);
    border: 1px solid #2a382d;
    border-radius: 24px;
    padding: 18px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden
}

.hero-preview:before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(45deg, rgba(255, 255, 255, .025) 25%, transparent 25%), linear-gradient(-45deg, rgba(255, 255, 255, .025) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, .025) 75%), linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, .025) 75%);
    background-size: 28px 28px;
    background-position: 0 0, 0 14px, 14px -14px, -14px 0;
    pointer-events: none
}

.hero-preview-inner {
    position: relative;
    min-height: 280px;
    display: grid;
    place-items: center;
    text-align: center;
    border: 1px solid #304335;
    border-radius: 16px;
    background: linear-gradient(#4e7394 0 46%, #759b57 46% 53%, #5d7f40 53% 57%, #3f6638 57%)
}

.pixel-demo {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 1000;
    font-size: clamp(2.1rem, 6vw, 4.5rem);
    letter-spacing: .05em;
    color: #fff76a;
    text-shadow: 4px 4px 0 #403d14, 8px 8px 0 rgba(0, 0, 0, .42);
    transform: scaleX(1.02)
}

.hero-preview small {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(6, 10, 7, .78);
    border: 1px solid rgba(255, 255, 255, .1);
    padding: 5px 8px;
    border-radius: 8px;
    color: #dce5dd
}

.tool-shell {
    padding: 18px 0 46px
}

.tool-topbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px
}

.tool-topbar h2 {
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    margin: 0;
    letter-spacing: -.035em
}

.tool-tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--line);
    background: #0e150f;
    border-radius: 12px
}

.tool-tabs button {
    border: 0;
    background: transparent;
    color: #aeb8b0;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 800
}

.tool-tabs button.active {
    background: #213024;
    color: #fff;
    box-shadow: inset 0 0 0 1px #35513a
}

.studio {
    display: grid;
    grid-template-columns: minmax(320px, .82fr) minmax(0, 1.18fr);
    grid-template-areas: "controls preview""controls extras";
    gap: 14px;
    align-items: start
}

.card {
    background: linear-gradient(180deg, #121b14, #0f1711);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 14px 38px rgba(0, 0, 0, .16)
}

.controls {
    padding: 18px;
    grid-area: controls
}

.preview-card {
    padding: 14px;
    grid-area: preview;
    position: sticky;
    top: var(--header-height);
    z-index: 30;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .32)
}

.preview-extras {
    grid-area: extras;
    padding: 14px
}

.field {
    margin-bottom: 18px
}

.field label,
.group-title {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    font-weight: 850;
    font-size: .9rem;
    margin-bottom: 7px
}

.field small,
.hint {
    font-size: .78rem;
    color: #859288
}

.field textarea,
.field input[type=text],
.field select {
    width: 100%;
    background: #090e0a;
    color: #fff;
    border: 1px solid #344438;
    border-radius: 10px;
    padding: 11px 12px;
    outline: 0
}

.field textarea:focus,
.field input[type=text]:focus,
.field select:focus {
    border-color: #6ebc4e;
    box-shadow: 0 0 0 3px rgba(120, 214, 75, .11)
}

.code-hint {
    margin-top: 7px;
    color: #8d9c90;
    font-size: .79rem
}

.code-hint code {
    color: #c9f4b5
}

.seg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px
}

.seg button,
.chip-btn {
    border: 1px solid #304034;
    background: #0d140f;
    color: #bdc8bf;
    border-radius: 9px;
    padding: 8px 9px;
    font-weight: 800;
    font-size: .85rem
}

.seg button.active,
.chip-btn.active {
    background: #223426;
    color: #efffeb;
    border-color: #4f744f
}

.palette {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 7px
}

.swatch {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
    position: relative
}

.swatch.active {
    outline: 2px solid #fff;
    outline-offset: 2px
}

.swatch:after {
    content: attr(data-code);
    position: absolute;
    inset: auto 2px 1px;
    color: #fff;
    font-size: .58rem;
    font-weight: 900;
    text-shadow: 0 1px 2px #000
}

.split2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

.color-field {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 8px;
    align-items: center
}

.color-field input[type=color] {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #3a4b3e;
    background: #111;
    border-radius: 9px
}

.color-field input[type=text] {
    margin: 0
}

.toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #2b392f;
    background: #0c120e;
    border-radius: 9px;
    padding: 8px 9px;
    color: #c5cec7;
    font-size: .84rem;
    font-weight: 700
}

.toggle input {
    accent-color: #6fc64b
}

.ranges {
    display: grid;
    gap: 11px
}

.range-row {
    display: grid;
    grid-template-columns: 110px 1fr 54px;
    align-items: center;
    gap: 8px
}

.range-row label {
    font-size: .81rem;
    color: #c5cec7
}

.range-row input {
    width: 100%;
    accent-color: #78d64b
}

.range-row output {
    text-align: right;
    font-size: .78rem;
    color: #95a299
}

.advanced {
    border-top: 1px solid #27342b;
    padding-top: 14px;
    margin-top: 14px
}

.advanced summary {
    cursor: pointer;
    font-weight: 900;
    color: #dbe4dc
}

.advanced-grid {
    display: grid;
    gap: 12px;
    margin-top: 12px
}

.preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px
}

.preview-actions,
.export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px
}

.icon-btn,
.btn {
    border: 1px solid #304035;
    background: #111a13;
    color: #d9e2db;
    border-radius: 9px;
    padding: 8px 10px;
    font-weight: 850
}

.btn.primary {
    background: linear-gradient(#8fe05e, #62b840);
    color: #10210d;
    border-color: #86df58;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18)
}

.btn.gold {
    background: linear-gradient(#ffe178, #e7b52e);
    color: #2d2205;
    border-color: #ffde69
}

.btn:hover,
.icon-btn:hover {
    filter: brightness(1.08)
}

.canvas-stage {
    position: relative;
    min-height: 220px;
    border: 1px solid #314238;
    border-radius: 14px;
    overflow: auto;
    display: grid;
    place-items: center;
    background-color: #1a221d;
    background-image: linear-gradient(45deg, #222c25 25%, transparent 25%), linear-gradient(-45deg, #222c25 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #222c25 75%), linear-gradient(-45deg, transparent 75%, #222c25 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0
}

.canvas-stage canvas {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    display: block
}

.preview-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #8f9a91;
    font-size: .78rem;
    margin-top: 8px
}

.preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 12px 0
}

.preset-row button {
    border: 1px solid #304034;
    background: #101713;
    color: #bbc6bd;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: .78rem;
    font-weight: 800
}

.preset-row button.active {
    border-color: #6fbd50;
    color: #eaffdf;
    background: #1b2a1d
}

.output-strip {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 12px;
    margin-top: 12px
}

.output-box {
    border: 1px solid #29382e;
    background: #0b110d;
    border-radius: 11px;
    padding: 11px
}

.output-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: .82rem;
    margin-bottom: 8px
}

.output-box code,
.output-box textarea {
    width: 100%;
    display: block;
    color: #dcf4d4;
    background: transparent;
    border: 0;
    resize: none;
    min-height: 48px;
    word-break: break-all;
    font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace
}

.blueprint {
    margin-top: 12px;
    border: 1px solid #29382e;
    background: #0a100c;
    border-radius: 11px;
    padding: 11px
}

.blueprint pre {
    margin: 8px 0 0;
    max-height: 180px;
    overflow: auto;
    font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #bfe8b1;
    white-space: pre
}

.section {
    padding: 64px 0
}

.section.alt {
    background: #0d130f;
    border-block: 1px solid rgba(255, 255, 255, .055)
}

.section-head {
    max-width: 780px;
    margin-bottom: 26px
}

.section-head h2 {
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1.06;
    letter-spacing: -.045em;
    margin: 0 0 12px
}

.section-head p {
    color: #b7c1b9;
    margin: 0
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px
}

.feature {
    padding: 18px;
    background: #111813;
    border: 1px solid #27352b;
    border-radius: 15px
}

.feature b {
    display: block;
    margin: 8px 0 5px
}

.feature p {
    margin: 0;
    color: #9ba79e;
    font-size: .9rem
}

.feature-icon {
    font-size: 1.45rem
}

.intent-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px
}

.intent {
    padding: 22px;
    border: 1px solid #2a392e;
    border-radius: 16px;
    background: linear-gradient(180deg, #121a14, #0e1510)
}

.intent h3 {
    margin: 9px 0 5px
}

.intent p {
    color: #aeb9b0;
    margin: 0 0 12px
}

.text-link {
    color: #b5ef94;
    font-weight: 850;
    text-decoration: none
}

.color-table-wrap {
    overflow: auto;
    border: 1px solid #2b392f;
    border-radius: 14px
}

.color-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
    background: #0f1611
}

.color-table th,
.color-table td {
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid #243028;
    font-size: .9rem
}

.color-dot {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    border: 1px solid rgba(255, 255, 255, .2)
}

.callout {
    border: 1px solid #38523d;
    background: linear-gradient(135deg, rgba(120, 214, 75, .11), rgba(255, 214, 90, .06));
    padding: 18px;
    border-radius: 15px;
    color: #dbe7dc
}

.steps {
    counter-reset: s;
    display: grid;
    gap: 12px;
    padding: 0
}

.steps li {
    list-style: none;
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    align-items: start;
    color: #b9c3bb
}

.steps li:before {
    counter-increment: s;
    content: counter(s);
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: #1d3020;
    border: 1px solid #3c5c42;
    color: #cfffaf;
    font-weight: 900
}

.steps b {
    color: #fff
}

.faq {
    display: grid;
    gap: 9px
}

.faq details {
    border: 1px solid #2b392f;
    border-radius: 12px;
    background: #101713;
    padding: 13px 15px
}

.faq summary {
    font-weight: 900;
    cursor: pointer
}

.faq p {
    color: #aeb9b0;
    margin: 10px 0 2px
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px
}

.related {
    display: block;
    text-decoration: none;
    border: 1px solid #2c3b31;
    border-radius: 14px;
    padding: 18px;
    background: #111813
}

.related:hover {
    border-color: #57805d;
    transform: translateY(-1px)
}

.related span {
    color: #91a096;
    font-size: .84rem
}

.related b {
    display: block;
    margin-top: 5px
}

.site-footer {
    padding: 38px 0;
    border-top: 1px solid #263129;
    color: #92a096
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr .6fr .6fr;
    gap: 24px
}

.footer-links {
    display: grid;
    gap: 7px
}

.footer-links a {
    text-decoration: none;
    color: #aeb8b0
}

.disclaimer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #252f28;
    font-size: .82rem;
    color: #79867c
}

.subhero {
    padding: 58px 0 28px
}

.subhero h1 {
    font-size: clamp(2.25rem, 5vw, 4rem);
    margin: 0 0 12px;
    letter-spacing: -.05em;
    line-height: 1
}

.subhero p {
    max-width: 760px;
    color: #b6c0b8
}

.simple-card {
    padding: 22px
}

.motd-preview {
    background: #1b1b1b;
    border: 2px solid #050505;
    box-shadow: inset 0 0 0 1px #333;
    padding: 14px;
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 90px;
    font-family: ui-monospace, monospace
}

.server-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #78d64b, #2e5b24);
    display: grid;
    place-items: center;
    color: #14200f;
    font-weight: 1000
}

.motd-lines {
    white-space: pre-wrap
}

.pill {
    display: inline-block;
    border: 1px solid #334239;
    padding: 4px 8px;
    border-radius: 999px;
    color: #aeb9b0;
    font-size: .75rem
}

.notice {
    padding: 12px 14px;
    border-left: 3px solid var(--gold);
    background: #19170e;
    color: #d8d0ad;
    border-radius: 0 10px 10px 0
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px
}

.legal h2 {
    margin-top: 30px
}

.legal p,
.legal li {
    color: #b4beb6
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 90;
    background: #eefbea;
    color: #152012;
    border-radius: 10px;
    padding: 10px 13px;
    font-weight: 850;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: .2s
}

.toast.show {
    opacity: 1;
    transform: none
}

@media(max-width:980px) {

    .hero-grid,
    .footer-grid {
        grid-template-columns: 1fr
    }

    .studio {
        grid-template-columns: 1fr;
        grid-template-areas: "preview""controls""extras"
    }

    .controls {
        position: static
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .canvas-stage {
        min-height: 350px
    }

    .tool-topbar {
        align-items: start;
        flex-direction: column
    }

    .tool-tabs {
        width: 100%;
        overflow: auto
    }

    .output-strip {
        grid-template-columns: 1fr
    }
}

@media(max-width:680px) {
    .wrap {
        width: min(100% - 22px, var(--wrap))
    }

    .preview-card {
        top: var(--header-height);
        padding: 10px;
        border-radius: 0 0 14px 14px
    }

    .preview-toolbar {
        flex-direction: row;
        align-items: center;
        margin-bottom: 6px
    }

    .preview-actions {
        gap: 4px
    }

    .preview-actions .icon-btn {
        padding: 6px 7px;
        font-size: .7rem
    }

    .preview-card .eyebrow {
        font-size: .68rem
    }

    .preview-card #canvasMeta {
        font-size: .76rem
    }

    .preview-meta {
        display: none
    }

    .preview-card .canvas-stage {
        min-height: 160px;
        max-height: 30vh
    }

    .preview-card .canvas-stage canvas {
        max-height: 28vh;
        width: auto;
        max-width: 100%
    }

    .preview-extras {
        padding: 12px
    }

    .hero {
        padding-top: 46px
    }

    .hero-preview-inner {
        min-height: 220px
    }

    .feature-grid,
    .intent-grid,
    .related-grid,
    .contact-grid {
        grid-template-columns: 1fr
    }

    .palette {
        grid-template-columns: repeat(8, 1fr);
        gap: 5px
    }

    .studio {
        grid-template-columns: 1fr
    }

    .toggle-grid,
    .split2 {
        grid-template-columns: 1fr
    }

    .range-row {
        grid-template-columns: 98px 1fr 44px
    }

    .canvas-stage {
        min-height: 280px
    }

    .preview-toolbar {
        align-items: flex-start;
        flex-direction: column
    }

    .export-actions .btn {
        flex: 1
    }

    .footer-grid {
        gap: 14px
    }
}

/* Mobile hardening */
.studio > * {
    min-width: 0
}

.seg {
    min-width: 0
}

.seg button {
    min-width: 0
}

.code-hint code {
    overflow-wrap: anywhere
}

@media(max-width:680px) {
    .controls {
        min-width: 0
    }

    .seg[style] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important
    }

    .seg button {
        font-size: .78rem;
        padding: 8px 5px
    }

    .palette {
        grid-template-columns: repeat(8, minmax(0, 1fr))
    }

    .output-box textarea {
        min-width: 0
    }

    .preview-card {
        min-width: 0;
        overflow: hidden
    }
}

/* Sticky live preview: stays directly below the global header. */
@media(max-width:680px) {
    .preview-card {
        position: sticky;
        top: var(--header-height);
        z-index: 30;
        padding: 10px;
        border-radius: 0 0 14px 14px;
    }

    .preview-card .preview-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        margin-bottom: 6px;
    }

    .preview-card .preview-actions {
        gap: 4px;
        flex-wrap: nowrap
    }

    .preview-card .preview-actions .icon-btn {
        padding: 6px 7px;
        font-size: .68rem;
        white-space: nowrap
    }

    .preview-card .canvas-stage {
        min-height: 160px;
        max-height: 30vh
    }

    .preview-card .canvas-stage canvas {
        max-height: 28vh;
        width: auto;
        max-width: 100%
    }

    .preview-card .preview-meta {
        display: none
    }
}
