:root {
    --bg: #000;
    --fg: #f5f5f2;
    --muted: rgba(245, 245, 242, 0.58);
    --line: rgba(245, 245, 242, 0.16);
    --line-strong: rgba(245, 245, 242, 0.34);
    --orange: #f97316;
    --green: #10b981;
    --red: #ef4444;
    --font: "SF Mono", "Roboto Mono", "Cascadia Mono", "Menlo", monospace;
    --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--fg);
    background: var(--bg);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

p,
h1,
h2,
ol {
    margin: 0;
}

ol {
    padding: 0;
    list-style: none;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 50;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    background: #111;
    color: var(--fg);
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.terminal-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    display: grid;
    grid-template-columns: 190px 1fr 168px;
    align-items: center;
    min-height: 64px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.42));
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    align-items: center;
    height: 100%;
    padding-left: clamp(22px, 3vw, 42px);
    border-right: 1px solid var(--line);
}

.brand span {
    font-family: var(--sans);
    font-size: clamp(1.32rem, 1.55vw, 1.72rem);
    font-weight: 700;
    letter-spacing: -0.08em;
}

.nav-links {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: 100%;
}

.nav-links a {
    display: grid;
    place-items: center;
    border-right: 1px solid var(--line);
    color: rgba(245, 245, 242, 0.78);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.nav-links a:hover {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.06);
}

.wallet-button {
    display: grid;
    place-items: center;
    min-height: 38px;
    margin: 0 clamp(14px, 1.6vw, 24px);
    border: 1px solid var(--line-strong);
    background: rgba(245, 245, 242, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    font-size: 0.76rem;
}

.terminal-page {
    background:
        radial-gradient(circle at 67% 38%, rgba(255, 255, 255, 0.18), transparent 18%),
        radial-gradient(circle at 80% 70%, rgba(249, 115, 22, 0.12), transparent 18%),
        #000;
}

.hero-console {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 64px 0 0;
    isolation: isolate;
}

.hero-console::before,
.hero-console::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -3;
    pointer-events: none;
}

.hero-console::before {
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 25vw 23vh;
}

.hero-console::after {
    background:
        repeating-linear-gradient(135deg, transparent 0 5px, rgba(255, 255, 255, 0.04) 6px 7px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.2), transparent 42%, rgba(0, 0, 0, 0.54));
    clip-path: polygon(31% 23%, 48% 23%, 48% 78%, 31% 78%);
    opacity: 0.72;
}

.grid-cell {
    position: absolute;
    border: 1px solid var(--line);
    pointer-events: none;
}

.grid-cell-a {
    inset: 23vh auto auto 0;
    width: 33vw;
    height: 55vh;
}

.grid-cell-b {
    inset: 23vh 0 auto auto;
    width: 45vw;
    height: 55vh;
}

.grid-cell-c {
    inset: auto 0 0 0;
    height: 22vh;
}

.hero-copy {
    position: relative;
    z-index: 4;
    width: min(43vw, 620px);
    padding: clamp(138px, 19vh, 202px) 0 0 clamp(24px, 3vw, 52px);
}

.feed-line {
    margin-bottom: 10px;
    color: rgba(245, 245, 242, 0.48);
    font-size: 0.66rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

h1 {
    max-width: 650px;
    color: var(--fg);
    font-size: clamp(3rem, 4.55vw, 5.15rem);
    font-weight: 400;
    line-height: 0.94;
    letter-spacing: -0.08em;
}

.hero-text {
    max-width: 430px;
    margin-top: 20px;
    color: rgba(245, 245, 242, 0.62);
    font-size: clamp(0.86rem, 0.92vw, 1rem);
    line-height: 1.46;
}

.hero-actions {
    display: flex;
    gap: 14px;
    margin-top: 30px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    font-size: 0.78rem;
    white-space: nowrap;
}

.button-ghost { background: rgba(0, 0, 0, 0.42); }

.button-solid {
    gap: 14px;
    background: rgba(245, 245, 242, 0.16);
}

.button-solid span {
    color: var(--fg);
    font-size: 1.35rem;
    line-height: 0;
}

.phantom-visual {
    position: absolute;
    inset: 7vh -1vw auto auto;
    z-index: 2;
    width: min(58vw, 960px);
    height: 78vh;
    pointer-events: none;
    opacity: 0.96;
}

.visual-orbit {
    position: absolute;
    inset: 4% 0 0 10%;
    background:
        radial-gradient(ellipse at 55% 34%, rgba(255, 255, 255, 0.78) 0 3%, rgba(255, 255, 255, 0.24) 10%, transparent 31%),
        radial-gradient(ellipse at 48% 55%, rgba(255, 255, 255, 0.32) 0 5%, rgba(255, 255, 255, 0.14) 14%, transparent 38%),
        radial-gradient(ellipse at 48% 42%, rgba(255, 255, 255, 0.18), transparent 52%);
    filter: blur(22px) contrast(1.42);
    transform: rotate(-5deg);
}

.field-photo {
    position: absolute;
    inset: -2% -1% 0 auto;
    width: 100%;
    height: 108%;
    background: url('survey.jpg') center 42% / cover no-repeat;
    filter: grayscale(1) contrast(1.42) brightness(0.92);
    opacity: 0.9;
    mix-blend-mode: screen;
    transform: rotate(-0.6deg);
}

.photo-vignette,
.photo-scan {
    position: absolute;
    inset: -8% -8% -4% 20%;
    pointer-events: none;
}

.photo-vignette {
    background:
        radial-gradient(ellipse at 58% 46%, transparent 0 48%, rgba(0, 0, 0, 0.18) 64%, rgba(0, 0, 0, 0.78) 88%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.9), transparent 30%, transparent 76%, rgba(0, 0, 0, 0.48));
    mix-blend-mode: multiply;
}

