/* ══════════════════════════════════════════════
   VERSION TIME MACHINE — Styles
   Theming: dark (default) / light via html.light
══════════════════════════════════════════════ */

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

/* ══ DARK THEME (default) ══ */
:root {
    --bg:          #0a0a0f;
    --surface:     #111118;
    --surface-2:   #18181f;
    --border:      rgba(255,255,255,0.07);
    --border-hi:   rgba(255,255,255,0.14);

    --ink:         #f0f0f5;
    --ink-2:       #9898b0;
    --ink-3:       #5c5c72;

    --accent:      #7b6cff;
    --accent-2:    #a78bfa;
    --accent-glow: rgba(123, 108, 255, 0.35);
    --accent-dim:  rgba(123, 108, 255, 0.12);

    --safe:        #22d3a0;
    --safe-dim:    rgba(34, 211, 160, 0.12);
    --warn:        #f59e0b;
    --warn-dim:    rgba(245, 158, 11, 0.12);
    --future:      #fb7185;
    --future-dim:  rgba(251, 113, 133, 0.12);

    --nav-bg:      rgba(10, 10, 15, 0.85);
    --card-shadow: rgba(0,0,0,0.4);
    --hero-shadow: rgba(0,0,0,0.5);

    --toggle-bg:     rgba(255,255,255,0.06);
    --toggle-border: rgba(255,255,255,0.12);

    --radius-sm:   8px;
    --radius:      14px;
    --radius-lg:   22px;
    --font-display: 'Syne', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;
    --font-body:    'Inter', sans-serif;
    --nav-h:       60px;
    --ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ══ LIGHT THEME ══ */
html.light {
    --bg:          #f4f4f8;
    --surface:     #ffffff;
    --surface-2:   #eaeaf0;
    --border:      rgba(0,0,0,0.08);
    --border-hi:   rgba(0,0,0,0.16);

    --ink:         #0d0d16;
    --ink-2:       #52526a;
    --ink-3:       #9898aa;

    --accent:      #5b4ee8;
    --accent-2:    #7c5cf5;
    --accent-glow: rgba(91, 78, 232, 0.28);
    --accent-dim:  rgba(91, 78, 232, 0.09);

    --safe:        #0b9e6e;
    --safe-dim:    rgba(11, 158, 110, 0.10);
    --warn:        #b86e00;
    --warn-dim:    rgba(184, 110, 0, 0.09);
    --future:      #c93050;
    --future-dim:  rgba(201, 48, 80, 0.09);

    --nav-bg:      rgba(244, 244, 248, 0.90);
    --card-shadow: rgba(0,0,0,0.07);
    --hero-shadow: rgba(0,0,0,0.10);

    --toggle-bg:     rgba(0,0,0,0.05);
    --toggle-border: rgba(0,0,0,0.12);
}

/* ── Global theme transition ── */
body,
#nav,
.section-header,
.section-body,
.card,
.card-version-block,
.card-fresh-note,
.lcat-header,
.lcat-body,
.vendor-card,
.date-picker-inner,
#linkSearch {
    transition:
        background-color 0.3s var(--ease),
        border-color 0.3s var(--ease),
        color 0.3s var(--ease),
        box-shadow 0.3s var(--ease);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
#nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--nav-h);
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.65; }
.logo-icon { font-size: 1.2rem; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface-2);
    padding: 4px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.nav-tab {
    background: none;
    border: none;
    color: var(--ink-2);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
}
.nav-tab:hover { color: var(--ink); background: rgba(128,128,128,0.1); }
.nav-tab.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-glow);
}

/* ── THEME TOGGLE ── */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--toggle-border);
    background: var(--toggle-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.25s var(--ease);
}
.theme-toggle:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    transform: rotate(18deg) scale(1.12);
}
.theme-toggle:active { transform: rotate(18deg) scale(0.96); }

/* ── VIEWS ── */
.view { display: none; padding-top: var(--nav-h); min-height: 100vh; }
.view.active { display: block; }

