/* =============================================================
   multipledger.com — glassmorphism fintech dashboard
   Palette:
     #0f1117 ledger dark   #161822 panel base    #6366f1 indigo
     #818cf8 indigo light  #e2e8f0 ledger light  #94a3b8 slate mid
     #1e293b border subtle
   ============================================================= */

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

html, body {
    background: #0f1117;
    color: #e2e8f0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    position: relative;
    background:
        radial-gradient(ellipse at 15% -10%, rgba(99, 102, 241, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 92% 8%, rgba(129, 140, 248, 0.10) 0%, transparent 50%),
        #0f1117;
    padding-bottom: 2rem;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Ambient glow that drifts behind everything */
.ambient-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 30% 50%, rgba(99, 102, 241, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(129, 140, 248, 0.05) 0%, transparent 40%);
    animation: ambientDrift 18s ease-in-out infinite alternate;
}

@keyframes ambientDrift {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(-30px, 20px); }
    100% { transform: translate(20px, -10px); }
}

/* =============================================================
   TOP NAV
   ============================================================= */
.topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    background: rgba(15, 17, 23, 0.65);
    border-bottom: 1px solid rgba(99, 102, 241, 0.10);
}

.nav-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 1rem;
}

.logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #818cf8;
}

.logo-text { color: #e2e8f0; }
.logo-accent { color: #818cf8; font-weight: 700; }

.nav-links {
    display: flex;
    justify-content: center;
    gap: 1.75rem;
    font-size: 0.88rem;
    color: #94a3b8;
}

.nav-links a {
    transition: color 0.2s ease;
    position: relative;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1px;
    background: #818cf8;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-links a:hover {
    color: #e2e8f0;
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.nav-meta { display: flex; justify-content: flex-end; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.18);
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: #94a3b8;
    letter-spacing: 0.01em;
}

/* =============================================================
   LAYOUT
   ============================================================= */
.page {
    position: relative;
    z-index: 1;
    max-width: 1320px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* =============================================================
   HERO PANEL
   ============================================================= */
.hero-panel {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.04) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(99, 102, 241, 0.14);
    padding: clamp(2rem, 4vw, 3.5rem) clamp(1.75rem, 3.5vw, 3rem);
    min-height: 360px;
}

/* Ledger network grid behind hero */
.hero-grid-bg {
    position: absolute;
    inset: 0;
    opacity: 0.85;
    pointer-events: none;
    overflow: hidden;
}

.hero-grid-bg svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.hero-grid-bg .gline {
    stroke: #1e293b;
    stroke-width: 1;
    fill: none;
    transition: stroke 0.4s ease, opacity 0.4s ease;
}

.hero-grid-bg .gline.pulse {
    stroke: #6366f1;
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.55));
    animation: linePulse 1.6s ease-out forwards;
}

