:root {
    --bg-deep: #071224;
    --bg-mid: #0d1d38;
    --bg-soft: #142647;
    --glass: rgba(255, 255, 255, 0.08);
    --glass-strong: rgba(255, 255, 255, 0.14);
    --text: #f6fbfc;
    --muted: #b3c2c7;
    --accent: #d4af37;
    --accent-hover: #b89226;
    --link-navy: #ffffff;
    --link-navy-hover: #f3f5f9;
    --shadow: 0 16px 42px rgba(0, 0, 0, 0.36);
    --motion-fluid: cubic-bezier(0.22, 1, 0.36, 1);
    --tile-duration: 1300ms;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Montserrat", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 400;
    background:
        radial-gradient(900px 600px at 8% 8%, rgba(39, 83, 165, 0.34), transparent 60%),
        radial-gradient(900px 650px at 92% 12%, rgba(17, 45, 98, 0.4), transparent 65%),
        linear-gradient(145deg, var(--bg-deep) 0%, var(--bg-mid) 48%, var(--bg-soft) 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.container {
    width: min(960px, 92%);
    margin: 0 auto;
}

.site-header {
    border-bottom: 1px solid rgba(255, 173, 173, 0.34);
    background: linear-gradient(120deg, rgba(127, 21, 43, 0.62), rgba(79, 13, 28, 0.55));
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.brand,
.brand a {
    margin: 0;
    color: var(--accent);
    text-decoration: none;
    font-size: 1.2rem;
}

.brand a {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

nav a {
    margin-left: 1rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--accent);
    font-weight: 600;
    transition: all 0.2s ease;
}

nav a:hover {
    color: var(--accent);
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.14);
}

main {
    padding: 2rem 0 3rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.2rem;
    align-items: center;
}

.profile-photo-wrap {
    display: flex;
    justify-content: center;
}

.profile-photo {
    width: 100%;
    max-width: 320px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35), 0 0 26px rgba(111, 24, 42, 0.34);
    object-fit: cover;
}

.card {
    background: linear-gradient(152deg, rgba(127, 21, 43, 0.5), rgba(79, 13, 28, 0.38));
    border: 1px solid rgba(255, 173, 173, 0.3);
    border-radius: 14px;
    padding: 1.4rem;
    margin: 1rem 0;
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(20px) scale(0.975);
    filter: blur(3px);
    animation: tile-in var(--tile-duration) var(--motion-fluid) forwards;
    animation-delay: var(--tile-delay, 0ms);
}

.post-list {
    display: grid;
    gap: 1rem;
}

.project-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.mini-card {
    margin: 0;
    padding: 1rem;
    border-radius: 12px;
    background: linear-gradient(152deg, rgba(127, 21, 43, 0.5), rgba(79, 13, 28, 0.38));
    border: 1px solid rgba(255, 173, 173, 0.3);
    opacity: 0;
    transform: translateY(20px) scale(0.975);
    filter: blur(3px);
    animation: tile-in var(--tile-duration) var(--motion-fluid) forwards;
    animation-delay: var(--tile-delay, 0ms);
}

main > .card:nth-of-type(1) { --tile-delay: 260ms; }
main > .card:nth-of-type(2) { --tile-delay: 560ms; }
main > .card:nth-of-type(3) { --tile-delay: 860ms; }
main > .card:nth-of-type(4) { --tile-delay: 1160ms; }

.post-list .card:nth-child(1) { --tile-delay: 280ms; }
.post-list .card:nth-child(2) { --tile-delay: 600ms; }
.post-list .card:nth-child(3) { --tile-delay: 920ms; }
.post-list .card:nth-child(4) { --tile-delay: 1240ms; }
.post-list .card:nth-child(5) { --tile-delay: 1560ms; }
.post-list .card:nth-child(6) { --tile-delay: 1880ms; }

.project-list .mini-card:nth-child(1) { --tile-delay: 320ms; }
.project-list .mini-card:nth-child(2) { --tile-delay: 660ms; }
.project-list .mini-card:nth-child(3) { --tile-delay: 1000ms; }
.project-list .mini-card:nth-child(4) { --tile-delay: 1340ms; }
.project-list .mini-card:nth-child(5) { --tile-delay: 1680ms; }
.project-list .mini-card:nth-child(6) { --tile-delay: 2020ms; }

.subtle,
.date {
    color: var(--muted);
    font-weight: 500;
}

a {
    color: var(--link-navy);
}

a:hover {
    color: var(--link-navy-hover);
}

.home-page a {
    text-decoration: none;
}

.home-page .excerpt p {
    margin: 0;
}

.home-page .excerpt a {
    text-decoration: underline;
}

.card h2,
.card h3,
.mini-card h3 {
    color: var(--accent);
}

.home-page .hero-card {
    padding: 1.8rem;
}

.home-page .hero-card h2 {
    margin: 0 0 0.7rem;
    font-size: clamp(2rem, 4vw, 2.45rem);
    font-weight: 800;
    line-height: 1.1;
}

.home-page .hero-card p {
    font-size: 1.03rem;
}

.home-page .card > h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.4rem, 2.4vw, 1.65rem);
    font-weight: 700;
    line-height: 1.2;
}