.photo-scan {
    background:
        repeating-linear-gradient(0deg, transparent 0 7px, rgba(255, 255, 255, 0.06) 8px 9px),
        linear-gradient(90deg, transparent 0 52%, rgba(255, 255, 255, 0.2) 53%, transparent 54%);
    opacity: 0.42;
    mix-blend-mode: screen;
    animation: scanShift 4.8s linear infinite;
}

.philosopher-head {
    position: absolute;
    inset: -4% -5% 0 auto;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: grayscale(1) contrast(1.52) brightness(0.9);
    mix-blend-mode: screen;
    opacity: 0.84;
    display: none;
}

.statue-grid {
    fill: none;
    stroke: rgba(245, 245, 242, 0.12);
    stroke-width: 1;
}

.statue-aura {
    opacity: 0.78;
}

.hair,
.face-main,
.face-side,
.neck,
.shoulder {
    stroke: rgba(245, 245, 242, 0.34);
    stroke-width: 1.2;
}

.hair {
    fill: url(#stoneEdge);
}

.hair-back {
    opacity: 0.62;
}

.hair-wave {
    opacity: 0.74;
}

.face-main {
    fill: url(#stoneEdge);
}

.face-side,
.shadow-cut {
    fill: rgba(0, 0, 0, 0.45);
}

.neck,
.shoulder {
    fill: rgba(245, 245, 242, 0.18);
}

.nose,
.brow,
.eye,
.cheek,
.mouth,
.chin {
    fill: none;
    stroke: rgba(255, 255, 255, 0.68);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 5;
}

.eye {
    fill: rgba(255, 255, 255, 0.18);
    stroke-width: 3;
}

.statue-texture {
    mix-blend-mode: screen;
    opacity: 0.32;
}

.statue-texture path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.38);
    stroke-dasharray: 16 12;
    stroke-width: 2;
    animation: scanShift 5.8s linear infinite;
}

.data-visor {
    opacity: 0.66;
}

.data-visor path:first-child {
    fill: rgba(0, 0, 0, 0.62);
    stroke: rgba(245, 245, 242, 0.34);
    stroke-width: 1.2;
}

.data-visor path:nth-child(2),
.data-visor path:nth-child(3) {
    fill: none;
    stroke: url(#terminalGlow);
    stroke-width: 2;
}

.data-visor text {
    fill: rgba(245, 245, 242, 0.74);
    font: 18px var(--font);
    letter-spacing: 0.14em;
}

.glitch-slices path {
    fill: rgba(255, 255, 255, 0.54);
    filter: blur(0.4px);
    opacity: 0.58;
    animation: glitchPulse 3.7s steps(2) infinite;
}

.scan-readout {
    position: absolute;
    inset: 35% 16% auto auto;
    display: grid;
    gap: 8px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-align: right;
    animation: readoutBlink 3.2s steps(2) infinite;
}

.hud-card,
.market-tape {
    position: absolute;
    z-index: 6;
    border: 1px solid var(--line-strong);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 32%),
        rgba(8, 8, 8, 0.58);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
}

.hud-card {
    width: min(17.5vw, 330px);
    min-width: 242px;
    padding: 16px 17px 14px;
}

.hud-card-primary {
    right: 2.4vw;
    top: 48vh;
}

.hud-card-secondary {
    right: 29vw;
    bottom: 8vh;
}

.hud-card p {
    margin-bottom: 8px;
    color: var(--fg);
    font-size: 0.74rem;
}

.hud-card svg {
    display: block;
    width: 100%;
    height: auto;
}

.hud-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.58rem;
    line-height: 1.45;
}

.hud-corners::before,
.hud-corners::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: rgba(245, 245, 242, 0.68);
}

