/* ============================================
   BROKEN TOOLKIT — Updates & Monitor
   Utility / workbench theme (matches brokentoolkit.com)
   ============================================ */

/* === TOKENS === */
:root {
    --bg: #0f1010;
    --bg-elev: #161818;
    --panel: #1a1d1d;
    --panel-2: #1f2222;
    --border: #2a2e2e;
    --border-strong: #3a3f3f;
    --text: #eae8df;
    --text-soft: #b5b3a8;
    --muted: #7d7b72;
    --accent: #f2a93b;
    --accent-ink: #191205;
    --accent-soft: rgba(242, 169, 59, 0.10);
    --accent-line: rgba(242, 169, 59, 0.35);
    --ok: #85d46b;
    --ok-soft: rgba(133, 212, 107, 0.12);

    --feature: #f2a93b;
    --feature-soft: rgba(242, 169, 59, 0.12);
    --feature-line: rgba(242, 169, 59, 0.4);
    --improve: #7db0e0;
    --improve-soft: rgba(125, 176, 224, 0.12);
    --improve-line: rgba(125, 176, 224, 0.4);
    --fix: #d9877a;
    --fix-soft: rgba(217, 135, 122, 0.12);
    --fix-line: rgba(217, 135, 122, 0.4);
    --security: #b78fd0;
    --security-soft: rgba(183, 143, 208, 0.12);
    --security-line: rgba(183, 143, 208, 0.4);

    --p-android: #85d46b;
    --p-windows: #7db0e0;
    --p-ext: #c9a15f;
    --p-service: #b78fd0;

    --nav-h: 64px;
    --r: 12px;
    --r-sm: 7px;
    --ease: cubic-bezier(0.25, 0.1, 0.15, 1);
    --t: all 0.22s var(--ease);
    --sans: 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="light"] {
    --bg: #f5f3ec;
    --bg-elev: #faf8f2;
    --panel: #ffffff;
    --panel-2: #fdfcf8;
    --border: #ddd8c9;
    --border-strong: #c5bfae;
    --text: #1a1810;
    --text-soft: #4a463c;
    --muted: #7a766a;
    --accent: #c77f12;
    --accent-ink: #1b1200;
    --accent-soft: rgba(199, 127, 18, 0.10);
    --accent-line: rgba(199, 127, 18, 0.40);
    --ok: #3f8f2b;
    --ok-soft: rgba(63, 143, 43, 0.10);

    --feature: #b06a10;
    --feature-soft: rgba(176, 106, 16, 0.12);
    --feature-line: rgba(176, 106, 16, 0.35);
    --improve: #2f6fa8;
    --improve-soft: rgba(47, 111, 168, 0.12);
    --improve-line: rgba(47, 111, 168, 0.35);
    --fix: #b3523f;
    --fix-soft: rgba(179, 82, 63, 0.12);
    --fix-line: rgba(179, 82, 63, 0.35);
    --security: #7b4f9e;
    --security-soft: rgba(123, 79, 158, 0.12);
    --security-line: rgba(123, 79, 158, 0.35);

    --p-android: #3f8f2b;
    --p-windows: #2f6fa8;
    --p-ext: #a4751f;
    --p-service: #7b4f9e;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; font-size: 16px; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { text-decoration: none; color: inherit; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }

::selection { background: var(--accent-soft); color: var(--text); }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* === SKIP LINK === */
.skip-link {
    position: fixed; top: -100%; left: 1rem;
    background: var(--accent); color: var(--accent-ink);
    padding: 0.6rem 1.2rem; border-radius: 0 0 var(--r-sm) var(--r-sm);
    font-weight: 700; font-size: 0.85rem; z-index: 9999;
    transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 0; }

/* === SCROLL PROGRESS === */
#scroll-progress {
    position: fixed; top: 0; left: 0;
    width: 0%; height: 2px;
    z-index: 999;
    background: var(--accent);
    transition: width 0.1s linear;
}

