:root {
    --bg: #f8f6f2;
    --surface: #ffffff;
    --surface-soft: #f4efe8;
    --text: #2f2a25;
    --muted: #6f655b;
    --accent: #b66e53;
    --accent-soft: #d9b5a7;
    --border: #e7dfd4;
    --shadow: 0 10px 28px rgba(31, 24, 18, 0.08);
    --navbar-bg: rgba(248, 246, 242, 0.88);
    --petal-a: rgba(236, 172, 191, 0.58);
    --petal-b: rgba(252, 229, 236, 0.88);
    --petal-shadow: rgba(164, 110, 126, 0.2);
}

body.dark {
    --bg: #1f1d1a;
    --surface: #282521;
    --surface-soft: #322e29;
    --text: #f2ede7;
    --muted: #c3b7aa;
    --accent: #d79b83;
    --accent-soft: #8b6355;
    --border: #3a352f;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    --navbar-bg: rgba(31, 29, 26, 0.9);
    --petal-a: rgba(208, 145, 166, 0.42);
    --petal-b: rgba(233, 196, 209, 0.68);
    --petal-shadow: rgba(0, 0, 0, 0.24);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.65;
    color: var(--text);
    background: radial-gradient(circle at 10% 10%, rgba(214, 182, 165, 0.2), transparent 35%),
        radial-gradient(circle at 90% 20%, rgba(217, 181, 167, 0.2), transparent 30%),
        var(--bg);
    transition: background-color 0.25s ease, color 0.25s ease;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(circle at 12% 16%, rgba(239, 192, 208, 0.18), transparent 35%),
        radial-gradient(circle at 82% 12%, rgba(245, 224, 233, 0.14), transparent 30%),
        radial-gradient(circle at 60% 86%, rgba(231, 193, 203, 0.12), transparent 34%);
}

.sakura-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

.sakura-petal {
    position: absolute;
    top: -12%;
    left: var(--x, 50%);
    width: var(--size, 14px);
    height: calc(var(--size, 14px) * 0.78);
    border-radius: 85% 15% 70% 30% / 70% 35% 65% 30%;
    background: linear-gradient(145deg, var(--petal-b), var(--petal-a));
    box-shadow: 0 2px 5px var(--petal-shadow);
    opacity: 0;
    transform: translate3d(0, -8vh, 0) rotate(0deg);
    animation: sakura-fall var(--duration, 14s) linear var(--delay, 0s) infinite;
}

.sakura-petal::after {
    content: '';
    position: absolute;
    left: 28%;
    top: 16%;
    width: 34%;
    height: 32%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    filter: blur(0.4px);
}

@keyframes sakura-fall {
    0% {
        opacity: 0;
        transform: translate3d(0, -8vh, 0) rotate(0deg);
    }

    12% {
        opacity: 0.82;
    }

    55% {
        transform: translate3d(calc(var(--drift, 22px) * -0.45), 56vh, 0) rotate(180deg);
    }

    100% {
        opacity: 0;
        transform: translate3d(var(--drift, 22px), 112vh, 0) rotate(350deg);
    }
}

.container,
.nav-container,
.hero-container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.navbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    padding: 0.9rem 0;
    background: var(--navbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.navbar.scrolled {
    border-color: var(--border);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent-soft) 30%, transparent);
}

.theme-btn {
    min-width: 4.2rem;
    height: 2.25rem;
    padding: 0 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-btn:hover {
    transform: translateY(-1px);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.bar {
    width: 22px;
    height: 2px;
    background: var(--text);
}

.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 7rem 0 4rem;
}

.hero-container {
    text-align: center;
}

.hero-title {
    font-size: clamp(1.9rem, 4.4vw, 3.25rem);
    margin-bottom: 0.9rem;
}

.pink-accent {
    color: var(--accent);
    font-family: 'Dancing Script', cursive;
    font-size: 1.12em;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hero-subtitle {
    color: var(--muted);
    max-width: 680px;
    margin: 0 auto 1.8rem;
    font-size: 1.05rem;
}

.hero-subtitle p {
    margin-top: 0.35rem;
}

.hero-intro {
    display: block;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.68rem 1.25rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

.btn-secondary {
    color: var(--text);
    background: transparent;
}

.btn:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.btn-primary:hover,
.btn-resume:hover {
    background: color-mix(in srgb, var(--accent) 86%, black);
    color: #fff;
}

section {
    padding: 4.25rem 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    margin-bottom: 2.25rem;
    color: var(--text);
}

.about,
.technologies,
.education,
.projects,
.contact {
    background: transparent;
}

.about-content {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: center;
}

.about-text p {
    color: var(--muted);
    margin-bottom: 1rem;
}

.about-text p:first-child {
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text);
}

.about-image {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 290px;
}

.about-image::before {
    content: '';
    position: absolute;
    width: min(320px, 95%);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent-soft) 42%, transparent), transparent 72%);
    filter: blur(12px);
    opacity: 0.55;
    pointer-events: none;
}

