/* === CSS Custom Properties === */

:root {
    --color-fg: #101010;
    --color-bg: #F6F6F6;
    --color-surface: #E9E9E9;
    --color-surface-dim: #DCDCDC;
}
.dark {
    --color-fg: #F6F6F6;
    --color-bg: #101010;
    --color-surface: #202020;
    --color-surface-dim: #2A2A2A;
}

/* === Reset === */

html {
    overflow: hidden;
    height: 100dvh;
}

body {
    font-family: 'Favorit Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
    overflow: hidden;
    height: 100dvh;
    margin: 0;
}

/* === Layout === */

.grid-viewport {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    position: relative;
    background: var(--color-bg);
}

.grid-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    z-index: 0;
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
}

.grid-surface {
    width: 400px;
    height: 400px;
    position: relative;
}

/* === Nodes === */

.node-base {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-fg);
    position: absolute;
    transition: width 100ms ease-out, height 100ms ease-out, background-color 100ms ease-out;
    cursor: pointer;
    will-change: width, height;
    backface-visibility: hidden;
}

.node-base::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    z-index: 1;
}

.node-retreating {
    width: 25px;
    height: 25px;
    background-color: #101010;
    transition: width 75ms ease-out, height 75ms ease-out, background-color 75ms ease-out;
}

.node-base:hover,
.node-base.mobile-hover {
    width: 30px;
    height: 30px;
    background-color: #1B6AF3;
    z-index: 10;
    transition: width 0.1s ease-out, height 0.1s ease-out, background-color 0.1s;
}

/* === Grid Selector === */

.grid-selector {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0px;
}

.selector-dot-inner {
    will-change: width, height;
    backface-visibility: hidden;
    border-radius: 100px;
    transition: width 0.15s ease-out, height 0.15s ease-out;
}

.selector-dot-inner.dot-spawn {
    transform: scale(0);
    animation: dot-spawn 0.3s ease-out forwards;
}

@keyframes dot-spawn {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.selector-dot-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 100px;
    cursor: pointer;
    z-index: 1;
}

.selector-dot-container:hover .selector-dot-inner {
    width: 25px !important;
    height: 25px !important;
}

.selector-dot-wip {
    cursor: default;
}

.selector-dot-inner.dot-retreating {
    width: 25px !important;
    height: 25px !important;
}

/* === Selector Pill === */

#selector-pill {
    position: absolute;
    left: 0px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--color-surface);
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
    transition: left 0.15s ease-in-out, width 0.15s ease-in-out, height 0.15s ease-in-out, border-radius 0.15s ease-in-out;
    will-change: left, width, height;
    backface-visibility: hidden;
}

/* === Classic Grid Icon === */

.classic-icon {
    background: transparent;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    position: relative;
    cursor: pointer;
    transition: background 0.15s ease-out;
    flex-shrink: 0;
    z-index: 1;
}

.classic-icon-dot {
    background: var(--color-fg);
    border-radius: 100px;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: width 0.15s ease-out, height 0.15s ease-out, background 0.15s ease-out;
}

.classic-icon:not(.classic-icon-active):hover .classic-icon-dot {
    width: 10px !important;
    height: 10px !important;
}

.classic-icon:not(.classic-icon-active) .classic-icon-dot.icon-dot-retreating {
    width: 10px !important;
    height: 10px !important;
}

/* === Output Panel === */

.output-panel {
    text-align: left;
    width: fit-content;
    max-width: 400px;
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    transition: width 0.15s ease-in-out, opacity 0.075s ease-in;
    opacity: 0;
    pointer-events: none;
}

.output-panel.panel-visible {
    opacity: 1;
    pointer-events: auto;
}

.panel-card {
    background: var(--color-surface);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-btn {
    font-family: Favorit Pro, sans-serif;
    font-size: 12px;
    font-weight: 500;
    background: var(--color-surface-dim);
    border-radius: 8px;
    padding: 4px 12px;
    cursor: pointer;
    transition: opacity 0.15s ease;
    border: none;
    color: var(--color-fg);
}

.panel-btn:hover {
    opacity: 0.7;
}

.panel-btn-primary {
    background: var(--color-fg);
    color: var(--color-bg);
}

.panel-mono-label {
    font-family: monospace;
    font-size: 12px;
    font-weight: bold;
    color: var(--color-fg);
    white-space: nowrap;
}

.panel-text {
    font-family: Favorit Pro, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-fg);
}

/* === Nav Pill === */

#nav-pill {
    position: absolute;
    background: var(--color-surface);
    border-radius: 5px;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: top 0.25s ease-in-out, left 0.25s ease-in-out, width 0.25s ease-in-out, height 0.25s ease-in-out, opacity 0.15s ease;
    will-change: width, height, opacity;
    backface-visibility: hidden;
}

/* === Footer Navigation === */

.footer-nav {
    position: absolute;
    bottom: 45px;
    left: 45px;
    z-index: 10;
}

.footer-nav-header {
    display: flex;
    gap: 20px;
    height: 30px;
    align-items: start;
}

.footer-nav-label {
    font-family: Favorit Pro, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-fg);
    line-height: 1.3;
}

.footer-nav-header-outlinks {
    font-weight: 400;
}

.footer-nav-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    align-items: start;
}

.nav-link {
    font-family: Favorit Pro, sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--color-fg);
    letter-spacing: -0.4px;
    line-height: 1.3;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    z-index: 1;
    position: relative;
}

.nav-link:hover {
    color: var(--color-fg);
    text-decoration: none;
}

/* === Responsive === */

@media (max-width: 768px) {
    .output-panel {
        position: fixed !important;
        right: auto !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        bottom: 155px !important;
        left: 50% !important;
        max-width: 400px !important;
    }
    .footer-nav {
        position: fixed !important;
        bottom: 15px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    .footer-nav-links {
        flex-direction: row !important;
        gap: 15px !important;
    }
    .footer-nav-header-outlinks {
        display: none !important;
    }
    .footer-nav-header {
        display: none !important;
    }
    .grid-selector {
        bottom: 85px !important;
    }
    .grid-shifted {
        transform: translateY(-40px) !important;
    }
}

@media (max-width: 400px) {
    #grid-surface {
        transform: scale(0.85) !important;
    }
}
