/* Base */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-ink: #18181b;
    --color-muted: #5f6470;
    --color-surface: #fff;
    --color-soft: #f4f6f8;
    --color-dark: #111827;
    --color-icon-bg: #eff6ff;
    --color-icon-border: #dbeafe;
    --dark-section-gradient:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.3), transparent 45%),
        linear-gradient(145deg, #111827, #1e3a5f);
    --radius: 16px;
    --shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}

html {
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-size: 18px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--color-soft);
    line-height: 1.65;
    margin: 0;
    color: var(--color-ink);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    padding: 0.7rem 1rem;
    color: #fff;
    background: var(--color-primary);
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

main:focus {
    outline: none;
}

.section {
    padding: clamp(4rem, 8vw, 7rem) 1.25rem;
    text-align: center;
}

.container {
    width: min(1120px, 100%);
    margin: 0 auto;
}

h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin: 0 0 2.5rem;
}

ul {
    list-style: none;
    padding: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    margin-top: 20px;
    padding: 0.75rem 1.15rem;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    border: 1px solid var(--color-primary);
    border-radius: 999px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 4px;
}

/* Header */
header {
    display: flex;
    justify-content: center;
    align-items: center;

    padding: 1rem 2rem;

    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(17, 24, 39, 0.94);
    backdrop-filter: blur(12px);
    color: #fff;

    border-bottom: 1px solid #444;
}

/* Navigation */
.site-nav {
    width: min(900px, 100%);
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
}

.nav-links a {
    display: inline-block;
    padding: 0.65rem 0.9rem;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    transition: transform 0.3s ease, color 0.3s ease, background-color 0.3s ease;
}

.nav-links a:hover {
    transform: translateY(-2px);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

@media (min-width: 769px) {
    .nav-links a.is-active {
        color: #fff;
        background: var(--color-primary);
        box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
    }
}

.nav-toggle {
    display: none;
}

/* Home */
#home {
    position: relative;
    overflow: clip;
    min-height: 70vh;
    padding: 8rem 1.25rem;
    text-align: center;
    color: #fff;
}

#home::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../media/coding.webp") center / cover no-repeat;
    opacity: 0.9;
    z-index: 1;
}

#home::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2;
}

#home .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
}

#home .hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.25rem;
    padding: 0.45rem 0.85rem;
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

#home .hero-eyebrow span {
    width: 0.5rem;
    height: 0.5rem;
    background: #60a5fa;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(96, 165, 250, 0.16);
}

#home .hero-name {
    width: 100%;
    margin: 0;
    color: #fff;
    font-size: clamp(3.75rem, 10vw, 7.5rem);
    line-height: 0.92;
    letter-spacing: -0.065em;
    text-shadow: 0 10px 36px rgba(0, 0, 0, 0.3);
}

#home .hero-focus {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    margin: 1.75rem 0 0;
    color: #e2e8f0;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    font-weight: 600;
    letter-spacing: 0.025em;
}

#home .hero-focus span + span::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-right: 0.9rem;
    vertical-align: middle;
    background: #60a5fa;
    border-radius: 50%;
}

/* About */
#about {
    background: var(--color-surface);
}

#about .container {
    max-width: 1200px;
}

.about-layout {
    display: grid;
    grid-template-columns: minmax(340px, 480px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(2.5rem, 6vw, 5rem);
}

.about-photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: calc(var(--radius) + 8px);
    box-shadow: var(--shadow);
}

.about-content {
    text-align: left;
}

.about-content h2 {
    margin-bottom: 1.5rem;
}

.about-content p {
    max-width: 62ch;
}

/* Currently */
.currently-section {
    padding: 1.25rem;
    background: var(--color-surface);
}

.currently-card {
    width: min(1050px, 100%);
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    color: #fff;
    text-align: left;
    background: linear-gradient(135deg, var(--color-dark), #1e3a5f);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.currently-label {
    margin: 0 0 0.35rem;
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.currently-card h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    letter-spacing: -0.025em;
}

.currently-card ul {
    display: grid;
    gap: 0.55rem;
    max-width: 75ch;
    margin: 0;
}

.currently-card li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #dbeafe;
}

.currently-card li::before {
    content: "";
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    margin-top: 0.6em;
    background: #60a5fa;
    border-radius: 50%;
}

/* Skills */
#skills {
    background: var(--color-soft);
}

#skills ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 0 auto;
    max-width: 900px;
}

#skills li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #fff;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#skills li:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

#skills strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #222;
}

