:root {
    --bg-base: #080c14;
    --bg-panel: rgba(15, 22, 34, 0.78);
    --bg-panel-strong: rgba(10, 16, 26, 0.94);
    --text-main: #ecf1ff;
    --text-muted: #9eb0c9;
    --line-soft: rgba(125, 168, 234, 0.25);
    --line-strong: rgba(94, 232, 186, 0.45);
    --accent: #5ee8ba;
    --accent-2: #67c5ff;
    --accent-warm: #f6d58e;
    --shadow-soft: 0 12px 40px rgba(4, 8, 16, 0.45);
    --shadow-strong: 0 22px 70px rgba(2, 6, 13, 0.55);

    /* Design tokens */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --gap-xs: 0.4rem;
    --gap-sm: 0.8rem;
    --gap-md: 1.4rem;
    --gap-lg: 2.4rem;
    --fz-sm: 0.85rem;
    --fz-md: 0.95rem;
    --fz-lg: 1.15rem;
    --transition-slow: 0.35s cubic-bezier(.2,.9,.2,1);
    --transition-fast: 0.18s ease-out;
}

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

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: radial-gradient(circle at 8% -10%, rgba(103, 197, 255, 0.2), transparent 38%),
                radial-gradient(circle at 92% 5%, rgba(94, 232, 186, 0.15), transparent 34%),
                linear-gradient(165deg, #070b12 0%, #0b1220 56%, #0a1320 100%);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.65;
}

/* Utility: visually hidden for accessibility */
.sr-only {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
}

body::before {
    background-image: linear-gradient(rgba(86, 139, 211, 0.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(86, 139, 211, 0.06) 1px, transparent 1px);
    background-size: 42px 42px;
}

body::after {
    z-index: -1;
    background: radial-gradient(circle at 25% 35%, rgba(94, 232, 186, 0.1), transparent 30%),
                radial-gradient(circle at 85% 80%, rgba(103, 197, 255, 0.12), transparent 32%);
}

.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #020508;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.boot-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.boot-content {
    max-width: 840px;
    width: 90%;
    padding: 2rem;
}

.boot-header {
    margin-bottom: 2rem;
    overflow: hidden;
}

.ascii-art {
    color: var(--accent);
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 0 12px rgba(94, 232, 186, 0.55);
    animation: glitch 3s infinite;
}

.boot-terminal {
    margin-bottom: 2rem;
}

.boot-terminal p {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    opacity: 0;
    animation: bootLine 0.3s forwards;
}

.boot-terminal p:nth-child(1) { animation-delay: 0.5s; }
.boot-terminal p:nth-child(2) { animation-delay: 1s; }
.boot-terminal p:nth-child(3) { animation-delay: 1.5s; }
.boot-terminal p:nth-child(4) { animation-delay: 2s; }
.boot-terminal p:nth-child(5) { animation-delay: 2.5s; }
.boot-terminal p:nth-child(6) { animation-delay: 3s; }
.boot-terminal p:nth-child(7) { animation-delay: 3.5s; }

.boot-prompt {
    color: var(--accent-2);
    font-weight: 700;
    margin-right: 0.5rem;
}

.boot-text {
    color: var(--text-muted);
}

.boot-status {
    float: right;
    font-weight: 700;
}

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

.boot-ready {
    color: var(--accent-warm);
    animation: pulse 1s infinite;
}

.boot-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.boot-progress {
    margin-bottom: 2rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    animation: bootLine 0.3s forwards 4s;
}

.boot-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    width: 0%;
    animation: progress 2s ease-out forwards 4s;
    box-shadow: 0 0 12px rgba(94, 232, 186, 0.55);
}

@keyframes progress {
    to { width: 100%; }
}

.boot-footer {
    text-align: center;
    color: var(--accent);
    font-size: 0.9rem;
    opacity: 0;
    animation: bootLine 0.3s forwards 4.5s, blink 1s infinite 5s;
}

