/* ==========================================================================
   PteroBill — 2026 refresh
   Control-panel aesthetic: blued charcoal ground, hairline structure,
   indigo for actions, sand for "claimed" allocations.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
    /* Ground & surfaces */
    --ink: #0b0d18;
    --ink-raised: #10132a;
    --panel: #141834;
    --panel-hi: #1a1f42;
    --line: #262c50;
    --line-soft: #1c2140;

    /* Accents */
    --indigo: #6c63ff;
    --indigo-hi: #8b84ff;
    --indigo-dim: rgba(108, 99, 255, 0.14);
    --violet: #a78bfa;
    --sand: #e9cfa4;
    --sand-dim: rgba(233, 207, 164, 0.16);
    --mint: #5ed6a4;

    /* Text */
    --white: #f2f4ff;
    --mist: #b3bade;
    --mist-dim: #7b83aa;

    /* Type */
    --font-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Rhythm */
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --shell: 1180px;
    --section-y: clamp(4rem, 7vw, 6.5rem);
    --radius: 14px;
    --radius-sm: 8px;

    /* Motion */
    --ease: cubic-bezier(0.22, 0.68, 0.35, 1);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
    -webkit-text-size-adjust: 100%;
    /* clip, not hidden: `hidden` on the scrolling element turns it into a
       scroll container and breaks fragment navigation. */
    overflow-x: clip;
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--mist);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* A faint aurora anchored to the top of the page — the only ambient effect. */
body::before {
    content: "";
    position: fixed;
    inset: -30vh 0 auto 0;
    height: 90vh;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(58% 52% at 22% 28%, rgba(108, 99, 255, 0.18), transparent 68%),
        radial-gradient(46% 46% at 82% 8%, rgba(167, 139, 250, 0.12), transparent 70%),
        radial-gradient(38% 38% at 62% 44%, rgba(233, 207, 164, 0.06), transparent 72%);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    text-wrap: balance;
    color: var(--white);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 0.6em;
}

h1 {
    font-size: clamp(2.5rem, 5.6vw, 4.15rem);
    letter-spacing: -0.035em;
}

h2 {
    font-size: clamp(1.9rem, 3.6vw, 2.7rem);
    letter-spacing: -0.03em;
}

h3 {
    font-size: 1.1875rem;
    letter-spacing: -0.015em;
}

h4 {
    font-size: 1rem;
    letter-spacing: -0.01em;
}

p {
    margin: 0 0 1.1em;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--indigo-hi);
    text-decoration: none;
    transition: color 0.18s var(--ease);
}

a:hover {
    color: var(--violet);
}

strong,
b {
    color: var(--white);
    font-weight: 600;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

hr {
    border: 0;
    border-top: 1px solid var(--line-soft);
    margin: 3rem 0;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

:focus-visible {
    outline: 2px solid var(--indigo-hi);
    outline-offset: 3px;
    border-radius: 3px;
}

::selection {
    background: rgba(108, 99, 255, 0.35);
    color: var(--white);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 200;
    background: var(--indigo);
    color: var(--white);
    padding: 0.7rem 1.1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: top 0.2s var(--ease);
}

.skip-link:focus {
    top: 1rem;
    color: var(--white);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section-y);
    position: relative;
}

.section--tight {
    padding-block: clamp(3rem, 6vw, 5rem);
}

/* Rack-unit style section marker: a hairline with the section label sitting on it. */
.rule {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.rule::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line) 0%, transparent 100%);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mist-dim);
    margin: 0;
    white-space: nowrap;
}

.eyebrow--accent {
    color: var(--sand);
}

.lede {
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    line-height: 1.65;
    color: var(--mist);
    max-width: 60ch;
}

.section-head {
    max-width: 62ch;
    margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.section-head h2 {
    margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 1.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1;
    cursor: pointer;
    text-align: center;
    transition: transform 0.18s var(--ease), background 0.18s var(--ease),
        border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), color 0.18s var(--ease);
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background: var(--indigo);
    color: var(--white);
    box-shadow: 0 8px 24px -10px rgba(108, 99, 255, 0.9);
}