.skill-icon,
.project-icon {
    display: grid;
    place-items: center;
    color: var(--color-primary);
    background: var(--color-icon-bg);
    border: 1px solid var(--color-icon-border);
}

.skill-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.skill-icon svg,
.project-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.skill-icon svg {
    width: 21px;
    height: 21px;
}

/* Experience */
#experience {
    color: #fff;
    background: var(--dark-section-gradient);
}

#experience .container {
    max-width: 900px;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
}

#experience .job-heading,
#experience .experience-subheading {
    padding-left: 20px;
    text-align: left;
}

#experience .job-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.5rem;
    margin: 0 0 0.25rem;
}

#experience .job-title {
    font-size: 1.3rem;
}

#experience .job-date {
    flex-shrink: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #cbd5e1;
}

#experience .experience-subheading {
    padding-left: 40px;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-style: italic;
    font-weight: normal;
    color: #ccc;
}

#experience .experience-location {
    flex-shrink: 0;
    margin: 0;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 500;
    color: #cbd5e1;
}

#experience .company-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

#experience .company-heading h3 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.25;
    font-weight: 750;
    text-align: left;
}

#experience .company-roles {
    position: relative;
    margin-left: 1.25rem;
    padding-left: 1.75rem;
    border-left: 2px solid rgba(147, 197, 253, 0.55);
}

#experience .role-entry {
    position: relative;
    padding: 0.75rem 0 0.5rem;
}

#experience .role-entry + .role-entry {
    padding-top: 0.5rem;
}

#experience .role-entry:last-child {
    padding-bottom: 0;
}

#experience .role-entry::before {
    content: "";
    position: absolute;
    top: 1.25rem;
    left: calc(-1.75rem - 6px);
    width: 10px;
    height: 10px;
    background: #93c5fd;
    border: 2px solid var(--color-dark);
    border-radius: 50%;
}

#experience ul {
    margin-top: 0.5rem;
    margin-left: 20px;
    padding-left: 1rem;
    font-size: 0.95rem;
    text-align: left;
}

#experience .role-entry ul:last-child {
    margin-bottom: 0;
}

#experience ul li {
    position: relative;
    padding-left: 1.5rem;
}

#experience ul li::before {
    content: "➜";
    position: absolute;
    left: 0;
    color: #ccc;
}

/* Credentials */
#credentials {
    overflow: hidden;
}

#credentials .container {
    width: min(1340px, 100%);
}

.education h3,
.certifications h3 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin: 0 0 2.5rem;
}

.side-by-side {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.education,
.certifications {
    flex: 1;
    width: auto;
    max-width: 650px;
    padding: 2.5rem;
    background: var(--color-surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 1.25rem;
    line-height: 1.45;
}

.education span,
.certifications span {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.15rem;
    color: #666;
    font-style: italic;
}

.credential-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.credential-date {
    flex-shrink: 0;
    color: var(--color-muted);
    font-size: 1.1rem;
    font-style: italic;
    font-weight: 500;
}

.nested-credential {
    margin: 0.5rem 0;
    padding: 0.2rem 0 0.2rem 0.8rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-ink);
    border-left: 2px solid #bfdbfe;
    font-style: normal;
}

.nested-credential span {
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-style: normal;
}

.education ul,
.certifications ul {
    margin: 0;
}

.education li,
.certifications li {
    text-align: left;
    margin-bottom: 1.5rem;
}

.education li:last-child,
.certifications li:last-child {
    margin-bottom: 0;
}

.reveal-card {
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left {
    transform: translateX(-4rem);
}

.reveal-right {
    transform: translateX(4rem);
}

.reveal-card.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Projects */
#projects {
    background: linear-gradient(180deg, #eef2ff, var(--color-soft));
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

#projects .project p {
    text-align: left;
}

#projects .project-tech {
    padding: 0.65rem 0.8rem;
    background: var(--color-soft);
    border-radius: 10px;
    color: var(--color-muted);
    font-size: 0.88rem;
}

.project {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.75rem;
    background: var(--color-surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project h3 {
    margin: 0;
    font-size: 1.2rem;
    text-align: left;
}

.project-heading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
}

.project-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 11px;
}

.project-icon svg {
    width: 23px;
    height: 23px;
}

.project-link {
    margin-top: auto;
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.project-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
    text-underline-offset: 0.25rem;
}

.project:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.projects-action {
    margin-top: 2rem;
}

/* Contact */
#contact {
    padding: clamp(3rem, 6vw, 4.5rem) 1.25rem;
    background: var(--dark-section-gradient);
}