@keyframes bootLine {
    to { opacity: 1; }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

@keyframes glitch {
    0%, 90%, 100% {
        transform: translate(0);
        text-shadow: 0 0 12px rgba(94, 232, 186, 0.55);
    }
    92% {
        transform: translate(-2px, 2px);
        text-shadow: 0 0 12px rgba(94, 232, 186, 0.75), 2px 0 5px rgba(255, 0, 0, 0.5);
    }
    94% {
        transform: translate(2px, -2px);
        text-shadow: 0 0 12px rgba(94, 232, 186, 0.75), -2px 0 5px rgba(0, 0, 255, 0.5);
    }
    96% {
        transform: translate(0);
        text-shadow: 0 0 12px rgba(94, 232, 186, 0.55);
    }
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(8, 12, 20, 0.72);
    border-bottom: 1px solid rgba(103, 197, 255, 0.18);
    padding: 0.75rem 1.75rem;
    z-index: 1000;
    backdrop-filter: blur(14px);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--gap-md);
}

.logo {
    color: var(--accent);
    font-size: 1.06rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: #e3ecff;
    text-decoration: none;
    margin-left: 1rem;
    font-size: var(--fz-md);
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.nav-links a:hover {
    color: var(--accent);
    border-color: rgba(94, 232, 186, 0.45);
    background: rgba(94, 232, 186, 0.08);
    transform: translateY(-3px);
}

.nav-links a:focus-visible {
    outline: 3px solid rgba(103,197,255,0.12);
    outline-offset: 3px;
    border-radius: calc(var(--radius-lg) + 2px);
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap-lg);
    padding-top: 96px;
}

.hero-content {
    text-align: center;
    max-width: 920px;
}

.tag {
    display: inline-block;
    border: 1px solid rgba(103, 197, 255, 0.5);
    padding: 0.55rem 1.05rem;
    border-radius: 999px;
    background: rgba(16, 29, 48, 0.65);
    color: var(--accent-2);
    margin-bottom: var(--gap-lg);
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Animated gradient text for prominent headings (respect reduced-motion) */
.animated-gradient-text {
    font-size: clamp(2.4rem, 6.5vw, 4.35rem);
    font-family: var(--font-heading, 'Space Grotesk'), sans-serif;
    font-weight: 700;
    background: linear-gradient(90deg, #ff00ff, #00ffff, #ff00ff);
    background-size: 200% auto;
    color: #fff; /* fallback */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    display: inline-block;
    animation: gradient-flow 4s linear infinite;
}

@keyframes gradient-flow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

@media (prefers-reduced-motion: reduce) {
    .animated-gradient-text { animation: none; }
}

h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.2rem, 7vw, 4.35rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.9rem;
    background: linear-gradient(90deg, #ebfbff 0%, #8af0ce 52%, #8fcfff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 2.4rem;
}

.terminal-window {
    background: linear-gradient(165deg, rgba(12, 18, 29, 0.96), rgba(10, 16, 26, 0.9));
    border: 1px solid rgba(125,168,234,0.06);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.4rem;
    margin: 2rem auto;
    max-width: 760px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(2,6,13,0.6), 0 2px 8px rgba(94,232,186,0.04);
}

.terminal-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: #ff6d8d; }
.dot-yellow { background: #ffd36c; }
.dot-green { background: #65ecbe; }

.terminal-text {
    font-size: 0.92rem;
    line-height: 1.6;
}

.terminal-console {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.terminal-output {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.55rem 0;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 0.35rem;
}

/* Skeleton / loading state utilities (lightweight) */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.035), rgba(255,255,255,0.02));
    position: relative;
    overflow: hidden;
}
.skeleton::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.00) 0%, rgba(255,255,255,0.035) 50%, rgba(255,255,255,0.00) 100%);
    transform: translateX(-100%);
    animation: loading 1.6s linear infinite;
}
@keyframes loading { to { transform: translateX(100%); } }

