/* ==========================================================
   Theme — same navy / teal / mint palette as before
   ========================================================== */
:root {
    --bg: #0D1B2A;
    --bg-raised: #12253a;
    --bg-card: rgba(255, 255, 255, 0.035);
    --line: rgba(173, 213, 202, 0.14);
    --teal: #4a8d7a;
    --mint: #ADD5CA;
    --text: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.68);
    --radius: 18px;
    --max: 1180px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Open Sans', system-ui, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection { background: var(--teal); color: #fff; }

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

img { max-width: 100%; display: block; }

h1, h2, h3 { margin: 0; line-height: 1.1; }

.italics { font-style: italic; }

/* Soft background glow */
.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(600px circle at 85% 10%, rgba(74, 141, 122, 0.18), transparent 60%),
        radial-gradient(700px circle at 5% 60%, rgba(173, 213, 202, 0.06), transparent 60%);
}

/* ==========================================================
   Animations (kept from the original)
   ========================================================== */
@keyframes background-pan {
    from { background-position: 0% center; }
    to { background-position: -200% center; }
}
@keyframes scale {
    from, to { transform: scale(0); }
    50% { transform: scale(1); }
}
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(180deg); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(8px); opacity: .4; }
}

/* ==========================================================
   Nav
   ========================================================== */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max);
    margin: 0 auto;
    padding: 22px 32px;
    transition: padding .3s var(--ease), background .3s var(--ease);
}
.nav::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: rgba(13, 27, 42, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    transition: opacity .3s var(--ease);
}
.nav.is-scrolled { padding-top: 14px; padding-bottom: 14px; }
.nav.is-scrolled::before { opacity: 1; }

.nav__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: .01em;
}
.nav__mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--teal);
    color: var(--mint);
    font-size: .85rem;
    font-weight: 800;
    letter-spacing: .05em;
    transition: background .25s, color .25s;
}
.nav__logo:hover .nav__mark { background: var(--teal); color: #fff; }

.nav__links {
    display: flex;
    align-items: center;
    gap: 34px;
}
.nav__links a {
    position: relative;
    font-size: .95rem;
    color: var(--text-muted);
    transition: color .2s;
}
.nav__links a:not(.nav__cta)::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    height: 1px;
    width: 100%;
    background: var(--mint);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .3s var(--ease);
}
.nav__links a:hover,
.nav__links a.is-active { color: var(--text); }
.nav__links a:hover::after,
.nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav__cta {
    padding: 8px 18px;
    border: 1px solid var(--teal);
    border-radius: 999px;
    color: var(--mint) !important;
    transition: background .2s, color .2s !important;
}
.nav__cta:hover { background: var(--teal); color: #fff !important; }

.nav__toggle {
    display: none;
    background: none;
    border: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    position: relative;
}
.nav__toggle span {
    position: absolute;
    left: 9px;
    right: 9px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .3s var(--ease), top .3s var(--ease);
}
.nav__toggle span:first-child { top: 15px; }
.nav__toggle span:last-child { top: 23px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

/* ==========================================================
   Layout
   ========================================================== */
main { max-width: var(--max); margin: 0 auto; padding: 0 32px; }

.section { padding: 110px 0 40px; }

.section__head {
    display: flex;
    align-items: baseline;
    gap: 18px;
    margin-bottom: 50px;
}
.section__head h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    white-space: nowrap;
}
.section__num {
    font-size: .95rem;
    font-weight: 600;
    color: var(--teal);
    letter-spacing: .1em;
}
.divider {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--teal), transparent);
    align-self: center;
}

/* ==========================================================
   Hero
   ========================================================== */
.hero {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    align-items: center;
    gap: 40px;
    min-height: calc(100vh - 90px);
    padding: 40px 0 80px;
}

.hero__welcome {
    margin: 0 0 6px;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 300;
    font-style: italic;
    color: var(--mint);
}

