/* Root Variables */
:root {
    --primary-color: #00ff88;
    --secondary-color: #0088ff;
    --accent-color: #ff0088;
    --bg-dark: #0a0e27;
    --bg-darker: #050816;
    --bg-card: #151a30;
    --text-primary: #ffffff;
    --text-secondary-1: #a0aec0;
    --code-keyword: #ff79c6;
    --code-function: #50fa7b;
    --code-string: #f1fa8c;
    --code-comment: #6272a4;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    --text-secondary: #00ff00; /* Terminal green */
    --background: #000000; /* Terminal black */
    --cursor-color: #00ff00; /* Cursor color */
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-darker);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(1rem, 5vw, 3rem);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
    height: auto;
}

/* Ensure adequate padding and spacing on all screen sizes */
@media (max-width: 1024px) {
    .navbar {
        padding: 0.5rem 0;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 5vw, 3rem);
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 600;
    font-family: 'Courier New', 'Consolas', monospace;
    position: relative;
    padding: 0.5rem 0;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Terminal prompt styling */
.logo-prompt {
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
    transition: all 0.3s;
}

.logo:hover .logo-prompt {
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
}

/* Command styling */
.logo-command {
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.logo:hover .logo-command {
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

/* Blinking cursor on hover */
.logo-command::after {
    content: '▋';
    margin-left: 2px;
    opacity: 0;
    color: var(--primary-color);
    animation: blink 1s infinite;
}

.logo:hover .logo-command::after {
    opacity: 1;
}

/* Blinking cursor animation */
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: clamp(0.5rem, 1.5vw, 1rem);
}

/* Mobile: hide nav-menu by default, show when .active */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 64px;
        flex-direction: column;
        width: 100%;
        height: calc(100vh - 64px);
        background: linear-gradient(180deg, #000 0%, #071018 100%);
        transition: left 0.3s ease;
        padding: 0;
        z-index: 1500;
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }
}

.nav-link {
    color: var(--text-secondary-1);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    padding: 0.5rem 0.8rem;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    font-family: 'Courier New', monospace;
    font-weight: 700;
    border-radius: 4px;
    white-space: nowrap;
}

/* Mobile nav-link styling */
@media (max-width: 768px) {
    .nav-link {
        padding: 1rem 1.5rem;
        font-size: 1.05rem;
        text-align: left;
        white-space: normal;
        border-bottom: 1px dashed rgba(0,255,136,0.03);
        background: transparent;
    }
}

/* Terminal prompt before text */
.nav-link::before {
    content: '';
    opacity: 0;
    margin-right: 0;
    transition: all 0.3s;
    color: var(--primary-color);
    font-weight: bold;
}

.nav-link:hover::before,
.nav-link.active::before {
    content: '$ ';
    opacity: 1;
    margin-right: 0.3rem;
}

/* Terminal background on hover */
.nav-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s;
    box-shadow:
        0 0 10px rgba(0, 255, 136, 0.3),
        inset 0 0 10px rgba(0, 255, 136, 0.1);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    background: rgba(0, 0, 0, 0.3);
}

/* Animated SVG checkbox hamburger (from provided snippet) */
.nav {
    --color: #ffffff;
    background: linear-gradient(180deg, #020203 0%, #071018 100%);
    width: 100px;
    height: 56px;
    position: relative;
    display: none;
    justify-content: center;
    align-items: center;
}

/* Show nav toggle only on mobile */
@media (max-width: 768px) {
    .nav {
        display: flex;
    }
}
.nav svg {
    fill: none;
    stroke: var(--color);
    stroke-width: 7px;
    stroke-linecap: round;
    stroke-linejoin: round;
    width: 46px;
    height: 26px;
}
.nav {
    padding: 6px;
    border-radius: 8px;
    border: 1px solid rgba(0,255,136,0.06);
    box-shadow: 0 6px 18px rgba(0,0,0,0.6), inset 0 -6px 18px rgba(0,255,136,0.02);
}
.nav svg {
    background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.2));
    padding: 6px 8px;
    border-radius: 6px;
    transition: transform 0.18s ease, filter 0.18s ease, stroke 0.18s ease, box-shadow 0.18s ease;
}
.nav input[type="checkbox"]:focus-visible + svg {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,255,136,0.08), 0 6px 18px rgba(0,255,136,0.06);
}
.nav input[type="checkbox"]:checked + svg {
    stroke: var(--primary-color);
    transform: scale(1.03);
    filter: drop-shadow(0 6px 18px rgba(0,255,136,0.18));
}
.nav input[type="checkbox"]:checked + svg use {
    stroke: var(--primary-color);
}
.nav svg use:nth-of-type(1) {
    opacity: 1;
    stroke-dashoffset: 221;
    stroke-dasharray: 46 249;
    transition: stroke-dashoffset .12s linear .2s, stroke-dasharray .12s linear .2s, opacity 0s linear .2s;
}
.nav svg use:nth-of-type(2) {
    animation: stroke-animation-reverse 1.2s ease-out forwards;
}
.nav input[type="checkbox"] {
    position: absolute;
    height: 100%;
    width: 100%;
    z-index: 2;
    cursor: pointer;
    opacity: 0;
}
.nav input[type="checkbox"]:checked + svg use:nth-of-type(1) {
    stroke-dashoffset: 175;
    stroke-dasharray: 0 295;
    opacity: 0;
    transition: stroke-dashoffset .07s linear .07s, stroke-dasharray .07s linear .07s, opacity 0s linear .14s;
}
.nav input[type="checkbox"]:checked + svg use:nth-of-type(2) {
    animation: stroke-animation 1.2s ease-out forwards;
}