.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: rgba(103, 197, 255, 0.35);
    border-radius: 999px;
}

.terminal-line {
    color: #e7efff;
}

.terminal-line strong {
    color: var(--accent);
}

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.2rem;
    border-top: 1px dashed rgba(103, 197, 255, 0.25);
    padding-top: 0.6rem;
}

.terminal-prompt {
    font-size: 1rem;
}

.terminal-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #f2f7ff;
    font-family: inherit;
    font-size: 0.92rem;
}

.terminal-input::placeholder {
    color: rgba(212, 226, 255, 0.45);
}

.terminal-text .prompt { color: var(--accent); }
.terminal-text .command { color: #ffb3c4; }
.terminal-text .output { color: #f1f5ff; }

.terminal-text .link {
    color: var(--accent-2);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.95rem 1.8rem;
    border-radius: 999px;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    border: 1px solid;
    will-change: transform;
}

.btn-primary {
    background: linear-gradient(120deg, rgba(94, 232, 186, 0.18), rgba(103, 197, 255, 0.22));
    border-color: rgba(94, 232, 186, 0.6);
    color: #e8fff6;
    box-shadow: 0 8px 26px rgba(94,232,186,0.14);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 18px 46px rgba(94,232,186,0.18);
}

.btn-secondary {
    background: transparent;
    border-color: rgba(103, 197, 255, 0.6);
    color: #c5e4ff;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    background: rgba(103, 197, 255, 0.08);
}

.cta-sign {
    color: var(--text-muted);
    font-size: 0.82rem;
    align-self: center;
}

section {
    padding: var(--gap-lg) 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.75rem, 4.8vw, 2.45rem);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    letter-spacing: 0.01em;
}

h2::before {
    content: '#';
    color: var(--accent-2);
    margin-right: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 110px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.about-container {
    margin-top: 3rem;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.about-text p {
    color: var(--text-muted);
    line-height: 1.9;
    margin-bottom: 1.2rem;
}

.about-intro {
    font-size: 1.12rem;
    color: #f3f7ff !important;
}

.about-text .highlight {
    color: var(--accent);
    font-weight: 700;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.3rem 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.01), var(--bg-panel));
    border: 1px solid rgba(125,168,234,0.06);
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
    border-color: var(--line-strong);
}

.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.85rem;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.about-image {
    position: sticky;
    top: 95px;
}

.code-window {
    background: var(--bg-panel);
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.code-header {
    background: rgba(9, 15, 24, 0.82);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(103, 197, 255, 0.2);
}

.code-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.code-title {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: auto;
}

.code-content {
    padding: 1.15rem;
    overflow-x: auto;
}

.code-content pre { margin: 0; }

/* Improve code block wrapping and prevent manual spacing from pushing text to the right */
.code-content pre, .code-content code {
    white-space: pre-wrap; /* allow wrapping while preserving line breaks */
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    tab-size: 2;
}

.code-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.86rem;
    line-height: 1.65;
    color: #ecf1ff;
}

.code-keyword { color: #ff9cb2; }
.code-variable { color: #f6d58e; }
.code-property { color: #86c9ff; }
.code-string { color: #70efc5; }

.skills-grid,
.certifications-grid,
.projects-grid,
.contact-grid {
    display: grid;
    gap: 1.4rem;
    margin-top: 2.4rem;
}

.skills-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.certifications-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.projects-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.contact-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.contact-item {
    display: block;
    text-decoration: none;
    color: inherit;
}

.skill-category,
.cert-card,
.project-card,
.contact-item,
.contact-form,
.timeline-content {
    background: linear-gradient(180deg, rgba(255,255,255,0.01), var(--bg-panel));
    border: 1px solid rgba(125,168,234,0.06);
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 8px 28px rgba(2,6,13,0.5);
}

.skill-category,
.cert-card,
.project-card,
.contact-item,
.contact-form,
.timeline-content {
    padding: 1.55rem;
}

.project-card {
    position: relative;
    overflow: hidden;
    will-change: transform, opacity;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: -20% 0 50%;
    background: radial-gradient(circle at top center, rgba(94,232,186,0.16), transparent 30%);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
}

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

.project-highlights {
    list-style: none;
    margin: 1rem 0 0 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.project-highlights li {
    position: relative;
    padding-left: 1.4rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.project-highlights li::before {
    content: '•';
    position: absolute;
    left: 0;
    top: 0.15rem;
    color: var(--accent);
    font-size: 1rem;
}

.skill-category:hover,
.cert-card:hover,
.project-card:hover,
.contact-item:hover,
.timeline-content:hover {
    transform: translateY(-6px);
    border-color: var(--line-strong);
    box-shadow: 0 18px 48px rgba(2,6,13,0.55);
}

/* Focus states for interactive elements */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(94,232,186,0.14);
    outline-offset: 3px;
}

.skill-category h3,
.timeline-content h3,
.project-card h3,
.cert-card h3,
.contact-item h3 {
    color: #ecf7ff;
    margin-bottom: 0.85rem;
    font-family: 'Space Grotesk', sans-serif;
}

.skill-item { margin-bottom: 0.5rem; }

.skill-name {
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.55rem;
    color: #d8e8ff;
    font-size: 0.86rem;
}

.skill-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 999px;
    transition: width 1.1s ease-out;
}

.timeline {
    position: relative;
    margin-top: 2.6rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, rgba(94,232,186,1), rgba(103,197,255,0.65) 45%, rgba(94,232,186,1));
    background-size: 100% 300%;
    animation: timeline-gradient 4s linear infinite;
    box-shadow: 0 0 32px rgba(94,232,186,0.4), inset 0 0 18px rgba(103,197,255,0.28);
}

@keyframes timeline-gradient {
    0% { background-position: 50% 0%; }
    50% { background-position: 50% 100%; }
    100% { background-position: 50% 0%; }
}

.timeline::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 16px;
    height: 100%;
    background: linear-gradient(180deg, rgba(94,232,186,0.18), transparent 35%, rgba(103,197,255,0.18));
    pointer-events: none;
    filter: blur(12px);
    opacity: 0.7;
    animation: timeline-flow 4.5s ease-in-out infinite;
}

@keyframes timeline-flow {
    0% { transform: translateX(-50%) translateY(-5%); opacity: 0.75; }
    50% { transform: translateX(-50%) translateY(2%); opacity: 0.95; }
    100% { transform: translateX(-50%) translateY(-5%); opacity: 0.75; }
}

.timeline-item {
    margin-bottom: 2.2rem;
    position: relative;
}

.timeline-item:nth-child(odd) {
    padding-right: 50%;
    text-align: right;
}

.timeline-item:nth-child(even) {
    padding-left: 50%;
    text-align: left;
}

.timeline-item:nth-child(odd) .timeline-content { margin-right: 1.7rem; }
.timeline-item:nth-child(even) .timeline-content { margin-left: 1.7rem; }

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 0.9rem;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid #0b1220;
    box-shadow: 0 0 0 6px rgba(94, 232, 186, 0.14);
}

.timeline-date,
.cert-date,
.cert-issuer {
    color: var(--accent-2);
    font-size: 0.85rem;
    margin-bottom: 0.65rem;
}

.timeline-description,
.project-card p,
.cert-description,
.stat-label,
.contact-note,
footer,
.blog-card p {
    color: var(--text-muted);
}

.cert-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(94, 232, 186, 0.05), transparent 30%, rgba(103, 197, 255, 0.05));
    pointer-events: none;
}

