:root {
    --bg: #000000;
    --bg-soft: #0b0b0c;
    --bg-card: #0e0e10;
    --fg: #ededee;
    --fg-mute: #8a8a8d;
    --fg-faint: #2a2a2c;
    --line: rgba(237, 237, 238, 0.07);
    --line-strong: rgba(237, 237, 238, 0.16);
    --accent: #d2a86a;
    --accent-soft: rgba(210, 168, 106, 0.10);
    --accent-bright: #e6bf7f;
    --green: #6ec48a;
    --red: #d27a7a;
    --sans: 'Geist', system-ui, -apple-system, sans-serif;
    --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.shell {
    height: 100vh;
    display: grid;
    grid-template-rows: 68px 1fr 42px;
    padding: 0 56px;
    max-width: 1320px;
    margin: 0 auto;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

main {
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    color: var(--fg-mute);
    font-size: 12px;
    font-family: var(--mono);
}

.brand {
    font-weight: 500;
    font-size: 16px;
    letter-spacing: -0.01em;
    color: var(--fg);
    display: flex;
    align-items: center;
    gap: 9px;
}

.brand .dot {
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

nav {
    display: flex;
    gap: 28px;
    align-items: center;
}

nav button {
    background: none;
    border: none;
    color: var(--fg-mute);
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    padding: 6px 0;
    position: relative;
    transition: color 180ms ease;
}

nav button:hover { color: var(--fg); }

nav button.active {
    color: var(--accent);
    font-weight: 500;
}

nav button.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: var(--accent);
}

.connect {
    margin-left: 14px;
    padding: 9px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    color: var(--fg);
    background: transparent;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 180ms ease;
    white-space: nowrap;
}

.connect:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.connect.connected {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.connect.wrong-chain {
    border-color: var(--red);
    color: var(--red);
}

.pane {
    display: none;
    height: 100%;
    flex-direction: column;
    padding: 28px 0;
    animation: fade 320ms ease forwards;
}

.pane.active { display: flex; }

@keyframes fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── MINT PANE ──────────────────────────────────────────── */
.mint-pane { justify-content: space-between; height: 100%; }

.mint-top {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 52px;
    align-items: stretch;
}

.mint-card {
    border: 1px solid var(--line-strong);
    background: var(--bg-card);
    padding: 30px 32px 26px;
    border-radius: 2px;
    position: relative;
}

.mint-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
    opacity: 0.6;
}

.mint-title {
    font-size: 26px;
    font-weight: 400;
    color: var(--fg);
    margin-bottom: 5px;
    letter-spacing: -0.018em;
}

.mint-title .em { color: var(--accent); }

.mint-sub {
    color: var(--fg-mute);
    font-size: 13px;
    margin-bottom: 24px;
    font-family: var(--mono);
}

.field { margin-bottom: 14px; }

.field-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--fg-mute);
    font-family: var(--mono);
    margin-bottom: 7px;
}

.field-label .max {
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    font-family: var(--mono);
}
.field-label .max:hover { opacity: 0.75; }

.input {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--fg);
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 400;
    padding: 14px 16px;
    outline: none;
    border-radius: 2px;
    transition: border-color 160ms ease;
}

.input:focus { border-color: var(--accent); }

.input.readonly {
    color: var(--fg-mute);
    background: transparent;
    pointer-events: none;
}

.mint-btn {
    width: 100%;
    margin-top: 14px;
    padding: 15px;
    background: var(--accent);
    color: #0a0a0a;
    border: none;
    border-radius: 2px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: all 200ms ease;
}

.mint-btn:hover:not(:disabled) { background: var(--accent-bright); }

.mint-btn:disabled {
    background: var(--fg-faint);
    color: var(--fg-mute);
    cursor: not-allowed;
}

.mint-warn {
    margin-top: 11px;
    font-size: 12px;
    color: var(--fg-mute);
    text-align: center;
    line-height: 1.55;
    font-family: var(--mono);
}

.stats-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 14px;
}

.stat {
    border: 1px solid var(--line);
    background: var(--bg-card);
    padding: 20px 20px;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-label {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--fg-mute);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-value {
    font-family: var(--sans);
    font-size: 32px;
    font-weight: 300;
    color: var(--fg);
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-value.accent { color: var(--accent); }

.stat-value .unit {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 400;
    color: var(--fg-mute);
    margin-left: 6px;
    letter-spacing: 0;
}

.stat-meta {
    margin-top: 9px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--fg-mute);
}

.live-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 0.06em;
}

