/* Import a spy-themed font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300;400;700&family=Share+Tech+Mono&display=swap');

:root {
    --primary-color: #FF4500;
    --secondary-color: #FF6347;
    --background-color: #1a1a1a;
    --text-color: #e0e0e0;
    --border-color: #444;
    --card-background: #282828;
    --error-red: #FF0000;
    --shadow-color: rgba(255, 69, 0, 0.5);
    --hardware-color: #00BFFF; /* Distinct accent for hardware subsection */
    --hardware-shadow: rgba(0, 191, 255, 0.45);
}

/* Base Styles */
body {
    font-family: 'Roboto Mono', monospace;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: var(--primary-color);
    font-size: 1.5em;
    font-family: 'Share Tech Mono', monospace;
    opacity: 1;
    transition: opacity 1s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header & Navbar */
.header {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-color);
    border-bottom: 1px solid var(--primary-color);
}

.navbar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 4px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 14px;
    font-size: 0.85em;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-link:hover::before {
    width: 100%;
}

/* Main Content Padding */
.main-content {
    padding-top: 80px;
}

/* Sections */
.section {
    padding: 80px 20px;
    max-width: 1000px;
    margin: 0 auto;
    border-bottom: 1px dashed var(--border-color);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.section:last-child {
    border-bottom: none;
}

.section-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 2.5em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 50px;
    text-shadow: 0 0 10px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

/* Hero Section */
.hero-section {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background-image: url('images/tech-background.png');
    background-size: cover;
    background-position: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 20px;
}

.hero-content h1.glitch {
    font-family: 'Share Tech Mono', monospace;
    font-size: 4em;
    color: var(--primary-color);
    margin-bottom: 0px;
    text-shadow: 0 0 15px var(--shadow-color);
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--error-red);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: 2px 0 var(--primary-color);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch 2.5s infinite linear alternate-reverse;
}

@keyframes glitch {
    0%   { clip: rect(10px, 9999px, 80px, 0);  transform: skewX(-2deg); }
    50%  { clip: rect(50px, 9999px, 120px, 0); transform: skewX(0deg); }
    100% { clip: rect(30px, 9999px, 60px, 0);  transform: skewX(1.5deg); }
}

.hero-content h2 {
    font-family: 'Roboto Mono', monospace;
    font-size: 2.5em;
    color: var(--text-color);
    margin-top: 5px;
    margin-bottom: 30px;
    text-shadow: 0 0 5px var(--shadow-color);
}

.hero-content p.typewriter {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5em;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    margin: 0 auto 30px;
    animation: typing 4s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color); }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    background-color: transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 69, 0, 0.3), transparent);
    transition: all 0.5s ease;
    z-index: 0;
}

.btn:hover::before { left: 100%; }

.btn:hover {
    color: var(--background-color);
    background-color: var(--primary-color);
    box-shadow: 0 0 15px var(--shadow-color);
}

.btn-secondary {
    background-color: var(--card-background);
    color: var(--primary-color);
    margin-left: 20px;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
}

/* About Section */
.profile-card {
    display: flex;
    align-items: center;
    background-color: var(--card-background);
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 40px;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 10px var(--shadow-color);
}

.profile-details h3 {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
}

.profile-details p { margin-bottom: 10px; }

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    text-align: center;
}

.skill-item {
    background-color: var(--card-background);
    padding: 25px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 5px;
    background-color: var(--primary-color);
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
}

.skill-item:hover::before { transform: translateX(0); }

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px var(--shadow-color);
    border-color: var(--primary-color);
}

.skill-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 5px var(--shadow-color));
}

.skill-item p { font-size: 0.95em; color: var(--text-color); }

.skill-item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 105%; left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0,0,0,0.8);
    color: var(--primary-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
}

.skill-item:hover[data-tooltip]::after { opacity: 1; visibility: visible; }

/* ================================================
   WORK EXPERIENCE — TIMELINE
   ================================================ */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0; left: 14px;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -33px;
    top: 6px;
    width: 14px;
    height: 14px;
    background-color: var(--primary-color);
    border-radius: 50%;
    border: 2px solid var(--background-color);
    box-shadow: 0 0 10px var(--shadow-color);
}

.timeline-content {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px 30px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--shadow-color);
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}

.timeline-role {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.3em;
    color: var(--primary-color);
    margin: 0;
}

.timeline-badge {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7em;
    padding: 3px 10px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 3px;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(255, 69, 0, 0.1);
}

.timeline-badge--past {
    border-color: #888;
    color: #888;
    background: rgba(136,136,136,0.1);
}

.timeline-org {
    font-size: 1em;
    color: var(--secondary-color);
    margin: 4px 0;
}

.timeline-date {
    font-size: 0.8em;
    color: #888;
    margin: 2px 0 12px;
    font-style: italic;
}

.timeline-bullets {
    margin: 0;
    padding-left: 18px;
    color: var(--text-color);
    font-size: 0.92em;
}

.timeline-bullets li { margin-bottom: 6px; }

/* ================================================
   PORTFOLIO — SUBSECTION LABELS
   ================================================ */
.subsection-label {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.subsection-tag {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1em;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 4px 14px;
    border-radius: 3px;
    white-space: nowrap;
    background: rgba(255,69,0,0.07);
    letter-spacing: 2px;
    text-shadow: 0 0 8px var(--shadow-color);
}

.subsection-tag--hardware {
    color: var(--hardware-color);
    border-color: var(--hardware-color);
    background: rgba(0,191,255,0.07);
    text-shadow: 0 0 8px var(--hardware-shadow);
}

.subsection-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--primary-color), transparent);
}

