:root {
    --bg-color: #050816;
    --card-bg: #0B1220;

    --accent-primary: #38BDF8;
    --accent-secondary: #A855F7;
    --accent-warm: #F97316;

    --text-color: #F9FAFB;
    --muted-text-color: #9CA3AF;

    /* backqards compatible colors */
    --background-color: var(--bg-color);
    --link-color: var(--accent-primary);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: radial-gradient(circle at top, #111827 0, var(--bg-color) 55%, #020617 100%);
    background-color: var(--bg-color);
    color: var(--text-color);
    max-width: 1400px;
    margin: 0 auto;
}

p {
    max-width: 70ch;
    line-height: 1.6;
}

section {
    border-bottom: 1px solid #1a1a1a;
    padding: 60px 0;
    scroll-margin-top: 100px;
}

.section-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 24px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
}

.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 2px;
    margin: 10px auto 0;
    background: linear-gradient(120deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0.9;
}

.hero-section,
.skills-section,
.about-section,
.experience-section,
.projects-section {
    background: rgba(11, 18, 32, 0.92);
    border-radius: 16px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
}

a {
    color: var(--link-color);
    text-decoration: none;
}

/* NAVBAR */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 0 50px;
    height: 80px;

    position: sticky;
    top: 0;
    background: rgba(11, 18, 32, 0.98);
    z-index: 100;
    border-bottom: 1px solid #222;
}

nav .left a {
    color: var(--text-color);
    font-size: 22px;
    font-weight: 600;
}

nav .right a {
    color: var(--text-color);
    margin: 0 10px;
}

nav .right a:last-child {
    color: var(--bg-color);
    background-color: var(--accent-primary);
    padding: 5px 15px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

nav .right a span {
    margin-left: 5px;
}

nav .right a:hover {
    color: var(--accent-secondary)
}

nav .right a:last-child:hover {
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
    transform: translateY(-1px);
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
}

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

.typewriter {
    display: inline-block;
    overflow: hidden;
    border-right: 2px solid #fff;
    white-space: nowrap;

    width: 0;
    font-size: 45px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: var(--text-color);

    animation: typing 2s steps(11, end) forwards, 
               blink 1s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 11ch; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* SECTION 1: Hero */
.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
    margin: 50px 0;
    margin-bottom: 100px;
    gap: 40px;
    position: relative;
    overflow: hidden;
    min-height: 45vh;
}

.hero-section::before {
    content: "";
    position: absolute;
    right: 5%;
    top: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(
        circle,
        rgba(56, 189, 248, 0.28),
        rgba(168, 85, 247, 0.22),
        transparent 70%
    );
    filter: blur(2px);
    z-index: -1;
}

/* fake terminal panel */
.terminal-panel {
    margin-top: 20px;
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 55%),
                rgba(15, 23, 42, 0.98);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.85);
    overflow: hidden;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
                 "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(to right, #020617, #0b1220);
    border-bottom: 1px solid rgba(15, 23, 42, 0.9);
}

.terminal-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
    opacity: 0.9;
}

.dot-red {
    background-color: #f97373;
}

.dot-yellow {
    background-color: #facc15;
}

.dot-green {
    background-color: #4ade80;
}

.terminal-title {
    margin-left: 8px;
    color: var(--muted-text-color);
    font-size: 11px;
}

.terminal-body {
    padding: 10px 12px 12px;
    background: radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.2), transparent 55%);
    color: var(--text-color);
    min-height: 90px;
    max-height: 200px;
    overflow: hidden;
}