.btn--primary:hover {
    background: var(--indigo-hi);
    color: var(--white);
    box-shadow: 0 12px 30px -10px rgba(108, 99, 255, 1);
}

.btn--ghost {
    background: transparent;
    color: var(--white);
    border-color: var(--line);
}

.btn--ghost:hover {
    color: var(--white);
    border-color: var(--indigo);
    background: var(--indigo-dim);
}

.btn--block {
    display: flex;
    width: 100%;
}

.btn--sm {
    padding: 0.6rem 1.15rem;
    font-size: 0.875rem;
}

.btn svg {
    width: 1em;
    height: 1em;
    flex: none;
}

/* --------------------------------------------------------------------------
   5. Navigation
   -------------------------------------------------------------------------- */

.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    padding-block: 1.1rem;
    border-bottom: 1px solid transparent;
    transition: background 0.28s var(--ease), border-color 0.28s var(--ease),
        padding 0.28s var(--ease), backdrop-filter 0.28s var(--ease);
}

.nav.is-stuck {
    background: rgba(11, 13, 24, 0.82);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
    border-bottom-color: var(--line-soft);
    padding-block: 0.7rem;
}

.nav__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--white);
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    flex: none;
}

.brand:hover {
    color: var(--white);
}

.brand img {
    width: 34px;
    height: 34px;
    flex: none;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

.nav__links a {
    display: block;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--mist);
    font-size: 0.925rem;
    font-weight: 500;
    transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.nav__links a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.nav__links a[aria-current="page"] {
    color: var(--white);
}

.nav__cta {
    flex: none;
}

.nav__toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--white);
    cursor: pointer;
}

.nav__toggle svg {
    width: 20px;
    height: 20px;
}

.nav__toggle .icon-close,
.nav__toggle[aria-expanded="true"] .icon-open {
    display: none;
}

.nav__toggle[aria-expanded="true"] .icon-close {
    display: block;
}

@media (max-width: 900px) {
    .nav__toggle {
        display: inline-flex;
    }

    .nav__menu {
        position: absolute;
        inset: 100% var(--gutter) auto var(--gutter);
        margin-top: 0.6rem;
        padding: 0.75rem;
        background: var(--ink-raised);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.8);
        display: none;
    }

    .nav__menu.is-open {
        display: block;
    }

    .nav__links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        margin-left: 0;
    }

    .nav__links a {
        padding: 0.7rem 0.85rem;
    }

    .nav__cta {
        margin-top: 0.6rem;
        display: flex;
    }

    .nav__cta .btn {
        width: 100%;
    }
}

@media (min-width: 901px) {
    .nav__menu {
        display: flex !important;
        align-items: center;
        gap: 1rem;
        flex: 1;
    }
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */

.hero {
    padding-top: clamp(7rem, 12vw, 9.5rem);
    padding-bottom: clamp(4rem, 8vw, 6.5rem);
    position: relative;
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: center;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.9rem 0.4rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mist);
    margin-bottom: 1.75rem;
}

.hero__badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 3px rgba(94, 214, 164, 0.16);
    flex: none;
    margin-left: 0.35rem;
}

.hero h1 {
    margin-bottom: 1.35rem;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(96deg, var(--violet) 0%, var(--sand) 78%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__lede {
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    max-width: 46ch;
    margin-bottom: 2rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 2.25rem;
}

.hero__proof {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--mist-dim);
}

.hero__proof li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.hero__proof svg {
    width: 13px;
    height: 13px;
    color: var(--mint);
    flex: none;
}

@media (max-width: 980px) {
    .hero__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero__lede {
        max-width: 60ch;
    }
}

/* --------------------------------------------------------------------------
   7. Signature: the allocator panel
   -------------------------------------------------------------------------- */

.allocator {
    background: linear-gradient(180deg, var(--panel) 0%, var(--ink-raised) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 30px 70px -35px rgba(0, 0, 0, 0.95);
}

.allocator__bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.02);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--mist-dim);
}

.allocator__bar .node {
    color: var(--mist);
}

.allocator__bar .spacer {
    flex: 1;
}

.allocator__game {
    color: var(--sand);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.allocator__body {
    padding: 1.1rem 1rem;
}

.allocator__grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 4px;
}

