/* ===========================================
   PORTFOLIO STYLES - Sudesh Kumar S
   =========================================== */

/* RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::selection {
    background: rgba(0, 217, 255, 0.3);
    color: #ffffff;
}

:root {
    --primary: #00ff41;
    --secondary: #00d9ff;
    --accent: #ff2a6d;
    --bg-dark: #0d0d0d;
    --bg-darker: #050505;
    --bg-card: #1a1a1a;
    --text: #00ff41;
    --text-secondary: #88ffaa;
    --text-dim: #00aa33;
    --border: #00ff4133;
    --shadow: rgba(0, 255, 65, 0.15);
    --nav-height: 70px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Courier New', 'Monaco', monospace;
    background: var(--bg-dark);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
    transition: all 0.5s ease;
}

/* FLUID TYPOGRAPHY */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); }
p { font-size: clamp(0.9rem, 2vw, 1.05rem); }

/* HACKER MODE STYLES */
body.hacker-mode {
    background: #000011 !important;
    animation: hackerBg 3s infinite;
}

@keyframes hackerBg {
    0%, 100% { background: #000011; }
    50% { background: #001133; }
}

.hacker-mode #matrix-bg { opacity: 0.4 !important; }
.hacker-mode .terminal-window { border-color: #ff0000 !important; box-shadow: 0 0 60px rgba(255, 0, 0, 0.8) !important; }
.hacker-mode .hero-content h1 { color: #ff0000 !important; text-shadow: 0 0 40px #ff0000, 0 0 80px #ff0000 !important; }
.hacker-mode .project-card { border-color: #ff0000 !important; background: linear-gradient(135deg, rgba(255,0,0,0.15), rgba(255,50,0,0.1)) !important; }
.hacker-mode .btn { border-color: #ff0000 !important; color: #ff0000 !important; }

/* MATRIX BACKGROUND */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.04;
    transition: all 0.5s ease;
}

/* HAMBURGER MENU */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    background: transparent;
    border: none;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background: var(--primary);
    margin: 4px 0;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px var(--primary);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-8px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-8px, -6px);
}

/* NAVIGATION */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(13, 13, 13, 0.98);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid var(--border);
    z-index: 1000;
    padding: 1rem 2rem;
    box-shadow: 0 4px 30px rgba(0, 255, 65, 0.1);
    transition: all 0.5s ease;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav.scrolled {
    padding: 0.5rem 2rem;
    background: rgba(13, 13, 13, 0.99);
}

.nav-brand {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 0 20px var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    transition: all 0.3s ease;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0.5rem 1rem;
    letter-spacing: 1px;
    display: block;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary);
}

/* SECTIONS */
section {
    min-height: 100vh;
    padding: calc(var(--nav-height) + 3rem) 2rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* HERO SECTION */
#hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: calc(var(--nav-height) + 5rem) 2rem 4rem;
}

.terminal-container {
    width: 100%;
    max-width: 900px;
    perspective: 1000px;
    margin-bottom: 2rem;
}

.terminal-window {
    background: var(--bg-darker);
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 0;
    width: 100%;
    box-shadow: 0 0 60px var(--shadow);
    transform: rotateX(2deg);
    transition: all 0.5s ease;
}

.terminal-window:hover {
    transform: rotateX(0deg) scale(1.01);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 255, 65, 0.05);
    border-bottom: 1px solid var(--border);
    border-radius: 6px 6px 0 0;
}

.terminal-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px currentColor;
    transition: all 0.3s;
    cursor: pointer;
}

