/* ── TOKENS ── */
:root {
    --bg: #ffffff;
    --bg-alt: #f6f4f9;
    --bg-card: #ffffff;
    --surface: #f0edf6;
    --border: rgba(120, 110, 160, 0.14);
    --txt: hsl(219, 22%, 20%);
    --txt-body: hsl(220, 12%, 43%);
    --txt-muted: hsl(219, 10%, 60%);
    --accent: hsl(344, 53%, 58%);
    --accent-a10: hsla(344, 53%, 58%, 0.10);
    --accent-a25: hsla(344, 53%, 58%, 0.25);
    --nav-bg: hsl(216, 14%, 12%);
    --sh-sm: 0 1px 12px rgba(20, 18, 40, 0.06);
    --sh-md: 0 4px 28px rgba(20, 18, 40, 0.10);
    --sh-lg: 0 8px 48px rgba(20, 18, 40, 0.14);
    --r8: 8px;
    --r12: 12px;
    --rpill: 100px;
    --t1: 0.22s ease;
    --t2: 0.4s ease;
    --t3: 0.3s ease-in-out;
    --ease: cubic-bezier(0.25, 1, 0.5, 1);
    --ff-d: 'Playfair Display', Georgia, serif;
    --ff-b: 'Manrope', sans-serif;
    --pad: 100px;
}

[data-theme="dark"] {
    --bg: #12111a;
    --bg-alt: #1a1825;
    --bg-card: #1e1c2a;
    --surface: #252334;
    --border: rgba(140, 130, 180, 0.12);
    --txt: hsl(240, 18%, 93%);
    --txt-body: hsl(240, 10%, 70%);
    --txt-muted: hsl(240, 8%, 50%);
    --accent: hsl(344, 65%, 66%);
    --accent-a10: hsla(344, 65%, 66%, 0.10);
    --accent-a25: hsla(344, 65%, 66%, 0.22);
    --nav-bg: #0d0c15;
    --sh-sm: 0 1px 12px rgba(0, 0, 0, 0.35);
    --sh-md: 0 4px 28px rgba(0, 0, 0, 0.45);
    --sh-lg: 0 8px 48px rgba(0, 0, 0, 0.55);
}

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

li {
    list-style: none
}

a,
img,
span,
button,
ion-icon {
    display: block
}

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

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

input,
button,
textarea {
    background: none;
    border: none;
    font: inherit
}

input,
textarea {
    width: 100%
}

button {
    cursor: pointer
}

ion-icon {
    pointer-events: none
}

html {
    font-family: var(--ff-b);
    font-size: 10px;
    scroll-behavior: smooth
}

body {
    background: var(--bg);
    color: var(--txt-body);
    font-size: 1.6rem;
    line-height: 1.75;
    transition: background .3s, color .3s
}

body.no-scroll {
    overflow: hidden
}

::-webkit-scrollbar {
    width: 5px
}

::-webkit-scrollbar-track {
    background: var(--bg)
}

::-webkit-scrollbar-thumb {
    background: var(--accent-a25);
    border-radius: 99px
}

/* ── TYPE SCALE ── */
.h1 {
    font-family: var(--ff-d);
    font-size: clamp(3.4rem, 6vw, 6.2rem);
    color: var(--txt);
    line-height: 1.1;
    font-weight: 700
}

.h2 {
    font-family: var(--ff-d);
    font-size: clamp(2.8rem, 4vw, 4.4rem);
    color: var(--txt);
    line-height: 1.2;
    font-weight: 700
}

.h3 {
    font-family: var(--ff-d);
    font-size: clamp(2rem, 2.5vw, 3rem);
    color: var(--txt);
    line-height: 1.25;
    font-weight: 700
}

.h4 {
    font-family: var(--ff-b);
    font-size: 1.85rem;
    color: var(--txt);
    line-height: 1.3;
    font-weight: 700
}

/* ── UTILS ── */
.container {
    width: 100%;
    padding-inline: 20px;
    margin-inline: auto
}

.section {
    padding-block: var(--pad)
}

.eyebrow {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-block-end: 12px
}

.section-title {
    margin-block-end: 14px
}

.section-text {
    font-size: 1.7rem;
    color: var(--txt-body)
}