/* === NAVBAR === */
.navbar {
    position: sticky; top: 0; z-index: 500;
    height: var(--nav-h);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.navbar.scrolled {
    border-bottom-color: var(--border-strong);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

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

.brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; letter-spacing: -0.01em; }
.brand-logo { display: flex; flex-shrink: 0; }
.brand-mascot { border-radius: 6px; }
.brand-name { font-size: 1rem; }
.brand-name .accent { color: var(--accent); }

.nav-menu { display: flex; align-items: center; gap: 0.1rem; flex: 1; justify-content: flex-end; }
.nav-item {
    padding: 0.42rem 0.9rem;
    border-radius: var(--r-sm);
    color: var(--muted);
    font-size: 0.87rem; font-weight: 500;
    transition: var(--t);
}
.nav-item:hover { color: var(--text); background: var(--panel); }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.theme-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--r-sm); color: var(--muted); cursor: pointer;
    transition: var(--t);
}
.theme-btn:hover { color: var(--text); border-color: var(--border-strong); }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: none; }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-soft); border-radius: 2px; transition: var(--t); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === HERO === */
.hero {
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(ellipse 80% 50% at 60% 0%, rgba(242, 169, 59, 0.06), transparent 70%),
        var(--bg);
    position: relative;
    overflow: hidden;
}
.hero-inner {
    max-width: 1240px; margin: 0 auto;
    padding: 4.5rem 1.75rem 3.5rem;
}

.hero-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    padding: 0.35rem 0.9rem;
    border-radius: 100px;
    margin-bottom: 1.5rem;
    width: fit-content;
}
.badge-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-out infinite;
}

.hero-headline {
    font-size: clamp(2.4rem, 5.2vw, 4rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.025em;
    margin-bottom: 1.4rem;
}
.hero-headline em { font-style: normal; color: var(--accent); }

.hero-sub {
    font-size: 1.08rem; color: var(--text-soft); line-height: 1.7;
    max-width: 560px; margin-bottom: 2.5rem;
}

.hero-stats {
    display: flex; align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--panel);
    max-width: 620px;
    overflow: hidden;
}
.stat {
    flex: 1;
    padding: 1.1rem 1.4rem;
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 0.15rem;
}
.stat:last-child { border-right: none; }
.stat-num {
    font-size: 1.7rem; font-weight: 700; line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-family: var(--mono); font-size: 0.72rem;
    color: var(--muted); letter-spacing: 0.02em;
}

/* === FILTERS === */
.filters-section {
    position: sticky; top: var(--nav-h); z-index: 400;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}
.filters-inner {
    max-width: 1240px; margin: 0 auto;
    padding: 0 1.75rem;
    display: flex; align-items: flex-end; gap: 2rem;
    flex-wrap: wrap;
}

.filter-group { display: flex; flex-direction: column; gap: 0.55rem; }
.filter-label {
    font-family: var(--mono); font-size: 0.68rem;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--muted);
}

.filter-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.pill {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    background: var(--panel); border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    font-size: 0.8rem; font-weight: 500; color: var(--text-soft);
    cursor: pointer; transition: var(--t);
    font-family: inherit;
}
.pill:hover { color: var(--text); border-color: var(--accent-line); }
.pill.active {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-soft);
}

.pill-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-android { background: var(--p-android); }
.dot-windows { background: var(--p-windows); }
.dot-ext     { background: var(--p-ext); }
.dot-service { background: var(--p-service); }

.search-group { flex: 1; min-width: 200px; }
.search-wrap {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--panel); border: 1px solid var(--border-strong);
    border-radius: var(--r-sm); padding: 0.42rem 0.85rem;
    transition: var(--t);
}
.search-wrap:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-wrap svg { color: var(--muted); flex-shrink: 0; }
.search-wrap input {
    flex: 1; background: none; border: none; outline: none;
    font-family: inherit; font-size: 0.85rem; color: var(--text);
}
.search-wrap input::placeholder { color: var(--muted); }

/* === FEED === */
.feed-container {
    max-width: 1240px; margin: 0 auto;
    padding: 3rem 1.75rem 6rem;
}

