@font-face {
    font-family: "Bricolage Grotesque";
    src: url("/_ethna/v6/bricolage.woff2") format("woff2");
    font-weight: 400 800;
    font-display: swap;
}
:root {
    color-scheme: light;
    --paper: #eeede7;
    --paper-2: #e3e1d7;
    --white: #fbfaf6;
    --ink: #121211;
    --soft: #57564f;
    --hair: rgba(18, 18, 17, 0.17);
    --accent: #c84b24;
    --accent-deep: #9e3716;
    --alert: #a62614;
    --display: "Bricolage Grotesque", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    --text: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    --mono: "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 1rem/1.62 var(--text);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
code { font-family: var(--mono); }
.wrap { width: min(76rem, 100% - 3rem); margin-inline: auto; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.bar { }
.bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 3.5rem;
}
.mark {
    display: inline-flex;
    align-items: center;
    flex: none;
    text-decoration: none;
}
.mark img {
    display: block;
    width: auto;
    height: 2rem;
}
.bar nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2rem); font-size: 0.92rem; }
.bar nav > a { text-decoration: none; }
.lang { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--soft); font: 500 0.88rem/1 var(--mono); }
.lang a { display: inline-flex; align-items: center; min-height: 2.25rem; padding-inline: 0.15rem; text-decoration: none; }
.lang a[aria-current] { color: var(--ink); font-weight: 700; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 3rem;
    padding: 0 1.4rem;
    border: 0;
    border-radius: 0;
    background: var(--ink);
    color: var(--paper);
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 120ms linear;
}
.btn:hover { background: var(--accent); color: var(--white); }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }

.field {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--ink);
    background: var(--white);
}
.field:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.field.is-invalid { border-color: var(--alert); }
.field input {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    font: 500 1.12rem/1.3 var(--mono);
}
.field input:focus { outline: none; }
.field input::placeholder { color: #8c8a82; opacity: 1; }
.field .btn { min-height: auto; padding-inline: 1.6rem; }
.field-label { display: block; margin-bottom: 0.5rem; font: 500 0.82rem/1.4 var(--mono); }

.yes, .no { font: 500 0.82rem/1.4 var(--mono); white-space: nowrap; }
.yes::before {
    content: "✓ ";
    color: var(--ink);
    font-weight: 700;
}
.no { color: var(--soft); }
.no::before { content: "— "; }

@media (max-width: 34rem) {
    .wrap { width: calc(100% - 2rem); }
    .field { flex-direction: column; }
    .field .btn { min-height: 3rem; }
}
.skip {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 5;
    padding: 0.6rem 0.9rem;
    background: var(--ink);
    color: var(--paper);
    transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* Hero: identity + address field on the left, the na.me sum on the right. */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    align-items: end;
    gap: 3rem clamp(3rem, 6vw, 6rem);
    padding-block: clamp(2rem, 7vw, 6.25rem) clamp(3rem, 7vw, 6rem);
}
h1 {
    max-width: 13ch;
    font: 800 clamp(2.45rem, 6.3vw, 5.8rem)/0.98 var(--display);
    letter-spacing: -0.05em;
    text-wrap: balance;
}
:lang(zh-CN) h1 {
    max-width: 10em;
    font-size: clamp(2.3rem, 5.5vw, 5rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
/* Headline keyword highlight sweep (eth.limo-inspired, adapted to cobalt ink). */
.h1-key {
    position: relative;
    display: inline-block;
    z-index: 0;
}
.h1-key::after {
    content: "";
    position: absolute;
    left: -0.03em;
    right: -0.03em;
    bottom: 0.04em;
    height: 0.16em;
    z-index: -1;
    background: rgba(200, 75, 36, 0.14);
    transform-origin: left;
    animation: h1-sweep 620ms cubic-bezier(0.22, 1, 0.36, 1) 180ms both;
}
@keyframes h1-sweep { from { transform: scaleX(0); } }

.hero-lead {
    max-width: 34rem;
    margin-top: 1.1rem;
    color: var(--soft);
    font-size: clamp(0.98rem, 1.4vw, 1.1rem);
}
.open { max-width: 40rem; margin-top: clamp(1.4rem, 3.5vw, 2.25rem); }
.btn-arrow, .ext-arrow {
    display: inline-block;
    transition: transform 130ms cubic-bezier(0.22, 1, 0.36, 1);
}
.btn:hover .btn-arrow { transform: translateX(3px); }
.btn:active .btn-arrow { transform: translateX(1px); }

.form-error {
    margin-top: 0.75rem;
    padding-left: 0.85rem;
    border-left: 3px solid var(--alert);
    font-size: 0.95rem;
}
.form-error strong { color: var(--alert); }
.preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.7rem;
    margin-top: 0.75rem;
    font: 500 0.92rem/1.5 var(--mono);
}
.preview-k { color: var(--soft); }
.preview-k::after { content: " →"; }
.preview.is-bad .preview-k { color: var(--alert); }
.preview.is-bad .preview-k::after { content: ""; }
.preview.is-bad .preview-v { color: var(--soft); font-family: var(--text); font-size: 0.9rem; }
.preview-v { min-width: 0; overflow-wrap: anywhere; }
.na { color: var(--accent); }
.examples { margin-top: 1.1rem; color: var(--soft); font-size: 0.92rem; }
.examples a { margin-right: 1rem; color: var(--ink); font-family: var(--mono); font-size: 0.88rem; white-space: nowrap; }

.eq { --eq: clamp(1.4rem, 3vw, 2.55rem); }
.eq-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.6rem;
    font: 500 0.82rem/1.4 var(--mono);
}
.eq-replay {
    padding: 0.35rem 0;
    border: 0;
    background: none;
    color: var(--soft);
    font: inherit;
    cursor: pointer;
}
.eq-replay:hover { color: var(--accent); }
.eq-body { padding-top: 0.75rem; }
.eq-row {
    display: grid;
    grid-template-columns: 1.4em minmax(0, 1fr);
    column-gap: 0.3em;
    color: inherit;
    font-size: var(--eq);
    text-decoration: none;
}
.eq-op { color: var(--soft); font: 500 1em/1.2 var(--mono); }
.eq-v {
    min-width: 0;
    font: 600 1em/1.2 var(--mono);
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}
.eq-note {
    grid-column: 2;
    margin: 0.25rem 0 1.25rem;
    color: var(--soft);
    font-size: 0.84rem;
    line-height: 1.45;
}
.ghost { visibility: hidden; }
.eq-b .na { display: inline-block; }
.eq-rule { height: 1px; margin: 0 0 0.9rem; background: var(--hair); transform-origin: left; }
.eq-c .na { display: inline-block; }
.eq-c:hover { color: inherit; }
.eq-c:hover .eq-v { color: var(--accent); }
.eq-c .eq-note { color: var(--ink); }

.eq.is-in .eq-b .na { animation: eq-slide 520ms cubic-bezier(0.2, 0.8, 0.2, 1) 80ms both; }
.eq.is-in .eq-rule { animation: eq-draw 380ms cubic-bezier(0.6, 0, 0.2, 1) 520ms both; }
.eq.is-in .eq-c .na { animation: eq-type 440ms steps(5, end) 840ms both; }
.eq.is-sync .eq-c .na { animation: eq-type 280ms steps(5, end) both; }
@keyframes eq-slide { from { transform: translateX(2.2em); opacity: 0; } }
@keyframes eq-draw { from { transform: scaleX(0); } }
@keyframes eq-type { from { clip-path: inset(0 100% 0 0); } }

/* Scroll reveal + stagger (progressive enhancement: visible without JS). */
.has-motion [data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 380ms cubic-bezier(0.22, 1, 0.36, 1), transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}
.has-motion [data-reveal]:nth-child(2) { transition-delay: 55ms; }
.has-motion [data-reveal]:nth-child(3) { transition-delay: 110ms; }
.has-motion [data-reveal]:nth-child(4) { transition-delay: 165ms; }
.has-motion [data-reveal].is-shown {
    opacity: 1;
    transform: none;
}

/* Numbered sections */
.sec { padding-block: clamp(3.5rem, 8.5vw, 6.75rem); }
.sec-grid { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1.25rem 3.5rem; }
.sec-no { font: 500 0.85rem/1.5 var(--mono); }
.sec-no span {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--accent);
    font: 800 clamp(2.4rem, 4.6vw, 3.8rem)/1 var(--display);
    letter-spacing: -0.04em;
}
h2 {
    max-width: 20ch;
    font: 780 clamp(1.85rem, 4.1vw, 3.25rem)/1.06 var(--display);
    letter-spacing: -0.035em;
    text-wrap: balance;
}
:lang(zh-CN) h2 { max-width: 16em; line-height: 1.2; letter-spacing: -0.01em; }
.lead { max-width: 40rem; margin-top: 0.9rem; color: var(--soft); font-size: 1.05rem; }