.w-100 {
    width: 100%
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 13px 28px;
    border-radius: var(--rpill);
    border: 2px solid var(--accent);
    color: var(--accent);
    transition: var(--t1);
    max-width: max-content;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--accent-a25)
}

.btn-primary {
    background: var(--accent);
    color: #fff
}

.btn-primary:hover {
    background: hsl(344, 53%, 51%);
    border-color: hsl(344, 53%, 51%)
}

.btn-secondary:hover {
    background: var(--accent);
    color: #fff
}

/* Reveal */
[data-reveal] {
    opacity: 0;
    transition: .7s var(--ease)
}

[data-reveal="top"] {
    transform: translateY(-24px)
}

[data-reveal="bottom"] {
    transform: translateY(24px)
}

[data-reveal="left"] {
    transform: translateX(-24px)
}

[data-reveal="right"] {
    transform: translateX(24px)
}

[data-reveal].revealed {
    transform: translate(0);
    opacity: 1
}

/* Social */
.social-list {
    display: flex;
    align-items: center;
    gap: 12px
}

.social-link {
    font-size: 1.9rem;
    color: var(--txt-muted);
    transition: var(--t1)
}

.social-link:hover {
    color: var(--accent);
    transform: translateY(-3px)
}

/* Grid */
.grid-list {
    display: grid;
    gap: 24px
}

/* ── HEADER ── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding-block: 18px;
    z-index: 10;
    background: transparent;
    transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}

.header.scrolled {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--sh-sm);
}

[data-theme="dark"] .header.scrolled {
    background: rgba(18, 17, 26, .85)
}

.header.scrolled::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: .5;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.logo {
    font-family: var(--ff-d);
    font-size: 2.2rem;
    font-style: italic;
    color: var(--accent);
    font-weight: 700
}

/* Desktop nav hidden on mobile */
.nav-open-btn {
    font-size: 3.2rem;
    color: var(--txt)
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px
}

/* Navbar (mobile slide-in) */
.navbar {
    position: fixed;
    top: 0;
    left: -300px;
    background: var(--nav-bg);
    color: #fff;
    max-width: 300px;
    width: 100%;
    height: 100vh;
    padding: 30px 30px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    z-index: 20;
    visibility: hidden;
    transition: var(--t3);
}

.navbar.active {
    visibility: visible;
    transform: translateX(300px)
}

.navbar-top {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.nav-close-btn {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 2rem;
    padding: 6px;
    border-radius: 50%;
    transition: var(--t1);
}

.nav-close-btn:hover {
    background: rgba(255, 255, 255, .15)
}

.nav-close-btn ion-icon {
    --ionicon-stroke-width: 50px
}

.navbar-list {
    margin-block-end: auto;
    display: flex;
    flex-direction: column;
    gap: 4px
}

.navbar-link {
    font-weight: 700;
    padding: 9px 0;
    font-size: 1.6rem;
    color: rgba(255, 255, 255, .75);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    transition: var(--t1);
    position: relative;
}

.navbar-link:hover,
.navbar-link.active-link {
    color: #fff
}

.navbar-link.active-link {
    color: var(--accent)
}

.nav-contact {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.nav-contact a {
    font-size: 1.35rem;
    color: rgba(255, 255, 255, .55);
    transition: var(--t1)
}

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

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    pointer-events: none;
    opacity: 0;
    transition: var(--t1);
    z-index: 15;
}

.overlay.active {
    pointer-events: all;
    opacity: 1
}

/* Theme toggle */
.theme-toggle {
    width: 40px;
    height: 22px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--rpill);
    position: relative;
    cursor: pointer;
    transition: background .25s;
    flex-shrink: 0;
}

.theme-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform .25s var(--ease);
}

[data-theme="dark"] .theme-toggle::after {
    transform: translateX(18px)
}

/* Desktop nav */
@media(min-width:900px) {
    .nav-open-btn {
        display: none
    }

    .navbar {
        all: unset;
        display: flex;
        align-items: center;
        flex-grow: 1;
    }

    .navbar-list {
        flex-direction: row;
        gap: 28px;
        margin-inline: auto;
        margin-block-end: 0;
    }

    .navbar-link {
        color: var(--txt-body);
        font-size: 1.5rem;
        padding: 4px 0;
        border-bottom: none;
    }

    .navbar-link::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        height: 2px;
        width: 0;
        background: var(--accent);
        border-radius: 2px;
        transition: width .2s ease;
    }

    .navbar-link:hover::after,
    .navbar-link.active-link::after {
        width: 100%
    }

    .navbar-link:hover,
    .navbar-link.active-link {
        color: var(--accent)
    }

    .navbar-top,
    .nav-contact,
    .navbar .social-list,
    .overlay {
        display: none
    }
}