.about-photo {
    width: min(360px, 95%);
    max-height: 430px;
    height: auto;
    object-fit: contain;
    border: 0;
    border-radius: 18px;
    box-shadow: none;
    position: relative;
    z-index: 1;
    opacity: 0.96;
    filter: saturate(0.95) contrast(1.04);
}

body.dark .about-photo {
    opacity: 0.9;
    filter: saturate(0.9) brightness(0.95) contrast(1.06);
}

.about-photo[src=""] {
    display: none;
}

.about-photo:not([src=""]) + .image-placeholder {
    display: none;
}

.image-placeholder {
    width: fit-content;
    margin: 0 auto;
    border-radius: 999px;
    border: 1px dashed var(--accent-soft);
    background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.95rem;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.skills-grid,
.projects-grid,
.education-grid {
    display: grid;
    gap: 1rem;
}

.skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.skills-grid .skill-category {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.skill-category,
.project-card,
.education-card,
.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.skill-category,
.project-info,
.education-card {
    padding: 1.25rem;
}

.skill-category h4 {
    color: var(--accent);
    margin-bottom: 0.55rem;
}

/* Certifications */
.cert-list {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.25rem 0;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.cert-item {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.45rem;
    padding: 0.2rem 0.25rem;
    /* flexible items: grow when space available, shrink when needed */
    flex: 1 1 220px;
    min-width: 160px;
}

.cert-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    min-width: 0;
}

.cert-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.cert-icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.cert-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    /* allow full multi-line names */
    white-space: normal;
    overflow: visible;
}

.cert-issuer {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.2;
}

.cert-link {
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    margin-top: 4px;
}

.cert-link svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 1100px) {
    .cert-item { flex: 1 1 200px; }
}

@media (max-width: 680px) {
    .cert-item { flex: 1 1 140px; }
}

@media (max-width: 1000px) {
    .cert-list { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
    .cert-list { grid-template-columns: repeat(1, 1fr); }
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
}

.projects-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
}

.project-card {
    width: min(760px, 100%);
}

.project-card:nth-child(odd) {
    justify-self: start;
}

.project-card:nth-child(even) {
    justify-self: end;
}

.project-image {
    display: none;
}

.project-info h3 {
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--muted);
    margin-bottom: 0.8rem;
}

.project-links {
    display: flex;
    gap: 0.8rem;
}

.project-link {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.project-link svg {
    width: 16px;
    height: 16px;
}

.project-link:hover {
    transform: translateY(-1px);
    opacity: 0.85;
}

.education-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

.education-card h4 {
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.education-card p {
    color: var(--muted);
}

.contact-subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 1.2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.contact-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.contact-icon,
.social-btn {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.contact-icon:hover,
.social-btn:hover {
    opacity: 0.75;
}

.contact-icon svg,
.social-btn svg {
    width: 22px;
    height: 22px;
}

.contact-form {
    max-width: 620px;
    margin: 0 auto;
    padding: 1rem;
}

.form-group {
    margin-bottom: 0.8rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    color: var(--text);
    background: var(--surface);
    font: inherit;
    transition: border-color 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--muted);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.footer {
    text-align: center;
    padding: 1.5rem 0 2rem;
    color: var(--muted);
}

.social-sidebar {
    position: fixed;
    left: 18px;
    top: 70%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

/* Minimal motion: only a soft entrance and color transitions */
@media (prefers-reduced-motion: no-preference) {
    .hero-container,
    .about-content,
    .skills-grid,
    .projects-grid,
    .education-grid,
    .contact-form {
        animation: riseIn 0.45s ease both;
    }

    @keyframes riseIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .sakura-layer {
        display: none;
    }
}

@media (max-width: 860px) {
    .nav-menu {
        position: fixed;
        top: 58px;
        left: -100%;
        width: 100%;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        padding: 1rem 0;
        flex-direction: column;
        transition: left 0.25s ease;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .social-sidebar {
        display: none;
    }
}

@media (max-width: 540px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    section {
        padding: 3.5rem 0;
    }
}