.feed-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}
.feed-header h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
.feed-count {
    font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
    padding: 0.32rem 0.75rem;
    background: var(--panel); border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
}

/* === TIMELINE === */
.timeline {
    position: relative;
    padding-left: 1.75rem;
}
.timeline::before {
    content: '';
    position: absolute; left: 6px; top: 6px; bottom: 6px;
    width: 2px;
    background: var(--border-strong);
}

/* === UPDATE CARD === */
.update-card {
    position: relative;
    margin-bottom: 1.5rem;
    opacity: 0; transform: translateY(14px);
    animation: cardReveal 0.5s var(--ease) forwards;
}
@keyframes cardReveal { to { opacity: 1; transform: translateY(0); } }

.timeline-dot {
    position: absolute;
    left: -1.75rem; top: 1.6rem;
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    background: var(--border-strong);
    box-shadow: 0 0 0 1px var(--border-strong);
    z-index: 2;
}
.timeline-dot.dot-feature     { background: var(--feature);   box-shadow: 0 0 0 1px var(--feature-line); }
.timeline-dot.dot-improvement { background: var(--improve);   box-shadow: 0 0 0 1px var(--improve-line); }
.timeline-dot.dot-fix         { background: var(--fix);       box-shadow: 0 0 0 1px var(--fix-line); }
.timeline-dot.dot-security    { background: var(--security);  box-shadow: 0 0 0 1px var(--security-line); }

.card-body {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.6rem 1.75rem;
    transition: var(--t);
}
.update-card:hover .card-body {
    border-color: var(--accent-line);
    background: var(--panel-2);
    transform: translateX(3px);
}

.card-top {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.card-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.platform-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.18rem 0.6rem;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.68rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
}
.platform-badge .p-dot { width: 6px; height: 6px; border-radius: 50%; }
.platform-badge.badge-android { color: var(--p-android); background: var(--ok-soft); border: 1px solid var(--ok-soft); }
.platform-badge.badge-android .p-dot { background: var(--p-android); }
.platform-badge.badge-windows { color: var(--p-windows); background: var(--improve-soft); border: 1px solid var(--improve-soft); }
.platform-badge.badge-windows .p-dot { background: var(--p-windows); }
.platform-badge.badge-extension { color: var(--p-ext); background: var(--accent-soft); border: 1px solid var(--accent-soft); }
.platform-badge.badge-extension .p-dot { background: var(--p-ext); }
.platform-badge.badge-service { color: var(--p-service); background: var(--security-soft); border: 1px solid var(--security-soft); }
.platform-badge.badge-service .p-dot { background: var(--p-service); }

.version-tag {
    font-family: var(--mono); font-size: 0.74rem; color: var(--text-soft);
    padding: 0.18rem 0.55rem;
    background: var(--panel-2); border: 1px solid var(--border-strong);
    border-radius: 4px; font-weight: 500;
}

.date-tag {
    font-family: var(--mono); font-size: 0.74rem; color: var(--muted);
    display: flex; align-items: center; gap: 0.35rem;
}

.type-badge {
    font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
    letter-spacing: 0.05em; text-transform: uppercase;
    padding: 0.18rem 0.6rem;
    border-radius: 4px;
}
.type-badge.badge-feature     { color: var(--feature);  background: var(--feature-soft);  border: 1px solid var(--feature-line); }
.type-badge.badge-improvement { color: var(--improve);  background: var(--improve-soft);  border: 1px solid var(--improve-line); }
.type-badge.badge-fix         { color: var(--fix);      background: var(--fix-soft);      border: 1px solid var(--fix-line); }
.type-badge.badge-security    { color: var(--security); background: var(--security-soft); border: 1px solid var(--security-line); }