/* ── HERO ── */
.hero {
    padding-block-start: calc(var(--pad) + 80px);
    padding-block-end: var(--pad);
    background: var(--bg-alt);
    overflow: hidden;
}

.hero .container {
    display: flex;
    flex-direction: column;
    gap: 48px;
    align-items: center;
}

/* Image placeholder (graceful when assets missing) */
.hero-img-wrap {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1/1;
    border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-a25), var(--accent-a10));
    border: 3px solid var(--accent-a25);
    box-shadow: var(--sh-lg);
    flex-shrink: 0;
}

.hero-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* hide broken img icon but keep space */
.hero-img-wrap img[src="./assets/images/hero-banner.jpg"] {
    font-size: 0;
    color: transparent;
}

.hero-content {
    text-align: center;
    max-width: 600px
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-a10);
    border: 1px solid var(--accent-a25);
    padding: 6px 16px;
    border-radius: var(--rpill);
    margin-block-end: 20px;
}

.hero-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1)
    }

    50% {
        opacity: .5;
        transform: scale(.8)
    }
}

.hero .h1 {
    margin-block-end: 4px
}

/* ── Typed line: fixed height so it never shifts layout ── */
.typed-line {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: clamp(2.4rem, 4vw, 3.8rem);
    color: var(--accent);
    line-height: 1.2;
    /* Reserve exactly one line of height always */
    min-height: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-block: 8px 20px;
    white-space: nowrap;
    overflow: hidden;
}

.typed-cursor {
    display: inline-block;
    width: 2px;
    background: var(--accent);
    margin-left: 3px;
    animation: blink .85s step-end infinite;
    flex-shrink: 0;
    align-self: center;
    height: .85em;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0
    }
}

.hero .section-text {
    margin-block-end: 32px;
    color: var(--txt-body)
}

.btn-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px
}

/* ── STATS ── */
.stats {
    background: var(--bg-card);
    border-block: 1px solid var(--border);
    padding-block: 44px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 16px;
    text-align: center;

    .stat-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        row-gap: 6px;
    }
}

.stat-num {
    font-family: var(--ff-d);
    font-weight: 700;
    font-size: clamp(3rem, 5vw, 5rem);
    color: var(--txt);
    line-height: 1;
    display: flex;
    column-gap: 6px;
    align-items: center;
}

.stat-num .acc {
    color: var(--accent)
}

.stat-lbl {
    font-size: 1.35rem;
    color: var(--txt-muted);
    margin-block-start: 6px;
    font-weight: 500
}

/* ── ABOUT ── */
.about {
    background: var(--bg)
}

.about-wrap {
    display: grid;
    gap: 48px;
    margin-block-end: 60px
}

.skills-label {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--txt);
    margin-block-end: 14px
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px
}

.tag {
    font-size: 1.35rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: var(--rpill);
    background: var(--surface);
    color: var(--txt-body);
    border: 1px solid var(--border);
    transition: var(--t1);
    cursor: default;
}

.tag:hover {
    background: var(--accent-a10);
    border-color: var(--accent-a25);
    color: var(--accent)
}

.about-photo {
    width: 100%;
    border-radius: var(--r12);
    object-fit: cover;
    aspect-ratio: 4/3;
    box-shadow: var(--sh-lg);
    display: block;
    background: var(--surface);
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r12);
    padding: 28px 24px;
    text-align: center;
    transition: var(--t2);
    box-shadow: var(--sh-sm);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sh-md);
    border-color: var(--accent-a25)
}

.svc-icon {
    width: 72px;
    height: 72px;
    margin-inline: auto;
    margin-block-end: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--accent);
}

.svc-icon img {
    width: 56px;
    height: 56px
}

.service-card .h4 {
    margin-block-end: 10px
}

.service-card p {
    font-size: 1.5rem;
    color: var(--txt-body)
}

/* ── PROJECTS ── */
.project {
    background: var(--bg-alt);
    border-block: 1px solid var(--border)
}