.terminal-line {
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* prompt vs output */
.terminal-line.prompt {
    color: var(--accent-primary);
}

.terminal-line.output {
    color: var(--muted-text-color);
}

.hero-section .text {
    flex: 5;
}

.hero-section .text h2 {
    font-size: 45px;
    color: var(--text-color)
}

.hero-section .text p {
    color: var(--text-color);
}

.hero-section .text .links {
    margin-top: 25px;
}

.hero-section .text .links a {
    display: inline-block;
    padding: 6px 12px;
    border: 2px solid var(--link-color);
    border-radius: 999px;
    margin-right: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    transition: .15s transform ease, .15s border-color ease, .15s color ease, .15s background-color ease;
}

.hero-section .text .links a:hover {
    color: var(--accent-secondary);
    box-shadow: 0 0 10px var(--accent-secondary);
    background-color: var(--accent-primary);
    transform: translateY(-2px);
}

.hero-section .headshot {
    flex: 2;
    display: flex;
    justify-content: right;
}

.hero-section .headshot img {
    width: 350px;
    border-radius: 50%;
    box-shadow:
        0 0 25px rgba(56, 189, 248, 0.35),
        0 20px 40px rgba(0, 0, 0, 0.8);
    margin: 10px;
    margin-bottom: 26px;
    border: 2px solid rgba(168, 85, 247, 0.9);
}

/* SECTION 2: Skills */
.skills-section {
    margin-bottom: 100px;
    padding: 20px;
}

.skills-section h2 {
    text-align: center;
    font-size: 35px;
    color: var(--text-color);
}

.skills-section .text {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-color);
}

.skills-section .cells {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--link-color);
}

.skills-section .cells .cell {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;

    width: 200px;
    padding: 10px 20px;
    margin: 10px;
    border: 1.5px solid var(--link-color);
    border-radius: 5px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.skills-section .cells .cell:hover {
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.7);
    border-color: var(--accent-secondary);
    transform: translateY(-3px);
}

.skills-section .cells .cell img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 2px;
}

.skills-section .cells .cell span {
    font-size: 18px;
}

/* SECTION 3: About */
.about-section {
    padding: 20px;
    margin-bottom: 100px;
    color: var(--text-color);
}

.about-section h2 {
    font-size: 35px;
    margin-bottom: 30px;
    text-align: center;
}

.about-section .group {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-section .group .text {
    text-align: center;
    flex: 2;
}

.about-section .group .person-details img {
    width: 200px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
}

.about-section .group .person-details p {
    font-weight: 600;
}

.about-section .group .person-details p:last-child {
    font-weight: normal;
}


.about-section .group .text {
    flex: 8;
}

/* SECTION 4: Projects */
.projects-section {
    padding: 20px;
    margin-bottom: 100px;
    color: var(--text-color);
}

.projects-section h2 {
    font-size: 35px;
}

.projects-section .group {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.projects-section .group .text {
    flex: 2;
    margin-top: 20px;
}

.projects-section .project-grid {
    flex: 3;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.projects-section .project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1.5px solid var(--link-color);
    border-radius: 10px;
    padding: 18px 20px;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.projects-section .project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(74, 118, 238, 0.7);
    border-color: var(--accent-secondary);
}

.projects-section .project-card h3 {
    margin-bottom: 8px;
    font-size: 20px;
}

.projects-section .project-card p {
    font-size: 14px;
    margin-bottom: 10px;
}

.projects-section .project-card .meta {
    font-size: 12px;
    opacity: 0.8;
}

.projects-section .project-card a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--link-color);
}

.projects-section .group .text,
.projects-section .project-card h3,
.projects-section .project-card p,
.projects-section .project-card .meta {
    color: var(--text-color);
}

.projects-section .project-body {
    flex-grow: 1;           /* fills available space */
}

.projects-section .project-footer {
    margin-top: auto;       /* pushes footer to the bottom */
    display: flex;
    flex-direction: column;
    gap: 4px;               /* space between meta and link */
}

/* SECTION 5: Experience */
.experience-section {
    padding: 40px 20px 100px;
    color: var(--text-color);
}

.experience-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
    gap: 36px;
    align-items: flex-start;
}

/* Timeline column */

.timeline-block {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px 18px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.85);
    margin-bottom: 24px;
}

.timeline-block-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left,
        rgba(56, 189, 248, 0.2),
        #020617);
    color: var(--accent-primary);
}

.timeline-block-header h3 {
    font-size: 18px;
    margin: 0;
}

