:root {
    --bg-base: #262629;
    --primary: #4A60A9;
    --surface-convex: color-mix(in srgb, var(--bg-base) 98%, white);
    --surface-concave: color-mix(in srgb, var(--bg-base) 85%, black);
    --text-primary: #F5F5F0;
    --accent: #4A60A9;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar for Dark Mode */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-concave);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-convex);
}

/* ===== GLASS NAVBAR ===== */
.glass-nav {
    background: color-mix(in srgb, var(--bg-base) 82%, transparent);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border-bottom: 1px solid var(--surface-concave);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ===== SKEUOMORPHIC SURFACE CARD (Convex) ===== */
.surface-card {
    background: var(--surface-convex);
    border: 1px solid var(--surface-concave);
    border-top-color: color-mix(in srgb, var(--surface-convex) 95%, white);
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 color-mix(in srgb, var(--surface-convex) 95%, white);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.3s ease;
}

.interactive-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.4),
        0 8px 16px rgba(0, 0, 0, 0.3),
        0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent),
        inset 0 1px 0 color-mix(in srgb, var(--surface-convex) 90%, white);
}

/* ===== INNER ITEMS (Concave) ===== */
.surface-inner {
    background: var(--surface-concave);
    border: 1px solid var(--bg-base);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Form Controls */
.input-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--bg-base);
    background-color: var(--surface-concave);
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.input-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Range Slider */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: var(--surface-concave);
    border-radius: 2px;
}

/* ===== FLOAT-IN ANIMATION ===== */
@keyframes float-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-float-in {
    animation: float-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Speed Chart Cells */
.speed-cell {
    padding: 0.5rem;
    border: 1px solid var(--bg-base);
    text-align: center;
    font-variant-numeric: tabular-nums;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.speed-cell.optimal {
    background-color: color-mix(in srgb, #059669 20%, transparent);
    color: #a7f3d0;
    font-weight: 700;
    border-color: color-mix(in srgb, #059669 40%, transparent);
}

.speed-cell.normal {
    background-color: var(--surface-concave);
    color: var(--text-primary);
}

.speed-cell.cross-chain {
    background-color: color-mix(in srgb, #e11d48 20%, transparent);
    color: #fecdd3;
    opacity: 0.9;
    border-color: color-mix(in srgb, #e11d48 40%, transparent);
}

/* ===== INSET INPUT (Recessed Feel) ===== */
.input-base {
    background-color: var(--surface-concave);
    border: 1px solid var(--bg-base);
    color: var(--text-primary);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.input-base:focus {
    border-color: var(--accent);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
    outline: none;
}

/* ===== INSET PANEL ===== */
.panel-inset {
    background: var(--surface-concave);
    border: 1px solid var(--bg-base);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===== RAISED BUTTON ===== */
.btn-raised {
    position: relative;
    border: none;
    border-top: 1px solid color-mix(in srgb, var(--surface-convex) 90%, white);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 color-mix(in srgb, var(--surface-convex) 80%, white);
    transition: all 0.15s ease;
}

.btn-raised:hover {
    transform: translateY(-1px);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 3px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 color-mix(in srgb, var(--surface-convex) 90%, white);
}

.btn-raised:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    border-top-color: transparent;
}