h1 {
    font-size: clamp(2.8rem, 6.4vw, 5.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.fancy { display: inline-block; position: relative; }

.fancy__text {
    animation: background-pan 3s linear infinite;
    background: linear-gradient(to right, var(--mint), var(--teal), var(--mint));
    background-size: 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.fancy__star {
    --size: clamp(16px, 1.6vw, 26px);
    position: absolute;
    left: var(--star-left);
    top: var(--star-top);
    width: var(--size);
    height: var(--size);
    display: block;
    transform: scale(0);
    animation: scale 700ms ease forwards;
    pointer-events: none;
}
.fancy__star > svg {
    display: block;
    opacity: .75;
    animation: rotate 1000ms linear infinite;
}
.fancy__star > svg > path { fill: var(--teal); }

/* Role list — the fading stack from the original, now cycling */
.roles {
    --row: clamp(2rem, 3vw, 2.6rem);
    position: relative;
    height: calc(var(--row) * 5);
    margin: 26px 0 34px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 65%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 65%, transparent);
}
.roles__track {
    list-style: none;
    margin: 0;
    padding: 0;
    transition: transform .7s var(--ease);
}
.roles__track li {
    height: var(--row);
    line-height: var(--row);
    font-size: clamp(1.15rem, 2vw, 1.6rem);
    color: rgba(255, 255, 255, 0.35);
    transition: color .5s, font-weight .5s;
    white-space: nowrap;
}
.roles__track li.is-active {
    color: var(--text);
    font-weight: 700;
}
.roles__track li.is-active::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 2px;
    margin-right: 14px;
    vertical-align: middle;
    background: var(--teal);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 999px;
    font-weight: 600;
    font-size: .98rem;
    transition: transform .25s var(--ease), background .25s, box-shadow .25s, border-color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
    background: var(--teal);
    color: #fff;
    box-shadow: 0 10px 30px -10px rgba(74, 141, 122, .8);
}
.btn--primary:hover { background: #57a28c; box-shadow: 0 14px 34px -10px rgba(74, 141, 122, 1); }
.btn--ghost { border: 1px solid var(--line); color: var(--mint); }
.btn--ghost:hover { border-color: var(--mint); }

.hero__image {
    position: relative;
    justify-self: center;
    width: min(100%, 460px);
    aspect-ratio: 1;
}
.hero__image img {
    position: absolute;
    inset: 6%;
    width: 88%;
    height: 88%;
    object-fit: cover;
    object-position: 52% 30%;
    border-radius: 50%;
    filter: grayscale(1) contrast(1.05);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
}
.hero__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--teal), transparent 30%, var(--mint) 55%, transparent 80%, var(--teal));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
    animation: spin 14s linear infinite;
}
.hero__image::after {
    content: "";
    position: absolute;
    inset: 10%;
    z-index: -1;
    border-radius: 50%;
    background: var(--teal);
    filter: blur(70px);
    opacity: .35;
}

.scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 20px;
    width: 26px;
    height: 42px;
    margin-left: -13px;
    border: 1.5px solid var(--line);
    border-radius: 20px;
}
.scroll-hint span {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: var(--mint);
    animation: bob 1.8s ease-in-out infinite;
}

/* ==========================================================
   About
   ========================================================== */
.about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}
.about__quote {
    margin: 0;
    padding-left: 26px;
    border-left: 3px solid var(--teal);
    font-size: clamp(1.35rem, 2.3vw, 1.9rem);
    font-style: italic;
    font-weight: 300;
    line-height: 1.45;
    color: var(--mint);
}
.about__body p { margin: 0 0 18px; color: var(--text-muted); }

.info-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 60px;
}
.info-card {
    padding: 30px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--line);
    transition: border-color .3s, transform .3s var(--ease);
}
.info-card:hover { border-color: rgba(74, 141, 122, .6); transform: translateY(-3px); }
.info-card__label {
    display: block;
    margin-bottom: 12px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--teal);
}
.info-card h3 { font-size: 1.3rem; margin-bottom: 6px; }
.info-card p { margin: 0; color: var(--text-muted); }
.cert-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    font-weight: 600;
    font-size: 1.1rem;
}
.cert-list li::before { content: "✦"; color: var(--teal); margin-right: 8px; font-size: .8em; }

/* ==========================================================
   Skills
   ========================================================== */
