
@keyframes tooltipAutoHide {
    0% { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(4px); }
    70% { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(4px); }
    100% { opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(8px); }
}
:root {
    /* Light Theme Variables */
    --bg: #f4f1ea;
    --bg-top: #f8f5ee;
    --bg-strong: #efe8dc;
    --paper: rgba(251, 250, 247, 0.78);
    --ink: #121316;
    --ink-light: #2d3238;
    --ink-muted: #68717a;
    --line: rgba(18, 19, 22, 0.1);
    /* Brand Colors */
    --accent: #fe9a00;
    --accent-soft: rgba(254, 154, 0, 0.16);
    --blue-soft: rgba(94, 113, 131, 0.08);
    /* Typography */
    --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Interactions */
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    --hover-shift: translateY(-2px);
    --premium-curve: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Legal Document Specific Styles */
.legal-content h2 { 
    font-family: var(--font-sans); 
    font-size: 1.5rem; 
    font-weight: 700; 
    margin: 48px 0 16px; 
    letter-spacing: -0.02em; 
    color: var(--ink); 
    font-variant-ligatures: none;
    
}
.legal-content h3 { 
    font-family: var(--font-sans); 
    font-size: 1.1rem; 
    font-weight: 600; 
    margin: 32px 0 12px; 
    color: var(--ink); 
}
.legal-content p, .legal-content li { 
    font-size: 1rem; 
    line-height: 1.7; 
    color: var(--ink-light); 
    margin-bottom: 16px; 
    text-wrap: pretty; 
}
.legal-content ul { 
    padding-left: 20px; 
    margin-bottom: 24px; 
}
.legal-content li { 
    margin-bottom: 10px; 
}
.legal-contact { 
    margin: 22px 0; 
    padding: 22px 32px; 
    background: var(--paper); 
    border: 1px solid var(--line); 
    border-radius: 12px; 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
}
.legal-contact p { 
    margin: 0; 
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark Theme Variables */
        --bg: #111111;
        --bg-top: #1a1a1a;
        --bg-strong: #050505;
        --paper: rgba(26, 26, 26, 0.75);
        --ink: #f0f0f0;
        --ink-light: #d1d5db;
        --ink-muted: #9ca3af;
        /* Adjusted Soft Colors for Dark Mode */
        --accent-soft: rgba(254, 154, 0, 0.10);
        --blue-soft: rgba(94, 113, 131, 0.12);
        --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
        --line: rgba(255, 255, 255, 0.05);
    }

    .hero-mark {
        animation: logoPulse 8s var(--premium-curve) infinite;
    }

    .hero-mark-number {
        animation: numberGlow 6s var(--premium-curve) infinite;
    }

    .hero-meta:hover,
    .fact-card:hover,
    .detail-card:hover,
    .visibility-row:hover {
        border-color: rgba(254, 154, 0, 1.0);
        box-shadow: var(--card-shadow), 0 0 20px rgba(254, 154, 0, 0.4), 0 0 50px rgba(254, 154, 0, 0.12);
        animation-play-state: paused;
    }
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, var(--accent-soft), transparent 45%),
        radial-gradient(circle at 90% 15%, var(--blue-soft), transparent 50%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 54%, var(--bg-strong) 100%);
    background-size: 200% 200%;
    animation: ambientDrift 25s ease-in-out infinite alternate;
    color: var(--ink);
    font-family: var(--font-sans);
    line-height: 1.6;
    transition: background-color 0.4s var(--premium-curve), color 0.4s var(--premium-curve);
    overflow-x: hidden;
}

@keyframes ambientDrift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 20%; }
    100% { background-position: 0% 100%; }
}

@keyframes logoPulse {
    0% { box-shadow: 0 4px 30px rgba(254, 154, 0, 0.06), 0 0 15px rgba(254, 154, 0, 0.03), 0 0 60px rgba(254, 154, 0, 0.02); }
    50% { box-shadow: 0 6px 45px rgba(254, 154, 0, 0.14), 0 0 25px rgba(254, 154, 0, 0.07), 0 0 80px rgba(254, 154, 0, 0.04); }
    100% { box-shadow: 0 4px 30px rgba(254, 154, 0, 0.06), 0 0 15px rgba(254, 154, 0, 0.03), 0 0 60px rgba(254, 154, 0, 0.02); }
}

