:root {
    --bg-950: #0a0e13;
    --bg-900: #10151c;
    --bg-800: #161d26;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-hover: rgba(255, 255, 255, 0.075);
    --border-soft: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text-hi: #eef3f6;
    --text-mid: #b9c4cd;
    --text-dim: #7c8894;

    --accent: #49d8bd;
    --accent-dim: #2f8f7d;
    --accent-soft: rgba(73, 216, 189, 0.12);
    --accent-2: #f2a65a;

    --font-display: "Michroma", "Play", sans-serif;
    --font-wordmark: "Manufacturing Consent", serif;
    --font-body: "Play", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Consolas,
        "Liberation Mono", Menlo, monospace;

    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.35);

    --section-max: 1180px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-950);
    color: var(--text-mid);
    line-height: 1.65;
    font-size: 16px;

    background-image:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0),
        radial-gradient(1100px 600px at 85% -10%, rgba(73, 216, 189, 0.10), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(242, 166, 90, 0.06), transparent 60%),
        linear-gradient(120deg, var(--bg-950), var(--bg-900) 45%, var(--bg-950));
    background-size: 26px 26px, auto, auto, 400% 400%;
    background-position: 0 0, 0 0, 0 0, 0% 50%;
    animation: gradient-drift 22s ease infinite;
}

@keyframes gradient-drift {
    0%   { background-position: 0 0, 0 0, 0 0, 0% 50%; }
    50%  { background-position: 0 0, 0 0, 0 0, 100% 50%; }
    100% { background-position: 0 0, 0 0, 0 0, 0% 50%; }
}

::selection {
    color: var(--bg-950);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(10, 14, 19, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
    padding: 0.9rem clamp(1.25rem, 5vw, 4rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    z-index: 1000;
}

.logo {
    font-family: var(--font-wordmark);
    color: var(--text-hi);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 400;
    text-decoration: none;
    letter-spacing: 1px;
    line-height: 1;
    position: relative;
    transition: color 0.3s;
}

.logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem clamp(1rem, 2.5vw, 2rem);
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-mid);
    text-decoration: none;
    padding: 6px 2px;
    position: relative;
    transition: color 0.25s;
}

.nav-links a::before {
    content: ">";
    color: var(--accent);
    opacity: 0;
    margin-right: 4px;
    transition: opacity 0.25s;
}

.nav-links a:hover {
    color: var(--text-hi);
}

.nav-links a:hover::before {
    opacity: 1;
}

section {
    min-height: 100vh;
    padding: 130px clamp(1.25rem, 6vw, 10%) 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: var(--section-max);
    margin-inline: auto;
    width: 100%;
}

.section-title {
    text-align: center;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--text-hi);
    margin-bottom: clamp(28px, 5vw, 44px);
    position: relative;
    padding-bottom: 18px;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    translate: -50% 0;
    width: 30vh;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

#home {
    align-items: center;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.1rem, 6vw, 3.6rem);
    color: var(--text-hi);
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: clamp(0.95rem, 2.4vw, 1.3rem);
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.hero-desc {
    max-width: 620px;
    margin: 0 auto 34px;
    color: var(--text-mid);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border-soft);
    background: var(--surface);
    color: var(--text-hi);
    font-size: 1.25rem;
    transition: transform 0.25s, border-color 0.25s, color 0.25s, background 0.25s;
}

.social-links a:hover {
    transform: translateY(-4px);
    background: var(--surface-hover);
}

.social-links a:nth-child(1):hover { color: #fff; border-color: #ffffff55; }
.social-links a:nth-child(2):hover { color: #0a66c2; border-color: #0a66c255; }
.social-links a:nth-child(3):hover { color: var(--accent); border-color: var(--accent); }

.grid-container,
.skills-container {
    display: grid;
    gap: clamp(18px, 2.5vw, 30px);
    margin-top: 1.5rem;
}

.grid-container {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.skills-container {
    display: grid;
    gap: 30px;
    margin-top: 1.5rem;
    grid-template-columns: repeat(4, 1fr); 
}

.card {
    background-color: var(--surface);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: clamp(20px, 3vw, 28px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--accent-dim);
    box-shadow: var(--shadow-soft);
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-left-color 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
    border-left-color: var(--accent);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--accent-soft);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-bottom: 12px;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.02rem, 2vw, 1.2rem);
    color: var(--text-hi);
    letter-spacing: 0.2px;
}

.card-date {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    color: var(--bg-950);
    background: var(--accent);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 700;
}

.card-subtitle {
    font-family: var(--font-mono);
    font-style: normal;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 16px;
}

.card ul {
    padding-left: 20px;
    color: var(--text-mid);
}

.card li {
    margin-bottom: 9px;
    font-size: 0.95rem;
}

.card li strong {
    color: var(--text-hi);
}

#skills {
    max-width: 1440px;
    width: 100%;
}