.contact-card {
    width: min(760px, calc(100% - 2.5rem));
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 4rem);
    color: #fff;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: calc(var(--radius) + 8px);
    box-shadow: var(--shadow);
}

.contact-card h2 {
    margin-bottom: 1rem;
}

.contact-card p {
    max-width: 60ch;
    margin: 0 auto;
    color: #cbd5e1;
}

.contact-links {
    display: flex;
    justify-content: center;
}

/* Footer */
footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background: #0b1220;
    color: #94a3b8;
    padding: 1rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    text-align: center;
}

footer p {
    margin: 0;
}

.back-to-top {
    color: #cbd5e1;
    text-decoration: none;
}

.back-to-top:hover {
    color: var(--color-primary);
}

/* Error page */
.error-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1.25rem;
    color: #fff;
    text-align: center;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.35), transparent 45%),
        var(--color-dark);
}

.error-card {
    width: min(620px, 100%);
    padding: clamp(2rem, 7vw, 4rem);
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: calc(var(--radius) + 8px);
    box-shadow: var(--shadow);
}

.error-code {
    margin: 0;
    color: #93c5fd;
    font-size: clamp(4rem, 18vw, 8rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.06em;
}

.error-card h1 {
    margin: 1.25rem 0 0.75rem;
    font-size: clamp(2rem, 6vw, 3rem);
}

.error-card p:not(.error-code) {
    margin: 0;
    color: #cbd5e1;
}

/* Animations */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInFromLeft 1.5s ease-out forwards;
}

.slide-in-right {
    animation: slideInFromRight 1.5s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    body.menu-open {
        overflow: hidden;
    }

    header {
        position: relative;
        justify-content: flex-end;
        padding: 0.75rem 1rem;
        background: var(--color-dark);
        backdrop-filter: none;
    }

    .nav-toggle {
        display: flex;
        position: relative;
        z-index: 101;
        flex-direction: column;
        justify-content: space-between;
        width: 2rem;
        height: 1.5rem;
        padding: 0;
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .nav-toggle span {
        width: 100%;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .nav-toggle[aria-expanded="true"] span:first-child {
        transform: translateY(11px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle[aria-expanded="true"] span:last-child {
        transform: translateY(-11px) rotate(-45deg);
    }

    .site-nav {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 100;
        padding: 5rem 1.5rem 2rem;
        background: var(--color-dark);
    }

    .site-nav.is-open {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        justify-content: center;
        gap: 0;
        min-height: 100%;
        font-size: 1.5rem;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid #fff;
        text-align: center;
    }

    .nav-links li:first-child {
        border-top: 1px solid #fff;
    }

    .nav-links a {
        display: block;
        padding: 1rem;
    }

    #home .container {
        padding: 0 10px;
    }

    #home .hero-name {
        font-size: clamp(3.2rem, 17vw, 5rem);
    }

    #home .hero-focus {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }

    .about-layout {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 2rem;
    }

    .about-photo {
        width: min(400px, 100%);
    }

    .about-content {
        text-align: center;
    }

    .side-by-side {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        text-align: center;
    }

    .side-by-side > div {
        flex: none;
        width: 100%;
        max-width: 600px;
    }

    .credential-heading {
        display: block;
    }

    .credential-date {
        display: block;
        margin-top: 0.15rem;
    }

    #skills ul {
        grid-template-columns: 1fr;
    }

    #projects {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

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

    #projects .project {
        padding: 1.25rem;
    }

    #projects .project p {
        margin: 0.75rem 0;
        line-height: 1.5;
    }

    #projects .btn {
        margin-top: 0.5rem;
    }

    #experience .company-heading,
    #experience .job-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    #experience .company-heading h3 {
        font-size: 1.3rem;
    }

    #experience .experience-location {
        font-size: 0.85rem;
    }

    #experience .job-title {
        font-size: 1.1rem;
    }

    #experience .job-date {
        font-size: 0.82rem;
    }

    #experience .company-roles {
        margin-left: 0.5rem;
        padding-left: 1rem;
    }

    #experience .role-entry::before {
        left: calc(-1rem - 6px);
    }

    #experience .job-heading {
        display: block;
        padding-left: 0.5rem;
    }

    #experience .job-date {
        display: block;
        margin-top: 0.15rem;
    }

    #experience .experience-subheading {
        padding-left: 0.75rem;
        font-size: 0.9rem;
    }

    #experience ul {
        margin-left: 0;
        font-size: 0.85rem;
        line-height: 1.5;
    }

    footer {
        padding: 0.75rem 1rem;
    }

}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal-card {
        opacity: 1;
        transform: none;
    }
}
