:root {
    --bg: #f6f1e8;
    --bg-deep: #1e2a39;
    --surface: rgba(255, 250, 243, 0.8);
    --surface-strong: #fffaf2;
    --surface-dark: #203046;
    --line: rgba(30, 42, 57, 0.12);
    --text: #1d2430;
    --muted: #5f6d7c;
    --brand: #ca6c2c;
    --brand-soft: #e89d5b;
    --accent: #2f7c6e;
    --accent-soft: #dcefe7;
    --ok: #1f8f5f;
    --warn: #9a6a00;
    --shadow: 0 22px 50px rgba(29, 36, 48, 0.12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(232, 157, 91, 0.28), transparent 24%),
        radial-gradient(circle at 90% 10%, rgba(47, 124, 110, 0.18), transparent 22%),
        linear-gradient(180deg, #fbf6ef 0%, #f2ebe1 44%, #e7e2d7 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(30, 42, 57, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 42, 57, 0.06) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.38), transparent 82%);
}

a {
    color: inherit;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 20px 6vw;
    background: rgba(250, 244, 235, 0.78);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(30, 42, 57, 0.08);
}

.brand {
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.03em;
    color: var(--bg-deep);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.96rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--brand);
}

main {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding-bottom: 80px;
}

.hero,
.content-section {
    scroll-margin-top: 100px;
}

.hero {
    min-height: calc(100vh - 84px);
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 46px;
    align-items: center;
    padding: 70px 0 56px;
}

.eyebrow {
    display: inline-flex;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(47, 124, 110, 0.18);
    background: rgba(255, 255, 255, 0.52);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1,
.section-tag,
.detail-hero h1 {
    font-family: "Playfair Display", serif;
}

.hero h1 {
    margin: 18px 0 14px;
    font-size: clamp(3.7rem, 8vw, 6.5rem);
    line-height: 0.95;
    color: var(--bg-deep);
}

.hero-line {
    max-width: 680px;
    font-size: clamp(1.24rem, 2.2vw, 1.72rem);
    line-height: 1.55;
    color: #273447;
}

.hero-text,
.panel p,
.project-card p,
.timeline-card p,
.resume-panel p,
.section-subtitle,
.detail-section p,
.detail-overview li,
.detail-grid li {
    font-size: 0.98rem;
    line-height: 1.8;
    color: var(--muted);
}

.hero-text {
    max-width: 610px;
    margin-top: 16px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 28px 0 30px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 800;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
    cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-2px);
}

.btn-primary {
    color: #fffaf2;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-soft) 100%);
    box-shadow: 0 14px 32px rgba(202, 108, 44, 0.22);
}

.btn-secondary {
    color: var(--bg-deep);
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(30, 42, 57, 0.12);
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.7s ease,
        transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-highlights,
.card-grid,
.about-grid,
.contact-grid,
.detail-grid,
.detail-metrics {
    display: grid;
    gap: 18px;
}

.hero-highlights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card,
.panel,
.project-card,
.timeline-card,
.detail-card,
.detail-sidebar {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(30, 42, 57, 0.08);
    background: rgba(255, 250, 243, 0.74);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.stat-card,
.panel,
.project-card,
.timeline-card,
.detail-card,
.detail-sidebar,
.detail-section,
.detail-hero-main {
    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease,
        border-color 0.28s ease,
        background 0.28s ease;
}

.stat-card::before,
.panel::before,
.project-card::before,
.timeline-card::before,
.detail-card::before,
.detail-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.6), transparent 55%);
}

.stat-label,
.card-kicker,
.timeline-year,
.detail-label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-card strong,
.panel h3,
.project-card h3,
.timeline-card h3,
.detail-card h3,
.detail-sidebar h3 {
    display: block;
    margin-top: 12px;
    font-size: 1.18rem;
    color: var(--bg-deep);
}

.stat-card:hover,
.panel:hover,
.project-card:hover,
.timeline-card:hover,
.detail-card:hover,
.detail-sidebar:hover,
.detail-section:hover {
    transform: translateY(-8px);
    box-shadow: 0 28px 55px rgba(29, 36, 48, 0.16);
    border-color: rgba(47, 124, 110, 0.2);
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.blob-shell {
    width: min(430px, 100%);
    aspect-ratio: 1 / 1.08;
    padding: 16px;
    border-radius: 57% 43% 48% 52% / 41% 55% 45% 59%;
    background: linear-gradient(135deg, rgba(232, 157, 91, 0.92), rgba(47, 124, 110, 0.84));
    box-shadow: 0 30px 70px rgba(30, 42, 57, 0.22);
    animation: morph 10s ease-in-out infinite;
}

.profile-photo,
.photo-fallback {
    width: 100%;
    height: 100%;
    border-radius: 58% 42% 46% 54% / 50% 44% 56% 50%;
    background: linear-gradient(160deg, #d79b67, #254259);
}

.profile-photo {
    display: block;
    object-fit: cover;
}

.photo-fallback {
    display: none;
    place-items: center;
    text-align: center;
    color: #fffaf2;
    padding: 30px;
}

.photo-fallback span {
    display: block;
    font-family: "Playfair Display", serif;
    font-size: 1.7rem;
}

.photo-fallback small {
    margin-top: 8px;
    font-size: 0.94rem;
}

.content-section {
    padding: 54px 0;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 26px;
}

.section-tag {
    font-size: clamp(2.55rem, 5vw, 4rem);
    line-height: 1;
    color: var(--bg-deep);
}

.section-subtitle {
    max-width: 620px;
    margin-top: 10px;
    font-size: 0.95rem;
}

.about-grid,
.card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skills-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-grid {
    align-items: stretch;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 290px;
}

.project-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.project-status::before,
.detail-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12);
}

