:root {
    color-scheme: dark;
    --bg: #050505;
    --panel: rgba(12, 12, 11, 0.82);
    --panel-strong: rgba(16, 15, 13, 0.94);
    --line: rgba(234, 214, 167, 0.18);
    --line-strong: rgba(234, 214, 167, 0.36);
    --text: #f3eee2;
    --muted: #a69d8c;
    --soft: #d2c2a0;
    --sand: #d8a84f;
    --sand-bright: #f0d38b;
    --dark-sand: #86652b;
    --success: #74e5a0;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Menlo, monospace;
    --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 18% 8%, rgba(189, 134, 46, 0.14), transparent 32rem),
        radial-gradient(circle at 78% 0%, rgba(255, 255, 255, 0.06), transparent 28rem),
        linear-gradient(180deg, #030303 0%, #090807 52%, #050505 100%);
    color: var(--text);
    font-family: var(--sans);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.16;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 74%);
}

a {
    color: inherit;
}

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.sandscapes-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.hero {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.52fr);
    align-items: stretch;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero__canvas {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0.82;
}

.hero__canvas::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5, 5, 5, 0.06) 0%, rgba(5, 5, 5, 0.16) 44%, rgba(5, 5, 5, 0.82) 73%, #050505 100%),
        linear-gradient(180deg, rgba(5, 5, 5, 0.08) 0%, rgba(5, 5, 5, 0.22) 60%, #050505 100%);
}

.hero__canvas img {
    width: 74vw;
    height: 100%;
    object-fit:contain;
    filter: saturate(0.9) contrast(1.08) brightness(0.86);
}

.hero__content,
.hero__panel {
    position: relative;
    z-index: 2;
}

.hero__content {
    align-self: center;
    padding: clamp(28px, 5vw, 80px);
    max-width: 760px;
}

.brand-link {
    display: inline-flex;
    margin-bottom: clamp(42px, 10vh, 110px);
    color: var(--text);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.86rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.meta-line,
.section-heading p,
.token-controls label,
.token-controls p,
.facts dt,
.page-footer,
.expansion-card small {
    color: var(--muted);
}

.meta-line {
    margin: 0 0 14px;
    font-family: var(--mono);
    font-size: 0.76rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1,
h2,
p {
    text-wrap: pretty;
}

h1 {
    margin: 0;
    font-size: clamp(4.7rem, 11vw, 10.8rem);
    line-height: 0.86;
    font-weight: 300;
    letter-spacing: 0;
}

.lede {
    max-width: 620px;
    margin: 28px 0 0;
    color: #ddd4c5;
    font-size: clamp(1.08rem, 1.6vw, 1.42rem);
    line-height: 1.55;
}

.hero__actions,
.page-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero__actions {
    margin-top: 34px;
}

.hero__actions a,
.page-footer a,
.token-search-row button,
.restart-renderer,
.viewer-links a,
.token-stepper button,
.statement-grid a {
    border: 1px solid var(--line-strong);
    background: rgba(9, 9, 8, 0.66);
    color: var(--text);
    text-decoration: none;
    padding: 11px 14px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.hero__actions a:hover,
.page-footer a:hover,
.token-search-row button:hover,
.restart-renderer:hover,
.viewer-links a:hover,
.token-stepper button:hover,
.statement-grid a:hover {
    border-color: var(--sand-bright);
    color: var(--sand-bright);
    background: rgba(216, 168, 79, 0.1);
}

.hero__panel {
    align-self: center;
    margin: 74px clamp(20px, 4vw, 56px) 44px 0;
    padding: 18px;
    border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, rgba(12, 12, 10, 0.82), rgba(5, 5, 5, 0.88));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.token-frame {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #010101;
    border: 1px solid var(--line);
    overflow: hidden;
    isolation: isolate;
}

.token-frame img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit:contain;
    display: block;
    opacity: 1;
}

.token-frame__label {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 30px;
    border: 1px solid rgba(234, 214, 167, 0.24);
    background: rgba(0, 0, 0, 0.54);
    color: var(--text);
    padding: 0 10px;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
}

.token-frame__label span:first-child {
    color: var(--sand-bright);
}

.simulation-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 3;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(116, 229, 160, 0.38);
    background: rgba(0, 0, 0, 0.46);
    color: var(--success);
    padding: 0 9px;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    pointer-events: none;
}

.token-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    box-shadow:
        inset 0 0 0 1px rgba(240, 211, 139, 0.08),
        inset 0 0 80px rgba(0, 0, 0, 0.34);
}

.token-controls {
    padding-top: 18px;
}

.token-controls label {
    display: block;
    margin: 14px 0 8px;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.token-controls label:first-child {
    margin-top: 0;
}

#token-select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: rgba(0, 0, 0, 0.64);
    color: var(--text);
    padding: 0 12px;
    outline: none;
}

.token-search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.token-search-row input {
    min-width: 0;
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: rgba(0, 0, 0, 0.52);
    color: var(--text);
    padding: 0 12px;
    outline: none;
}

.token-search-row input:focus,
#token-select:focus {
    border-color: var(--sand-bright);
    box-shadow: 0 0 0 3px rgba(216, 168, 79, 0.12);
}

.token-controls p {
    margin: 10px 0 14px;
    font-size: 0.86rem;
    line-height: 1.4;
}