.cell {
    aspect-ratio: 1;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease),
        transform 0.3s var(--ease);
}

/* Occupied by servers that already exist on the node. */
.cell.is-used {
    background: rgba(108, 99, 255, 0.3);
    box-shadow: inset 0 0 0 1px rgba(108, 99, 255, 0.4);
}

/* The allocator sweeping for a free run. */
.cell.is-scanning {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(0.86);
}

/* Ports the AutoAllocator just claimed for this order. */
.cell.is-claimed {
    background: var(--sand);
    box-shadow: inset 0 0 0 1px var(--sand), 0 0 12px rgba(233, 207, 164, 0.45);
}

.cell.is-primary {
    background: #fff;
    box-shadow: inset 0 0 0 1px #fff, 0 0 16px rgba(255, 255, 255, 0.6);
}

.allocator__foot {
    border-top: 1px solid var(--line-soft);
    padding: 0.95rem 1rem 1.1rem;
    background: rgba(0, 0, 0, 0.2);
}

.allocator__json {
    font-family: var(--font-mono);
    font-size: 0.775rem;
    line-height: 1.75;
    color: var(--mist);
    margin: 0 0 0.7rem;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 3.2em;
}

.allocator__json .k {
    color: var(--violet);
}

.allocator__json .n {
    color: var(--sand);
}

.allocator__json .p {
    color: var(--mist-dim);
}

.allocator__status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.73rem;
    letter-spacing: 0.05em;
    color: var(--mist-dim);
    min-height: 1.4em;
}

.allocator__status.is-done {
    color: var(--mint);
}

.allocator__status svg {
    width: 13px;
    height: 13px;
    flex: none;
}

.allocator__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.1rem;
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mist-dim);
}

.allocator__legend li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.swatch {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    flex: none;
}

.swatch--free {
    background: rgba(255, 255, 255, 0.12);
}

.swatch--used {
    background: rgba(108, 99, 255, 0.55);
}

.swatch--claimed {
    background: var(--sand);
}

@media (max-width: 520px) {
    .allocator__grid {
        grid-template-columns: repeat(12, 1fr);
    }
}

/* --------------------------------------------------------------------------
   8. Cards & grids
   -------------------------------------------------------------------------- */

.grid {
    display: grid;
    gap: 1px;
    background: var(--line-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
}

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

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

/* Hairline-separated tiles, like slots in a rack. */
.tile {
    background: var(--ink);
    padding: clamp(1.5rem, 2.6vw, 2.1rem);
    transition: background 0.25s var(--ease);
}

.tile:hover {
    background: var(--ink-raised);
}

.tile__label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sand);
    margin-bottom: 1.1rem;
}

.tile h3 {
    margin-bottom: 0.55rem;
}

.tile p {
    font-size: 0.975rem;
    color: var(--mist);
    margin: 0;
}

.tile__icon {
    width: 34px;
    height: 34px;
    color: var(--indigo-hi);
    margin-bottom: 1rem;
}

@media (max-width: 880px) {
    .grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .grid--2,
    .grid--3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --------------------------------------------------------------------------
   9. Comparison
   -------------------------------------------------------------------------- */

.compare {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
}

.compare__cell {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.compare__cell--head {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mist-dim);
    background: rgba(255, 255, 255, 0.025);
    padding-block: 0.85rem;
}

.compare__cell--feature {
    color: var(--white);
    font-weight: 500;
}

.compare__col--ours {
    background: rgba(108, 99, 255, 0.06);
}

.compare__cell:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.compare svg {
    width: 17px;
    height: 17px;
    flex: none;
}

.compare .yes {
    color: var(--mint);
}

.compare .no {
    color: #5b6288;
}

.compare__note {
    color: var(--mist-dim);
    font-size: 0.9rem;
}

@media (max-width: 720px) {
    .compare {
        grid-template-columns: minmax(0, 1fr);
        border: 0;
        border-radius: 0;
    }

    .compare__cell {
        border: 0;
    }

    .compare__cell--head {
        display: none;
    }

    .compare__cell--feature {
        border-top: 1px solid var(--line-soft);
        margin-top: 0.9rem;
        padding-top: 1.4rem;
        font-family: var(--font-display);
        font-size: 1.05rem;
        font-weight: 700;
    }

    .compare__cell--val::before {
        font-family: var(--font-mono);
        font-size: 0.68rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--mist-dim);
        content: attr(data-col);
        min-width: 11ch;
    }

    .compare__cell {
        padding-block: 0.4rem;
    }
}

