/* ==========================================================================
   AI Engineer Portfolio — Design System
   Color: Zinc scale + Orange accent (#ff6b2b)
   Fonts: Inter (body), JetBrains Mono (code)
   Inspired by: Linear, Resend, Framer, Vercel, Polar
   ========================================================================== */

/* --- TOKENS ----------------------------------------------------------- */
:root {
    /* Backgrounds */
    --bg-primary: #09090b;
    --bg-secondary: #111113;
    --bg-tertiary: #18181b;
    --bg-card: #09090b;
    --bg-card-hover: #0f0f11;

    /* Borders */
    --border: #23232a;
    --border-hover: #3f3f46;

    /* Text */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;

    /* Accent */
    --accent: #ff6b2b;
    --accent-hover: #ff8347;
    --accent-subtle: rgba(255, 107, 43, 0.10);
    --accent-glow: rgba(255, 107, 43, 0.15);
    --accent-border: rgba(255, 107, 43, 0.25);

    /* Surfaces */
    --nav-bg: rgba(9, 9, 11, 0.72);
    --overlay: rgba(0, 0, 0, 0.6);

    /* Layout */
    --container: 1140px;
    --nav-h: 64px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Grid (hero background) */
    --grid-color: rgba(255, 255, 255, 0.035);
    --glow-opacity: 0.14;
}

[data-theme="light"] {
    --bg-primary: #fafafa;
    --bg-secondary: #f4f4f5;
    --bg-tertiary: #e4e4e7;
    --bg-card: #fafafa;
    --bg-card-hover: #f4f4f5;

    --border: #e4e4e7;
    --border-hover: #d4d4d8;

    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-tertiary: #71717a;

    --accent: #ea580c;
    --accent-hover: #c2410c;
    --accent-subtle: rgba(234, 88, 12, 0.07);
    --accent-glow: rgba(234, 88, 12, 0.10);
    --accent-border: rgba(234, 88, 12, 0.20);

    --nav-bg: rgba(250, 250, 250, 0.78);
    --overlay: rgba(255, 255, 255, 0.6);

    --grid-color: rgba(0, 0, 0, 0.04);
    --glow-opacity: 0.08;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

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

img {
    max-width: 100%;
    display: block;
}

ul,
ol {
    list-style: none;
}

button {
    font: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

/* --- TYPOGRAPHY -------------------------------------------------------- */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, #ff8347 0%, #ff6b2b 50%, #ea580c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .gradient-text {
    background: linear-gradient(135deg, #f97316, #ea580c, #c2410c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- LAYOUT ------------------------------------------------------------ */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 6rem 0;
    position: relative;
}

.section__header {
    margin-bottom: 3.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
}

.section__label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-subtle);
    padding: 0.3em 0.9em;
    border-radius: 999px;
    width: fit-content;
}

.section__title {
    width: 100%;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-top: 0.5rem;
}

.section__link {
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    transition: color 0.25s;
}

.section__link:hover {
    color: var(--accent);
}

/* --- NAVIGATION -------------------------------------------------------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-h);
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}

.nav__inner {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.nav__logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0;
}

.nav__logo-bracket {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
}

.nav__logo-text {
    margin: 0 0.15em;
}

.nav__links {
    display: flex;
    gap: 0.25rem;
    margin-left: 3rem;
}

.nav__link {
    font-size: 0.875rem;
    font-weight: 450;
    color: var(--text-secondary);
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-xs);
    transition: color 0.2s, background 0.2s;
}

.nav__link:hover,
.nav__link--active {
    color: var(--text-primary);
    background: var(--accent-subtle);
}

.nav__link--active {
    color: var(--accent);
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.nav__social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    color: var(--text-tertiary);
    transition: color 0.2s, background 0.2s;
}

.nav__social:hover {
    color: var(--text-primary);
    background: var(--accent-subtle);
}

.nav__social svg {
    width: 18px;
    height: 18px;
}

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    color: var(--text-tertiary);
    transition: color 0.2s, background 0.2s;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--accent-subtle);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

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

[data-theme="light"] .theme-toggle .icon-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: block;
}

/* Mobile menu */
.nav__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: var(--radius-xs);
    transition: background 0.2s;
}

.nav__hamburger:hover {
    background: var(--accent-subtle);
}

.nav__hamburger span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: transform 0.3s var(--ease), opacity 0.2s;
}