.cert-icon {
    font-size: 2.1rem;
    text-align: center;
    margin-bottom: 0.9rem;
}

.cert-badge {
    background: rgba(103, 197, 255, 0.08);
    border: 1px solid rgba(103, 197, 255, 0.25);
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
    margin-bottom: 1rem;
}

.cert-badge-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.cert-title {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(103, 197, 255, 0.2);
}

.cert-badge-text {
    color: var(--accent-warm);
    font-weight: 700;
    font-size: 0.84rem;
}

.contact-container {
    max-width: 880px;
    margin: 2.5rem auto;
}

.contact-icon {
    font-size: 1.7rem;
    margin-bottom: 0.7rem;
}

.contact-item a {
    color: var(--accent-2);
    text-decoration: none;
    word-break: break-all;
}

.contact-item a:hover {
    color: var(--accent);
}

.contact-form {
    margin-top: 0.6rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    color: #dcf3ff;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(103, 197, 255, 0.28);
    border-radius: 10px;
    padding: 0.78rem;
    color: #f2f7ff;
    font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(94, 232, 186, 0.14);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

.form-status {
    margin: 0 0 0.85rem;
    color: #8ee8c1;
    font-size: 0.92rem;
    min-height: 1.35rem;
}
.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #07211a;
    border: none;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(2,6,13,0.45);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.submit-btn:focus-visible { outline: 3px solid rgba(94,232,186,0.16); outline-offset: 3px; }

.submit-btn .btn-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.22);
    border-top-color: rgba(255,255,255,0.95);
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