/* --------------------------------------------------------------------------
   10. Pricing
   -------------------------------------------------------------------------- */

.plans {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.plan {
    position: relative;
    background: var(--ink-raised);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 1.75rem 1.6rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.22s var(--ease), transform 0.22s var(--ease);
}

.plan:hover {
    border-color: var(--line);
    transform: translateY(-2px);
}

.plan--featured {
    background: linear-gradient(180deg, rgba(108, 99, 255, 0.14) 0%, var(--ink-raised) 55%);
    border-color: rgba(108, 99, 255, 0.5);
}

.plan__tag {
    position: absolute;
    top: -0.72rem;
    left: 1.6rem;
    background: var(--indigo);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 0.63rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
}

.plan__name {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mist-dim);
    margin-bottom: 1.1rem;
}

.plan__price {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.045em;
    color: var(--white);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.plan__price .cur {
    font-size: 1.35rem;
    color: var(--mist-dim);
    letter-spacing: 0;
}

.plan__price .per {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--mist-dim);
}

.plan__blurb {
    font-size: 0.925rem;
    color: var(--mist-dim);
    margin-bottom: 1.4rem;
}

.plan__features {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.75rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--line-soft);
    font-size: 0.925rem;
}

.plan__features li {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}

.plan__features svg {
    width: 16px;
    height: 16px;
    color: var(--indigo-hi);
    flex: none;
    margin-top: 0.24em;
}

.plan .btn {
    margin-top: auto;
}

.plan-note {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.plan-note__price {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.03em;
    flex: none;
}

.plan-note p {
    margin: 0;
    flex: 1 1 20ch;
    color: var(--mist-dim);
}

@media (max-width: 900px) {
    .plans {
        grid-template-columns: minmax(0, 1fr);
        max-width: 30rem;
    }
}

/* --------------------------------------------------------------------------
   11. Contact
   -------------------------------------------------------------------------- */

.contact {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.contact__channels {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1.75rem;
}

.channel {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    background: var(--ink-raised);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    color: var(--mist);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.channel:hover {
    border-color: var(--indigo);
    background: var(--panel);
    color: var(--white);
}

.channel svg {
    width: 20px;
    height: 20px;
    color: var(--indigo-hi);
    flex: none;
}

.channel__text {
    display: block;
    min-width: 0;
}

.channel b {
    display: block;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--white);
    word-break: break-word;
}

.channel small {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.73rem;
    color: var(--mist-dim);
    letter-spacing: 0.04em;
    line-height: 1.5;
}

.form {
    background: var(--ink-raised);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 3vw, 2rem);
}

.form__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mist-dim);
    margin-bottom: 0.5rem;
}

.field input,
.field textarea {
    width: 100%;
    padding: 0.8rem 0.95rem;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.field textarea {
    resize: vertical;
    min-height: 8rem;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #5c638a;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--indigo);
    background: #090b16;
}

.form__msg {
    display: none;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.925rem;
    margin-bottom: 1rem;
}

.form__msg.is-visible {
    display: block;
}

.form__msg.is-ok {
    background: rgba(94, 214, 164, 0.12);
    border: 1px solid rgba(94, 214, 164, 0.35);
    color: #9fe8c8;
}

.form__msg.is-error {
    background: rgba(255, 122, 122, 0.1);
    border: 1px solid rgba(255, 122, 122, 0.35);
    color: #ffb0b0;
}

@media (max-width: 820px) {
    .contact {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .form__row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */

.footer {
    border-top: 1px solid var(--line-soft);
    padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
    background: rgba(0, 0, 0, 0.25);
}

.footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
}

.footer__blurb {
    max-width: 34ch;
    font-size: 0.95rem;
    color: var(--mist-dim);
    margin-top: 1rem;
}

.footer h4 {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mist-dim);
    margin-bottom: 1rem;
}

.footer__links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.footer__links a {
    color: var(--mist);
}

.footer__links a:hover {
    color: var(--white);
}

.footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--line-soft);
    font-family: var(--font-mono);
    font-size: 0.73rem;
    letter-spacing: 0.05em;
    color: var(--mist-dim);
}