@keyframes stroke-animation {
    0% {
        stroke-dashoffset: 295;
        stroke-dasharray: 25 270;
    }
    50% {
        stroke-dashoffset: 68;
        stroke-dasharray: 59 236;
    }
    65% {
        stroke-dashoffset: 59;
        stroke-dasharray: 59 236;
    }
    100% {
        stroke-dashoffset: 68;
        stroke-dasharray: 59 236;
    }
}

@keyframes stroke-animation-reverse {
    0% {
        stroke-dashoffset: 68;
        stroke-dasharray: 59 236;
    }
    50% {
        stroke-dashoffset: 290;
        stroke-dasharray: 25 270;
    }
    65% {
        stroke-dashoffset: 295;
        stroke-dasharray: 25 270;
    }
    100% {
        stroke-dashoffset: 290;
        stroke-dasharray: 25 270;
    }
}

.nav-link:hover::after,
.nav-link.active::after {
    opacity: 1;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    padding: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    transform: scale(1.05);
}

.hamburger span {
    width: 24px;
    height: 2.5px;
    background: var(--primary-color);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: absolute;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
}

.hamburger span:nth-child(1) {
    transform: translateY(-8px);
}

.hamburger span:nth-child(2) {
    transform: translateY(0);
}

.hamburger span:nth-child(3) {
    transform: translateY(8px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: clamp(5rem, 10vh, 8rem) 0 clamp(3rem, 5vh, 5rem);
    background: var(--bg-darker);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 136, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    position: relative;
    z-index: 1;
    width: 100%;
}

.code-line {
    font-family: 'Courier New', 'Consolas', monospace;
    margin: 0.5rem 0;
    font-size: clamp(1rem, 1.5vw, 1.5rem);
}

.keyword {
    color: var(--code-keyword);
}

.class-name {
    color: var(--code-function);
}

.bracket {
    color: var(--text-secondary);
}

.semicolon {
    color: var(--text-secondary);
}

.comment {
    color: var(--code-comment);
    font-style: italic;
}

.glitch {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: bold;
    margin: 1rem 0;
    position: relative;
    color: var(--primary-color);
    animation: glitch 3s infinite;
    word-break: break-word;
}

@keyframes glitch {
    0%, 90%, 100% {
        text-shadow: none;
    }
    92% {
        text-shadow: 2px 2px var(--accent-color), -2px -2px var(--secondary-color);
    }
    94% {
        text-shadow: -2px 2px var(--accent-color), 2px -2px var(--secondary-color);
    }
}


.matrix-text {
  color: #0f0;
  font-size: 80px;
  font-family: monospace;
  position: relative;
  text-shadow: 0 0 10px #0f0, 0 0 20px #0f0, 0 0 30px #0f0;
  z-index: 2; 
}

.matrix-text::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: glitch 2s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  transform: translate(-2px, -2px);
  color: #0f0;
  text-shadow: 0 0 5px #0f0, 0 0 15px #0f0;
}

/* Glitch effect for the text */
@keyframes glitch {
  0%, 100% {
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translate(0);
  }
  33% {
    clip-path: polygon(0 0, 100% 0, 100% 15%, 0 15%);
    transform: translate(-5px, -5px);
  }
  66% {
    clip-path: polygon(0 85%, 100% 85%, 100% 100%, 0 100%);
    transform: translate(5px, 5px);
  }
}

.typing-container {
    display: inline-block;
    position: relative;
}

.subtitle {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: clamp(1.5rem, 2vw, 1.8rem);
    color: var(--text-secondary);
    margin-bottom: 1rem;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    animation: typing 3.5s steps(40, end) forwards;
}
/* Linux bash-style block cursor */
.cursor {
    display: inline-block;
    width: 0.8em;
    height: 1.6em;
    background-color: var(--cursor-color);
    margin-left: 2px;
    animation: blink 1s infinite;
}

.location-line {
    font-family: 'Courier New', 'Consolas', monospace;
    margin-bottom: 2rem;
}

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

/* GitHub Stats Widget */
.github-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 3rem;
    padding: 1.5rem;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.15);
    border-radius: 12px;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 0.3s both;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-right: 1px solid rgba(0, 255, 136, 0.1);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.stat-item:nth-child(1) { animation-delay: 0.4s; }
.stat-item:nth-child(2) { animation-delay: 0.6s; }
.stat-item:nth-child(3) { animation-delay: 0.8s; }

/* Page Indicator (right-side dot navigation) */
.page-indicator {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
    pointer-events: none; /* allow clicks to pass to underlying elements except dots */
}

.page-indicator .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 0 8px rgba(0,0,0,0.6) inset;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    pointer-events: auto; /* make dots clickable */
}

.page-indicator .dot.active {
    background: var(--primary-color);
    transform: scale(1.45);
    box-shadow: 0 0 12px rgba(0,255,136,0.25);
}