.terminal-btn:nth-child(2) { background: #ffbd2e; }
.terminal-btn:nth-child(3) { background: var(--primary); }

.terminal-title {
    margin-left: auto;
    color: var(--text-dim);
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    letter-spacing: 2px;
}

.terminal-body {
    padding: 2rem;
    max-height: 300px;
    overflow-y: auto;
}

.command-history {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.terminal-line {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: clamp(0.85rem, 2vw, 1rem);
    word-break: break-word;
}

.terminal-prompt {
    color: var(--secondary);
    font-weight: bold;
}

.command-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.command-input {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: clamp(0.85rem, 2vw, 1rem);
    outline: none;
    flex: 1;
    padding: 0.5rem 0;
    min-width: 200px;
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 18px;
    background: var(--primary);
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-content h1 {
    margin: 2rem 0 1rem;
    color: var(--primary);
    text-shadow: 0 0 30px var(--primary), 0 0 60px var(--primary);
    animation: glow 2s ease-in-out infinite alternate;
    letter-spacing: 3px;
    transition: all 0.5s ease;
}

@keyframes glow {
    from { text-shadow: 0 0 20px var(--primary), 0 0 40px var(--primary); }
    to { text-shadow: 0 0 30px var(--primary), 0 0 60px var(--primary); }
}

.role {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-secondary);
    margin-top: 1rem;
    letter-spacing: 2px;
}

.role-highlight {
    color: var(--secondary);
    font-weight: bold;
}

.hero-description {
    color: var(--text-dim);
    margin: 1.5rem auto 0;
    max-width: 600px;
    line-height: 1.8;
    text-align: center;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 1rem 2rem;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: clamp(0.85rem, 2vw, 1rem);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    font-weight: bold;
    min-width: 150px;
    text-align: center;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary);
    transition: left 0.3s;
    z-index: -1;
}

.btn:hover::before {
    left: 0;
}

.btn:hover {
    color: var(--bg-dark);
    box-shadow: 0 0 30px var(--primary);
    transform: translateY(-3px);
}

.btn-secondary {
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-secondary::before {
    background: var(--secondary);
}

/* SECTION HEADERS */
.section-header {
    margin-bottom: 3rem;
    text-align: center;
    color: var(--primary);
    position: relative;
    letter-spacing: 3px;
    transition: all 0.5s ease;
}

.section-header::before {
    content: '[ ';
    color: var(--secondary);
    text-shadow: 0 0 15px var(--secondary);
}

.section-header::after {
    content: ' ]';
    color: var(--secondary);
    text-shadow: 0 0 15px var(--secondary);
}

/* ABOUT SECTION */
.about-content {
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.03), rgba(0, 217, 255, 0.03));
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 8px;
    line-height: 1.9;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 1000px;
    margin: 0 auto;
}

.about-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.about-content strong {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

/* TIMELINE */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background: var(--primary);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    border-radius: 10px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    animation: slideIn 0.6s ease-out;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--bg-dark);
    border: 4px solid var(--primary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(odd)::after {
    right: -10px;
}

.timeline-item:nth-child(even)::after {
    left: -10px;
}

.timeline-content {
    padding: 20px 30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    position: relative;
}

.timeline-content h3 {
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

/* SKILLS */
.skill-tree {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-node {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.skill-node:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
}

.skill-node.active {
    border-color: var(--secondary);
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), transparent);
}

.skill-node h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.skill-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.skill-node.active .skill-details {
    max-height: 200px;
    margin-top: 1rem;
}

.skill-details p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.skill-bar {
    height: 10px;
    background: rgba(0, 255, 65, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-top: 0.5rem;
}

.skill-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00aa33, #00d9ff);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 170, 51, 0.4);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* PROJECTS */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.project-card {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), rgba(13, 13, 13, 0.9));
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 80px var(--shadow);
    transform: translateY(-10px);
}

.project-card h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.project-status {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(0, 255, 65, 0.2);
    border: 1px solid var(--primary);
    border-radius: 5px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.project-desc {
    margin: 1.5rem 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1.5rem 0;
}

.tech-tag {
    padding: 0.4rem 1rem;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--secondary);
    border-radius: 5px;
    font-size: 0.85rem;
    color: var(--secondary);
    transition: all 0.3s;
}

.tech-tag:hover {
    background: rgba(0, 217, 255, 0.2);
    transform: translateY(-2px);
}

.project-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.project-links a:hover {
    color: var(--secondary);
    text-shadow: 0 0 15px var(--secondary);
    transform: translateX(5px);
}

/* SERVICES */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05), rgba(0, 255, 65, 0.05));
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    border-color: var(--secondary);
    box-shadow: 0 20px 80px rgba(0, 217, 255, 0.3);
    transform: translateY(-10px);
}

.service-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px currentColor);
    transition: all 0.3s;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotateY(360deg);
}

.service-card h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
}

.service-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 1rem 0 1.5rem;
    min-height: 80px;
}

.service-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.service-card .btn {
    margin-top: 1rem;
    width: 100%;
}

/* CERTIFICATIONS */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.cert-card {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05), rgba(0, 255, 65, 0.05));
    border: 1px solid var(--secondary);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    transition: all 0.4s;
}

.cert-card:hover {
    border-color: var(--primary);
    box-shadow: 0 15px 50px rgba(0, 217, 255, 0.3);
    transform: scale(1.05);
}

.cert-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px currentColor);
}

.cert-card h3 {
    color: var(--secondary);
    margin-bottom: 0.7rem;
}

.cert-status {
    color: var(--text-dim);
    font-weight: bold;
    letter-spacing: 1px;
}

/* CONTACT */
.contact-container {
    max-width: 700px;
    margin: 0 auto;
}

.method-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.method-card {
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.05), rgba(0, 217, 255, 0.03));
    border: 2px solid var(--border);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s;
}

