/* ── Reset & Base ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f0f0f5;
    --text-secondary: rgba(240, 240, 245, 0.65);
    --accent: #4facfe;
    --accent-secondary: #00f2fe;
    --accent-glow: rgba(79, 172, 254, 0.3);
    --radius-lg: 1.25rem;
    --radius-md: 0.875rem;
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Aurora Background ── */
.aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.aurora::before,
.aurora::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: aurora-drift 18s ease-in-out infinite alternate;
}

.aurora::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #4facfe, #00f2fe, transparent 70%);
    top: -15%;
    left: -10%;
}

.aurora::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #a78bfa, #f472b6, transparent 70%);
    bottom: -10%;
    right: -5%;
    animation-delay: -9s;
}

@keyframes aurora-drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(60px, 40px) scale(1.15);
    }
}

/* ── Particles ── */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-float linear infinite;
    opacity: 0;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    15% {
        opacity: 0.8;
    }

    85% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-10vh) scale(1);
        opacity: 0;
    }
}

/* ── Layout ── */
.site-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ── Navbar ── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
}

.navbar-back {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.navbar-back:hover {
    color: var(--text-primary);
}

.navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: opacity var(--transition);
}

.navbar-brand:hover {
    opacity: 0.8;
}

.navbar-brand span {
    font-size: 1.6rem;
}

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero-badge {
    display: inline-block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.03em;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.highlight {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 50%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── IP Cards (IPv4/IPv6) ── */
.ip-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.ip-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.ip-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--card-gradient, linear-gradient(135deg, #4facfe 0%, #00f2fe 100%));
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.ip-card.loaded::before {
    opacity: 0.04;
}

.ip-card.loaded {
    border-color: var(--border-hover);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 0 30px var(--accent-glow);
}

.ip-card-label {
    position: relative;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ip-card-label .ip-icon {
    font-size: 1.2rem;
}

.ip-card-value {
    position: relative;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
    margin-bottom: 1rem;
    min-height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ip-card-value.na {
    font-size: 1rem;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.copy-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

/* ── Refresh button ── */
.refresh-row {
    text-align: center;
    margin-bottom: 2rem;
}

.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}

.refresh-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.refresh-btn:active {
    transform: scale(0.97);
}

/* ── Loading indicator ── */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Error message ── */
.error-message {
    display: none;
    text-align: center;
    padding: 1rem 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #fca5a5;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* ── Section title ── */
.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* ── Details Grid ── */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding-bottom: 3rem;
}

.detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.detail-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}

.detail-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.detail-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

/* ── Footer ── */
footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: auto;
}

footer strong {
    color: var(--text-primary);
    font-weight: 600;
}

footer a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition);
}

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

/* ── Responsive ── */
@media (max-width: 600px) {
    .hero {
        padding: 2rem 0 1.5rem;
    }

    .ip-cards-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .detail-card {
        padding: 1rem 0.75rem;
    }
}

@media (max-width: 400px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
}