@keyframes cardPulse {
    0% { border-color: var(--line); }
    50% { border-color: rgba(254, 154, 0, 0.08); }
    100% { border-color: var(--line); }
}

.hero-meta, .fact-card, .detail-card, .visibility-row {
    animation: cardPulse 8s var(--premium-curve) infinite;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    transition: all 0.4s var(--premium-curve);
}

a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
}

/* Typography Balances */
h1, h2, h3, h4 {
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

.shell {
    max-width: 1000px;
    margin: 0 auto;
    padding: 22px 24px 44px;
}

.topbar,
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--ink-muted);
}

.topbar {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
    transition: border-color 0.4s var(--premium-curve);
}

.site-footer {
    padding-top: 12px;
    border-top: 1px solid var(--line);
    transition: border-color 0.4s var(--premium-curve);
    text-transform: none;
}

.footer-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer-separator {
    user-select: none;
}

.nav-home-link {
    color: inherit;
}

.legal-section {
    padding: 44px 0 22px;
}

.legal-title {
    font-family: var(--font-sans);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 8px;
    color: var(--ink);
    font-variant-ligatures: none;
}

.legal-date {
    color: var(--ink-muted);
    font-size: 0.85rem;
    margin: 0 0 40px;
    font-weight: 600;
    letter-spacing: 0.05em;
    
}

.margin-bottom-sm {
    margin-bottom: 8px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.92fr);
    gap: 42px;
    align-items: center;
    padding: 44px 0 22px;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
    margin: 0;
}

.hero-logo-box {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 240px;
    padding-bottom: 24px;
    margin-top: -12px;
}

.hero-mark {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    margin: 0;
    width: fit-content;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: clamp(44px, 7.8vw, 90px);
    line-height: 0.9;
    letter-spacing: -0.04em;
    white-space: nowrap;
    max-width: 100%;
    overflow: visible;
    border-radius: 5px;
    font-variant-numeric: lining-nums tabular-nums;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 5;
}

@media (hover: hover) {
    .hero-mark:hover {
        transform: rotate(-6deg) scale(1.14);
        box-shadow: 14px 18px 50px var(--accent-soft);
    }

    .hero-mark:active {
        animation: logoClickWobble 0.08s cubic-bezier(0.36, 0.07, 0.19, 0.97) 5;
    }
}

@keyframes logoClickWobble {
    0%, 100% { transform: rotate(-6deg) scale(1.14); }
    25% { transform: rotate(5deg) scale(1.16); }
    75% { transform: rotate(-4deg) scale(1.12); }
}

@media (hover: none) {
    .hero-mark:active {
        transform: rotate(-6deg) scale(1.14);
        box-shadow: 14px 18px 50px var(--accent-soft);
    }
}

.hero-mark-as {
    color: #000000;
    background: var(--accent);
    padding: 0.08em 0.14em 0.12em;
    transition: background-color 0.4s var(--premium-curve);
}

.hero-mark-number {
    color: #ffffff;
    background: #000000;
    padding: 0.08em 0.15em 0.12em;
    box-shadow: inset 0 0 0 3px transparent;
    transition: background-color 0.4s var(--premium-curve), box-shadow 0.4s var(--premium-curve);
}

.hero-text {
    max-width: 540px;
    margin: 0;
    font-size: 1.125rem;
    color: var(--ink-light);
    text-align: left;
    padding-left: 20px;
    border-left: 2px solid var(--accent);
    transition: color 0.4s var(--premium-curve);
}

.hero-meta,
.fact-card,
.detail-card {
    border: 1px solid var(--line);
    background: var(--paper);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    transition: transform 0.3s var(--premium-curve), 
                box-shadow 0.3s var(--premium-curve), 
                border-color 0.3s var(--premium-curve),
                background-color 0.4s var(--premium-curve);
}

.hero-meta {
    padding: 24px 24px 24px 36px;
}

.hero-meta:hover,
.fact-card:hover,
.detail-card:hover {
    transform: var(--hover-shift);
    box-shadow: var(--card-shadow), 0 0 18px rgba(254, 154, 0, 0.35);
    border-color: rgba(254, 154, 0, 1);
}

.meta-label,
.fact-card strong,
.detail-card strong,
.visibility-row strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--ink);
    transition: color 0.4s var(--premium-curve);
    
}