.proj-header {
    margin-block-end: 44px
}

.proj-header-inner {
    display: flex;
    flex-direction: column;
    gap: 20px
}

.project .grid-list {
    gap: 24px
}

.project-card {
    --pad-c: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: var(--sh-sm);
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sh-lg);
    border-color: var(--accent-a25)
}

.card-content {
    padding: var(--pad-c)
}

.card-tag {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-block-end: 8px
}

.card-title {
    margin-block: 8px 10px
}

.card-text {
    font-size: 1.5rem;
    color: var(--txt-body);
    margin-block-end: 18px
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 1.45rem;
    transition: var(--t1);
}

.card-link ion-icon {
    transition: transform .2s ease
}

.card-link:hover ion-icon {
    transform: translateX(5px)
}

.card-banner {
    overflow: hidden;
    aspect-ratio: 16/9
}

.card-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s var(--ease)
}

.project-card:hover .card-banner img {
    transform: scale(1.04)
}

/* ── CONTACT ── */
.contact {
    background: var(--bg);
    padding-block-end: 7rem;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r12);
    padding: 36px 28px;
    display: grid;
    gap: 40px;
    box-shadow: var(--sh-md);
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-a10);
    border: 1px solid var(--accent-a25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--accent);
    margin-block-end: 16px;
}

.contact .section-title {
    margin-block: 8px 12px
}

/* Form */
.form-row {
    display: grid;
    gap: 16px;
    margin-block-end: 16px
}

.form-group {
    position: relative
}

.input {
    background: var(--surface);
    color: var(--txt);
    font-size: 1.5rem;
    padding: 14px 16px;
    border-radius: var(--r8);
    width: 100%;
    border: 1.5px solid var(--border);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-a10)
}

.input.err {
    border-color: #e05a5a;
    box-shadow: 0 0 0 3px rgba(224, 90, 90, .10)
}

.input::placeholder {
    color: var(--txt-muted)
}

textarea.input {
    min-height: 130px;
    resize: vertical
}

.err-msg {
    font-size: 1.15rem;
    color: #e05a5a;
    margin-block-start: 4px;
    display: none
}

.err-msg.show {
    display: block
}

.form-success {
    display: none;
    text-align: center;
    padding: 36px 24px;
    border-radius: var(--r12);
    background: var(--accent-a10);
    border: 1px solid var(--accent-a25);
}

.form-success.show {
    display: block
}

.form-success ion-icon {
    font-size: 3.4rem;
    color: var(--accent);
    margin-block-end: 12px
}

.form-success p {
    font-size: 1.6rem;
    color: var(--txt)
}

/* ── FOOTER ── */
.footer {
    padding-block: 36px;
    background: var(--bg-alt);
    border-top: 1px solid var(--border)
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center
}

.footer p {
    font-size: 1.35rem;
    color: var(--txt-muted)
}

/* ── RESPONSIVE ── */
@media(min-width:560px) {
    .container {
        max-width: 540px
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr)
    }
}

@media(min-width:768px) {
    .container {
        max-width: 720px
    }

    .form-row {
        grid-template-columns: 1fr 1fr
    }

    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left
    }

    .proj-header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end
    }
}

@media(min-width:900px) {
    .container {
        max-width: 880px
    }

    :root {
        --pad: 110px
    }

    /* Hero side by side */
    .hero .container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 60px
    }

    .hero-img-wrap {
        width: 400px;
        max-width: none;
        flex-shrink: 0
    }

    .hero-content {
        text-align: left;
        max-width: none;
        flex: 1
    }

    .typed-line {
        justify-content: flex-start
    }

    .btn-wrap {
        justify-content: flex-start
    }

    /* About side by side */
    .about-wrap {
        grid-template-columns: 1fr 1fr;
        align-items: center
    }

    .about .grid-list {
        grid-template-columns: repeat(4, 1fr)
    }

    /* Contact side by side */
    .contact-card {
        grid-template-columns: 1fr 1fr;
        align-items: start;
        padding: 56px
    }
}

@media(min-width:1100px) {
    .container {
        max-width: 1060px
    }

    /* Projects 2-col */
    .project .grid-list {
        grid-template-columns: 1fr 1fr
    }
}

@media(min-width:1280px) {
    .container {
        max-width: 1200px
    }
}

/* Reduced motion */
@media(prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important
    }
}