.submit-btn .btn-text { display: inline-block; }

.submit-btn.loading { opacity: 0.95; transform: translateY(0); }
.submit-btn.loading .btn-spinner { display: inline-block; }

.submit-btn.success {
    background: linear-gradient(120deg, rgba(94,232,186,0.95), rgba(103,197,255,0.95));
    color: #021012;
    box-shadow: 0 14px 40px rgba(94,232,186,0.18);
    transform: translateY(-2px);
}

@keyframes spin { to { transform: rotate(360deg); } }

.submit-btn:hover { transform: translateY(-3px); box-shadow: 0 18px 46px rgba(94,232,186,0.18); }

footer {
    text-align: center;
    padding: 2.2rem;
    background: rgba(8, 12, 20, 0.85);
    border-top: 1px solid rgba(103, 197, 255, 0.2);
}

footer .signature {
    color: var(--accent);
    font-weight: 700;
}

.lazy-section {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Extra small devices */
@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
    
    .tag { font-size: 0.75rem; padding: 0.4rem 0.8rem; }
    
    .boot-content { padding: 0.8rem; }
    .ascii-art { font-size: 0.4rem; line-height: 1; }
    .boot-terminal p { font-size: 0.75rem; margin-bottom: 0.5rem; }
    .boot-footer { font-size: 0.7rem; }
    
    nav { padding: 0.7rem 1rem; }
    .logo { font-size: 0.9rem; }
    .logo-sign { display: none; }
    
    .hero { padding: 0.8rem; padding-top: 70px; min-height: 90vh; }
    .subtitle { font-size: 0.9rem; margin-bottom: 1.5rem; }
    
    .terminal-window { padding: 1rem 0.8rem; margin: 1.5rem auto; }
    .terminal-text { font-size: 0.8rem; }
    
    .btn { padding: 0.8rem 1.4rem; font-size: 0.85rem; }
    .cta-sign { font-size: 0.7rem; }
    
    section { padding: 2.5rem 1rem; }
    
    .about-stats { grid-template-columns: 1fr; gap: 0.8rem; }
    .stat-item { padding: 1rem 0.8rem; }
    .stat-number { font-size: 1.5rem; }
    
    .skills-grid { grid-template-columns: 1fr; }
    .certifications-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    
    .contact-item { padding: 1.2rem; }
    .contact-icon { font-size: 1.5rem; }
    
    .form-group input,
    .form-group textarea { padding: 0.6rem; }
    
    .terminal-input { font-size: 0.8rem; }
}

