/* ============================================
   DESIGN SYSTEM
   ============================================ */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #0f1420;
    --bg-card: #141a2a;
    --bg-card-hover: #1a2236;
    --border: #1e2a42;
    --border-hover: #2a3a5c;
    --text-primary: #e2e8f0;
    --text-secondary: #8892a8;
    --text-muted: #5a6478;
    --accent: #60a5fa;
    --accent-glow: rgba(96, 165, 250, 0.15);
    --accent-dim: #3b82c4;
    --success: #4ade80;
    --warning: #fbbf24;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   CANVAS BACKGROUND
   ============================================ */
#network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
    position: relative;
    z-index: 1;
}

.section-alt {
    background: var(--bg-secondary);
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent);
}

/* ============================================
   HERO
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 0.4rem 1.2rem;
    border-radius: 2rem;
    margin-bottom: 1.5rem;
    background: var(--accent-glow);
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.accent {
    color: var(--accent);
}

.hero-sub-handle {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.hero-tagline {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

/* TryHackMe badge */
.thm-badge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.thm-badge-clip {
    display: none;
}

.thm-badge-img {
    width: 500px;
    max-width: 100%;
    border-radius: 12px;
    display: block;
    transition: transform 0.2s ease;
}

.thm-badge-img:hover {
    transform: scale(1.03);
}

.thm-badge-clip iframe {
    display: block;
    border: none;
    background: transparent;
}

.thm-key {
    display: flex;
    gap: 1.25rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-wrap: wrap;
    justify-content: center;
}

.thm-key span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.thm-key .fa-bolt-lightning { color: #f5c518 !important; }
.thm-key .fa-trophy          { color: #b0b8c4 !important; }
.thm-key .fa-award           { color: #d8b4fe !important; }
.thm-key .fa-fire            { color: #a3e635 !important; }
.thm-key .fa-door-closed     { color: #60a5fa !important; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.7rem 1.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: var(--font-sans);
}

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

.btn-primary:hover {
    background: #7ab8ff;
    transform: translateY(-1px);
}

.btn-ghost {
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: transparent;
}

.btn-ghost:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-full { width: 100%; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-indicator span {
    display: block;
    width: 2px;
    height: 30px;
    background: var(--accent);
    opacity: 0.4;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.1; transform: scaleY(0.5); }
    50% { opacity: 0.5; transform: scaleY(1); }
}

/* ============================================
   ABOUT
   ============================================ */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.75;
}

.highlight-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}

.highlight-card:hover {
    border-color: var(--border-hover);
}

.highlight-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.highlight-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.highlight-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   SKILLS
   ============================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    align-items: stretch;
}

.skill-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.8rem;
    transition: border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.skill-group:hover {
    border-color: var(--border-hover);
}

.skill-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    font-size: 0.8rem;
    padding: 0.35rem 0.8rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.skill-tag:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.skill-tag.cert {
    border-color: var(--warning);
    color: var(--warning);
}

/* ============================================
   PROJECTS
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.8rem;
    transition: all 0.3s ease;
}

.project-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.project-card.featured {
    border-color: var(--accent-dim);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(96, 165, 250, 0.05) 100%);
    grid-column: 1 / -1;
}

.project-card.featured .project-desc {
    max-width: 700px;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-icon {
    font-size: 1.5rem;
}

.project-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.7rem;
    border-radius: 3px;
}

.status-active {
    background: rgba(96, 165, 250, 0.1);
    color: var(--accent);
}

.status-complete {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success);
}

.project-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.project-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1.2rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.project-tech span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    background: var(--bg-primary);
    border-radius: 3px;
    color: var(--text-muted);
}

/* ============================================
   CONTACT
   ============================================ */
.contact-grid {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.contact-card:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.contact-card svg {
    flex-shrink: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   GATE (LOGIN)
   ============================================ */
.gate-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-primary);
}

.gate-container {
    width: 100%;
    max-width: 360px;
    padding: 1rem;
}

.gate-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2.5rem 2rem;
}

.gate-header {
    text-align: center;
    margin-bottom: 2rem;
}

.gate-icon {
    font-size: 2rem;
    color: var(--accent);
    font-family: var(--font-mono);
}

.gate-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.gate-form .input-group {
    margin-bottom: 1rem;
}

.gate-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}

.gate-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.gate-form button {
    margin-top: 0.5rem;
}

.gate-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.gate-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.gate-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.gate-link:hover {
    color: var(--accent);
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-body {
    background: var(--bg-primary);
}

.dashboard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.nav-brand {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.dashboard-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.app-grid {
    display: grid;
    gap: 1rem;
}

.app-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    position: relative;
}

.app-card:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.app-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.app-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.app-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.app-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.app-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    background: rgba(90,100,120,0.2);
    color: var(--text-muted);
}

.app-badge-live {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success);
}

/* ============================================
   ADMIN SECTION
   ============================================ */
.admin-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.invite-form {
    display: inline;
}

.invite-url-box {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.invite-url-box label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.invite-url-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
}

.invite-table-wrap {
    overflow-x: auto;
}

.invite-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.invite-table th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}

.invite-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.token-cell {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.token-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
}

.token-active {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success);
}

.token-used {
    background: rgba(96, 165, 250, 0.1);
    color: var(--accent);
}

.token-expired {
    background: rgba(90, 100, 120, 0.2);
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-card.featured { grid-column: auto; }
    .hero-stats { gap: 1.5rem; }
    .section { padding: 4rem 0; }
    .hero-cta { flex-direction: column; align-items: center; }
    .contact-grid { flex-direction: column; align-items: center; }
    .dashboard-nav { padding: 1rem; }
    .dashboard-container { padding: 2rem 1rem; }
    .app-card { flex-direction: column; text-align: center; }
    .app-badge { position: static; margin-top: 0.5rem; }
}