/* Small labels on hover */
.page-indicator .dot[data-label]:hover::after {
    content: attr(data-label);
    position: absolute;
    right: 26px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.75);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .page-indicator { right: 10px; gap: 10px; }
    .page-indicator .dot { width: 9px; height: 9px; }
}

@media (max-width: 480px) {
    .page-indicator { display: none; }
}

.stat-item:last-child {
    border-right: none;
}

.stat-icon {
    font-size: 1.5rem;
    display: inline-block;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary-1);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    min-width: 40px;
    text-align: center;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    position: relative;
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 3.5vw, 2rem);
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    white-space: nowrap;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.5s;
}

.btn:hover .btn-shine {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #00cc6e 100%);
    color: var(--bg-dark);
    box-shadow: 
        0 4px 15px rgba(0, 255, 136, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #00cc6e 0%, var(--primary-color) 100%);
    opacity: 0;
    transition: opacity 0.4s;
    border-radius: 10px;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 8px 30px rgba(0, 255, 136, 0.5),
        0 0 0 1px rgba(0, 255, 136, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover .btn-icon {
    transform: scale(1.2) rotate(5deg);
}

.btn-primary:active {
    transform: translateY(-2px) scale(1);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.4);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 15px rgba(0, 255, 136, 0.15),
        inset 0 0 20px rgba(0, 255, 136, 0.05);
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.4s;
    border-radius: 10px;
}

.btn-secondary:hover {
    color: var(--bg-dark);
    border-color: var(--primary-color);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 8px 30px rgba(0, 255, 136, 0.4),
        0 0 0 1px var(--primary-color),
        inset 0 0 20px rgba(0, 255, 136, 0.1);
}

.btn-secondary:hover::before {
    opacity: 1;
}

.btn-secondary:hover .btn-icon {
    transform: scale(1.2) rotate(-5deg);
}

.btn-secondary:active {
    transform: translateY(-2px) scale(1);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary-1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 8px 30px rgba(255, 255, 255, 0.1),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.btn-ghost:hover .btn-icon {
    transform: scale(1.2);
}

.btn-ghost:active {
    transform: translateY(-2px) scale(1);
}

/* Circuit Board Animation */
.circuit-board {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: clamp(300px, 50vw, 400px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* IC Chip Design */
.ic-chip {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
}

.ic-body {
    width: clamp(140px, 25vw, 200px);
    height: clamp(180px, 30vw, 240px);
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    border: 3px solid var(--primary-color);
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 30px rgba(0, 255, 136, 0.3),
        inset 0 0 20px rgba(0, 255, 136, 0.05);
}

.ic-core {
    font-size: clamp(3rem, 7vw, 4.5rem);
    color: var(--primary-color);
    filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.6));
}

/* IC Pins */
.ic-pins {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2.5vw, 15px);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.ic-pins-left {
    left: -18px;
}

.ic-pins-right {
    right: -18px;
}

.ic-pin {
    width: 18px;
    height: 5px;
    background: linear-gradient(90deg, #c0c0c0, #808080);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
}

.ic-pins-left .ic-pin {
    border-radius: 2px 0 0 2px;
}

.ic-pins-right .ic-pin {
    border-radius: 0 2px 2px 0;
}

/* Signal activity on pins */
.ic-pin::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    opacity: 0;
    border-radius: inherit;
    box-shadow: 0 0 10px var(--primary-color);
}

.ic-pin:nth-child(1)::after { animation: signalPulse 2s ease-in-out infinite; animation-delay: 0s; }
.ic-pin:nth-child(2)::after { animation: signalPulse 2s ease-in-out infinite; animation-delay: 0.2s; }
.ic-pin:nth-child(3)::after { animation: signalPulse 2s ease-in-out infinite; animation-delay: 0.4s; }
.ic-pin:nth-child(4)::after { animation: signalPulse 2s ease-in-out infinite; animation-delay: 0.6s; }
.ic-pin:nth-child(5)::after { animation: signalPulse 2s ease-in-out infinite; animation-delay: 0.8s; }
.ic-pin:nth-child(6)::after { animation: signalPulse 2s ease-in-out infinite; animation-delay: 1s; }

@keyframes signalPulse {
    0%, 100% {
        opacity: 0;
    }
    10%, 30% {
        opacity: 0.8;
    }
    20% {
        opacity: 0.3;
    }
}

/* Circuit SVG */
.circuit-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Circuit Traces */
.trace {
    stroke: var(--primary-color);
    stroke-width: 2;
    opacity: 0.3;
}

.trace-1 { animation: traceSignal 3s ease-in-out infinite; animation-delay: 0s; }
.trace-2 { animation: traceSignal 3s ease-in-out infinite; animation-delay: 0.3s; }
.trace-3 { animation: traceSignal 3s ease-in-out infinite; animation-delay: 0.6s; }
.trace-4 { animation: traceSignal 3s ease-in-out infinite; animation-delay: 0.9s; }
.trace-5 { animation: traceSignal 3s ease-in-out infinite; animation-delay: 1.2s; }
.trace-6 { animation: traceSignal 3s ease-in-out infinite; animation-delay: 1.5s; }

@keyframes traceSignal {
    0%, 100% {
        opacity: 0.3;
        stroke-width: 2;
    }
    50% {
        opacity: 0.8;
        stroke-width: 3;
    }
}

/* Connection Nodes */
.node {
    fill: var(--primary-color);
    filter: drop-shadow(0 0 3px rgba(0, 255, 136, 0.6));
}

.node-1 { animation: nodeActivity 3s ease-in-out infinite; animation-delay: 0s; }
.node-2 { animation: nodeActivity 3s ease-in-out infinite; animation-delay: 0.3s; }
.node-3 { animation: nodeActivity 3s ease-in-out infinite; animation-delay: 0.6s; }
.node-4 { animation: nodeActivity 3s ease-in-out infinite; animation-delay: 0.9s; }
.node-5 { animation: nodeActivity 3s ease-in-out infinite; animation-delay: 1.2s; }
.node-6 { animation: nodeActivity 3s ease-in-out infinite; animation-delay: 1.5s; }

@keyframes nodeActivity {
    0%, 100% {
        opacity: 0.4;
        filter: drop-shadow(0 0 3px rgba(0, 255, 136, 0.6));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(0, 255, 136, 1));
    }
}

/* Data Flow Particles */
.data-particle {
    fill: var(--primary-color);
    filter: drop-shadow(0 0 6px rgba(0, 255, 136, 0.9));
}

.particle-1 {
    animation: dataFlow 4s linear infinite;
}

.particle-2 {
    animation: dataFlow 4s linear infinite;
    animation-delay: 1.3s;
}

.particle-3 {
    animation: dataFlow 4s linear infinite;
    animation-delay: 2.6s;
}

@keyframes dataFlow {
    0% {
        cx: 0;
        opacity: 0;
        r: 3;
    }
    5% {
        opacity: 1;
        r: 4;
    }
    95% {
        opacity: 1;
        r: 4;
    }
    100% {
        cx: 500;
        opacity: 0;
        r: 3;
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-secondary);
    animation: bounce 2s infinite;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Section Styles */
section {
    padding: clamp(3rem, 8vh, 6rem) 0;
    position: relative;
    width: 100%;
}

.section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    text-align: center;
    margin-bottom: clamp(2rem, 5vh, 3rem);
    font-family: 'Courier New', monospace;
    word-break: break-word;
}

.function {
    color: var(--code-function);
}

.type {
    color: var(--secondary-color);
}

/* About Section */
.about {
    background: var(--bg-dark);
}

.about-content {
    display: flex;
    gap: 20px;
    align-items: stretch; /* Makes both elements same height */
}

.linux-photo-frame {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 136, 0.2);
    width: 280px; /* Increased width for bigger photo */
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.linux-photo-frame:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.2);
    transform: translateY(-5px);
}