.timeline {
    list-style: none;
    margin: 0;
    padding-left: 26px;
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 2px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(56, 189, 248, 0.85),
        rgba(168, 85, 247, 0.4)
    );
}

.timeline li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 18px;
}

.timeline-dot {
    position: absolute;
    left: -3px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 2px solid var(--accent-primary);
    background-color: #020617;
}

.timeline-period {
    display: block;
    font-size: 12px;
    color: var(--muted-text-color);
    margin-bottom: 2px;
}

.timeline-content h4 {
    font-size: 15px;
    margin: 0 0 4px;
}

.timeline-content p {
    font-size: 13px;
    color: var(--muted-text-color);
    line-height: 1.6;
    margin: 0;
}

/* Skills column */

.skills-panel {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px 18px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.85);
}

.skills-panel h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.skill-bar {
    margin-top: 12px;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

.skill-track {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #020617;
    overflow: hidden;
}

.skill-fill {
    position: absolute;
    inset: 0;
    width: var(--fill);
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        var(--accent-primary),
        var(--accent-secondary)
    );
    transform: scaleX(0);
    transform-origin: left;
    animation: skill-fill 1.2s ease-out forwards;
}

@keyframes skill-fill {
    to {
        transform: scaleX(1);
    }
}

.experience-note {
    margin-top: 14px;
    font-size: 12px;
    color: var(--muted-text-color);
}

@media (max-width: 850px) {
    /* SECTION 1: Hero */
    .hero-section .text h2 {
        font-size: 35px;
    }
}

/* Makes sure Image formats to above text when screen is mobile sized */
@media (max-width: 740px) {
    /* SECTION 1: Hero */
    .hero-section {
        flex-direction: column-reverse;
    }
    .hero-section .headshot img {
        width: 300px;
    }

    /* SECTION 3: about */
    .about-section {
        text-align: center;
    }

    .about-section .group {
        flex-direction: column;
    }

    /* SECTION 5: Experience */
    .experience-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .timeline-block,
    .skills-panel {
        padding: 18px 16px;
    }
}

/* REMOVE PADDING FOR WHEN SCREEN GOES TO 600px and lower (mobile users) */
@media (max-width: 600px) {
    /* NAVBAR */
    nav {
        padding: 0 20px;
    }

    nav .right a {
        font-size: 22px;
    }

    /* Email background changes to match other icons when smaller */
    nav .right a:last-child {
        color: var(--text-color);
        background-color: transparent;
        padding: 0;
    }

    nav .right a span {
        display: none;
    }

    .typewriter {
        font-size: 30px;
    }

    /* SECTION 1: Hero */
    .hero-section {
        padding: 0 20px;
    }

    /* re-adjust font and padding for mobile */
    .hero-section .text h2 {
        font-size: 30px;
    }

    /* SECTION 2: Skills */
    .skills-section {
        padding: 20px;
    }

    .skills-section .cells .cell span {
        font-size: 16px;
    }

    /* SECTION 3: About */
    .about-section {
        padding: 20px;
    }

    /* SECTION 4: Projects */

    .projects-section .group .text,
    .projects-section .project-card h3,
    .projects-section .project-card p,
    .projects-section .project-card .meta {
        color: var(--text-color);
    }

    .projects-section .project-card a {
        color: var(--link-color);
    }

    .projects-section {
        padding: 0 20px 40px;
        margin-bottom: 60px;
    }

    .projects-section h2 {
        font-size: 28px;
        margin-bottom: 16px;
    }

    .projects-section .text {
        font-size: 14px;
        line-height: 1.7;
        margin-top: 16px;
        margin-bottom: 12px;
    }

    .projects-section .project-card {
        padding: 16px 16px;
    }

    .projects-section .project-card h3 {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .projects-section .project-card p {
        font-size: 13px;
        line-height: 1.6;
    }

    .projects-section .project-card .meta {
        font-size: 12px;
    }

    /* SECTION 5: Experience */
    .experience-section {
        padding: 0 10px;
    }
}