.skills-container {
    display: grid;
    gap: 20px;
    margin-top: 1.5rem;
    grid-template-columns: repeat(4, 1fr);
}

.skills-category {
    background-color: var(--surface);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.skills-category {
    background-color: var(--surface);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 15px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
    border-left: 4px solid var(--accent);
}

.skills-category h3 {
    font-family: var(--font-display);
    font-weight: 400;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 12px;
    text-align: center;
    color: var(--text-hi);
    font-size: clamp(1rem, 2vw, 1.15rem);
    letter-spacing: 0.5px;
}

.skillbar {
    background-color: rgba(0, 0, 0, 0.35);
    border-radius: 20px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--bg-950);
    font-weight: 700;
    width: 100%;
    box-sizing: border-box;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-soft);
    overflow: hidden;
    position: relative;
}

.skillbar::before {
    content: attr(data-skill);
    display: inline-block;
    font-family: var(--font-mono);
    padding: 7px 14px;
    font-size: 12.5px;
    border-radius: 0 20px 20px 0;
    animation: load 1.6s cubic-bezier(0.25, 1, 0.5, 1);
    white-space: nowrap;
    box-sizing: border-box;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    box-shadow: 0 0 12px rgba(73, 216, 189, 0.35);
}

@keyframes load {
    from { width: 0%; }
}

.skillbar.learning::before      { width: 20%; }
.skillbar.basic::before         { width: 40%; }
.skillbar.intermediate::before  { width: 60%; }
.skillbar.advanced::before      { width: 80%; }
.skillbar.expert::before {
    width: 100%;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent-2));
    box-shadow: 0 0 12px rgba(242, 166, 90, 0.35);
}

footer {
    background: #0a0e13;
    border-top: 1px solid var(--border-soft);
    color: var(--text-mid);
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 110px clamp(1.25rem, 6vw, 10%) 80px;
    position: relative;
    gap: 6px;
}

footer p {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
}

footer p i {
    color: var(--accent);
    margin-right: 8px;
}

footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--accent);
}

.copyright {
    position: absolute;
    bottom: 22px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    width: 100%;
    text-align: center;
    left: 0;
}

.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.card:nth-child(1) { transition-delay: 0.08s; }
.card:nth-child(2) { transition-delay: 0.16s; }
.card:nth-child(3) { transition-delay: 0.24s; }
.card:nth-child(4) { transition-delay: 0.32s; }

.animate-text { opacity: 0; }
.animate-text.ready { opacity: 1; }

.word-wrapper {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
}

.word {
    display: inline-block;
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease-out;
}

.word.active {
    transform: translateY(0);
    opacity: 1;
    color: inherit;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    body {
        animation: none;
    }
}

@media (max-width: 1024px) {
    .grid-container {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
    
    .skills-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 150px;
    }

    nav {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0.9rem 5%;
        gap: 0.6rem;
    }

    .logo {
        margin: 0;
    }

    .nav-links {
        justify-content: center;
        gap: 0.5rem 1.1rem;
    }

    section {
        padding: 150px 5% 60px;
        min-height: auto;
    }

    #home {
        min-height: 100vh;
    }

    .hero-title { font-size: clamp(2rem, 8vw, 2.6rem); }
    .hero-subtitle { font-size: clamp(0.85rem, 4vw, 1.05rem); }

    .grid-container,
    .skills-container {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: row;
        flex-wrap: wrap;
    }

    footer {
        min-height: auto;
        padding: 90px 6% 90px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .logo {
        font-size: 1.7rem;
    }

    .nav-links a {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }

    section,
    footer {
        padding-left: 5%;
        padding-right: 5%;
    }

    section {
        padding-top: 140px;
    }

    .hero-desc {
        font-size: 0.9rem;
    }

    .social-links a {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .card,
    .skills-category {
        padding: 18px;
    }

    .card-date {
        font-size: 0.68rem;
        padding: 3px 8px;
    }

    .skillbar::before {
        white-space: normal;
        word-break: break-word;
        padding: 7px 10px;
        line-height: 1.35;
    }

    .copyright {
        position: static;
        margin-top: 30px;
    }

    footer {
        padding-bottom: 40px;
    }
}

@media (max-width: 360px) {
    .logo { font-size: 1.5rem; }
    .hero-title { font-size: 1.75rem; }
    .nav-links { gap: 0.4rem 0.8rem; }
}

@media (min-width: 1600px) {
    :root {
        --section-max: 1320px;
    }

    body {
        font-size: 17px;
    }
}