.photo-content {
    padding: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Matrix overlay canvas inside the photo */
.photo-content {
    position: relative;
}

.photo-content canvas.matrix {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.9;
}

/* Desktop: give the photo more space by partitioning the about section
   into a wider image column and a narrower code column. Keeps mobile
   stacking unchanged. */
@media (min-width: 900px) {
    .about-content {
        display: grid;
        grid-template-columns: 55% 45%; /* more space for the image */
        gap: clamp(1rem, 2vw, 2rem);
        align-items: start;
    }

    /* Let the linux-photo-frame expand to fill the left column */
    .linux-photo-frame {
        width: auto;
        max-width: 100%;
        align-self: start;
    }

    /* Ensure the photo area keeps a nice height and scales cleanly */
    .photo-content {
        min-height: 360px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .profile-photo {
        width: 100%;
        height: 100%;
        max-height: 540px;
        object-fit: cover;
    }

    /* Tighten the code block column so it flows well next to the image */
    .about-code-block {
        display: flex;
        align-items: flex-start;
    }
}

/* Improved terminal / code block styling for about section */
.terminal-content {
    padding: clamp(1rem, 2vw, 1.5rem);
    flex: 1;
    display: flex;
    align-items: stretch;
    background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.15));
    border-radius: 10px;
    border: 1px solid rgba(0,255,136,0.06);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.code-snippet {
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    font-size: clamp(0.9rem, 1.4vw, 1rem);
    overflow-x: auto;
    width: 100%;
    color: rgba(200, 255, 210, 0.95);
    background: transparent;
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
}

.code-snippet .comment { color: rgba(160, 255, 180, 0.85); font-style: normal; }
.code-snippet .macro { color: #8be9fd; }
.code-snippet .string { color: var(--code-string); }
.code-snippet .function { color: var(--code-function); }
.code-snippet .type { color: #9ad1ff; }
.code-snippet .keyword { color: #ff7b72; }
.code-snippet .number { color: #79c0ff; }

/* subtle hover to highlight code area */
.image-frame .terminal-content:hover .code-snippet {
    background: rgba(0,0,0,0.02);
    box-shadow: inset 0 0 18px rgba(0,255,136,0.02);
}

/* Responsive: reduce matrix and effects on mobile */
@media (max-width: 768px) {
    .photo-content canvas.matrix { display: none; }
    .terminal-content { padding: clamp(0.75rem, 2vw, 1rem); }
}

.about-code-block {
    flex: 1;
    min-width: 0;
    display: flex;
}

.image-frame {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 136, 0.2);
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.image-frame:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.2);
    transform: translateY(-5px);
}

.terminal-header {
    background: rgba(0, 0, 0, 0.3);
    padding: clamp(0.6rem, 1.5vw, 0.8rem);
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.dot {
    width: clamp(10px, 1.5vw, 12px);
    height: clamp(10px, 1.5vw, 12px);
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
    margin-left: auto;
    color: var(--text-secondary-1);
    font-size: clamp(0.8rem, 1.3vw, 0.9rem);
    font-family: 'Courier New', monospace;
}

.terminal-content {
    padding: clamp(1rem, 2vw, 1.5rem);
    flex: 1;
    display: flex;
    align-items: center;
}

.code-snippet {
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    overflow-x: auto;
    width: 100%;
}

.macro {
    color: #8be9fd;
}

.string {
    color: var(--code-string);
}

.number {
    color: #bd93f9;
}

.comment {
    color: var(--text-secondary-2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
    }
    
    .linux-photo-frame {
        width: 200px;
        align-self: center;
    }
}

/* Skills Section */
.skills {
    background: var(--bg-darker);
}

.skills-categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 4vw, 2.5rem);
    max-width: 1200px;
    margin: 0 auto;
}

/* Two-column layout for larger screens */
@media (min-width: 1024px) {
    .skills-categories {
        grid-template-columns: repeat(2, 1fr);
        max-width: 1400px;
        gap: clamp(2rem, 3vw, 2.5rem);
        align-items: start;
    }

    /* Make Development & Build Tools span full width */
    .skills-categories .skill-box:nth-child(4) {
        grid-column: 3 / 2;
    }
}

.skill-box {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
    border-radius: 20px;
    border: 2px solid rgba(0, 255, 136, 0.15);
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(10px);
}

.skill-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.08), rgba(0, 136, 255, 0.08));
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    border-radius: 18px;
}