.holder-card {
    display: grid;
    gap: 7px;
    margin: 12px 0 10px;
    padding: 12px;
    border: 1px solid rgba(234, 214, 167, 0.2);
    background: rgba(255, 255, 255, 0.035);
}

.holder-card > span {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.holder-card a {
    display: grid;
    gap: 3px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.holder-card a:hover strong {
    color: var(--sand-bright);
}

.holder-card strong,
.holder-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.holder-card strong {
    font-family: var(--mono);
    font-size: 0.86rem;
    font-weight: 500;
}

.holder-card small {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.68rem;
}

.renderer-status {
    min-height: 42px;
    padding: 10px;
    border: 1px solid rgba(116, 229, 160, 0.22);
    background: rgba(116, 229, 160, 0.06);
    color: #b8f1cd !important;
}

.token-stepper {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

#selected-token-label {
    min-height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.035);
    font-family: var(--mono);
    color: var(--sand-bright);
    letter-spacing: 0.12em;
}

.restart-renderer {
    width: 100%;
    margin-top: 8px;
}

.statement-grid,
.external-links,
.expansions,
.page-footer {
    margin: 0 auto;
    width: min(100% - 40px, 1480px);
}

.external-links,
.expansions {
    padding: clamp(36px, 6vw, 76px) 0 0;
}

.section-heading {
    display: grid;
    grid-template-columns: minmax(220px, 0.35fr) minmax(0, 0.65fr);
    gap: 24px;
    align-items: end;
    margin-bottom: 20px;
}

.section-heading h2,
.statement-grid h2 {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.9rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 500;
}

.section-heading p {
    margin: 0;
    line-height: 1.55;
}

.statement-grid {
    display: grid;
    grid-template-columns: 1fr 0.88fr 1fr;
    border: 1px solid var(--line);
    margin-top: clamp(36px, 6vw, 76px);
    background: rgba(5, 5, 5, 0.42);
}

.viewer-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.link-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.link-card-grid a {
    display: grid;
    gap: 12px;
    padding: 14px;
    min-height: 220px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.link-card-grid a:hover {
    border-color: var(--sand-bright);
    background: rgba(216, 168, 79, 0.08);
    transform: translateY(-2px);
}

.link-card-grid img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit:contain;
    border: 1px solid var(--line);
    filter: saturate(0.84) contrast(1.06);
}

.link-card-grid span {
    color: var(--text);
    font-size: clamp(1rem, 1.4vw, 1.22rem);
}

.link-card-grid small {
    color: var(--muted);
    line-height: 1.45;
}

.statement-grid article {
    padding: clamp(22px, 3vw, 34px);
    min-height: 300px;
}

.statement-grid article + article {
    border-left: 1px solid var(--line);
}

.statement-grid p {
    color: #d7cebf;
    line-height: 1.62;
}

.facts {
    display: grid;
    gap: 10px;
    margin: 20px 0 0;
}

.facts div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 18px;
}

.facts dt,
.facts dd {
    margin: 0;
}

.facts dt {
    font-family: var(--mono);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.facts dd {
    overflow-wrap: anywhere;
}

.facts a {
    color: var(--sand-bright);
    text-decoration-color: rgba(240, 211, 139, 0.4);
}

.expansion-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.expansion-card {
    display: grid;
    grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
    text-decoration: none;
    min-height: 150px;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.expansion-card:hover {
    border-color: var(--sand-bright);
    background: rgba(216, 168, 79, 0.08);
    transform: translateY(-2px);
}

.expansion-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit:contain;
    border: 1px solid var(--line);
    filter: saturate(0.82) contrast(1.05);
}

.expansion-card span,
.expansion-card small {
    grid-column: 2;
}

.expansion-card span {
    font-size: clamp(1.18rem, 2vw, 1.6rem);
    color: var(--text);
}

.expansion-card small {
    line-height: 1.45;
}

.page-footer {
    margin-top: clamp(36px, 6vw, 72px);
    padding: 28px 0 34px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.page-footer p {
    margin: 0;
    font-size: 0.9rem;
}

@media (max-width: 1120px) {
    .hero {
        grid-template-columns: 1fr;
        padding-top: 24px;
    }

    .hero__canvas img {
        width: 100%;
    }

    .hero__canvas::after {
        background:
            linear-gradient(180deg, rgba(5, 5, 5, 0.12) 0%, rgba(5, 5, 5, 0.72) 62%, #050505 100%);
    }

    .hero__content {
        padding-bottom: 24px;
    }

    .hero__panel {
        margin: 0 auto 32px;
        width: min(100% - 40px, 620px);
    }

    .statement-grid {
        grid-template-columns: 1fr;
    }

    .statement-grid article + article {
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 760px) {
    .hero__content {
        padding: 24px 20px;
    }

    .brand-link {
        margin-bottom: 58px;
    }

    h1 {
        font-size: clamp(3.1rem, 17vw, 4.6rem);
        line-height: 0.94;
    }

    .hero__actions {
        display: grid;
    }

    .section-heading,
    .expansion-grid,
    .link-card-grid,
    .page-footer {
        grid-template-columns: 1fr;
    }

    .statement-grid,
    .external-links,
    .expansions,
    .page-footer {
        width: min(100% - 28px, 1480px);
    }

    .viewer-links {
        grid-template-columns: 1fr;
    }


    .expansion-card {
        grid-template-columns: 1fr;
    }

    .expansion-card span,
    .expansion-card small {
        grid-column: auto;
    }

    .page-footer {
        display: grid;
        align-items: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