.routes, .trace { margin-top: 2.25rem; }
.route {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1.25rem 2.75rem;
    padding-block: 2.1rem;
    border-bottom: 1px solid var(--hair);
}
.route-key, .trace-n { color: var(--accent); font: 800 1.6rem/1.15 var(--display); }
.route-url {
    display: inline-block;
    font: 600 clamp(1.15rem, 2.4vw, 1.8rem)/1.25 var(--mono);
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}
.route-url:hover .ext-arrow, .trace p a:hover .ext-arrow {
    transform: translate(3px, -3px);
}
.route h3 { margin-top: 0.9rem; font: 700 1rem/1.4 var(--text); }
.route p { margin-top: 0.35rem; color: var(--soft); }
.route-meta div {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 0.75rem;
    padding-block: 0.55rem;
    border-top: 1px solid var(--hair);
    font-size: 0.9rem;
}
.route-meta div:first-child { padding-top: 0.25rem; border-top: 0; }
.route-meta dt { color: var(--soft); }
.route-meta code { font-size: 0.85rem; overflow-wrap: anywhere; }
.native { margin-top: 1.25rem; color: var(--soft); font-size: 0.92rem; }
.native a { color: var(--ink); overflow-wrap: anywhere; }

/* Section 02: architectural resolution schematic */
.diagram {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5.25rem minmax(0, 1fr) 5.25rem minmax(0, 1fr) 5.25rem minmax(0, 1.15fr);
    align-items: stretch;
    margin-top: 2.75rem;
}
.diag-node {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    padding: 1.1rem 0.95rem;
    border: 1.5px solid var(--ink);
    background: var(--white);
    color: var(--ink);
    text-decoration: none;
}
.diag-ico { color: var(--ink); margin-bottom: 0.35rem; }
.diag-k { color: var(--soft); font: 500 0.75rem/1.3 var(--mono); }
.diag-v { font: 600 0.88rem/1.35 var(--mono); overflow-wrap: anywhere; }
.diag-end {
    background: var(--ink);
    color: var(--paper);
    transition: background-color 140ms linear;
}
.diag-end .diag-ico { color: var(--paper); }
.diag-end .diag-k { color: #a7a59d; }
.diag-end:hover { background: #1e1e1c; color: var(--paper); }
.na-inv { color: #f09372; }

.diag-edge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding-inline: 0.3rem;
}
.diag-step {
    color: var(--accent);
    font: 600 0.7rem/1.2 var(--mono);
    white-space: nowrap;
}
.diag-sub {
    color: var(--soft);
    font: 500 0.68rem/1.2 var(--mono);
    white-space: nowrap;
}
.diag-line {
    position: relative;
    width: 100%;
    height: 1.5px;
    background: var(--ink);
}
.diag-line::after {
    content: "";
    position: absolute;
    right: 0;
    top: -3.5px;
    width: 8px;
    height: 8px;
    border-top: 1.5px solid var(--ink);
    border-right: 1.5px solid var(--ink);
    transform: rotate(45deg);
}
.diag-dot {
    position: absolute;
    top: -2.25px;
    left: 0;
    width: 6px;
    height: 6px;
    background: var(--accent);
    animation: diag-flow 2.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.diag-edge:nth-of-type(4) .diag-dot { animation-delay: 0.45s; }
.diag-edge:nth-of-type(6) .diag-dot { animation-delay: 0.9s; }
@keyframes diag-flow {
    0% { left: 0; opacity: 0; }
    15% { opacity: 1; }
    75% { opacity: 1; }
    100% { left: calc(100% - 6px); opacity: 0; }
}
.diag-foot { margin-top: 1.35rem; }
.dns-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font: 500 0.9rem/1.5 var(--mono);
    color: var(--ink);
    cursor: pointer;
}
.dns-trigger:hover { color: var(--accent); }
.dns-caret {
    display: inline-block;
    transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}
.dns-trigger[aria-expanded="true"] .dns-caret { transform: rotate(180deg); }

.dns-panel {
    max-width: 48rem;
    margin-top: 0.9rem;
    padding: 1rem 1.15rem;
    border: 1.5px solid var(--ink);
    border-left: 3.5px solid var(--accent);
    background: var(--white);
    animation: dns-open 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes dns-open {
    from { opacity: 0; transform: translateY(-4px); }
}
.dns-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.25rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--hair);
    color: var(--soft);
    font: 500 0.78rem/1.4 var(--mono);
}
.dns-meta-right {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
}
.dns-refresh {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
}
.dns-refresh:hover { color: var(--accent); }
.dns-refresh:disabled { opacity: 0.45; cursor: wait; }
.dns-record {
    margin-top: 0.75rem;
    font: 500 0.92rem/1.55 var(--mono);
    overflow-wrap: anywhere;
}
.dns-prefix { color: var(--soft); }
.dns-value { color: var(--ink); }
.dns-value:hover { color: var(--accent); }
.dns-status {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--soft);
    font: 500 0.86rem/1.5 var(--mono);
}
.dns-status.is-err { color: var(--alert); }
.dns-pulse {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--accent);
    animation: dns-blink 900ms ease-in-out infinite;
}
@keyframes dns-blink {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 1; }
}