.skill-box:hover::before {
    opacity: 1;
}

.skill-box:hover {
    border-color: var(--primary-color);
    box-shadow:
        0 10px 40px rgba(0, 255, 136, 0.2),
        0 0 0 1px rgba(0, 255, 136, 0.1);
    transform: translateY(-8px);
}

.skill-box-header {
    padding: clamp(1.5rem, 3vw, 2rem);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05), rgba(0, 0, 0, 0.3));
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.skill-box-header:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 0, 0, 0.4));
}

.skill-box-icon {
    width: clamp(50px, 8vw, 60px);
    height: clamp(50px, 8vw, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 255, 136, 0.05));
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
    transition: all 0.3s;
}

.skill-box:hover .skill-box-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.4);
}

.skill-box-icon i {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px var(--primary-color));
}

.skill-box-header h3 {
    color: var(--text-primary);
    font-size: clamp(1.2rem, 2.2vw, 1.4rem);
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.5px;
    flex: 1;
}

.skill-box-chevron {
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
}

.skill-box:hover .skill-box-chevron,
.skill-box.active .skill-box-chevron {
    transform: rotate(180deg);
}

.skill-box-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease;
    padding: 0 clamp(1.5rem, 3vw, 2rem);
    opacity: 0;
}

.skill-box:hover .skill-box-content,
.skill-box.active .skill-box-content {
    max-height: 1500px;
    padding: clamp(1.5rem, 3vw, 2rem);
    padding-top: clamp(1.5rem, 2.5vw, 2rem);
    opacity: 1;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: clamp(1.2rem, 2.5vw, 1.8rem);
    justify-items: center;
}

.skill-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: clamp(1.2rem, 2.5vw, 1.8rem);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    min-height: 120px;
    width: 100%;
    max-width: 140px;
}

.skill-badge::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 15px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s;
    background: linear-gradient(135deg,
        rgba(0, 255, 136, 0.3),
        rgba(0, 136, 255, 0.3));
}

.skill-badge:hover::before {
    opacity: 1;
}

.skill-badge:hover {
    transform: translateY(-10px) scale(1.08);
    border-color: rgba(0, 255, 136, 0.4);
    box-shadow:
        0 10px 30px rgba(0, 255, 136, 0.3),
        0 0 40px rgba(0, 255, 136, 0.15),
        inset 0 0 20px rgba(0, 255, 136, 0.08);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
}

.skill-badge img {
    width: clamp(35px, 6vw, 45px);
    height: clamp(35px, 6vw, 45px);
    object-fit: contain;
    transition: all 0.3s;
}

.skill-badge i {
    font-size: clamp(2rem, 4vw, 2.5rem);
    transition: all 0.3s;
}

.skill-badge:hover svg,
.skill-badge:hover img,
.skill-badge:hover i {
    filter:
        drop-shadow(0 0 20px currentColor)
        drop-shadow(0 0 40px currentColor)
        drop-shadow(0 0 60px currentColor);
    transform: scale(1.5);
}

.skill-badge span {
    color: var(--text-secondary);
    font-size: clamp(0.8rem, 1.4vw, 0.9rem);
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
    letter-spacing: 0.3px;
}

.skill-badge:hover span {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    transform: scale(1.05);
}

/* Experience Section */
.experience {
    background: var(--bg-dark);
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-marker {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 4px solid var(--bg-dark);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    z-index: 1;
}

.timeline-content {
    background: var(--bg-card);
    padding: clamp(1.5rem, 3vw, 2rem);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 136, 0.1);
    transition: all 0.3s;
}

