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

:root {
    --red: #da2628;
    --red-dim: #a81d1f;
    --dark: #0f0f13;
    --dark2: #17171d;
    --dark3: #1e1e26;
    --border: rgba(255, 255, 255, 0.07);
    --muted: #888899;
    --light: #e8e8f0;
    --white: #ffffff;
    --serif: "DM Serif Display", Georgia, serif;
    --sans: "DM Sans", system-ui, sans-serif;
}

body.light {
    --dark: #f0ede8;
    --dark2: #e6e2db;
    --dark3: #dad6ce;
    --border: rgba(0, 0, 0, 0.1);
    --muted: #5e5a52;
    --light: #2a2520;
    --white: #1a1612;
}

body.light::before {
    opacity: 0.15;
}

body.light nav {
    background: rgba(240, 237, 232, 0.9);
}

body.light .nav-drawer {
    background: rgba(240, 237, 232, 0.98);
}

body.light #hero::after {
    background: radial-gradient(circle,
            rgba(218, 38, 40, 0.07) 0%,
            transparent 70%);
}

body.light .hero-img-frame::before {
    background: linear-gradient(135deg, var(--red), transparent 60%);
}

body.light .stat-box,
body.light .skill-card,
body.light .proj-card {
    background: var(--dark3);
}

body.light .exp-role {
    color: var(--white);
}

body.light .exp-company {
    color: var(--muted);
}

body.light .exp-body li {
    color: var(--light);
}

body.light footer {
    background: var(--dark2);
}

/* ── THEME TOGGLE ── */

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    color: var(--muted);
    transition:
        color 0.2s,
        border-color 0.2s;
    flex-shrink: 0;
    margin-left: 16px;
}

.theme-toggle:hover {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.2);
}

body.light .theme-toggle:hover {
    border-color: rgba(0, 0, 0, 0.2);
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

body.light .theme-toggle .icon-sun {
    display: block;
}

body.light .theme-toggle .icon-moon {
    display: none;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--dark);
    color: var(--light);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.65;
    overflow-x: hidden;
}

:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 4px;
}

/* ── NOISE OVERLAY ── */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.6;
}

/* ── NAV ── */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 48px;
    background: rgba(15, 15, 19, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-family: var(--serif);
    font-size: 1.1rem;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.nav-logo span {
    color: var(--red);
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
    align-items: center;
    margin-left: auto;
}

.nav-hamburger {
    margin-left: 8px;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--white);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--white);
}

.nav-links a.active {
    color: var(--red);
}

.nav-shopee {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: none;
    color: #fff !important;
    background: linear-gradient(135deg, #ee4d2d, #c73a1e);
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1;
}

.nav-shopee svg {
    flex-shrink: 0;
}

.nav-shopee:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff !important;
}

/* ── HERO ── */

#hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 140px 48px 100px;
    gap: 64px;
    position: relative;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

#hero::after {
    content: "";
    position: absolute;
    top: -200px;
    right: -200px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle,
            rgba(218, 38, 40, 0.12) 0%,
            transparent 70%);
    pointer-events: none;
}

.hero-text {
    z-index: 1;
}

.hero-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red);
    border: 1px solid rgba(218, 38, 40, 0.3);
    padding: 5px 14px;
    border-radius: 2px;
    margin-bottom: 24px;
    animation: fadeUp 0.6s ease both;
}

h1 {
    font-family: var(--serif);
    font-size: clamp(2.8rem, 5vw, 4.2rem);
    line-height: 1.08;
    color: var(--white);
    letter-spacing: -0.02em;
    animation: fadeUp 0.6s 0.1s ease both;
}

h1 em {
    font-style: italic;
    color: var(--red);
}

.hero-sub {
    margin-top: 24px;
    color: var(--muted);
    font-size: 1rem;
    max-width: 480px;
    line-height: 1.7;
    font-weight: 300;
    animation: fadeUp 0.6s 0.2s ease both;
}

.hero-cta {
    display: flex;
    gap: 14px;
    margin-top: 40px;
    flex-wrap: wrap;
    animation: fadeUp 0.6s 0.3s ease both;
}

.btn {
    padding: 13px 28px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--red-dim);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--light);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.hero-img-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeUp 0.8s 0.1s ease both;
    padding: 0 20px 20px 0;
}

.hero-img-frame {
    position: relative;
    width: 340px;
    height: 420px;
    max-width: 100%;
}

.hero-img-frame::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--red), transparent 60%);
    border-radius: 6px;
    z-index: 0;
}

.hero-img-frame::after {
    content: "";
    position: absolute;
    bottom: -16px;
    right: -16px;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(218, 38, 40, 0.25);
    border-radius: 6px;
    z-index: 0;
}