/* ── HERO ── */
.hero {
    position: relative;
    overflow: hidden;
    padding: 80px 24px 64px;
    text-align: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}
html.light .orb { opacity: 0.15; }

.orb1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #7b6cff 0%, transparent 70%);
    top: -200px; left: 50%;
    animation: driftCenter 12s ease-in-out infinite alternate;
}
.orb2 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, #22d3a0 0%, transparent 70%);
    bottom: -100px; left: 10%;
    animation: drift 15s ease-in-out infinite alternate-reverse;
}
.orb3 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, #fb7185 0%, transparent 70%);
    bottom: -80px; right: 10%;
    animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
    from { transform: translate(0,0) scale(1); }
    to   { transform: translate(30px,20px) scale(1.1); }
}
@keyframes driftCenter {
    from { transform: translateX(-50%) translate(0,0) scale(1); }
    to   { transform: translateX(-50%) translate(30px,20px) scale(1.1); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.hero-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-2);
    background: var(--accent-dim);
    border: 1px solid rgba(167, 139, 250, 0.25);
    padding: 5px 14px;
    border-radius: 40px;
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 24px;
}
.hero-title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1rem;
    color: var(--ink-2);
    margin-bottom: 40px;
    line-height: 1.7;
}
.hero-sub strong { color: var(--ink); }

/* ── DATE PICKER ── */
.date-picker-wrap { display: flex; justify-content: center; }

.date-picker-inner {
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-lg);
    padding: 8px 8px 8px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 20px 60px var(--hero-shadow);
    flex-wrap: wrap;
    justify-content: center;
}

.date-picker-inner label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
    white-space: nowrap;
}

input[type=date] {
    background: none;
    border: none;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    padding: 6px 0;
    outline: none;
    cursor: pointer;
    min-width: 148px;
}
input[type=date]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    filter: invert(0.7) sepia(1) saturate(3) hue-rotate(220deg);
}
html.light input[type=date]::-webkit-calendar-picker-indicator {
    filter: invert(0.3) sepia(0.5) saturate(2) hue-rotate(220deg);
}
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ── BUTTONS ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    box-shadow: 0 8px 24px var(--accent-glow);
    white-space: nowrap;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--accent-glow);
    filter: brightness(1.1);
}
.btn-primary:active { transform: none; }

/* ── RESULTS ── */
.results-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-date-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--safe);
    background: var(--safe-dim);
    border: 1px solid rgba(34, 211, 160, 0.25);
    padding: 6px 16px;
    border-radius: 40px;
}

/* ── SECTION ── */
.section {
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.5s var(--ease) forwards;
}
@keyframes slideUp {
    to { opacity: 1; transform: none; }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    user-select: none;
}
.section-header:hover {
    background: var(--surface-2);
    border-color: var(--border-hi);
}
.section-header.open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

.section-header-left { display: flex; align-items: center; gap: 12px; }
.section-icon { font-size: 1.3rem; }
.section-count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink-3);
    background: rgba(128,128,128,0.1);
    padding: 2px 8px;
    border-radius: 20px;
}
.section-chevron {
    color: var(--ink-3);
    font-size: 0.8rem;
    transition: transform 0.3s var(--ease);
}
.section-header.open .section-chevron { transform: rotate(180deg); }

.section-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.6s var(--ease), opacity 0.4s var(--ease), padding 0.3s;
    padding: 0 12px;
}
.section-body.open {
    max-height: 2000px;
    opacity: 1;
    padding: 12px;
}

/* ── VERSION CARD ── */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
                border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
                background-color 0.3s var(--ease);
}
.card.show { opacity: 1; transform: none; }
.card:hover {
    border-color: var(--border-hi);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--card-shadow);
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0;
    transition: opacity 0.25s;
}
.card:hover::before { opacity: 1; }

