:root {
    --bg: #050505;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent-primary: #8a2be2;
    --accent-secondary: #00d2ff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Gradients */
.background-glow {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(138,43,226,0.15) 0%, rgba(5,5,5,0) 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(80px);
    animation: drift 20s infinite alternate;
}

.background-glow.secondary {
    top: 50%;
    left: 50%;
    background: radial-gradient(circle, rgba(0,210,255,0.1) 0%, rgba(5,5,5,0) 70%);
    animation: drift-reverse 25s infinite alternate;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(10%, 10%); }
}

@keyframes drift-reverse {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-10%, -10%); }
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
}

h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.gradient-text {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-secondary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5%;
}

.hero-content {
    max-width: 800px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.primary-btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.primary-btn.glow-on-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(138, 43, 226, 0.4);
}

/* Overview Section */
.overview {
    padding: 2rem 5% 4rem;
    display: flex;
    justify-content: center;
}

.overview-content {
    max-width: 900px;
    padding: 3rem;
    border-radius: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.overview-content p {
    margin-bottom: 1.2rem;
}

.overview-content h2 {
    color: var(--text-main);
}

/* Domains Section */
.domains {
    padding: 4rem 5% 8rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
}

.glass-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.glass-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.glass-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Architecture Section */
.architecture {
    padding: 8rem 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    width: 100%;
}

.arch-node {
    padding: 1.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    width: 250px;
    position: relative;
    transition: all 0.3s ease;
}

.arch-node:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
    border-color: var(--accent-secondary);
}

.arch-node h4 {
    margin-bottom: 0.5rem;
    color: var(--accent-secondary);
}

.arch-node p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.center-node h4 {
    color: var(--accent-primary);
}

.arch-connector {
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent-secondary), var(--accent-primary));
    margin: 0 auto;
    opacity: 0.5;
}

.arch-connector.split {
    height: 40px;
    background: transparent;
    border-left: 2px solid var(--accent-primary);
    border-right: 2px solid var(--accent-primary);
    border-top: 2px solid var(--accent-primary);
    width: 300px;
    opacity: 0.5;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    margin-top: 20px;
    margin-bottom: -2px;
    border-bottom: none;
}