.hud-corners::before {
    top: -1px;
    left: -1px;
    border-top: 2px solid;
    border-left: 2px solid;
}

.hud-corners::after {
    right: -1px;
    bottom: -1px;
    border-right: 2px solid;
    border-bottom: 2px solid;
}

.market-tape {
    right: 2.4vw;
    bottom: 6vh;
    width: min(27vw, 470px);
    padding: 17px 19px;
}

.tape-row {
    display: grid;
    grid-template-columns: 48px 1fr 70px 76px;
    align-items: center;
    gap: 10px;
    min-height: 24px;
    color: var(--fg);
    font-size: 0.8rem;
}

.tape-row + .tape-row {
    border-top: 1px dashed rgba(245, 245, 242, 0.13);
}

.tape-row i {
    height: 12px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.92) 0 var(--v), rgba(255, 255, 255, 0.08) var(--v) 100%);
    mask-image: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 6px);
}

.tape-row strong {
    font-weight: 400;
    text-align: right;
}

.tape-row em {
    font-style: normal;
    text-align: right;
}

.up { color: var(--green); }
.down { color: var(--red); }

.muted {
    margin-top: 14px;
    padding-top: 12px;
}

.terminal-status {
    position: absolute;
    inset: auto clamp(24px, 3vw, 52px) 14px;
    z-index: 7;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    color: rgba(245, 245, 242, 0.42);
    font-size: 0.58rem;
}

.terminal-status span:nth-child(2),
.terminal-status span:nth-child(3) {
    text-align: center;
}

.terminal-status span:last-child {
    text-align: right;
}

.intel-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    background: #050505;
}

.intel-strip article {
    min-height: 240px;
    padding: 44px clamp(24px, 3vw, 52px);
    border-right: 1px solid var(--line);
}

.intel-strip article:last-child {
    border-right: 0;
}

.intel-strip span {
    display: block;
    margin-bottom: 42px;
    color: rgba(245, 245, 242, 0.5);
    font-size: 0.72rem;
}

.intel-strip h2 {
    margin: 0 0 12px;
    color: var(--fg);
    font-size: 1.35rem;
    font-weight: 400;
}

.intel-strip p {
    max-width: 330px;
    color: rgba(245, 245, 242, 0.55);
    font-size: 0.9rem;
    line-height: 1.5;
}

@keyframes scanShift {
    from { transform: translateY(-18px); }
    to { transform: translateY(18px); }
}

@keyframes readoutBlink {
    0%, 82% { opacity: 0.74; }
    83%, 100% { opacity: 0.2; }
}

@keyframes glitchPulse {
    0%, 76% { transform: translateX(0); opacity: 0.44; }
    77%, 80% { transform: translateX(-14px); opacity: 0.72; }
    81%, 84% { transform: translateX(9px); opacity: 0.34; }
    85%, 100% { transform: translateX(0); opacity: 0.5; }
}

@media (max-width: 1080px) {
    .terminal-nav {
        grid-template-columns: 190px 1fr 170px;
    }

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

    .nav-links a:nth-child(n+4) {
        display: none;
    }

    .phantom-visual {
        opacity: 0.58;
        right: -16vw;
        width: 84vw;
    }

    .hud-card-primary {
        top: auto;
        bottom: 26vh;
    }

    .hud-card-secondary {
        display: none;
    }

    .market-tape {
        width: 43vw;
    }
}

@media (max-width: 720px) {
    .terminal-nav {
        grid-template-columns: 1fr auto;
        min-height: 70px;
    }

    .brand {
        border-right: 0;
    }

    .nav-links {
        display: none;
    }

    .wallet-button {
        min-width: 132px;
        margin-right: 14px;
    }

    .hero-console {
        min-height: auto;
        padding-bottom: 44px;
    }

    .hero-copy {
        width: auto;
        padding: 140px 22px 0;
    }

    .feed-line {
        white-space: normal;
    }

    h1 {
        font-size: clamp(3rem, 18vw, 5rem);
    }

    .hero-actions {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .phantom-visual {
        position: relative;
        inset: auto;
        width: 100%;
        height: 390px;
        margin-top: 18px;
        opacity: 0.7;
    }

    .hud-card,
    .market-tape,
    .terminal-status {
        position: relative;
        inset: auto;
        width: calc(100% - 44px);
        min-width: 0;
        margin: 18px 22px 0;
    }

    .market-tape {
        padding: 18px;
    }

    .tape-row {
        grid-template-columns: 52px 1fr 62px;
    }

    .tape-row em {
        display: none;
    }

    .terminal-status,
    .intel-strip {
        grid-template-columns: 1fr;
    }

    .terminal-status span,
    .terminal-status span:nth-child(2),
    .terminal-status span:nth-child(3),
    .terminal-status span:last-child {
        text-align: left;
    }

    .intel-strip article {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}