.status-live {
    color: var(--ok);
    background: rgba(31, 143, 95, 0.1);
}

.status-build {
    color: var(--warn);
    background: rgba(154, 106, 0, 0.12);
}

.project-meta,
.detail-tags,
.detail-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-meta span,
.detail-tags span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(47, 124, 110, 0.1);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
}

.project-links a,
.detail-links a,
.back-link {
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--brand);
}

.project-links a:hover,
.detail-links a:hover,
.back-link:hover {
    color: var(--accent);
}

.more-projects {
    margin-top: 24px;
}

.more-projects summary {
    width: fit-content;
    list-style: none;
}

.more-projects summary::-webkit-details-marker {
    display: none;
}

.more-project-grid {
    margin-top: 20px;
}

.timeline {
    display: grid;
    gap: 18px;
}

.resume-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

code {
    padding: 2px 6px;
    border-radius: 8px;
    font-family: Consolas, monospace;
    background: rgba(30, 42, 57, 0.08);
}

.project-detail-page {
    background:
        radial-gradient(circle at top right, rgba(232, 157, 91, 0.22), transparent 20%),
        radial-gradient(circle at left center, rgba(47, 124, 110, 0.14), transparent 24%),
        linear-gradient(180deg, #fbf7ef 0%, #f1eadf 100%);
}

.detail-shell {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 48px 0 80px;
}

.detail-hero {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 24px;
    align-items: stretch;
}

.detail-hero-main,
.detail-sidebar {
    min-height: 100%;
}

.detail-hero-main {
    padding: 34px;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(255, 250, 243, 0.96), rgba(247, 235, 220, 0.9));
    border: 1px solid rgba(30, 42, 57, 0.08);
    box-shadow: var(--shadow);
}

.back-link {
    display: inline-flex;
    margin-bottom: 20px;
}

.detail-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.detail-hero h1 {
    margin-top: 18px;
    font-size: clamp(2.9rem, 5vw, 4.7rem);
    line-height: 0.98;
    color: var(--bg-deep);
}

.detail-summary {
    margin-top: 14px;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2d3948;
}

.detail-links {
    margin-top: 22px;
}

.detail-links a {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(30, 42, 57, 0.08);
}

.detail-sidebar {
    display: grid;
    gap: 18px;
    align-content: start;
}

.detail-sidebar ul,
.detail-overview ul,
.detail-grid ul {
    margin-top: 12px;
    padding-left: 18px;
}

.detail-content {
    display: grid;
    gap: 20px;
    margin-top: 22px;
}

.detail-section {
    padding: 26px;
    border-radius: 28px;
    background: rgba(255, 250, 243, 0.78);
    border: 1px solid rgba(30, 42, 57, 0.08);
    box-shadow: var(--shadow);
}

.detail-section h2 {
    font-size: 1.5rem;
    color: var(--bg-deep);
}

.detail-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 16px;
}

.metric {
    padding: 18px;
    border-radius: 22px;
    background: rgba(47, 124, 110, 0.08);
}

.metric strong {
    display: block;
    font-size: 1.3rem;
    color: var(--bg-deep);
}

.metric span {
    display: block;
    margin-top: 6px;
    font-size: 0.86rem;
    color: var(--muted);
}

.detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

@keyframes morph {
    0%,
    100% {
        border-radius: 57% 43% 48% 52% / 41% 55% 45% 59%;
    }
    50% {
        border-radius: 42% 58% 58% 42% / 56% 43% 57% 44%;
    }
}

@media (max-width: 980px) {
    .hero,
    .detail-hero,
    .about-grid,
    .card-grid,
    .detail-grid,
    .detail-metrics {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-visual {
        order: -1;
    }

    .hero-highlights {
        grid-template-columns: 1fr;
    }

    .resume-panel {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .navbar {
        padding: 18px 20px;
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        justify-content: flex-start;
        gap: 12px 16px;
    }

    .hero-actions,
    .project-links,
    .project-meta,
    .detail-links,
    .detail-tags {
        gap: 10px;
    }

    main,
    .detail-shell {
        width: min(100% - 28px, 1180px);
    }

    .hero {
        min-height: auto;
        gap: 30px;
        padding-top: 42px;
    }

    .hero h1 {
        font-size: clamp(3rem, 16vw, 4.8rem);
    }

    .section-tag {
        font-size: clamp(2.2rem, 12vw, 3.2rem);
    }

    .skills-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .blob-shell {
        width: min(320px, 100%);
    }

    .stat-card,
    .panel,
    .project-card,
    .timeline-card,
    .detail-card,
    .detail-sidebar,
    .detail-section,
    .detail-hero-main {
        padding: 20px;
        border-radius: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal,
    .reveal.is-visible,
    .btn,
    .stat-card,
    .panel,
    .project-card,
    .timeline-card,
    .detail-card,
    .detail-sidebar,
    .detail-section,
    .detail-hero-main,
    .blob-shell {
        transition: none;
        animation: none;
        transform: none;
        opacity: 1;
    }
}