.arch-branches {
    display: flex;
    justify-content: space-between;
    width: 340px;
    margin: 0 auto;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Animations */
.fade-in {
    opacity: 0;
    transition: opacity 1s ease-out;
}

.fade-in.visible {
    opacity: 1;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.glass-card.fade-in-up {
    transition-delay: var(--delay);
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .nav-links { display: none; }
    .arch-branches { flex-direction: column; gap: 20px; align-items: center; width: 100%;}
    .arch-connector.split { border: none; width: 2px; background: var(--accent-primary); height: 40px; border-radius: 0; margin-top: 0; margin-bottom: 0;}
}

/* Report Styles */
.report-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
}
.report-section {
    padding: 2.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}
.report-section h2 {
    color: var(--accent-secondary);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    min-width: 700px;
}
.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}
.data-table th {
    color: var(--accent-primary);
    font-weight: 600;
}
.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge.builtin { background: rgba(138, 43, 226, 0.2); color: #c48df5; }
.badge.official { background: rgba(0, 210, 255, 0.2); color: #80e5ff; }
.badge.local { background: rgba(255, 165, 0, 0.2); color: #ffd280; }
.badge.trusted { background: rgba(46, 204, 113, 0.2); color: #85e0a3; }

.domain-card {
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-primary);
}
.domain-card h3 {
    margin-bottom: 0.5rem;
    color: #fff;
}
.domain-card ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    color: var(--text-muted);
}
.domain-card li { margin-bottom: 0.3rem; }
.domain-card strong { color: #ddd; }

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.skill-category {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 8px;
}
.skill-category h4 {
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}
.skill-category p {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
    line-height: 1.5;
}
.workflow-code {
    background: #0a0a0a;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--glass-border);
}
.workflow-code pre {
    margin: 0;
    color: #a0a0a0;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(50px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}
.modal-close:hover {
    color: var(--accent-primary);
}
.modal-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
}
.modal-icon {
    font-size: 3rem;
}
.modal-title {
    font-size: 2rem;
    color: var(--text-main);
    font-weight: 800;
}
.modal-body h4 {
    color: var(--accent-secondary);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}
.modal-body p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

/* Glass Card Interactivity */
.glass-card[data-modal] {
    cursor: pointer;
}
.glass-card[data-modal]:hover {
    box-shadow: 0 15px 35px rgba(138, 43, 226, 0.3);
    border-color: var(--accent-primary);
}

.arch-node[data-modal] {
    cursor: pointer;
}

.skill-icon {
    font-size: 3.5rem;
    text-align: center;
    margin-top: 1rem;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.skill-category {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.skill-category:hover {
    background: rgba(138, 43, 226, 0.1);
    border-color: var(--accent-primary);
}
.skill-category:hover .skill-icon {
    transform: scale(1.3) rotate(5deg);
}

/* ============================================================
   Skills Index — search, tilt, spotlight
   ============================================================ */

.skills-toolbar {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    flex-wrap: wrap;
    margin: 1.75rem 0 1rem;
}

.skills-search-wrap {
    position: relative;
    flex: 1 1 320px;
    display: flex;
    align-items: center;
}

.skills-search-icon {
    position: absolute;
    left: 1rem;
    font-size: 0.95rem;
    opacity: 0.5;
    pointer-events: none;
}

#skill-search {
    width: 100%;
    padding: 0.85rem 4.5rem 0.85rem 2.9rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
#skill-search::placeholder { color: rgba(160, 160, 160, 0.55); }
#skill-search::-webkit-search-cancel-button { display: none; }
#skill-search:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(138, 43, 226, 0.16);
}

.skills-kbd {
    position: absolute;
    right: 1rem;
    padding: 0.15rem 0.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 5px;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.skills-clear {
    position: absolute;
    right: 0.9rem;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.skills-clear:hover { color: var(--text-main); background: rgba(138, 43, 226, 0.35); }
.skills-search-wrap.has-query .skills-kbd { opacity: 0; }
.skills-search-wrap.has-query .skills-clear { opacity: 1; pointer-events: auto; }

.skills-dice {
    flex: 0 0 auto;
    padding: 0.85rem 1.4rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.28), rgba(0, 210, 255, 0.18));
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.skills-dice:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 26px rgba(138, 43, 226, 0.3);
}
.skills-dice:active { transform: translateY(0); }
.skills-dice .dice-face {
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.skills-dice.rolling .dice-face { transform: rotate(540deg) scale(1.25); }

/* Live counter */
.skills-meter {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.meter-num {
    font-family: 'Fira Code', monospace;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--accent-secondary);
    font-variant-numeric: tabular-nums;
}
.meter-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #37e39b;
    box-shadow: 0 0 0 0 rgba(55, 227, 155, 0.6);
    animation: meterPulse 2.2s infinite;
    align-self: center;
    margin-left: 0.2rem;
}
@keyframes meterPulse {
    0%   { box-shadow: 0 0 0 0 rgba(55, 227, 155, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(55, 227, 155, 0); }
    100% { box-shadow: 0 0 0 0 rgba(55, 227, 155, 0); }
}

/* Empty state */
.skills-empty {
    margin: 0.5rem 0 1.5rem;
    color: var(--text-muted);
}
.skills-empty strong { color: var(--accent-secondary); }
.skills-reset {
    margin-left: 0.6rem;
    padding: 0.3rem 0.85rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: var(--text-main);
    background: rgba(138, 43, 226, 0.22);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.skills-reset:hover { background: rgba(138, 43, 226, 0.4); }

/* Card upgrades: stagger-in, cursor glow, 3D tilt */
.skills-grid { perspective: 1200px; }

.skill-category {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Pointer-tracking glow */
.skill-category::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        260px circle at var(--mx, 50%) var(--my, 50%),
        rgba(138, 43, 226, 0.28),
        transparent 65%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.skill-category:hover::before { opacity: 1; }
.skill-category > * { position: relative; z-index: 1; }

/* Staggered entrance */
.skills-grid.enhanced .skill-category {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
}
.skills-grid.enhanced .skill-category.revealed {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Filtering */
.skill-category.filtered-out {
    display: none;
}
.skill-category.dimmed {
    opacity: 0.28;
    filter: saturate(0.3);
}

/* Matched skill chips */
.skill-hits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    margin-top: 0.9rem;
}
.skill-hits:empty { margin-top: 0; }
.skill-hit {
    padding: 0.2rem 0.6rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    color: var(--accent-secondary);
    background: rgba(0, 210, 255, 0.1);
    border: 1px solid rgba(0, 210, 255, 0.25);
    border-radius: 999px;
    animation: hitIn 0.3s ease backwards;
}
.skill-hit mark {
    color: var(--text-main);
    background: rgba(138, 43, 226, 0.55);
    border-radius: 3px;
    padding: 0 2px;
}
.skill-hit.more {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
}
@keyframes hitIn {
    from { opacity: 0; transform: translateY(5px) scale(0.9); }
    to   { opacity: 1; transform: none; }
}

/* Count badge per card */
.skill-count-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.9rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.skill-category:hover .skill-count-badge { opacity: 0.85; }

/* Dice spotlight */
.skill-category.spotlight {
    animation: spotlightPop 1.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-color: var(--accent-secondary);
}
@keyframes spotlightPop {
    0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.5); }
    35%  { transform: scale(1.07); box-shadow: 0 0 0 16px rgba(0, 210, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .skills-grid.enhanced .skill-category { opacity: 1; transform: none; }
    .skill-category { transform: none !important; }
    .skill-category.spotlight { animation: none; }
    .skills-dice .dice-face { transition: none; }
    .meter-pulse { animation: none; }
    .skill-hit { animation: none; }
}