.nav__hamburger.active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.nav__hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav__hamburger.active span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile overlay */
.mobile-menu {
    display: none;
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    z-index: 999;
    background: var(--bg-primary);
    padding: 2rem 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.mobile-menu.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu .nav__link {
    font-size: 1.125rem;
    padding: 0.75rem 0;
}

/* --- HERO -------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: calc(var(--nav-h) + 4rem) 0 5rem;
}

/* Noise texture overlay (Cosmos-inspired) */
.hero__noise,
.cta__noise {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    pointer-events: none;
    z-index: 1;
}

[data-theme="light"] .hero__noise,
[data-theme="light"] .cta__noise {
    opacity: 0.025;
}

/* Subtle grid */
.hero__grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 72px 72px;
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 10%, transparent 70%);
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 10%, transparent 70%);
}

/* Floating orbs */
.hero__orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(100px);
}

.hero__orb--1 {
    width: 500px;
    height: 400px;
    top: -10%;
    right: -5%;
    background: rgba(255, 107, 43, var(--glow-opacity));
    animation: orb-drift-1 12s ease-in-out infinite alternate;
}

.hero__orb--2 {
    width: 350px;
    height: 300px;
    bottom: 0;
    left: -5%;
    background: rgba(255, 131, 71, calc(var(--glow-opacity) * 0.5));
    animation: orb-drift-2 15s ease-in-out infinite alternate;
}

@keyframes orb-drift-1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-30px, 20px) scale(1.1);
    }
}

@keyframes orb-drift-2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(20px, -15px) scale(1.08);
    }
}

/* Hero split layout */
.hero__layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.hero__left {
    text-align: left;
}

/* Monospace status line */
.hero__mono {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.75rem;
}

.hero__mono-dot {
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.hero__title {
    font-size: clamp(2.8rem, 5vw + 0.5rem, 4.8rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin-bottom: 1.5rem;
}

.hero__subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 460px;
    margin-bottom: 2.5rem;
}

.hide-mobile {
    display: inline;
}

.hero__cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Terminal card (Mux+Nothing inspired) */
.terminal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

[data-theme="light"] .terminal {
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}

.terminal__chrome {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.terminal__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal__dot--red {
    background: #ff5f57;
}

.terminal__dot--yellow {
    background: #ffbd2e;
}

.terminal__dot--green {
    background: #28c840;
}

.terminal__title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-left: auto;
    margin-right: auto;
}

.terminal__body {
    padding: 1.25rem 1.25rem 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.85;
}

.terminal__line {
    display: flex;
    gap: 0.5em;
    color: var(--text-secondary);
}

.terminal__line--output {
    color: var(--text-tertiary);
    padding-left: 1.3em;
}

.terminal__line--blank {
    height: 1.1em;
}

.terminal__prompt {
    color: var(--accent);
    font-weight: 500;
    user-select: none;
}

.terminal__cmd {
    color: var(--text-primary);
}

.terminal__key {
    color: var(--accent);
}

.terminal__cursor {
    color: var(--accent);
    animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Scroll indicator */
.hero__scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero__scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scroll-line 2s ease-in-out infinite;
}

@keyframes scroll-line {
    0% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: top;
    }

    51% {
        transform-origin: bottom;
    }

    100% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* --- TICKER ------------------------------------------------------------ */
.ticker {
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 0;
    position: relative;
}

.ticker__inner {
    display: flex;
    gap: 0;
    width: max-content;
    animation: ticker-scroll 25s linear infinite;
}

.ticker:hover .ticker__inner {
    animation-play-state: paused;
}

.ticker__item {
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 0 1rem;
    transition: color 0.2s;
}

.ticker__item:hover {
    color: var(--accent);
}

.ticker__sep {
    flex-shrink: 0;
    color: var(--text-tertiary);
    opacity: 0.4;
    font-size: 0.75rem;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* --- BUTTONS ----------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.7em 1.6em;
    border-radius: var(--radius-sm);
    transition: all 0.25s var(--ease);
    white-space: nowrap;
}

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

.btn--primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 24px 4px var(--accent-glow);
    transform: translateY(-1px);
}

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

.btn--ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--accent-subtle);
}

.btn--lg {
    font-size: 1rem;
    padding: 0.85em 2em;
}