@keyframes linePulse {
    0%   { stroke: #1e293b; opacity: 0.4; }
    25%  { stroke: #818cf8; opacity: 1; }
    100% { stroke: #1e293b; opacity: 0.35; }
}

.hero-grid-bg .gnode {
    fill: #1e293b;
}

.hero-grid-bg .gnode.live {
    fill: #818cf8;
    animation: nodePulse 2s ease-out forwards;
}

@keyframes nodePulse {
    0%   { fill: #1e293b; r: 1.6; }
    50%  { fill: #818cf8; r: 3; }
    100% { fill: #1e293b; r: 1.6; }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 880px;
}

.hero-meta {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.10);
    border: 1px solid rgba(99, 102, 241, 0.22);
    font-size: 0.72rem;
    color: #818cf8;
    letter-spacing: 0.02em;
}

.tag-mono {
    font-family: 'Space Mono', monospace;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.45);
    border-color: rgba(99, 102, 241, 0.14);
}

.hero-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #e2e8f0;
    margin-bottom: 1.1rem;
}

.grad {
    background: linear-gradient(90deg, #818cf8 0%, #6366f1 60%, #818cf8 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradShift 6s linear infinite;
}

@keyframes gradShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.hero-sub {
    font-size: 1rem;
    color: #94a3b8;
    max-width: 620px;
    margin-bottom: 2rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 200px));
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.stat {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 0.15rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.stat-num {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    color: #e2e8f0;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.stat-suffix {
    font-family: 'Space Mono', monospace;
    color: #818cf8;
    font-size: 1.1rem;
    font-weight: 700;
}

.stat-label {
    flex-basis: 100%;
    font-size: 0.74rem;
    color: #94a3b8;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* =============================================================
   BENTO GRID
   ============================================================= */
.bento {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-auto-rows: minmax(180px, auto);
    gap: 1rem;
}

/* Card placement on the bento grid */
.card-feed     { grid-column: 1 / 2; grid-row: 1 / 3; }
.card-ledgers  { grid-column: 2 / 3; grid-row: 1 / 2; }
.card-recon    { grid-column: 2 / 3; grid-row: 2 / 3; }
.card-spark    { grid-column: 1 / 2; grid-row: 3 / 4; }
.card-hash     { grid-column: 2 / 3; grid-row: 3 / 4; }
.card-api      { grid-column: 1 / 3; grid-row: 4 / 5; }

/* Glassmorphic card base */
.card {
    position: relative;
    background: rgba(99, 102, 241, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(99, 102, 241, 0.10);
    border-radius: 12px;
    padding: 1.5rem;
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background:
        radial-gradient(circle at 20% 0%, rgba(129, 140, 248, 0.08) 0%, transparent 50%);
    opacity: 0.6;
    pointer-events: none;
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.07);
}

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
    position: relative;
    z-index: 1;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    letter-spacing: -0.005em;
}

.card-sub {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: #94a3b8;
    letter-spacing: 0.03em;
}

/* =============================================================
   STATUS DOTS
   ============================================================= */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 currentColor;
}

.dot-green { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.55); animation: dotPulse 2.4s ease-in-out infinite; }
.dot-amber { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.55); animation: dotPulse 2.4s ease-in-out infinite 0.4s; }
.dot-red   { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, 0.55); animation: dotPulse 1.6s ease-in-out infinite; }

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(0.85); }
}

/* =============================================================
   LIVE FEED CARD
   ============================================================= */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-height: 460px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.feed-row {
    display: grid;
    grid-template-columns: 14px 1.5fr 1.2fr 1.4fr auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.4rem;
    border-bottom: 1px dashed rgba(30, 41, 59, 0.65);
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.feed-row:last-child { border-bottom: none; }

.feed-row:hover {
    background: rgba(99, 102, 241, 0.04);
}

.feed-row.fresh {
    animation: rowFlash 1.4s ease-out;
}

@keyframes rowFlash {
    0%   { background: rgba(99, 102, 241, 0.18); }
    100% { background: transparent; }
}

.feed-chain {
    color: #e2e8f0;
    font-weight: 500;
    font-size: 0.85rem;
}

.feed-hash {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #818cf8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-amount {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    color: #e2e8f0;
    text-align: right;
    white-space: nowrap;
}

.feed-row .feed-amount:first-letter { /* keep simple */ }

.feed-time {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: #94a3b8;
    text-align: right;
    min-width: 32px;
}

/* =============================================================
   CONNECTED LEDGERS CARD
   ============================================================= */
.ledger-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    position: relative;
    z-index: 1;
}

.ledger-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.4rem;
    border-bottom: 1px dashed rgba(30, 41, 59, 0.6);
    font-size: 0.86rem;
    color: #e2e8f0;
}

.ledger-list li:last-child { border-bottom: none; }

.ledger-list .mono {
    margin-left: auto;
    font-size: 0.72rem;
}