.method-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px var(--shadow);
}

.method-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.15), rgba(0, 217, 255, 0.08));
}

.method-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px currentColor);
}

.method-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.contact-form {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
    font-size: 1rem;
}

.form-input option {
    background: var(--bg-dark);
    color: var(--text-secondary);
    padding: 0.5rem;
}

.form-input select {
    cursor: pointer;
}

.form-input select option {
    background-color: var(--bg-dark);
    color: var(--text-secondary);
}

.form-input select option:checked {
    background: var(--primary);
    color: var(--bg-dark);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--shadow);
    outline: none;
}

.contact-info {
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.05), rgba(0, 217, 255, 0.05));
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    padding: 1rem;
    background: rgba(0, 255, 65, 0.03);
    border-radius: 5px;
    transition: all 0.3s;
    flex-wrap: wrap;
}

.contact-item:hover {
    background: rgba(0, 255, 65, 0.08);
    transform: translateX(10px);
}

.contact-item a {
    color: var(--secondary);
    text-decoration: none;
    word-break: break-all;
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s;
    padding: 1rem 2rem;
    border: 2px solid var(--primary);
    border-radius: 5px;
    letter-spacing: 1px;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.social-links a:hover {
    color: var(--bg-dark);
    background: var(--primary);
    transform: scale(1.05) translateY(-5px);
}

/* BACK TO TOP */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--bg-dark);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s;
    z-index: 999;
    box-shadow: 0 0 20px var(--primary);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px var(--primary);
}

/* TOAST NOTIFICATION */
.toast {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.95), rgba(0, 170, 51, 0.95));
    color: var(--bg-dark);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    z-index: 10001;
    transform: translateX(400px);
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0, 255, 65, 0.5);
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: linear-gradient(135deg, rgba(255, 42, 109, 0.95), rgba(200, 0, 50, 0.95));
    color: white;
}

/* FOOTER */
footer {
    background: var(--bg-darker);
    border-top: 2px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-dim);
}

footer p {
    margin: 0.5rem 0;
}

footer strong {
    color: var(--primary);
}

/* SCANLINE */
.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.03) 2px,
        rgba(0, 255, 65, 0.03) 4px
    );
    z-index: 9999;
    animation: scan 8s linear infinite;
}

@keyframes scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

/* LOADING SCREEN */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s;
}

.loading-text {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary);
    margin-bottom: 2rem;
}

.loading-bar-container {
    width: 90%;
    max-width: 500px;
}

.loading-bar {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--primary);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--primary) 100%);
    transition: width 0.3s ease-out;
    box-shadow: 0 0 20px var(--primary);
}

.loading-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bg-dark);
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 10;
    mix-blend-mode: difference;
}

.loading-status {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 1rem;
}

/* FADE IN ANIMATIONS */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* PROGRESS INDICATOR */
.progress-indicator {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 1001;
    transition: width 0.1s;
    box-shadow: 0 0 10px var(--primary);
}

/* RIPPLE ANIMATION */
@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
    }

    .hamburger {
        display: flex;
    }

    nav {
        padding: 1rem;
    }

    nav ul {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: rgba(13, 13, 13, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        gap: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    nav ul.active {
        transform: translateX(0);
    }

    nav a {
        width: 100%;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        font-size: 1.1rem;
    }

    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-item::after {
        left: 21px;
    }

    section {
        padding: calc(var(--nav-height) + 2rem) 1rem 2rem;
    }

    #hero {
        padding: calc(var(--nav-height) + 3rem) 1rem 2rem;
    }

    .terminal-body {
        padding: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .projects-grid,
    .skill-tree,
    .services-grid {
        grid-template-columns: 1fr;
    }

    .method-cards {
        grid-template-columns: 1fr;
    }

    .social-links {
        flex-direction: column;
    }

    .social-links a {
        width: 100%;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    #matrix-bg {
        opacity: 0.02;
    }
}

@media (max-width: 480px) {
    .terminal-header {
        padding: 0.8rem 1rem;
    }

    .terminal-title {
        display: none;
    }

    .about-content,
    .contact-info {
        padding: 1.5rem;
    }

    .project-card,
    .skill-node,
    .cert-card {
        padding: 1.5rem;
    }
}

/* TABLET OPTIMIZATIONS */
@media (min-width: 769px) and (max-width: 1024px) {
    .projects-grid,
    .skill-tree {
        grid-template-columns: repeat(2, 1fr);
    }

    .cert-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* HIGH CONTRAST */
@media (prefers-contrast: high) {
    :root {
        --primary: #00ff00;
        --secondary: #00ffff;
        --accent: #ff0000;
        --border: #ffffff;
    }
}