.home-page .mini-card h3 {
    margin: 0 0 0.45rem;
    font-size: clamp(1.05rem, 1.5vw, 1.18rem);
    font-weight: 600;
    line-height: 1.3;
}

.home-page .mini-card p,
.home-page .mini-card .excerpt {
    font-size: 0.95rem;
}

.featured-projects .project-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(19, 32, 53, 0.34);
    backdrop-filter: blur(14px) saturate(122%);
    -webkit-backdrop-filter: blur(14px) saturate(122%);
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.featured-projects .project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(168deg, rgba(6, 14, 28, 0.22), rgba(6, 14, 28, 0.8) 68%),
        var(--project-bg, radial-gradient(circle at 20% 20%, rgba(95, 171, 255, 0.22), transparent 55%), radial-gradient(circle at 85% 75%, rgba(125, 158, 212, 0.18), transparent 45%));
    background-size: cover;
    background-position: 50% 50%;
    z-index: 0;
    transform: scale(1);
    filter: blur(0);
    transition: transform 0.35s ease, background-position 0.35s ease;
}

.featured-projects .project-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 38%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 0;
}

.featured-projects .project-card > * {
    position: relative;
    z-index: 1;
}

.featured-projects .project-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow:
        0 18px 30px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.featured-projects .project-card:hover::before {
    transform: scale(1.08);
    background-position: 54% 46%;
    filter: blur(2px);
}

.featured-projects .project-card h3,
.featured-projects .project-card p {
    margin-top: 0;
}

.project-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    margin-bottom: 0.6rem;
}

.project-head h3 {
    margin: 0;
}

.project-head h3 a {
    display: inline-block;
}

.featured-projects .project-card .subtle {
    color: #d8e4f2;
}

.project-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin: 0;
    padding: 0.3rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.featured-projects .project-card:hover .project-logo {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.12);
}

.project-cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    color: #f5f8ff;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.project-cta:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.36);
    color: #ffffff;
}

.featured-projects .project-card:hover .project-cta {
    transform: translateX(2px);
}

.project-selray {
    --project-bg: radial-gradient(circle at 12% 15%, rgba(90, 224, 255, 0.26), transparent 45%), radial-gradient(circle at 80% 80%, rgba(39, 101, 197, 0.22), transparent 42%);
}

.project-passinspector {
    --project-bg: radial-gradient(circle at 18% 12%, rgba(96, 183, 255, 0.24), transparent 46%), radial-gradient(circle at 84% 78%, rgba(65, 218, 173, 0.18), transparent 44%);
}

.project-badsuccessor {
    --project-bg: radial-gradient(circle at 12% 82%, rgba(255, 122, 122, 0.16), transparent 44%), radial-gradient(circle at 82% 12%, rgba(255, 203, 112, 0.16), transparent 42%);
}

.post-body pre {
    margin: 1rem 0;
    padding: 1rem 1.1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(3, 10, 22, 0.85);
    color: #eaf3ff;
    overflow-x: auto;
    line-height: 1.5;
}

.post-body code {
    font-family: "JetBrains Mono", "Fira Code", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.95rem;
}

.post-body :not(pre) > code {
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    background: rgba(3, 10, 22, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.post-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
    border-radius: 10px;
}

.hero-cta {
    margin-top: 0.85rem;
}

.liquid-glass-btn {
    --x: 50%;
    --y: 50%;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.74rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 234, 177, 0.65);
    background:
        radial-gradient(circle at var(--x) var(--y), rgba(255, 247, 214, 0.5), rgba(255, 247, 214, 0) 34%),
        linear-gradient(160deg, #f0ca62, #c99823 68%);
    color: #241703;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow:
        0 12px 26px rgba(111, 24, 42, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.42);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.liquid-glass-btn .linkedin-icon {
    width: 16px;
    height: 16px;
}

.liquid-glass-btn .glass-shine {
    position: absolute;
    inset: -140% 30% auto -50%;
    height: 240%;
    transform: rotate(18deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.45s ease, opacity 0.35s ease;
}

.liquid-glass-btn:hover {
    transform: translateY(-2px);
    filter: saturate(112%);
    box-shadow:
        0 16px 30px rgba(111, 24, 42, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.liquid-glass-btn:hover .glass-shine {
    opacity: 1;
    transform: translateX(86%) rotate(18deg);
}

.liquid-glass-btn:focus-visible {
    outline: 2px solid rgba(255, 234, 177, 0.95);
    outline-offset: 2px;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0.72rem 1.2rem;
    border-radius: 999px;
    color: #241703;
    border: 1px solid rgba(255, 234, 177, 0.65);
    background: var(--accent);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow:
        0 10px 26px rgba(111, 24, 42, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.button-link:hover {
    background: var(--accent-hover);
    box-shadow:
        0 14px 30px rgba(111, 24, 42, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.button-link:focus-visible {
    outline: 2px solid rgba(255, 234, 177, 0.8);
    outline-offset: 2px;
}

@keyframes tile-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.975);
        filter: blur(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .card,
    .mini-card {
        opacity: 1;
        transform: none;
        filter: none;
        animation: none;
    }
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .project-list {
        grid-template-columns: 1fr;
    }

    .home-page .hero-card {
        padding: 1.35rem;
    }

    .featured-projects .project-card {
        min-height: 215px;
    }

    .project-head {
        align-items: flex-start;
    }
}