@media (max-width: 820px) {
    .footer__grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 2rem;
    }

    .footer__brand {
        grid-column: 1 / -1;
    }
}

/* --------------------------------------------------------------------------
   13. Page header (inner pages)
   -------------------------------------------------------------------------- */

.page-head {
    padding-top: clamp(7.5rem, 13vw, 10rem);
    padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
    border-bottom: 1px solid var(--line-soft);
}

.page-head h1 {
    font-size: clamp(2.25rem, 4.6vw, 3.4rem);
    margin-bottom: 0.75rem;
}

.page-head .lede {
    max-width: 56ch;
}

.page-head .eyebrow {
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   14. Docs layout
   -------------------------------------------------------------------------- */

.docs {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    padding-block: clamp(3rem, 6vw, 4.5rem);
    align-items: start;
}

.docs > * {
    min-width: 0;
}

.toc {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc h2 {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mist-dim);
    margin-bottom: 0.9rem;
    letter-spacing: 0.16em;
}

.toc ul {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--line-soft);
}

.toc a {
    display: block;
    padding: 0.45rem 0 0.45rem 0.95rem;
    margin-left: -1px;
    border-left: 1px solid transparent;
    color: var(--mist-dim);
    font-size: 0.9rem;
    line-height: 1.45;
    transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.toc a:hover {
    color: var(--white);
}

.toc a.is-active {
    color: var(--white);
    border-left-color: var(--indigo);
}

.doc-section {
    scroll-margin-top: 100px;
    padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
    border-bottom: 1px solid var(--line-soft);
}

.doc-section:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.doc-section h2 {
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    margin-bottom: 1.25rem;
}

.doc-section h3 {
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
}

.doc-section p,
.doc-section li {
    max-width: 74ch;
}

.doc-section ol.steps {
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.doc-section ol.steps li {
    counter-increment: step;
    position: relative;
    padding-left: 2.6rem;
}

.doc-section ol.steps li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0.15em;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--sand);
    letter-spacing: 0.08em;
}

.doc-section ul.bullets {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0 0 1.5rem;
}

.doc-section ul.bullets li {
    position: relative;
    padding-left: 1.35rem;
}

.doc-section ul.bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: var(--indigo);
}

@media (max-width: 960px) {
    .docs {
        grid-template-columns: minmax(0, 1fr);
    }

    .toc {
        position: static;
        max-height: none;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--line-soft);
    }

    .toc ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
        border-left: 0;
    }

    .toc a {
        padding: 0.4rem 0.8rem;
        margin-left: 0;
        border: 1px solid var(--line-soft);
        border-radius: 999px;
        font-size: 0.85rem;
    }

    .toc a.is-active {
        border-color: var(--indigo);
    }
}

/* --------------------------------------------------------------------------
   15. Code, tables, callouts
   -------------------------------------------------------------------------- */

.code {
    position: relative;
    background: #080a14;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    margin: 0 0 1.5rem;
    max-width: 74ch;
}

.code pre {
    margin: 0;
    padding: 1rem 3.5rem 1rem 1.1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--mist);
    tab-size: 2;
}

.code .k {
    color: var(--violet);
}

.code .n {
    color: var(--sand);
}

.code .s {
    color: #8fd7b4;
}

.code .c {
    color: #565d84;
}

.copy {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--mist-dim);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.18s var(--ease), color 0.18s var(--ease),
        border-color 0.18s var(--ease);
}

.code:hover .copy,
.copy:focus-visible {
    opacity: 1;
}

.copy:hover {
    color: var(--white);
    border-color: var(--indigo);
}

.copy.is-done {
    color: var(--mint);
    border-color: rgba(94, 214, 164, 0.4);
    opacity: 1;
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line-soft);
    border-radius: 4px;
    padding: 0.1em 0.38em;
    color: var(--sand);
}

