:root {
    --bg: #0f1115;
    --panel: #161922;
    --panel-2: #1d212c;
    --text: #f3f0ea;
    --muted: #b9b3aa;
    --line: #343844;
    --accent: #a92123;
    --accent-soft: rgba(169, 33, 35, 0.16);
    --code: #d9d0c5;
    --max: 1080px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 80% 0%, rgba(169, 33, 35, 0.16), transparent 34rem),
        linear-gradient(180deg, #0f1115 0%, #11141b 45%, #0f1115 100%);
    line-height: 1.65;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 70%);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--text);
    text-decoration-color: rgba(169, 33, 35, 0.75);
    text-underline-offset: 0.22em;
}

a:hover {
    color: #ffffff;
}

.wrap {
    width: min(var(--max), calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(15, 17, 21, 0.82);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 18px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.brand span {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 18px;
    font-size: 0.95rem;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
}

.nav a[aria-current="page"],
.nav a:hover {
    color: var(--text);
}

main {
    padding: 64px 0 70px;
}

main > *:first-child {
    margin-top: 0;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 34px;
    align-items: stretch;
    margin: 34px 0 64px;
}

.eyebrow {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92rem;
    margin: 0 0 18px;
}

.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 18px rgba(169, 33, 35, 0.7);
}

h1,
h2,
h3 {
    line-height: 1.12;
    margin: 0;
}

h1 {
    font-size: clamp(2.6rem, 7vw, 5.2rem);
    letter-spacing: -0.055em;
    max-width: 850px;
}

h2 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    letter-spacing: -0.035em;
    margin-bottom: 18px;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.lead {
    color: var(--muted);
    font-size: clamp(1.08rem, 2vw, 1.25rem);
    max-width: 760px;
    margin: 24px 0 0;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 2px;
    font-weight: 650;
}

.button.secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
}

.button:hover {
    filter: brightness(1.08);
}

.terminal {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(29, 33, 44, 0.94), rgba(16, 18, 24, 0.94));
    box-shadow: 0 20px 80px rgba(0,0,0,0.28);
    border-radius: 8px;
    overflow: hidden;
}

.terminal-head {
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
}

.terminal pre {
    margin: 0;
    padding: 18px;
    white-space: pre-wrap;
    color: var(--code);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
}

.accent {
    color: #ffb4b4;
}

.section {
    margin: 70px 0;
}

.section-intro {
    color: var(--muted);
    max-width: 760px;
    margin: 0 0 24px;
}

.contact-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 38px;
    align-items: center;
    margin-top: 46px;
}

.contact-intro {
    min-width: 0;
}

.contact-portrait {
    position: relative;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(29, 33, 44, 0.94), rgba(16, 18, 24, 0.94));
    box-shadow: 0 22px 80px rgba(0,0,0,0.28);
}

.contact-portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 62%, rgba(15, 17, 21, 0.14));
}

.contact-portrait img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 50% 38%;
}

.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    gap: 16px;
}

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

.card,
.note,
.project {
    border: 1px solid var(--line);
    background: rgba(22, 25, 34, 0.72);
    border-radius: 8px;
    padding: 22px;
}

.card h3,
.project h3 {
    color: #ffffff;
}

.card p,
.project p,
.note p {
    color: var(--muted);
    margin: 0;
}

.card .tag {
    display: inline-block;
    margin-bottom: 14px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #ffcdcd;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
}

.note {
    border-left: 4px solid var(--accent);
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 22px;
    align-items: start;
}

.clean-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.clean-list li {
    position: relative;
    padding-left: 22px;
    color: var(--muted);
}

.clean-list li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.kicker {
    margin: 0 0 8px;
    color: var(--accent);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86rem;
}

.contact-box {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 26px;
}

.contact-box p {
    margin: 8px 0 0;
    color: var(--muted);
}

.contact-box .button {
    white-space: nowrap;
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding: 26px 0;
    font-size: 0.92rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.legal main {
    max-width: 850px;
}

.legal p,
.legal li {
    color: var(--muted);
}

.legal h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    margin-bottom: 28px;
}

.legal h2 {
    font-size: 1.35rem;
    margin-top: 42px;
}

@media (max-width: 850px) {
    .header-inner,
    .contact-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        justify-content: flex-start;
    }

    .hero,
    .contact-hero,
    .split,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .contact-portrait {
        max-width: 420px;
    }

    .terminal {
        order: -1;
    }
}