.hero-img-frame img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 5px;
    filter: grayscale(15%);
}

.hero-badge {
    position: absolute;
    bottom: -8px;
    left: -24px;
    background: var(--dark3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px 16px;
    font-size: 0.78rem;
    color: var(--muted);
    z-index: 2;
    white-space: nowrap;
}

.hero-badge strong {
    color: var(--white);
    display: block;
    font-size: 1rem;
}

/* ── SECTIONS ── */

section {
    padding: 96px 48px;
}

.section-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--serif);
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    line-height: 1.1;
    color: var(--white);
    margin-bottom: 48px;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 0 48px;
}

/* ── ABOUT ── */

#about {
    background: var(--dark2);
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 64px;
    align-items: start;
}

.about-text p {
    color: var(--muted);
    margin-bottom: 16px;
    font-weight: 300;
    line-height: 1.75;
}

.about-text p strong {
    color: var(--light);
    font-weight: 500;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-box {
    background: var(--dark3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
    transition: border-color 0.2s;
}

.stat-box:hover {
    border-color: rgba(218, 38, 40, 0.3);
}

.stat-num {
    font-family: var(--serif);
    font-size: 2.2rem;
    color: var(--red);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 6px;
}

/* ── SKILLS ── */

#skills {
    background: var(--dark);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.skill-card {
    background: var(--dark2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px;
    transition: all 0.2s;
}

.skill-card:hover {
    border-color: rgba(218, 38, 40, 0.3);
    transform: translateY(-3px);
}

.skill-cat {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 12px;
}

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

.tag {
    font-size: 0.78rem;
    padding: 4px 10px;
    background: var(--dark3);
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--muted);
}

/* ── EXPERIENCE ── */

#experience {
    background: var(--dark2);
}

.exp-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.exp-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 32px;
    padding: 36px 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.exp-item>div:last-child {
    padding-left: 8px;
}

.exp-item:last-child {
    border-bottom: none;
}

.exp-meta {
    padding-top: 4px;
}

.exp-period {
    font-size: 0.78rem;
    color: var(--red);
    font-weight: 500;
    margin-bottom: 6px;
}

.exp-company {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

.exp-role {
    font-family: var(--serif);
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: 12px;
    padding-left: 2px;
}

.exp-body {
    color: var(--muted);
    font-weight: 300;
    line-height: 1.75;
    padding-left: 2px;
}

.exp-body ul {
    list-style: none;
    padding-left: 4px;
}

.exp-body li {
    padding: 3px 0 3px 16px;
    position: relative;
    font-size: 0.9rem;
}

.exp-body li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--red);
    font-size: 0.8rem;
}

/* ── PROJECTS ── */

#projects {
    background: var(--dark);
}

.proj-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.proj-card {
    background: var(--dark2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.proj-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--red);
    transition: height 0.3s;
}

.proj-card:hover {
    border-color: rgba(218, 38, 40, 0.25);
    transform: translateY(-4px);
}

.proj-card:hover::before {
    height: 100%;
}

.proj-name {
    font-family: var(--serif);
    font-size: 1.15rem;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.proj-link {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    opacity: 0.6;
    transition:
        opacity 0.2s,
        color 0.2s;
    flex-shrink: 0;
    margin-left: auto;
}

.proj-link:hover {
    opacity: 1;
    color: var(--white);
}

.proj-xeratic {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red);
    border: 1px solid rgba(218, 38, 40, 0.3);
    border-radius: 2px;
    padding: 2px 7px;
    font-family: var(--sans);
    margin-top: 8px;
    align-self: flex-start;
}

.proj-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.proj-tech span {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: rgba(218, 38, 40, 0.1);
    color: var(--red);
    border-radius: 2px;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.proj-desc {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.65;
    font-weight: 300;
}

/* Featured Project Style */
.proj-card.featured {
    border-color: rgba(218, 38, 40, 0.4);
    box-shadow: 0 4px 24px rgba(218, 38, 40, 0.12);
}

.proj-card.featured::before {
    height: 100%;
}

.proj-card.featured .proj-name::after {
    content: "FEATURED";
    font-size: 0.6rem;
    padding: 2px 6px;
    background: var(--red);
    color: #fff;
    border-radius: 2px;
    margin-left: 10px;
    vertical-align: middle;
    font-family: var(--sans);
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ── CONTACT ── */

#contact {
    background: var(--dark2);
}

.contact-inner {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.contact-inner .section-title {
    margin-bottom: 16px;
}

.contact-sub {
    color: var(--muted);
    font-weight: 300;
    margin-bottom: 40px;
    line-height: 1.7;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.contact-link:hover {
    color: var(--white);
    border-color: rgba(218, 38, 40, 0.4);
    background: rgba(218, 38, 40, 0.06);
}

/* ── ANIMATIONS ── */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

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

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

/* ── HAMBURGER & MOBILE MENU ── */

.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
    position: relative;
}

.nav-hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--light);
    border-radius: 2px;
    transition: all 0.25s ease;
    transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 19, 0.97);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    backdrop-filter: blur(16px);
}

