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

:root {
    /* GitHub-inspired dark grey with light blue accents */
    --primary: #58a6ff;           /* Light blue accent */
    --primary-dark: #1f6feb;      /* Darker blue */
    --bg: #0d1117;                /* Dark grey background */
    --bg-secondary: #161b22;      /* Slightly lighter grey */
    --bg-tertiary: #21262d;       /* Even lighter grey */
    --border: #30363d;            /* Border color */
    --text: #c9d1d9;              /* Light text */
    --text-dim: #8b949e;          /* Dimmer text */
    --accent: #79c0ff;            /* Lighter blue accent */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'JetBrains Mono', 'Courier New', monospace;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background wave: fixed behind the hero; screen blending drops the video's black backdrop */
.bg-wave {
    position: fixed;
    top: 32%;
    left: 50%;
    width: min(1400px, 150vw);
    aspect-ratio: 4 / 3;
    transform: translate(-50%, -50%);
    object-fit: contain;
    mix-blend-mode: screen;
    opacity: 0.7;
    pointer-events: none;
    z-index: -1;
}

/* Cursor Animation */
.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--primary);
    margin-left: 4px;
    animation: blink 1s infinite;
}

.cursor.blinking {
    animation: blink 1s infinite;
}

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

/* Typography */
.prompt {
    color: var(--primary);
    font-weight: bold;
}

/* Navbar */
.navbar {
    background: rgba(13, 17, 23, 0.95);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(88, 166, 255, 0.3);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 24px;
}

.nav-menu a {
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-size: 14px;
}

.nav-menu a:hover {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(88, 166, 255, 0.5);
}

/* Main Container */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 0 120px;
}

.hero-content {
    animation: fadeInUp 1s ease-out;
}

.terminal-header {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
    letter-spacing: 2px;
    font-family: 'JetBrains Mono', monospace;
}

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

.hero-subtitle {
    font-size: 18px;
    color: var(--text-dim);
    margin-bottom: 40px;
}

.hero-description {
    max-width: 600px;
    margin: 0 auto;
    font-size: 15px;
    color: var(--text);
    line-height: 1.8;
}

/* About Section */
.about {
    margin-bottom: 120px;
}

.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.about-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 6px;
    transition: all 0.3s ease;
    opacity: 1 !important;
}

.about-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    transform: translateY(-4px);
}

.about-card h3 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 16px;
}

.about-card p {
    color: var(--text);
    font-size: 14px;
    line-height: 1.8;
}

/* Section Titles */
.section-title {
    font-size: 32px;
    margin-bottom: 40px;
    color: var(--primary);
    text-shadow: 0 0 15px rgba(88, 166, 255, 0.2);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    width: fit-content;
    font-family: 'JetBrains Mono', monospace;
}

/* Featured Project Section */
.featured {
    margin-bottom: 120px;
}

.featured-window {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(88, 166, 255, 0.08);
}

.window-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

/* macOS-style window buttons: close, minimise, maximise */
.window-dot {
    position: relative;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border-radius: 50%;
}

.window-dot:nth-child(1) { background: #ff5f57; }
.window-dot:nth-child(2) { background: #febc2e; }
.window-dot:nth-child(3) { background: #28c840; }

/* Icons are drawn as bars centred on the dot, so they line up exactly */
.window-dot::before,
.window-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 1.5px;
    border-radius: 1px;
    background: rgba(0, 0, 0, 0.55);
}

/* close: x */
.window-dot:nth-child(1)::before { transform: translate(-50%, -50%) rotate(45deg); }
.window-dot:nth-child(1)::after  { transform: translate(-50%, -50%) rotate(-45deg); }

/* minimise: - */
.window-dot:nth-child(2)::before { transform: translate(-50%, -50%); }
.window-dot:nth-child(2)::after  { display: none; }

/* maximise: + */
.window-dot:nth-child(3)::before { transform: translate(-50%, -50%); }
.window-dot:nth-child(3)::after  { transform: translate(-50%, -50%) rotate(90deg); }

.window-path {
    margin-left: 12px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.featured-body {
    padding: 32px;
}

.featured-title {
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    margin-bottom: 16px;
}

.featured-description {
    max-width: 760px;
    font-size: 15px;
    line-height: 1.8;
}

.featured-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    margin: 32px 0;
}

.featured-shot {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-shot-main {
    grid-row: span 2;
    aspect-ratio: auto;
}

.featured-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shot-placeholder {
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 16px;
    text-align: center;
}

.featured-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.featured-button {
    padding: 12px 24px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.featured-button.primary {
    border-color: var(--primary);
    background: rgba(88, 166, 255, 0.1);
    color: var(--primary);
}

.featured-button:hover,
.featured-button:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(88, 166, 255, 0.2);
    transform: translateY(-2px);
}

/* Projects Section */
.projects {
    margin-bottom: 120px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    opacity: 1 !important;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.project-card:hover,
.project-card:focus-visible {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(88, 166, 255, 0.15);
}

.project-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.card-header {
    background: linear-gradient(90deg, rgba(88, 166, 255, 0.05), rgba(121, 192, 255, 0.05));
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: bold;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content p {
    color: var(--text);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.tag {
    background: rgba(88, 166, 255, 0.1);
    color: var(--primary);
    padding: 4px 8px;
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.2s;
}

.tag:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: var(--primary);
}

/* Socials Section */
.socials {
    margin-bottom: 80px;
}

.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.social-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    text-decoration: none;
    color: var(--primary);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: bold;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    opacity: 1 !important;
}

.social-card:hover {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(88, 166, 255, 0.2);
    transform: scale(1.05);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
    font-size: 14px;
}

.footer p {
    margin: 0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .terminal-header {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .section-title {
        font-size: 24px;
    }

    .nav-menu {
        gap: 12px;
        font-size: 12px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

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

    .featured-body {
        padding: 20px;
    }

    .featured-title {
        font-size: 22px;
    }

    .featured-gallery {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .featured-shot-main {
        grid-column: span 2;
        grid-row: auto;
        aspect-ratio: 16 / 10;
    }
}