.dim { color: #94a3b8; }

.mono { font-family: 'Space Mono', monospace; }

/* =============================================================
   RECONCILIATION CARD
   ============================================================= */
.recon-bars {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
    z-index: 1;
}

.recon-row {
    display: grid;
    grid-template-columns: 70px 1fr 56px;
    align-items: center;
    gap: 0.75rem;
}

.recon-label {
    font-size: 0.78rem;
    color: #94a3b8;
}

.recon-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.7);
    overflow: hidden;
}

.recon-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-green { background: linear-gradient(90deg, #34d399, #6366f1); }
.bar-amber { background: linear-gradient(90deg, #fbbf24, #818cf8); }
.bar-red   { background: linear-gradient(90deg, #f87171, #6366f1); }

.recon-val {
    font-size: 0.78rem;
    color: #e2e8f0;
    text-align: right;
}

.recon-foot {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(30, 41, 59, 0.6);
    font-size: 0.72rem;
    position: relative;
    z-index: 1;
}

/* =============================================================
   THROUGHPUT SPARKLINE
   ============================================================= */
.spark-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 110px;
    margin-bottom: 0.75rem;
}

#sparkline {
    width: 100%;
    height: 100%;
    display: block;
}

.spark-foot {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8rem;
    color: #e2e8f0;
    position: relative;
    z-index: 1;
}

#sparkValue { color: #818cf8; font-weight: 700; }

/* =============================================================
   HASH CARD
   ============================================================= */
.hash-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    column-gap: 0.85rem;
    row-gap: 0.55rem;
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
}

.hash-grid dt {
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
    padding-top: 2px;
}

.hash-grid dd {
    color: #e2e8f0;
    font-size: 0.78rem;
}

.trunc {
    color: #818cf8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* =============================================================
   API CARD
   ============================================================= */
.code {
    background: rgba(15, 17, 23, 0.55);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    color: #e2e8f0;
    overflow-x: auto;
    position: relative;
    z-index: 1;
    white-space: pre;
}

.c-key  { color: #818cf8; font-weight: 700; }
.c-path { color: #e2e8f0; }
.c-com  { color: #94a3b8; font-style: italic; }
.c-str  { color: #34d399; }

.api-foot {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(30, 41, 59, 0.6);
    font-size: 0.78rem;
    position: relative;
    z-index: 1;
}

/* =============================================================
   PAGE FOOTER
   ============================================================= */
.page-foot {
    margin-top: 0.5rem;
    padding: 1.25rem 0.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.74rem;
    color: #94a3b8;
    border-top: 1px solid rgba(99, 102, 241, 0.08);
}

.foot-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 960px) {
    .nav-inner {
        grid-template-columns: auto auto;
        row-gap: 0.5rem;
    }
    .nav-links { display: none; }
    .nav-meta { justify-content: flex-end; }

    .bento {
        grid-template-columns: 1fr 1fr;
    }
    .card-feed     { grid-column: 1 / 3; grid-row: auto; }
    .card-ledgers  { grid-column: 1 / 2; grid-row: auto; }
    .card-recon    { grid-column: 2 / 3; grid-row: auto; }
    .card-spark    { grid-column: 1 / 3; grid-row: auto; }
    .card-hash     { grid-column: 1 / 3; grid-row: auto; }
    .card-api      { grid-column: 1 / 3; grid-row: auto; }

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

@media (max-width: 640px) {
    .bento {
        grid-template-columns: 1fr;
    }
    .card-feed, .card-ledgers, .card-recon,
    .card-spark, .card-hash, .card-api {
        grid-column: 1 / 2;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .feed-row {
        grid-template-columns: 14px 1fr auto;
        row-gap: 0.2rem;
    }
    .feed-hash, .feed-amount {
        grid-column: 2 / 4;
        text-align: left;
    }
    .feed-time {
        grid-column: 3 / 4;
        grid-row: 1 / 2;
    }

    .nav-links { display: none; }
    .page { padding: 1rem; }
    .hero-panel { padding: 1.75rem 1.25rem; }
}