.nav-drawer.open {
    display: flex;
}

.nav-drawer .drawer-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 20px 0;
    width: 240px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s;
    display: block;
}

.nav-drawer .drawer-link:first-child {
    border-top: 1px solid var(--border);
}

.nav-drawer .drawer-link:hover {
    color: var(--white);
}

.nav-drawer .drawer-shopee {
    margin-top: 28px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: none;
    color: #fff;
    background: linear-gradient(135deg, #ee4d2d, #c73a1e);
    border-radius: 3px;
    border: none;
    width: auto;
}

.nav-drawer .drawer-shopee:first-child {
    border-top: none;
}

.nav-drawer .drawer-shopee:hover {
    color: #fff;
    opacity: 0.88;
}

/* ======================================================
       BLOG PAGE
       ====================================================== */

/* ── HERO / PAGE HEADER ── */

.page-header {
    padding: 140px 48px 72px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.page-header::after {
    content: "";
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle,
            rgba(218, 38, 40, 0.1) 0%,
            transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.page-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red);
    border: 1px solid rgba(218, 38, 40, 0.3);
    padding: 5px 14px;
    border-radius: 2px;
    margin-bottom: 20px;
    animation: fadeUp 0.5s ease both;
}

.page-title {
    font-family: var(--serif);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    line-height: 1.08;
    color: var(--white);
    letter-spacing: -0.02em;
    animation: fadeUp 0.5s 0.1s ease both;
}

.page-title em {
    font-style: italic;
    color: var(--red);
}

.page-sub {
    margin-top: 18px;
    color: var(--muted);
    font-size: 1rem;
    max-width: 520px;
    line-height: 1.7;
    font-weight: 300;
    animation: fadeUp 0.5s 0.2s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

/* ── DIVIDER ── */

.divider {
    height: 1px;
    background: var(--border);
    margin: 0 48px;
}

/* ── BLOG SECTION ── */

#blog {
    padding: 64px 48px 96px;
}

.blog-inner {
    max-width: 1000px;
    margin: 0 auto;
}

/* ── FILTER BAR ── */

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-count {
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0.05em;
}

.filter-count strong {
    color: var(--light);
}

.search-wrap {
    position: relative;
}

.search-input {
    background: var(--dark2);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--light);
    font-family: var(--sans);
    font-size: 0.83rem;
    padding: 8px 14px 8px 36px;
    outline: none;
    width: 240px;
    transition: border-color 0.2s;
}

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

.search-input:focus {
    border-color: rgba(218, 38, 40, 0.4);
}

.search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

/* ── BLOG GRID ── */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ── BLOG CARD ── */

.blog-card {
    background: var(--dark2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition:
        border-color 0.2s,
        transform 0.2s;
    opacity: 0;
    transform: translateY(14px);
    animation: fadeUp 0.5s ease forwards;
}

.blog-card:hover {
    border-color: rgba(218, 38, 40, 0.35);
    transform: translateY(-3px);
}

.blog-card-num {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(218, 38, 40, 0.5);
}

.blog-card-title {
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--white);
    line-height: 1.35;
    flex: 1;
    transition: color 0.2s;
}

.blog-card:hover .blog-card-title {
    color: var(--red);
}

.blog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.blog-card-date {
    font-size: 0.76rem;
    color: var(--muted);
}

.blog-card-arrow {
    color: var(--muted);
    font-size: 0.8rem;
    transition:
        color 0.2s,
        transform 0.2s;
}

.blog-card:hover .blog-card-arrow {
    color: var(--red);
    transform: translate(2px, -2px);
}

/* stagger animation */
.blog-card:nth-child(1) {
    animation-delay: 0.05s;
}

.blog-card:nth-child(2) {
    animation-delay: 0.1s;
}

.blog-card:nth-child(3) {
    animation-delay: 0.15s;
}

.blog-card:nth-child(4) {
    animation-delay: 0.18s;
}

.blog-card:nth-child(5) {
    animation-delay: 0.21s;
}

.blog-card:nth-child(6) {
    animation-delay: 0.24s;
}

.blog-card:nth-child(n + 7) {
    animation-delay: 0.27s;
}

/* ── STATES ── */