.skill-groups {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.skill-group h3 {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.chips li {
    padding: 7px 15px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(74, 141, 122, .08);
    font-size: .92rem;
    color: var(--mint);
    transition: background .2s, border-color .2s, color .2s;
}
.chips li:hover { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ==========================================================
   Projects
   ========================================================== */
.project-list { display: flex; flex-direction: column; gap: 40px; }

.project-card {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 44px;
    align-items: center;
    padding: 28px;
    border-radius: calc(var(--radius) + 6px);
    background: var(--bg-card);
    border: 1px solid var(--line);
    transition: border-color .3s, transform .4s var(--ease), box-shadow .4s;
}
.project-card:hover {
    border-color: rgba(74, 141, 122, .55);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
}
.project-card:nth-child(even) .project-card__media { order: 2; }

.project-card__media {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 18px;
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 50% 0%, rgba(74, 141, 122, .18), transparent 70%),
        var(--bg-raised);
    border: 1px solid var(--line);
}
.project-card__media img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform .6s var(--ease);
}
.project-card:hover .project-card__media img { transform: scale(1.02); }

.project-card__num {
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .12em;
    color: var(--teal);
}
.project-card h3 {
    margin: 8px 0 14px;
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}
.project-card p { margin: 0 0 20px; color: var(--text-muted); font-size: .98rem; }
.project-card .chips { margin-bottom: 24px; }
.project-card .chips li { font-size: .8rem; padding: 5px 12px; }

.project-card__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--mint);
}
.project-card__link .arrow { transition: transform .25s var(--ease); }
.project-card__link:hover .arrow { transform: translate(3px, -3px); }

/* ==========================================================
   Contact + footer
   ========================================================== */
.contact { padding-bottom: 100px; }
.contact__card {
    position: relative;
    overflow: hidden;
    padding: clamp(40px, 7vw, 80px);
    border-radius: calc(var(--radius) + 10px);
    text-align: center;
    background:
        radial-gradient(500px circle at 50% 0%, rgba(74, 141, 122, .35), transparent 70%),
        var(--bg-raised);
    border: 1px solid var(--line);
}
.contact__card h2 {
    margin: 12px 0 18px;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
}
.contact__card p {
    max-width: 560px;
    margin: 0 auto 32px;
    color: var(--text-muted);
}
.contact__card .hero__actions { justify-content: center; }

.footer {
    max-width: var(--max);
    margin: 0 auto;
    padding: 30px 32px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-top: 1px solid var(--line);
    font-size: .9rem;
    color: var(--text-muted);
}
.footer p { margin: 0; }
.footer__links { display: flex; gap: 24px; }
.footer__links a:hover { color: var(--mint); }

/* ==========================================================
   Scroll reveal
   ========================================================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 900px) {
    .nav { padding: 16px 22px; }
    .nav__toggle { display: block; }
    .nav__links {
        position: fixed;
        inset: 0;
        z-index: -1;
        flex-direction: column;
        justify-content: center;
        gap: 30px;
        background: rgba(13, 27, 42, .97);
        backdrop-filter: blur(14px);
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s, visibility .3s;
    }
    .nav__links a { font-size: 1.5rem; color: var(--text); }
    .nav.is-open .nav__links { opacity: 1; visibility: visible; }

    main { padding: 0 22px; }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        min-height: auto;
        padding: 30px 0 90px;
        gap: 30px;
    }
    .hero__image { order: -1; width: min(70vw, 300px); }
    .hero__text { display: flex; flex-direction: column; align-items: center; }
    .roles { width: 100%; }
    .roles__track li.is-active::before { display: none; }
    .hero__actions { justify-content: center; }

    .section { padding-top: 80px; }
    .about__grid,
    .info-cards,
    .skill-groups,
    .project-card { grid-template-columns: 1fr; gap: 28px; }
    .project-card { padding: 20px; }
    .project-card:nth-child(even) .project-card__media { order: 0; }

    .footer { flex-direction: column; text-align: center; padding: 30px 22px; }
}

@media (max-width: 520px) {
    .nav__name { display: none; }
    .section__head { gap: 12px; }
    .footer__links { flex-wrap: wrap; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}