/* ── EOL CARD STATE ── */
.card--eol {
    border-color: rgba(239, 68, 68, 0.35);
    background: color-mix(in srgb, var(--bg) 94%, #ef4444 6%);
}
.card--eol::before {
    background: linear-gradient(90deg, #ef4444, #f97316);
    opacity: 1;
}
.card--eol:hover {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.15);
}

.card-eol-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 10px;
}
html.light .card-eol-banner {
    background: rgba(239, 68, 68, 0.07);
    border-color: rgba(239, 68, 68, 0.22);
}

.card-eol-icon {
    font-size: 1.1rem;
    line-height: 1.3;
    flex-shrink: 0;
}

.card-eol-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ef4444;
    margin-bottom: 2px;
}
html.light .card-eol-title { color: #dc2626; }

.card-eol-date {
    font-size: 0.78rem;
    color: #fca5a5;
    line-height: 1.4;
}
html.light .card-eol-date { color: #b91c1c; }

.card-name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 12px;
    line-height: 1.3;
}

.card-version-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 10px;
}

.card-version-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--safe);
    margin-bottom: 4px;
}

.card-version-number {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.2;
    word-break: break-all;
}

.card-version-date {
    font-size: 0.78rem;
    color: var(--ink-2);
    margin-top: 4px;
}

.card-fresh-note {
    background: var(--warn-dim);
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.8rem;
    color: var(--warn);
    line-height: 1.5;
}
.card-fresh-note strong { color: var(--warn); font-weight: 700; }

.future-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--future);
    background: var(--future-dim);
    border: 1px solid rgba(251, 113, 133, 0.25);
    padding: 3px 10px;
    border-radius: 20px;
    margin-top: 8px;
}

.not-released {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ink-3);
}

/* ── LINKS VIEW ── */
.links-view-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.links-hero {
    text-align: center;
    margin-bottom: 48px;
}
.links-hero h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 10px;
}
.links-hero p { color: var(--ink-2); font-size: 0.95rem; }

.links-filter-row {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

#linkSearch {
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius);
    padding: 11px 18px;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.9rem;
    width: 100%;
    max-width: 400px;
    outline: none;
}
#linkSearch::placeholder { color: var(--ink-3); }
#linkSearch:focus { border-color: var(--accent); }

.link-categories { display: flex; flex-direction: column; gap: 12px; }
.link-category { border-radius: var(--radius); overflow: hidden; }

.lcat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    user-select: none;
}
.lcat-header:hover { background: var(--surface-2); border-color: var(--border-hi); }
.lcat-header.open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

.lcat-icon { font-size: 1.2rem; }
.lcat-chevron {
    margin-left: auto;
    color: var(--ink-3);
    font-size: 1rem;
    transition: transform 0.3s var(--ease);
}
.lcat-header.open .lcat-chevron { transform: rotate(180deg); }

.lcat-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.6s var(--ease), opacity 0.4s var(--ease), padding 0.3s;
    padding: 0 12px;
}
.lcat-body.open {
    max-height: 3000px;
    opacity: 1;
    padding: 12px;
}

.vendor-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.vendor-card:hover { border-color: var(--border-hi); }

.vendor-card h4 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 10px;
}

.link-pill {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-2);
    background: var(--accent-dim);
    border: 1px solid rgba(123, 108, 255, 0.2);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 20px;
    margin-right: 6px;
    margin-bottom: 6px;
    transition: all 0.2s var(--ease);
}
.link-pill:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.vendor-card.hidden { display: none; }
.link-category.hidden { display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    .date-picker-inner {
        flex-direction: column;
        padding: 16px;
        gap: 14px;
        width: 90%;
        text-align: center;
    }
    input[type=date] { text-align: center; }
    .btn-primary { width: 100%; justify-content: center; }
    .hero { padding: 48px 16px 40px; }
    .nav-inner { padding: 0 16px; }
    .nav-logo span:not(.logo-icon) { display: none; }
    .section-body, .lcat-body { grid-template-columns: 1fr; }
    .nav-tab { padding: 6px 10px; font-size: 0.8rem; }
}

/* ── SECTION HEADER DATE LABEL ── */
.section-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}
.section-date-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 400;
    color: var(--ink-3);
    letter-spacing: 0.03em;
}