.timeline-content:hover {
    border-color: var(--primary-color);
    transform: translateX(10px);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.timeline-header h3 {
    color: var(--primary-color);
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    margin: 0;
}

.timeline-date {
    color: var(--text-secondary);
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    /* Badge-like appearance */
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(0,255,136,0.04);
    border: 1px solid rgba(0,255,136,0.06);
    color: rgba(255,255,255,0.9);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, background 0.2s, box-shadow 0.2s;
}

.company-name {
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* New styling: make company stand out while keeping theme */
    background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.04));
    border: 1px solid rgba(0,255,136,0.06);
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    color: var(--primary-color);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.timeline-content p {
    /* Improve paragraph visibility while keeping the site's green accent */
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.75;
    margin-bottom: 1rem;
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.04));
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border-left: 4px solid rgba(0,255,136,0.12);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    transition: transform 0.28s cubic-bezier(.2,.9,.3,1), box-shadow 0.28s, border-left-color 0.28s, background 0.28s;
}

.timeline-content p:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 36px rgba(0, 255, 136, 0.08);
    border-left-color: rgba(0,255,136,0.9);
    background: linear-gradient(180deg, rgba(0,255,136,0.03), rgba(0,255,136,0.02));
}

.experience-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.33) 0%, rgba(0, 255, 136, 0.08) 100%);
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.tag:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, rgba(0, 255, 136, 0.9) 100%);
    color: var(--bg-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 255, 136, 0.4);
    border-color: rgba(0, 255, 136, 1);
}

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

/* Projects Section */
.projects {
    background: var(--bg-dark);
}

.projects-list {
    max-width: 1000px;
    margin: 0 auto;
}

.project-item {
    margin-bottom: 2rem;
}

.project-content {
    background: var(--bg-card);
    padding: clamp(1.5rem, 3vw, 2rem);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 136, 0.1);
    transition: all 0.3s;
}

.project-content:hover {
    border-color: var(--primary-color);
    transform: translateX(10px);
}

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

.project-icon {
    width: clamp(50px, 8vw, 60px);
    height: clamp(50px, 8vw, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 10px;
    border: 2px solid var(--primary-color);
}

.project-icon i {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--primary-color);
}

.project-links a {
    color: var(--text-secondary);
    font-size: clamp(1.3rem, 2.5vw, 1.5rem);
    transition: color 0.3s;
    display: inline-block;
}

.project-links a:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.project-content h3 {
    color: var(--primary-color);
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    margin-bottom: 1rem;
}

/* Project header with title and date */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-header h3 {
    color: var(--primary-color);
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    margin: 0;
}

.project-date {
    color: var(--text-secondary-1);
    font-size: clamp(0.85rem, 1.3vw, 0.95rem);
    font-family: 'Courier New', monospace;
    background: rgba(0, 255, 136, 0.08);
    padding: 0.25rem 0.7rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 136, 0.15);
    white-space: nowrap;
}

.project-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.project-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-tag {
    background: rgba(0, 255, 136, 0.1);
    padding: clamp(0.4rem, 1vw, 0.5rem) clamp(0.8rem, 1.5vw, 1rem);
    border-radius: 15px;
    color: var(--primary-color);
    font-size: clamp(0.8rem, 1.3vw, 0.85rem);
    border: 1px solid rgba(0, 255, 136, 0.2);
    transition: all 0.3s;
}

.keyword-tag:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--primary-color);
}

/* Organizations Section */
.organizations {
    background: var(--bg-darker);
}

.organizations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: clamp(1.5rem, 3vw, 2rem);
}

.organization-card {
    background: var(--bg-card);
    padding: clamp(1.5rem, 3vw, 2rem);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 136, 0.1);
    transition: all 0.3s;
    text-align: center;
}

.organization-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}

.org-icon {
    width: clamp(60px, 10vw, 80px);
    height: clamp(60px, 10vw, 80px);
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.org-icon i {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--primary-color);
}

.organization-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
}

.org-role {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.organization-card > p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.org-activities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.activity-tag {
    background: rgba(0, 255, 136, 0.1);
    padding: clamp(0.4rem, 1vw, 0.5rem) clamp(0.8rem, 1.5vw, 1rem);
    border-radius: 20px;
    color: var(--primary-color);
    font-size: clamp(0.8rem, 1.3vw, 0.9rem);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-tag i {
    font-size: 0.8em;
}

/* Contact Section */
.contact {
    background: var(--bg-darker);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 4vw, 3rem);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-text h3 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.contact-text p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: clamp(0.9rem, 1.8vw, 1rem);
}

.code-comment {
    font-family: 'Courier New', monospace;
    margin-top: 1rem;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: clamp(0.8rem, 2vw, 1rem);
    background: var(--bg-card);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid rgba(0, 255, 136, 0.1);
    transition: all 0.3s;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.social-link:hover {
    border-color: var(--primary-color);
    transform: translateX(10px);
}

.social-link i {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    color: var(--primary-color);
}

.terminal-window {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 136, 0.2);
    width: 100%;
}

.terminal-title {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: clamp(0.8rem, 1.3vw, 0.9rem);
}

.terminal-body {
    padding: clamp(1.5rem, 3vw, 2rem);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: clamp(0.6rem, 1.5vw, 0.8rem);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.3s;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

/* Footer */
/* Footer */
.footer {
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    padding: clamp(3rem, 5vh, 4rem) 0 clamp(1rem, 2vh, 1.5rem);
    border-top: 2px solid rgba(0, 255, 136, 0.2);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--primary-color), 
        var(--secondary-color), 
        var(--primary-color), 
        transparent);
    animation: scanline 3s linear infinite;
}