.card-title {
    font-size: 1.2rem; font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.card-app {
    font-family: var(--mono); font-size: 0.82rem;
    color: var(--accent); font-weight: 600; margin-bottom: 0.75rem;
}

.card-desc {
    font-size: 0.92rem; color: var(--text-soft);
    line-height: 1.7; margin-bottom: 1.1rem;
}

.changes-list {
    list-style: none;
    display: flex; flex-direction: column; gap: 0.4rem;
}
.changes-list li {
    display: flex; align-items: flex-start; gap: 0.6rem;
    font-size: 0.87rem; color: var(--text-soft);
    line-height: 1.55;
}
.changes-list li::before {
    content: '→';
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.download-link {
    display: inline-flex; align-items: center; gap: 0.45rem;
    margin-top: 1.1rem;
    padding: 0.5rem 1.05rem;
    border-radius: 6px;
    font-family: var(--mono); font-size: 0.78rem; font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--bg);
    background: var(--accent);
    border: 1px solid var(--accent);
    text-decoration: none;
    transition: opacity 0.15s ease;
}
.download-link:hover { opacity: 0.85; }
.download-link svg { flex-shrink: 0; }

/* === LOADING STATE === */
.loading-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}
.loader {
    width: 34px; height: 34px;
    border: 3px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state p { color: var(--muted); font-size: 0.9rem; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--panel);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r);
}
.empty-icon { color: var(--muted); margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--muted); font-size: 0.9rem; }

/* === BACK TO TOP === */
.back-to-top {
    position: fixed; bottom: 1.75rem; right: 1.75rem;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--panel); border: 1px solid var(--border-strong);
    border-radius: var(--r-sm); color: var(--text-soft);
    cursor: pointer; z-index: 400;
    opacity: 0; transform: translateY(12px);
    transition: var(--t);
    pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { color: var(--accent); border-color: var(--accent-line); }

/* === FOOTER === */
.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-elev);
    padding: 3.5rem 1.75rem 2rem;
}
.footer-inner { max-width: 1240px; margin: 0 auto; }

.footer-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem; margin-bottom: 2.5rem;
}
.footer-tagline { color: var(--muted); font-size: 0.88rem; margin-top: 0.8rem; max-width: 300px; line-height: 1.6; }

.footer-nav { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col-head {
    font-size: 0.72rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    font-family: var(--mono);
    margin-bottom: 0.35rem;
}
.footer-col a { color: var(--text-soft); font-size: 0.88rem; transition: var(--t); }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 0.5rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem; color: var(--muted);
    font-family: var(--mono);
}
.footer-powered { display: flex; align-items: center; gap: 0.5rem; }
.footer-powered .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .footer-top { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none; flex-direction: column; gap: 0.2rem;
        position: fixed; inset: var(--nav-h) 0 0 0;
        background: var(--bg); border-top: 1px solid var(--border);
        padding: 1.25rem; overflow-y: auto;
        justify-content: flex-start;
    }
    .nav-menu.open { display: flex; }
    .nav-item { padding: 0.9rem 1rem; font-size: 0.95rem; border-radius: var(--r-sm); }
    .hamburger { display: flex; }
    .hero-inner { padding: 3.5rem 1.25rem 2.5rem; }
    .filters-inner { flex-direction: column; align-items: stretch; gap: 1rem; }
    .filter-group { width: 100%; }
    .search-group { min-width: 100%; }
    .feed-container { padding: 2rem 1.25rem 4rem; }
    .timeline { padding-left: 1.4rem; }
    .timeline-dot { left: -1.4rem; }
    .card-body { padding: 1.25rem 1.35rem; }
    .card-top { flex-direction: column; align-items: flex-start; }
    .footer-top { grid-template-columns: 1fr; }
    .footer-nav { gap: 2rem; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .back-to-top { bottom: 1.25rem; right: 1.25rem; }
}

@media (max-width: 480px) {
    .nav-inner { padding: 0 1.1rem; }
    .hero-headline { font-size: 2.1rem; }
    .hero-stats { flex-direction: column; }
    .stat { border-right: none; border-bottom: 1px solid var(--border); padding: 0.9rem 1.1rem; }
    .stat:last-child { border-bottom: none; }
    .pill { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
}