.matrix { width: 100%; margin-top: 2.75rem; border-collapse: collapse; }
.matrix th, .matrix td { padding: 1.25rem 1rem 1.25rem 0; text-align: left; vertical-align: top; }
.matrix thead th { padding-block: 0.6rem; border-bottom: 1px solid var(--hair); font: 500 0.8rem/1.4 var(--mono); }
.matrix tbody th, .matrix tbody td { border-bottom: 1px solid var(--hair); }
.matrix tbody th { width: 11rem; font: 700 1rem/1.45 var(--text); }
.matrix .what { color: var(--soft); font-size: 0.95rem; }
.matrix td[data-label] { width: 9.5rem; }
.matrix .yes, .matrix .no { white-space: normal; }

/* Two-part footer: multi-column nav with sibling-dimming + halftone canvas scene */
.foot { padding-top: clamp(1rem, 3vw, 2rem); }
.foot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr);
    gap: 2rem 3rem;
    padding-block: clamp(2rem, 5vw, 3.25rem);
}
.foot-brand p {
    max-width: 24rem;
    margin-top: 0.85rem;
    color: var(--soft);
    font-size: 0.92rem;
}
.foot-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem 2rem;
}
.foot-col h3 {
    margin-bottom: 0.7rem;
    color: var(--soft);
    font: 500 0.78rem/1.4 var(--mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.foot-col li + li { margin-top: 0.42rem; }
.foot-col a {
    display: inline-block;
    font-size: 0.94rem;
    text-decoration: none;
    transition: color 120ms linear, opacity 220ms ease;
}
.foot-col a:hover { color: var(--accent); }
.foot-cols:has(a:hover) a:not(:hover) { opacity: 0.35; }

.foot-scene {
    position: relative;
    height: clamp(17rem, 42vh, 25rem);
    border-top: 1px solid var(--hair);
    overflow: hidden;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.foot-scene canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

@media (max-width: 60rem) {
    .hero { grid-template-columns: 1fr; }
    .sec-grid { grid-template-columns: 1fr; }
    .sec-no span { display: inline; margin-right: 0.4rem; font-size: 1rem; letter-spacing: 0; }
    .foot-grid { grid-template-columns: 1fr; }
    .diagram {
        grid-template-columns: 1fr;
        max-width: 24rem;
    }
    .diag-edge {
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.75rem;
        padding: 0.65rem 0 0.65rem 1.2rem;
    }
    .diag-line {
        width: 1.5px;
        height: 1.75rem;
        order: -1;
    }
    .diag-line::after {
        right: auto;
        top: auto;
        left: -3.25px;
        bottom: 0;
        transform: rotate(135deg);
    }
    .diag-dot {
        left: -2.25px;
        top: 0;
        animation-name: diag-flow-v;
    }
}
@keyframes diag-flow-v {
    0% { top: 0; opacity: 0; }
    15% { opacity: 1; }
    75% { opacity: 1; }
    100% { top: calc(100% - 6px); opacity: 0; }
}

@media (max-width: 46rem) {
    .route { grid-template-columns: 1.75rem minmax(0, 1fr); gap: 0.75rem 1rem; }
    .route-meta { grid-column: 2; }
    .trace li { grid-template-columns: 1.75rem minmax(0, 1fr); gap: 0.75rem 1rem; }
    .route-key, .trace-n { font-size: 1.3rem; }

    .matrix, .matrix tbody { display: block; }
    .matrix thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .matrix tbody { border-top: 1px solid var(--hair); }
    .matrix tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.4rem 0.75rem;
        padding-block: 1.1rem;
        border-bottom: 1px solid var(--hair);
    }
    .matrix tbody th, .matrix tbody td, .matrix td[data-label] { width: auto; min-width: 0; padding: 0; border: 0; }
    .matrix tbody th, .matrix .what { grid-column: 1 / -1; }
    .matrix .what { margin-bottom: 0.4rem; }
    .matrix td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.15rem;
        color: var(--soft);
        font: 500 0.75rem/1.4 var(--mono);
    }
    .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 34rem) {
    .nav-section { display: none; }
    .hero-lead { margin-top: 0.8rem; }
    .examples a { display: inline-block; margin-top: 0.2rem; }
    .foot-scene { height: 15.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .h1-key::after,
    .eq.is-in .eq-b .na,
    .eq.is-in .eq-rule,
    .eq.is-in .eq-c .na,
    .eq.is-sync .eq-c .na,
    .diag-dot { animation: none; }
    .diag-dot { opacity: 0; }
    .has-motion [data-reveal] {
        transform: none;
        transition: opacity 200ms ease;
        transition-delay: 0ms !important;
    }
    .btn-arrow, .ext-arrow { transition: none; }
}