/* --- CARDS (shared) ---------------------------------------------------- */
.card {
    position: relative;
    background: var(--bg-card);
    border: 0px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.75rem;
    overflow: hidden;
    transition: border-color 0.35s var(--ease),
        transform 0.35s var(--ease),
        box-shadow 0.35s var(--ease),
        background 0.35s var(--ease);
}

/* Cursor-follow glow */
.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            var(--accent-subtle),
            transparent 40%);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    pointer-events: none;
}

.card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.card:hover::after {
    opacity: 0.5;
}

/* --- ABOUT (editorial two-column) -------------------------------------- */
.about__layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    align-items: start;
}

.about__label-col {
    position: sticky;
    top: calc(var(--nav-h) + 2rem);
}

.about__heading {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.about__text {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

/* --- SECTION HEADER ROW ------------------------------------------------ */
.section__header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.section__header-row .section__title {
    width: auto;
    margin-top: 0;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.section__header-row .section__link {
    margin-left: auto;
}

/* --- BENTO GRID (Competencies) ----------------------------------------- */
.bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    gap: 1rem;
}

.bento__cell--lg {
    grid-column: span 2;
}

.bento__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.bento__desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- BLOG CARDS -------------------------------------------------------- */
.blog-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.blog-card {
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    transition: border-color 0.35s var(--ease),
        transform 0.35s var(--ease),
        box-shadow 0.35s var(--ease),
        background 0.35s var(--ease);
}

.blog-card__category {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 1rem;
}

.blog-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    transition: color 0.2s;
}

.blog-card:hover .blog-card__title {
    color: var(--accent);
}

.blog-card__excerpt {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    line-height: 1.55;
    flex: 1;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blog-card__footer time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.blog-card__arrow {
    font-size: 1.1rem;
    color: var(--text-tertiary);
    transition: color 0.2s, transform 0.2s;
}

.blog-card:hover .blog-card__arrow {
    color: var(--accent);
    transform: translateX(3px);
}

/* --- PROJECT CARDS ----------------------------------------------------- */
.projects__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.project-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    margin-bottom: 1.25rem;
}

.project-card__links {
    display: flex;
    gap: 0.5rem;
}

.icon-link {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 0.3em 0.7em;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.icon-link:hover {
    color: var(--accent);
    border-color: var(--accent-border);
}

.project-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-card__desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* Tags */
.tag {
    font-size: 0.7rem;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.25em 0.65em;
    border-radius: var(--radius-xs);
    background: var(--accent-subtle);
    color: var(--accent);
    letter-spacing: 0.02em;
}

/* Featured badge */
.project-card--featured {
    border-color: var(--accent-border);
}

/* --- BLOG ITEMS -------------------------------------------------------- */
.blogs__list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.blog-item {
    display: block;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.25s;
}

.blog-item:first-child {
    border-top: 1px solid var(--border);
}

.blog-item:hover {
    border-color: var(--accent-border);
}

.blog-item__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.blog-item__meta time {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
}

.blog-item__category {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2em 0.6em;
    border-radius: var(--radius-xs);
    background: var(--accent-subtle);
    color: var(--accent);
}

.blog-item__title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    transition: color 0.25s;
}

.blog-item:hover .blog-item__title {
    color: var(--accent);
}

.blog-item__excerpt {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* --- BLOG ARTICLE ------------------------------------------------------ */
.article-header {
    padding: calc(var(--nav-h) + 4rem) 0 3rem;
    position: relative;
    overflow: hidden;
}

.article-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: linear-gradient(black, transparent);
    mask-image: linear-gradient(black, transparent);
}

.article-header__inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.article-header__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.article-header__meta time,
.article-header__reading {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
}

.article-header__meta .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-tertiary);
}

.article-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.article-header__excerpt {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.article-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 0 6rem;
}

.article-body h2 {
    font-size: 1.6rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
}

.article-body h3 {
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-body p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-body a:hover {
    color: var(--accent-hover);
}

.article-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.25rem;
}

.article-body li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    line-height: 1.7;
    list-style: disc;
}

.article-body ol li {
    list-style: decimal;
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 2rem 0;
}

.article-body blockquote p {
    font-style: italic;
    color: var(--text-secondary);
}

.article-body pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.85rem;
    line-height: 1.7;
}

.article-body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.article-body :not(pre)>code {
    background: var(--bg-tertiary);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--accent);
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.9rem;
}