.subsection-line--hardware {
    background: linear-gradient(to right, var(--hardware-color), transparent);
}

/* Portfolio Cards */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.project-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.project-card .project-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
    filter: brightness(0.8);
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.project-card .project-video-preview {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 200px;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-color: black;
    pointer-events: none;
}

.project-card:hover .project-thumbnail {
    opacity: 0;
    filter: brightness(1);
}

.project-card:hover .project-video-preview {
    opacity: 1;
    pointer-events: auto;
}

.project-card h3,
.project-card p,
.project-card .project-links {
    position: relative;
    z-index: 2;
    background-color: var(--card-background);
}

.project-card::before {
    content: 'CLASSIFIED';
    position: absolute;
    top: 10px; right: 10px;
    background-color: var(--error-red);
    color: white;
    padding: 5px 10px;
    font-size: 0.7em;
    font-weight: bold;
    border-radius: 3px;
    transform: rotate(5deg);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.project-card:hover::before { opacity: 1; }

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

.project-card h3 {
    font-size: 1.4em;
    color: var(--primary-color);
    padding: 15px 20px 10px;
    margin: 0;
}

.project-card p {
    padding: 0 20px 15px;
    font-size: 0.9em;
    color: var(--text-color);
}

.project-links {
    padding: 15px 20px;
    background-color: rgba(0,0,0,0.2) !important;
    border-top: 1px dashed var(--border-color);
    display: flex;
    justify-content: space-around;
}

.btn-project {
    flex: 1;
    text-align: center;
    margin: 0 5px;
    font-size: 0.85em;
    padding: 8px 15px;
    border: 1px solid var(--primary-color);
}

/* ================================================
   CERTIFICATIONS
   ================================================ */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 22px 20px;
    text-decoration: none;
    color: var(--text-color);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.cert-card::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,69,0,0.06), transparent);
    transition: left 0.5s ease;
}

.cert-card:hover::after { left: 100%; }

.cert-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--shadow-color);
    transform: translateY(-4px);
}

.cert-icon {
    font-size: 2.2em;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px var(--shadow-color));
}

.cert-info { flex: 1; }

.cert-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.05em;
    color: var(--primary-color);
    margin: 0 0 4px;
}

.cert-issuer {
    font-size: 0.85em;
    color: var(--secondary-color);
    margin: 2px 0;
}

.cert-date {
    font-size: 0.78em;
    color: #888;
    margin: 0;
    font-style: italic;
}

.cert-open {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.72em;
    color: var(--primary-color);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    letter-spacing: 1px;
}

.cert-card:hover .cert-open {
    opacity: 1;
    transform: translateX(0);
}

/* ================================================
   EDUCATION
   ================================================ */
.edu-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.edu-card {
    display: flex;
    gap: 30px;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 28px 30px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    flex-wrap: wrap;
}

.edu-card:hover {
    box-shadow: 0 0 22px var(--shadow-color);
    border-left-color: var(--secondary-color);
}

.edu-year {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85em;
    color: var(--primary-color);
    white-space: nowrap;
    min-width: 130px;
    padding-top: 4px;
    opacity: 0.85;
    letter-spacing: 1px;
}

.edu-body { flex: 1; }

.edu-degree {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2em;
    color: var(--primary-color);
    margin: 0 0 6px;
}

.edu-institution {
    font-size: 0.95em;
    color: var(--secondary-color);
    margin: 0 0 8px;
}

.edu-detail {
    font-size: 0.85em;
    color: var(--text-color);
    margin: 3px 0;
}

/* Contact Section */
.contact-section .section-title { margin-bottom: 20px; }

.contact-section p {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.1em;
}

.social-links-large {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.social-links-large a {
    display: inline-block;
    line-height: 0;
}

.social-links-large img {
    width: 80px;
    height: 80px;
    filter: grayscale(100%) brightness(0.8) drop-shadow(0 0 5px rgba(0,0,0,0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.social-links-large a:hover img {
    transform: translateY(-8px) scale(1.1);
    filter: grayscale(0%) brightness(1.2) drop-shadow(0 0 15px var(--shadow-color));
}

.social-links { display: none; }

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px dashed var(--border-color);
    color: #666;
    font-size: 0.9em;
    margin-top: 50px;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .navbar { flex-direction: column; align-items: center; }
    .nav-link { margin: 3px 0; font-size: 0.8em; }
    .hero-content h1.glitch { font-size: 3em; }
    .hero-content h2 { font-size: 2em; }
    .hero-content p.typewriter { font-size: 1.2em; }
    .section-title { font-size: 2em; }
    .profile-card { flex-direction: column; text-align: center; }
    .profile-pic { margin-right: 0; margin-bottom: 20px; }
    .skills-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .portfolio-grid { grid-template-columns: 1fr; }
    .project-links { flex-direction: column; }
    .btn-project { margin: 5px 0; width: 90%; }
    .social-links-large { gap: 25px; }
    .social-links-large img { width: 60px; height: 60px; }
    .timeline { padding-left: 30px; }
    .timeline-dot { left: -26px; }
    .edu-card { flex-direction: column; gap: 8px; }
    .edu-year { min-width: auto; }
    .cert-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .hero-content h1.glitch { font-size: 2em; }
    .hero-content h2 { font-size: 1.5em; }
    .hero-content p.typewriter { font-size: 1em; }
    .section { padding: 60px 15px; }
    .profile-pic { width: 120px; height: 120px; }
    .social-links-large { gap: 20px; }
    .social-links-large img { width: 50px; height: 50px; }
    .section-title { font-size: 1.6em; }
}
