:root {
    --bg: #0b101c;
    --surface: #121a2b;
    --surface-2: #18223a;
    --border: #23304d;
    --text: #e8ecf4;
    --muted: #93a0b8;
    --accent: #3fd0b5;
    --accent-2: #f4b860;
    --radius: 14px;
    --max: 1120px;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(1000px 500px at 85% -10%, rgba(63, 208, 181, .10), transparent 60%),
        radial-gradient(800px 400px at -10% 30%, rgba(244, 184, 96, .06), transparent 60%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

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

.mono {
    font-family: var(--mono);
}

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

/* header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px max(16px, calc((100% - var(--max)) / 2));
    background: rgba(11, 16, 28, .82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 52px;
    height: auto;
}

.site-header ul {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-header nav a {
    display: block;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: var(--mono);
    font-size: .9rem;
    color: var(--muted);
    transition: color .15s, background .15s;
}

.site-header nav a:hover {
    color: var(--text);
    background: var(--surface-2);
}

/* layout */

main {
    padding: 0 16px;
}

.section,
.hero {
    max-width: var(--max);
    margin: 0 auto;
}

.section {
    padding: 96px 0 24px;
}

.section-head {
    margin-bottom: 40px;
}

.eyebrow {
    margin: 0 0 12px;
    font-size: .85rem;
    color: var(--accent);
    letter-spacing: .02em;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.15;
    letter-spacing: -.02em;
}

h1 {
    font-size: clamp(2.3rem, 5.5vw, 3.8rem);
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
}

h3 {
    font-size: 1.2rem;
}

.lede {
    max-width: 58ch;
    margin: 20px 0 0;
    font-size: 1.15rem;
    color: var(--muted);
}

/* hero */

.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 48px;
    min-height: min(calc(100vh - 77px), 760px);
    padding: 48px 0;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 500;
    transition: transform .15s, background .15s, border-color .15s;
}

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

.btn-primary {
    background: var(--accent);
    color: #062520;
}

.btn-ghost {
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--accent);
}

/* shared chart styles */

svg .grid line {
    stroke: var(--border);
    stroke-width: 1;
    stroke-dasharray: 4 6;
}

svg .bars rect {
    fill: var(--surface-2);
    stroke: var(--border);
}

svg .bars rect.hl {
    fill: rgba(244, 184, 96, .18);
    stroke: var(--accent-2);
}

svg .line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

svg .dot {
    fill: var(--accent-2);
}

.hero-chart {
    width: 100%;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.hero-chart .line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: draw 1.6s ease-out .2s forwards;
}

@keyframes draw {
    to { stroke-dashoffset: 0; }
}

/* projects */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform .2s, border-color .2s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.card-media {
    aspect-ratio: 16 / 9;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.card-media-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.card-media-svg svg {
    width: 100%;
    height: 100%;
}

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
    padding: 22px;
}

.card-body p {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.tags li {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .75rem;
    color: var(--accent);
    background: rgba(63, 208, 181, .1);
}

.card-links {
    display: flex;
    gap: 16px;
    margin-top: auto;
    padding-top: 8px;
    font-family: var(--mono);
    font-size: .85rem;
}

.card-links a {
    color: var(--accent-2);
}

.card-links a::after {
    content: ' ↗';
}

.card-links a:hover {
    text-decoration: underline;
}

/* about */

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

.about-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.about-text p {
    margin: 0 0 18px;
    color: var(--muted);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 28px 0 0;
}

.stats div {
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.stats dt {
    font-size: .75rem;
    color: var(--accent);
}

.stats dd {
    margin: 4px 0 0;
    font-weight: 500;
}

/* contact */

.contact-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    max-width: 640px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 500;
    transition: border-color .2s, transform .2s;
}

.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.contact-card svg {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.6;
}

.contact-card svg.filled {
    fill: var(--accent);
    stroke: none;
}

.contact-label {
    display: block;
    font-size: .75rem;
    font-weight: 400;
    color: var(--muted);
}

/* footer */

.site-footer {
    max-width: var(--max);
    margin: 96px auto 0;
    padding: 24px 16px 40px;
    border-top: 1px solid var(--border);
    font-size: .8rem;
    color: var(--muted);
}

.site-footer p {
    margin: 0;
}

:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-chart .line { animation: none; stroke-dashoffset: 0; }
    .card, .btn, .contact-card { transition: none; }
}

/* responsive */

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 56px 0 24px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .about-photo {
        max-width: 200px;
    }
}

@media (max-width: 560px) {
    .brand-logo {
        width: 44px;
    }

    .section {
        padding-top: 72px;
    }

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

    .stats {
        grid-template-columns: 1fr;
    }
}