.article-body th,
.article-body td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.article-body th {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.article-body td {
    color: var(--text-secondary);
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    transition: color 0.2s;
    margin-bottom: 0.5rem;
}

.article-back:hover {
    color: var(--accent);
}

/* --- PAGE HEADER ------------------------------------------------------- */
.page-header {
    padding: calc(var(--nav-h) + 4rem) 0 3rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: linear-gradient(black, transparent);
    mask-image: linear-gradient(black, transparent);
}

.page-header__inner {
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.page-header p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 520px;
}

/* --- CTA SECTION ------------------------------------------------------- */
.cta {
    text-align: center;
    padding: 5rem 0;
}

.cta__inner {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 5rem 2rem;
    position: relative;
    overflow: hidden;
}

.cta__inner::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 300px;
    background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    animation: orb-drift-1 8s ease-in-out infinite alternate;
}

.cta__title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    margin-bottom: 0.75rem;
    position: relative;
}

.cta__text {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    position: relative;
}

/* --- FOOTER ------------------------------------------------------------ */
.footer {
    border-top: 1px solid var(--border);
    padding: 0;
    max-width: var(--container);
    margin: 0 auto;
}

.footer__top {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    padding: 4rem 1.5rem 3rem;
}

.footer__brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer__logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
}

.footer__tagline {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    line-height: 1.6;
    max-width: 280px;
}

.footer__socials {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.footer__socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-xs);
    color: var(--text-tertiary);
    transition: color 0.2s, background 0.2s;
}

.footer__socials a:hover {
    color: var(--accent);
    background: var(--accent-subtle);
}

.footer__socials svg {
    width: 17px;
    height: 17px;
}

.footer__columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer__col-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.footer__col-links {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer__col-links li a {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    transition: color 0.2s;
}

.footer__col-links li a:hover {
    color: var(--text-primary);
}

.footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem;
    border-top: 1px solid var(--border);
}

.footer__copy {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.footer__built {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
}

/* --- SCROLL REVEAL ----------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* Stagger children */
.stagger>.reveal:nth-child(1) {
    transition-delay: 0.00s;
}

.stagger>.reveal:nth-child(2) {
    transition-delay: 0.06s;
}

.stagger>.reveal:nth-child(3) {
    transition-delay: 0.12s;
}

.stagger>.reveal:nth-child(4) {
    transition-delay: 0.18s;
}

.stagger>.reveal:nth-child(5) {
    transition-delay: 0.24s;
}

.stagger>.reveal:nth-child(6) {
    transition-delay: 0.30s;
}

/* Hero entrance */
.hero-enter {
    opacity: 0;
    transform: translateY(30px);
    animation: hero-in 0.8s var(--ease) forwards;
}

.hero-enter:nth-child(1) {
    animation-delay: 0.1s;
}

.hero-enter:nth-child(2) {
    animation-delay: 0.2s;
}

.hero-enter:nth-child(3) {
    animation-delay: 0.35s;
}

.hero-enter:nth-child(4) {
    animation-delay: 0.5s;
}

@keyframes hero-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RESPONSIVE -------------------------------------------------------- */
@media (max-width: 1024px) {
    .hero__layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero__right {
        max-width: 520px;
    }

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

    .bento__cell--lg {
        grid-column: span 1;
    }

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

    .blog-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav__links {
        display: none;
    }

    .nav__hamburger {
        display: flex;
    }

    .hero {
        min-height: auto;
        padding-top: calc(var(--nav-h) + 3rem);
        padding-bottom: 3rem;
    }

    .hero__layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .hero__title {
        font-size: clamp(2.2rem, 8vw, 3rem);
    }

    .hide-mobile {
        display: none;
    }

    .about__layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about__label-col {
        position: static;
    }

    .section {
        padding: 4rem 0;
    }

    .bento,
    .projects__grid,
    .blog-cards {
        grid-template-columns: 1fr;
    }

    .footer__top {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

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

    .footer__bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .article-body {
        padding: 1.5rem 0 4rem;
    }

    .cta__inner {
        padding: 3rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero__cta {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .blog-item__meta {
        flex-wrap: wrap;
    }
}

/* --- UTILITIES --------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Page transition */
.page-body {
    animation: page-in 0.5s var(--ease);
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* All projects page grid */
.all-projects__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .all-projects__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .all-projects__grid {
        grid-template-columns: 1fr;
    }
}