.code code {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Reference tables for template vars / config options */
.ref {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.ref__row {
    display: grid;
    grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr);
    gap: 0 1.5rem;
    padding: 0.75rem 1.15rem;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.94rem;
    align-items: baseline;
}

.ref__row:last-child {
    border-bottom: 0;
}

.ref__row:nth-child(odd) {
    background: rgba(255, 255, 255, 0.017);
}

.ref__key {
    font-family: var(--font-mono);
    font-size: 0.83rem;
    color: var(--sand);
    word-break: break-word;
}

.ref__val {
    color: var(--mist);
}

@media (max-width: 620px) {
    .ref__row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.25rem;
    }
}

/* Field reference with longer descriptions */
.fields {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--line-soft);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.fields > div {
    background: var(--ink);
    padding: 1.05rem 1.25rem;
}

.fields dt {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--white);
    margin-bottom: 0.35rem;
}

.fields dd {
    margin: 0;
    font-size: 0.945rem;
    color: var(--mist);
    max-width: 74ch;
}

.note {
    display: flex;
    gap: 0.9rem;
    padding: 1rem 1.2rem;
    background: rgba(108, 99, 255, 0.07);
    border: 1px solid rgba(108, 99, 255, 0.28);
    border-radius: var(--radius-sm);
    margin: 0 0 1.5rem;
    max-width: 74ch;
    font-size: 0.945rem;
}

.note--warn {
    background: rgba(233, 207, 164, 0.07);
    border-color: rgba(233, 207, 164, 0.3);
}

.note svg {
    width: 18px;
    height: 18px;
    flex: none;
    margin-top: 0.2em;
    color: var(--indigo-hi);
}

.note--warn svg {
    color: var(--sand);
}

.note p {
    margin: 0;
}

/* --------------------------------------------------------------------------
   16. Screenshots and lightbox
   -------------------------------------------------------------------------- */

.shots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.shot {
    position: relative;
    display: block;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--panel);
    overflow: hidden;
    cursor: zoom-in;
    flex: 0 1 244px;
    max-width: 100%;
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.shot:hover {
    border-color: var(--indigo);
    transform: translateY(-2px);
}

.shot img {
    width: 100%;
    height: 138px;
    display: block;
    object-fit: contain;
    padding: 10px;
}

/* Thumbnails need to look openable on touch too, not only on hover. */
.shot::after {
    content: "View";
    position: absolute;
    right: 7px;
    bottom: 7px;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    background: rgba(11, 13, 24, 0.86);
    border: 1px solid var(--line);
    color: var(--mist);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.shot:hover::after {
    background: var(--indigo);
    border-color: var(--indigo);
    color: var(--white);
}

/* A full-width figure that still opens in the lightbox. */
.shots--wide .shot {
    flex: 1 1 100%;
    max-width: 100%;
}

.shots--wide .shot img {
    height: auto;
    max-height: 440px;
    padding: 14px;
}

.caption {
    margin: -0.75rem 0 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: var(--mist-dim);
    max-width: 74ch;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 5vw, 3rem);
    background: rgba(5, 6, 13, 0.9);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.lightbox.is-open {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 88vh;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 1);
}

.lightbox__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
}

.lightbox__close svg {
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------------------------------
   17. CTA strip
   -------------------------------------------------------------------------- */

.cta-strip {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(2.25rem, 5vw, 3.5rem);
    background:
        radial-gradient(120% 140% at 12% 0%, rgba(108, 99, 255, 0.28), transparent 62%),
        radial-gradient(90% 120% at 92% 100%, rgba(233, 207, 164, 0.12), transparent 60%),
        var(--ink-raised);
    text-align: center;
}

.cta-strip h2 {
    margin-bottom: 0.75rem;
}

.cta-strip p {
    max-width: 52ch;
    margin-inline: auto;
    margin-bottom: 1.75rem;
}

.cta-strip__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   18. Reveal on scroll
   -------------------------------------------------------------------------- */

/* Scoped to .js so content stays visible when scripting is off. */
.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.js .reveal.is-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

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