.meta-label {
    margin-bottom: 20px;
}

.meta-item strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--ink-muted);
    transition: color 0.4s var(--premium-curve);
    
}

.meta-grid {
    display: grid;
    gap: 12px;
}

.upstream-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: baseline;
}

.upstream-badge {
    position: relative;
    cursor: default;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.upstream-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--ink);
    color: var(--bg);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s var(--premium-curve), transform 0.2s var(--premium-curve), visibility 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}

/* Desktop: Trigger on hover only */
@media (hover: hover) {
    .upstream-badge:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(4px);
    }
}

/* Mobile/Touch: Trigger on focus (tap) only */
@media (hover: none) {
    .upstream-badge:focus::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(4px);
        animation: tooltipAutoHide 1s forwards;
    }
}

.meta-item span {
    font-size: 1rem;
    font-weight: 500;
}

.overview-block,
.peering-block {
    display: grid;
    gap: 22px;
    padding: 22px 0;
    border-top: 1px solid var(--line);
    transition: border-color 0.4s var(--premium-curve);
}

.section-heading h2,
.peering-intro h2 {
    margin: 0;
    font-family: var(--font-sans);
    font-size: clamp(26px, 3.5vw, 32px);
    line-height: 1.2;
    letter-spacing: normal;
    font-variant-ligatures: none;
    font-weight: 700;
    color: var(--ink);
}

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

.fact-card,
.detail-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.fact-card p,
.detail-card p,
.visibility-row p,
.peering-intro p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--ink-light);
    transition: color 0.4s var(--premium-curve);
}

.peering-intro {
    max-width: 620px;
}

.peering-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.visibility-row {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(135deg, var(--paper), var(--bg-strong));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.4s var(--premium-curve), box-shadow 0.3s var(--premium-curve), transform 0.3s var(--premium-curve);
}

.visibility-row:hover {
    transform: var(--hover-shift);
    border-color: rgba(254, 154, 0, 1);
    box-shadow: var(--card-shadow), 0 0 18px rgba(254, 154, 0, 0.35);
}

@media (max-width: 860px) {
    .hero,
    .peering-grid {
        grid-template-columns: 1fr;
    }

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

    .hero {
        gap: 32px;
        padding-top: 56px;
    }

    .hero-copy {
        grid-template-rows: auto auto;
        gap: 24px;
        min-height: auto;
    }

    .hero-mark {
        justify-self: center;
        align-self: center;
    }
}

@media (max-width: 560px) {
    .shell {
        padding: 22px 32px 44px;
    }

    .topbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .site-footer {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 8px;
    }

    .hero-copy {
        align-items: center;
        text-align: center;
    }
    
    .hero-logo-box {
        padding-bottom: 24px;
        min-height: auto;
    }

    .hero-mark {
        font-size: clamp(40px, 12vw, 64px);
    }

    .hero-text {
        max-width: none;
        font-size: 1.05rem;
        text-align: center;
        padding-left: 0;
        border-left: none;
    }

    .hero-meta {
        padding: 20px;
    }
}

/* Number Glow — Dark Mode breathing for 203888 block */
@keyframes numberGlow {
    0% {
        box-shadow:
            inset 0 0 0 0.25px rgba(254, 154, 0, 0.3),
            0 0 0 0.25px rgba(254, 154, 0, 0.3),
            0 0 12px rgba(254, 154, 0, 0.06),
            0 0 35px rgba(254, 154, 0, 0.03),
            0 0 60px rgba(254, 154, 0, 0.015);
    }
    50% {
        box-shadow:
            inset 0 0 0 0.25px rgba(254, 154, 0, 0.6),
            0 0 0 0.25px rgba(254, 154, 0, 0.6),
            0 0 20px rgba(254, 154, 0, 0.12),
            0 0 50px rgba(254, 154, 0, 0.06),
            0 0 80px rgba(254, 154, 0, 0.025);
    }
    100% {
        box-shadow:
            inset 0 0 0 0.25px rgba(254, 154, 0, 0.3),
            0 0 0 0.25px rgba(254, 154, 0, 0.3),
            0 0 12px rgba(254, 154, 0, 0.06),
            0 0 35px rgba(254, 154, 0, 0.03),
            0 0 60px rgba(254, 154, 0, 0.015);
    }
}