.state-box {
    grid-column: 1 / -1;
    padding: 64px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.state-box .state-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

.state-box .spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 2px solid var(--border);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 14px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-box {
    grid-column: 1 / -1;
    background: var(--dark2);
    border: 1px solid rgba(218, 38, 40, 0.2);
    border-radius: 4px;
    padding: 32px;
    text-align: center;
}

.error-box p {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 8px;
}

.error-box strong {
    color: var(--light);
}

.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    padding: 9px 20px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--sans);
}

.retry-btn:hover {
    background: var(--red-dim);
}

/* no-results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ======================================================
       POST PAGE
       ====================================================== */

/* ── LAYOUT ── */

.page-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 120px 48px 96px;
}

/* ── BACK LINK ── */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
    margin-bottom: 40px;
    animation: fadeUp 0.4s ease both;
}

.back-link:hover {
    color: var(--white);
}

.back-link svg {
    transition: transform 0.2s;
}

.back-link:hover svg {
    transform: translateX(-3px);
}

/* ── POST HEADER ── */

.post-header {
    margin-bottom: 40px;
    animation: fadeUp 0.4s 0.05s ease both;
}

.post-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red);
    border: 1px solid rgba(218, 38, 40, 0.3);
    padding: 4px 12px;
    border-radius: 2px;
    margin-bottom: 18px;
}

.post-title {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 1.1;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.post-date {
    font-size: 0.78rem;
    color: var(--muted);
}

.post-author {
    font-size: 0.78rem;
    color: var(--muted);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.post-tag {
    font-size: 0.72rem;
    padding: 3px 9px;
    background: var(--dark3);
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--muted);
}

/* ── DIVIDER ── */

.post-divider {
    height: 1px;
    background: var(--border);
    margin: 36px 0;
    animation: fadeUp 0.4s 0.1s ease both;
}

/* ── PROSE BODY ── */

.prose-body {
    color: var(--light);
    font-size: 1rem;
    line-height: 1.85;
    font-weight: 300;
    animation: fadeUp 0.5s 0.15s ease both;
}

.prose-body p {
    margin-bottom: 1.4em;
}

.prose-body h1,
.prose-body h2,
.prose-body h3,
.prose-body h4 {
    font-family: var(--serif);
    color: var(--white);
    margin: 2em 0 0.6em;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.prose-body h1 {
    font-size: 1.9rem;
}

.prose-body h2 {
    font-size: 1.5rem;
}

.prose-body h3 {
    font-size: 1.2rem;
}

.prose-body h4 {
    font-size: 1rem;
    font-family: var(--sans);
    font-weight: 600;
}

.prose-body a {
    color: var(--red);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.15s;
}

.prose-body a:hover {
    opacity: 0.75;
}

.prose-body strong {
    color: var(--white);
    font-weight: 600;
}

.prose-body em {
    font-style: italic;
}

.prose-body ul,
.prose-body ol {
    padding-left: 1.4em;
    margin-bottom: 1.4em;
}

.prose-body li {
    margin-bottom: 0.4em;
}

.prose-body code {
    font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.85em;
    background: var(--dark3);
    color: #f0a;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border);
}

.prose-body pre {
    background: var(--dark2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px 24px;
    overflow-x: auto;
    margin-bottom: 1.6em;
    font-size: 0.85rem;
    line-height: 1.65;
}

.prose-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: #c9d1d9;
    font-size: inherit;
}

.prose-body blockquote {
    border-left: 3px solid var(--red);
    background: var(--dark2);
    margin: 1.6em 0;
    padding: 16px 20px;
    border-radius: 0 4px 4px 0;
    color: var(--muted);
    font-style: italic;
}

.prose-body blockquote p {
    margin: 0;
}

.prose-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2em 0;
}

.prose-body img {
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: block;
    margin: 1.6em auto;
}

.prose-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.6em;
    font-size: 0.9rem;
}

.prose-body th,
.prose-body td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.prose-body th {
    background: var(--dark2);
    color: var(--white);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── POST FOOTER ── */

.post-footer {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    animation: fadeUp 0.4s 0.2s ease both;
}

.post-footer-orig {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 3px;
    transition:
        border-color 0.2s,
        color 0.2s;
}

.post-footer-orig:hover {
    border-color: rgba(218, 38, 40, 0.35);
    color: var(--light);
}

/* ── STATES ── */

.state-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    gap: 16px;
    text-align: center;
    padding: 0 24px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 2px solid var(--border);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.state-wrap p {
    color: var(--muted);
    font-size: 0.9rem;
}

.state-wrap strong {
    color: var(--light);
    display: block;
    margin-bottom: 8px;
}

.error-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red);
    border: 1px solid rgba(218, 38, 40, 0.3);
    padding: 4px 12px;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 12px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 9px 20px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: var(--dark2);
    color: var(--light);
    border: 1px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s;
    font-family: var(--sans);
}

.back-btn:hover {
    border-color: rgba(218, 38, 40, 0.4);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}