@import url("https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Arvo:wght@400;700&family=Asset&display=swap");

:root {
    --background: #0A1045;
    --primary: #B3DEC1;
    --secondary: #93827F;
    --accent: #016FB9;
    --white: #ffffff;
    --text-on-dark: rgba(255, 255, 255, 0.85);
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(179, 222, 193, 0.2);
    --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 30px rgba(1, 111, 185, 0.35);
    --radius: 20px;
    --section-space: clamp(40px, 6vw, 80px);
    --nav-h: 91px;
    --transition: transform 0.3s ease,
                  border-color 0.3s ease,
                  box-shadow 0.3s ease,
                  background-color 0.3s ease,
                  color 0.3s ease;
    --font-heading: "Abril Fatface", Georgia, serif;
    --font-preheading: Georgia, "Times New Roman" serif;
    --font-text: "Arvo", Georgia, serif;
    color-scheme: dark;
}


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

html {
    scroll-padding-top: var(--nav-h);
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-text);
    background: var(--background);
    color: var(--white);
    line-height: 1.7;
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3 {
    font-weight: 400;
    line-height: 1.2;
}

h1 {
    font-family: var(--font-heading);
}

h2,
h3 {
    font-family: var(--font-preheading);
}

p a {
    color: var(--primary);
    text-underline-offset: 3px;
}

p a:hover {
    color: var(--white);
}

::selection {
    background: var(--accent);
    color: var(--white);
}

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

.skip-link {
    position: absolute;
    left: 20px;
    top: -100px;
    z-index: 2000;
    padding: 10px 18px;
    background: var(--primary);
    color: var(--background);
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 10px 10px;
}

.skip-link:focus {
    top: 0;
}

body > nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    background: var(--background);
    border-bottom: 1px solid var(--card-border);
}

.logo {
    display: block;
}

.logo img {
    display: block;
    height: 60px;
    width: 80px;
}

#nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
    list-style: none;
}

#nav-links a {
    position: relative;
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease;
}

#nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

#nav-links a:hover,
#nav-links a[aria-current="page"] {
    color: var(--primary);
}

#nav-links a:hover::after,
#nav-links a[aria-current="page"]::after {
    transform: scaleX(1);
}

#menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

#menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

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

#menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.button {
    display: inline-block;
    margin-top: 15px;
    padding: 14px 28px;
    background: var(--accent);
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
}

.button:hover {
    background: var(--primary);
    color: var(--background);
}

.hero {
    min-height: calc(100svh - var(--nav-h));
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--background), var(--accent));
}

.hero-content {
    max-width: 900px;
}

.hero-content h1 {
    margin-bottom: 20px;
    font-size: clamp(2.5rem, 7vw, 4rem);
    line-height: 1.15;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-wrap: balance;
    overflow-wrap: anywhere;
    color: var(--primary);
}

.hero-content p {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    color: var(--text-on-dark);
}

.hero-content p + p {
    margin-top: 20px;
}

:is(.about, .skills, .projects, .contact) {
    padding: var(--section-space) 20px;
}

:is(.about-container, .skills-container, .projects-container, .contact-container) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 40px 60px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

:is(.about-tag, .skills-tag, .projects-tag, .contact-tag) {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 18px;

    background: var(--accent);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;

    border-radius: 999px;
}

:is(.about-text, .skills-text, .projects-text, .contact-text) :is(h1, h2) {
    margin-bottom: 25px;

    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
    text-wrap: balance;

    color: var(--primary);
}

:is(.about-text, .skills-text, .projects-text, .contact-text) p {
    max-width: 65ch;

    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-on-dark);
}

:is(.about-text, .skills-text, .projects-text, .contact-text) p + p {
    margin-top: 1em;
}

:is(.about-stats, .skills-cards, .projects-cards, .contact-cards) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 20px;
}


.cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;

    max-width: 1200px;
    margin: 0 auto;
    padding: var(--section-space) 20px;
}

.card {
    flex: 1 1 min(280px, 100%);
    max-width: 380px;
}

:is(.card, .stat-card, .skill-card, .project-card) {
    padding: 30px;

    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

:is(.card, .stat-card, .skill-card, .project-card) :is(h2, h3) {
    margin-bottom: 10px;

    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--primary);
}

:is(.card, .stat-card, .skill-card, .project-card) p {
    color: var(--text-on-dark);
}

:is(.card, .stat-card, .skill-card, .project-card) p + p {
    margin-top: 0.5em;
}

@media (hover: hover) {
    :is(.card, .stat-card, .skill-card, .project-card):hover {
        transform: translateY(-6px);
        border-color: var(--primary);
        box-shadow: var(--shadow-lg);
    }

    .button:hover {
        transform: translateY(-3px);
    }
}

.stat-card {
    text-align: center;
}

.stat-card :is(h2, h3) {
    font-size: clamp(1.6rem, 4vw, 2rem);
}

.stat-card ul {
    list-style: none;
    color: var(--text-on-dark);
}

footer {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-on-dark);
    border-top: 1px solid var(--card-border);
}

footer ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 25px;
    list-style: none;
}

footer a {
    color: inherit;
    text-decoration: none;

    transition: color 0.3s ease;
}

footer a:hover,
footer a[aria-current="page"] {
    color: var(--primary);
}

.footer-note {
    margin-top: 20px;

    font-size: 0.9rem;
    color: var(--secondary);
}


@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.hero-content,
:is(.about-container, .skills-container, .projects-container, .contact-container) {
    animation: fadeUp 0.8s ease both;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 768px) {

    body > nav {
        flex-wrap: wrap;
        padding: 15px 20px;
    }

    .logo img {
        height: 50px;
    }

    #menu-toggle {
        display: flex;
    }

    #nav-links {
        display: none;
        flex-direction: column;
        gap: 5px;
        width: 100%;
        margin-top: 15px;
        text-align: center;
        max-height: calc(100dvh - var(--nav-h));
        overflow-y: auto;
    }

    #menu-toggle[aria-expanded="true"] + #nav-links {
        display: flex;
    }

    #nav-links a {
        display: block;
        padding: 10px 0;
    }

    #nav-links a::after {
        display: none;
    }

    .hero {
        padding: 60px 20px;
    }

    .hero-content h1 {
        letter-spacing: 1px;
    }

    .card {
        max-width: none;
    }
}