.live-tag::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

/* ─── ABOUT STRIP (mint page bottom) ─────────────────────── */
.about-strip {
    margin-top: 36px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 2.4fr;
    gap: 60px;
    align-items: start;
}

.about-headline {
    font-size: 18px;
    color: var(--fg);
    font-weight: 400;
    letter-spacing: -0.012em;
    line-height: 1.35;
}

.about-headline .em { color: var(--accent); }

.about-desc {
    font-size: 14px;
    color: var(--fg);
    line-height: 1.6;
    max-width: 720px;
}

.about-desc p { margin-bottom: 9px; }
.about-desc p.mute { color: var(--fg-mute); font-size: 13px; }
.about-desc .hi { color: var(--accent); font-weight: 500; }

/* ─── PAPER PANE ─────────────────────────────────────────── */
.paper {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 56px;
    height: 100%;
    align-content: start;
    padding-top: 14px;
}

.paper-meta .label {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--fg-mute);
    margin-bottom: 11px;
}

.paper-meta .title {
    font-size: 30px;
    font-weight: 400;
    color: var(--fg);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.paper-meta .title .em { color: var(--accent); }

.paper-meta .meta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--fg-mute);
    line-height: 1.7;
    margin-bottom: 22px;
}

.paper-download {
    display: inline-block;
    padding: 9px 15px;
    border: 1px solid var(--line-strong);
    color: var(--fg);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 12px;
    border-radius: 2px;
    transition: all 180ms ease;
}

.paper-download:hover { border-color: var(--accent); color: var(--accent); }

.paper-body {
    column-count: 2;
    column-gap: 38px;
    column-rule: 1px solid var(--line);
    font-size: 13px;
    line-height: 1.65;
    color: var(--fg);
    max-height: 100%;
    overflow: hidden;
}

.paper-body section { break-inside: avoid; margin-bottom: 13px; }

.paper-body h4 {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 6px;
}

.paper-body p { margin-bottom: 9px; color: var(--fg); }
.paper-body p.mute { color: var(--fg-mute); }

.paper-body b {
    color: var(--accent);
    font-weight: 500;
}

.paper-body .arrow { display: inline-block; color: var(--accent); margin: 0 4px; }

.paper-body .arb-row {
    display: grid;
    gap: 5px;
    margin: 7px 0 9px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--fg-mute);
    line-height: 1.55;
}

.paper-body .arb-row b { color: var(--accent); font-weight: 500; }

/* indented formula block, sato-style */
.paper-body .formula {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--fg);
    background: var(--bg-card);
    border-left: 1px solid var(--accent);
    padding: 8px 12px;
    margin: 7px 0 9px;
    line-height: 1.7;
    letter-spacing: 0;
}

.paper-body .formula sub,
.paper-body .formula sup {
    font-size: 9px;
    color: var(--fg-mute);
}

/* spec table for §05 */
.paper-body .spec {
    font-family: var(--mono);
    font-size: 11.5px;
    margin-top: 4px;
}

.paper-body .spec-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px dotted var(--line);
    padding: 4px 0;
    color: var(--fg-mute);
    gap: 16px;
}

.paper-body .spec-row:last-child {
    border-bottom: none;
}

.paper-body .spec-row > span:first-child {
    color: var(--fg-mute);
}

.paper-body .spec-row > span:last-child {
    color: var(--fg);
    text-align: right;
}

.paper-body .spec-row sub,
.paper-body .spec-row sup {
    font-size: 9px;
    color: var(--fg-mute);
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer-left {
    display: flex;
    gap: 24px;
    align-items: center;
}

.footer-left a {
    color: var(--fg-mute);
    text-decoration: none;
    transition: color 160ms ease;
}

.footer-left a:hover { color: var(--accent); }

.footer-version .dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    margin: 0 8px;
    vertical-align: middle;
}

.toast {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--fg);
    padding: 13px 22px;
    font-size: 13px;
    font-family: var(--mono);
    border-radius: 2px;
    opacity: 0;
    pointer-events: none;
    transition: all 240ms ease;
    z-index: 100;
    max-width: 90%;
    text-align: center;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 980px) {
    .shell { padding: 0 24px; }
    .mint-top { grid-template-columns: 1fr; }
    .stats-col { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
    .about-strip { grid-template-columns: 1fr; gap: 18px; }
    .paper { grid-template-columns: 1fr; }
    .paper-body { column-count: 1; }
}