/* Small devices - phones */
@media (max-width: 640px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    
    .tag { font-size: 0.78rem; }
    
    .boot-content { padding: 1rem; }
    .ascii-art { font-size: 0.48rem; }
    .boot-terminal p { font-size: 0.82rem; }
    
    .hamburger { display: flex; }
    
    .nav-links {
        position: fixed;
        top: 62px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 62px);
        max-height: calc(100vh - 62px);
        background: var(--bg-panel-strong);
        flex-direction: column;
        align-items: stretch;
        padding: 1.2rem;
        transition: left 0.3s ease;
        border-bottom: 1px solid rgba(103, 197, 255, 0.22);
        overflow-y: auto;
        z-index: 999;
    }
    
    .nav-links.active { left: 0; }
    
    .nav-links a {
        margin: 0.5rem 0;
        padding: 0.6rem;
        text-align: center;
        border: 1px solid rgba(103, 197, 255, 0.18);
        border-radius: 8px;
    }
    
    .hero { padding: 1rem; padding-top: 75px; min-height: 85vh; }
    .hero-content { max-width: 100%; }
    .subtitle { font-size: 0.95rem; }
    
    .terminal-window { padding: 1rem; border-radius: 12px; }
    .terminal-text { font-size: 0.88rem; line-height: 1.5; }
    
    .cta-buttons { flex-direction: column; gap: 0.8rem; }
    .btn { width: 100%; padding: 0.9rem; }
    .cta-sign { display: block; margin-top: 0.5rem; }
    
    section { padding: 3rem 1rem; }
    
    .about-content { grid-template-columns: 1fr; gap: 1.5rem; }
    .about-image { position: static; order: -1; }
    .about-stats { grid-template-columns: 1fr; }
    
    .timeline::before { left: 0; }
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding-left: 1.4rem;
        padding-right: 0;
        text-align: left;
    }
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 0;
        margin-right: 0;
    }
    .timeline-dot { left: 0; transform: translateX(-50%); }
    
    .contact-form { margin-top: 1.5rem; }
    
    .code-content { padding: 0.8rem; }
    .code-content code { font-size: 0.8rem; }
}

/* Medium devices - tablets */
@media (max-width: 768px) {
    h1 { font-size: 2.55rem; }
    h2 { font-size: 2rem; }
    
    .boot-content { padding: 1.2rem; }
    .ascii-art { font-size: 0.52rem; }
    .boot-terminal p { font-size: 0.86rem; }
    .boot-footer { font-size: 0.82rem; }
    
    nav { padding: 0.9rem 1.5rem; }
    
    .hero { padding: 1.2rem; padding-top: 80px; }
    .terminal-window { padding: 1.3rem; }
    .terminal-text { font-size: 0.9rem; }
    
    .cta-buttons { flex-direction: column; }
    .btn { width: 100%; }
    
    section { padding: 3.5rem 1.5rem; }
    
    .about-content { grid-template-columns: 1fr; gap: 2rem; }
    .about-image { position: static; order: -1; }
    .about-stats { grid-template-columns: repeat(2, 1fr); }
    
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .certifications-grid { grid-template-columns: repeat(2, 1fr); }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: repeat(2, 1fr); }
    
    .timeline::before { left: 0; }
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding-left: 1.6rem;
        padding-right: 0;
        text-align: left;
    }
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 0;
        margin-right: 0;
    }
    .timeline-dot { left: 0; transform: translateX(-50%); }
}

/* Large devices - small laptops */
@media (max-width: 1024px) {
    section { padding: 4rem 1.5rem; }
    .about-stats { grid-template-columns: repeat(3, 1fr); }
}

/* Performance: reduce heavy painting on smaller devices */
@media (max-width: 768px) {
    .skill-category,
    .cert-card,
    .project-card,
    .contact-item,
    .contact-form,
    .timeline-content {
        box-shadow: none;
        transform: none;
        will-change: auto;
    }

    .project-card::before {
        display: none;
    }
}