@keyframes scanline {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2rem;
}

/* Terminal Section */
.footer-terminal {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

.footer-prompt {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.prompt-symbol {
    color: var(--primary-color);
    font-weight: 700;
}

.prompt-command {
    color: var(--code-function);
    margin-left: 0.5rem;
}

.footer-output {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-line {
    color: var(--text-secondary-1);
    font-size: clamp(0.85rem, 1.3vw, 0.95rem);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-icon {
    font-size: 1.1em;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    animation: blink-dot 2s infinite;
}

@keyframes blink-dot {
    0%, 49% { 
        opacity: 1; 
        box-shadow: 0 0 10px var(--primary-color);
    }
    50%, 100% { 
        opacity: 0.3; 
        box-shadow: 0 0 3px var(--primary-color);
    }
}

.status-ok {
    color: var(--primary-color);
    font-weight: 600;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
}

/* Footer Right */
.footer-right {
    display: fixed;
    flex-direction: column;
    gap: 1.5rem;
    align-items: left;
}

/* Footer Bottom */
.footer-bottom {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 4rem;
    align-items: center;
    padding-top: 0rem;
    border-top: 1px solid rgba(0, 255, 136, 0.1);
}

.footer-copyright {
    justify-self: start;
    text-align: left;
}

.footer-badge {
    justify-self: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary-1);
    font-size: clamp(0.85rem, 1.3vw, 0.95rem);
}

.footer-badge i {
    color: var(--primary-color);
    font-size: 1.2em;
}

.footer-copyright p {
    color: var(--text-secondary-1);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    margin: 0.25rem 0;
}

.built-with {
    color: var(--text-secondary);
    font-size: clamp(0.85rem, 1.3vw, 0.95rem);
}

.built-with i {
    color: var(--accent-color);
}

.back-to-top {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.back-to-top:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

.back-to-top i {
    font-size: 1.2em;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .footer-bottom {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-copyright,
    .footer-badge,
    .back-to-top {
        justify-self: center;
    }
    
    .footer-copyright {
        text-align: center;
    }
}

/* Responsive Design */
@media (min-width: 769px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
    }

    .about-content {
        grid-template-columns: 1fr 1.5fr;
    }

    .contact-content {
        grid-template-columns: 1fr 1.2fr;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Tablet: smooth transition between mobile and desktop (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-container {
        padding: 0.75rem clamp(1rem, 4vw, 2rem);
    }

    .logo {
        font-size: clamp(0.95rem, 2vw, 1.1rem);
    }

    .nav-link {
        padding: 0.45rem 0.65rem;
        font-size: clamp(0.85rem, 1vw, 0.95rem);
    }
}

@media (max-width: 768px) {

    /* Terminal style for the mobile nav when active */
    .nav-menu.terminal,
    .nav-menu.active {
        left: 0;
        top: 64px;
        height: calc(100vh - 64px);
        padding: 1rem 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        background: linear-gradient(180deg, #000 0%, #071018 100%);
        border-top: 4px solid rgba(0,255,136,0.12);
        /* Rounded top corners to match the nav icon */
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
        font-family: 'Courier New', monospace;
        color: var(--text-secondary);
        z-index: 1500;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Small inset shadow for depth, creating a subtle connector effect */
        box-shadow: inset 0 2px 8px rgba(0,255,136,0.08), 
                    inset -1px 0 0 rgba(0,255,136,0.04),
                    inset 1px 0 0 rgba(0,255,136,0.04);
    }

    /* Terminal header line */
    .nav-menu.terminal::before,
    .nav-menu.active::before {
        content: 'najd@portfolio:~$';
        display: block;
        padding: 0.9rem 1.25rem;
        color: var(--primary-color);
        font-weight: 700;
        border-bottom: 1px solid rgba(0,255,136,0.04);
        background: linear-gradient(180deg, rgba(0,0,0,0.08), transparent);
        box-shadow: inset 0 -1px 0 rgba(0,0,0,0.2);
    }

    /* Make each nav link look like a terminal command line */
    .nav-menu.active .nav-link,
    .nav-menu.terminal .nav-link {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.5rem;
        padding: 0.85rem 1.25rem;
        border-bottom: 1px dashed rgba(0,255,136,0.03);
        color: var(--text-secondary);
        font-size: 1.05rem;
        text-align: left;
        width: 100%;
        background: transparent;
    }

    /* Always show a prompt symbol at the start of each link (mobile/terminal) */
    .nav-menu.active .nav-link::before,
    .nav-menu.terminal .nav-link::before {
        content: '$ ';
        opacity: 1;
        color: var(--primary-color);
        margin-right: 0.5rem;
        font-weight: 700;
    }

    .nav-menu.active .nav-link:hover,
    .nav-menu.terminal .nav-link:hover {
        background: rgba(0,255,136,0.02);
        color: var(--primary-color);
        text-shadow: none;
    }

    /* subtle close hint at bottom */
    .nav-menu.active::after,
    .nav-menu.terminal::after {
        content: 'Press Esc or tap outside to close';
        display: block;
        padding: 0.8rem 1.25rem;
        color: rgba(255,255,255,0.35);
        font-size: 0.85rem;
        text-align: center;
        margin-top: auto;
        border-top: 1px solid rgba(0,255,136,0.02);
    }

    .hamburger {
        display: flex;
    }

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

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

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-buttons {
        width: 100%;
    }

    .btn {
        flex: 1 1 auto;
        min-width: 140px;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-marker {
        left: 1px;
    }

    .timeline-item {
        padding-left: 40px;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .hero {
        min-height: auto;
        padding: 6rem 0 3rem;
    }

    .circuit-board {
        height: 250px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .interests-grid {
        flex-direction: column;
    }

    .interest-tag {
        width: 100%;
        justify-content: center;
    }

    .timeline::before {
        left: 5px;
    }

    .timeline-marker {
        left: -4px;
        width: 16px;
        height: 16px;
    }

    .timeline-item {
        padding-left: 30px;
    }

    .skill-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
}

/* Additional mobile-first refinements for small smartphones */
@media (max-width: 420px) {
    html { font-size: 14px; }

    .container { padding-left: 0.75rem; padding-right: 0.75rem; }

    /* Navigation */
    .nav-container {
        padding: 0.5rem 0.5rem;
    }

    .logo {
        font-size: clamp(0.85rem, 2vw, 0.95rem);
    }

    .nav-link { font-size: 1rem; padding: 0.9rem 1.2rem; }

    .nav {
        width: 90px;
        height: 50px;
    }

    /* Hero */
    .hero { padding: 4.5rem 0 2.5rem; }
    .matrix-text { font-size: clamp(2rem, 8vw, 2.6rem); }

    /* About */
    .about-content { gap: 1rem; }
    .linux-photo-frame { width: 160px; margin: 0 auto; }
    .photo-content { align-items: center; justify-content: center; }
    .profile-photo { width: 100%; height: auto; object-fit: cover; }

    .terminal-content { flex-direction: column; padding: 0.75rem; }
    .about-output { width: 100%; padding-right: 0; }
    .program-output { padding: 0.8rem; font-size: 0.97rem; }

    /* Timeline */
    .timeline { padding: 1.25rem 0; }
    .timeline-item { padding-left: 44px; margin-bottom: 1.5rem; }
    .timeline-content { padding: 0.9rem 0.9rem; }
    .timeline-header h3 { font-size: 1rem; }
    .timeline-date { font-size: 0.82rem; padding: 0.2rem 0.45rem; }

    /* Projects */
    .project-content { padding: 1rem; }
    .project-content p { font-size: 0.95rem; }

    /* Skills */
    .skill-grid { gap: 0.9rem; }
    .skill-badge { min-height: 100px; padding: 0.8rem; }

    /* Footer */
    .footer { padding: 2rem 0 2rem; }

    /* Ensure SVGs and images never overflow */
    img, svg, canvas { max-width: 100%; height: auto; }
}

/* Extra tiny-phone adjustments */
@media (max-width: 360px) {
    html { font-size: 13px; }
    .hero { padding-top: 4rem; }
    .nav-container { padding: 0.4rem 0.4rem; }
    .nav {
        width: 80px;
        height: 48px;
    }
    .nav-menu { top: 60px; }
    .linux-photo-frame { width: 140px; }
    .program-output { font-size: 0.95rem; padding: 0.65rem; }
}

/* Print styles */
@media print {
    .navbar,
    .hamburger,
    .scroll-indicator,
    .circuit-board {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    section {
        page-break-inside: avoid;
    }
}

/* Work in Progress Component */
.work-in-progress {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.wip-terminal {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 136, 0.2);
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.1);
    transition: all 0.3s;
}

.wip-terminal:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 30px rgba(0, 255, 136, 0.2);
    transform: translateY(-5px);
}

.wip-content {
    padding: clamp(2rem, 4vw, 3rem);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.wip-icon {
    width: clamp(80px, 12vw, 100px);
    height: clamp(80px, 12vw, 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 255, 136, 0.05));
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 50px rgba(0, 255, 136, 0.5);
        transform: scale(1.05);
    }
}

.wip-icon i {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--primary-color);
    filter: drop-shadow(0 0 10px var(--primary-color));
}

.wip-text {
    width: 100%;
    max-width: 600px;
}

.wip-message {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    margin: 1rem 0;
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.wip-message .prompt {
    color: var(--primary-color);
    font-weight: 700;
}

.wip-message .typing-effect {
    color: var(--text-secondary-1);
    display: inline-block;
    animation: typing 2s steps(40, end), blink-cursor 0.75s step-end infinite;
}

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

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

.wip-status {
    color: var(--text-secondary-1);
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.wip-status i {
    color: var(--primary-color);
}

.wip-note {
    font-family: 'Courier New', monospace;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.15);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: left;
    font-size: clamp(0.9rem, 1.4vw, 1rem);
}

.wip-note .keyword {
    color: var(--code-keyword);
    font-weight: 700;
}

.wip-note .string {
    color: var(--code-string);
}

/* Projects Section */