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

@font-face {
    font-family: 'Manrope';
    src: url(/src/Manrope-VariableFont_wght.woff2) format('woff2');
}

:root {
    --black: #000;
    --white: #fff;
    --gray: #888;
    --gray-light: #bbb;
    --gray-dim: #333;
    --max-w: 1100px;
    --pad-x: 40px;
    --pad-y: 100px;
    --nav-h: 61px;
}

body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--white);
    background: var(--black);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ── Header & Nav ──────────────────────────────────────────────── */

header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 18px 32px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.08em;
    z-index: 100;
    border-bottom: 1px solid #1a1a1a;
}

.logo {
    filter: invert(1);
    height: 100%;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--white);
    text-decoration: none;
}

nav {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    right: 32px;
    height: var(--nav-h);
    z-index: 101;
}

nav a, nav a:visited {
    color: var(--gray-light);
    text-decoration: none;
    margin-left: 28px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.15s ease;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}

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

.menu {
    display: none;
    height: 38px;
    width: 44px;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    background: var(--black);
    cursor: pointer;
    border: 0;
    & .bar {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--white);
        transition: all 0.3s ease;
    }
}

.lang-switch {
    display: flex;
    align-items: center;
    margin-left: 36px;
    border: 1px solid var(--gray-dim);
    border-radius: 2px;
    overflow: hidden;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--gray);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 5px 10px;
    transition: background 0.12s, color 0.12s;
}

.lang-btn.active       { background: var(--white); color: var(--black); }
.lang-btn:hover:not(.active) { background: #111; color: var(--white); }


/* ── Layout ────────────────────────────────────────────────────── */

main { padding-top: var(--nav-h); }

.inner {
    max-width: var(--max-w);
    margin: 0 auto;
}

.section {
    padding: var(--pad-y) var(--pad-x);
}

.label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.label::before {
    content: '';
    display: block;
    width: 32px;
    height: 1px;
    background: var(--gray);
}

.sublabel {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 20px;
}

.grid {
    display: grid;
    gap: 1px;
    background: #1a1a1a;
    border: 1px solid #1a1a1a;
}

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

.grid.grid-2 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.grid.grid-3 > :last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
.grid.grid-3 > :last-child:nth-child(3n + 2) { grid-column: span 2; }

.note {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #111;
    font-size: 0.88rem;
    color: var(--gray-light);
    line-height: 1.7;
}

.note a {
    color: var(--gray);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-dim);
    transition: color 0.15s, border-color 0.15s;
}

.note a:hover { color: var(--white); border-color: var(--white); }


/* ── Card ──────────────────────────────────────────────────────── */

.card {
    display: flex;
    flex-direction: column;
    background: var(--black);
    padding: 36px 32px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.card:hover { background: #0a0a0a; }

.card--dim { background: #050505; padding: 40px 32px; }
.card--dim:hover { background: #0d0d0d; }

.card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-lang {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray);
}

.card-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.card--dim h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.card-desc {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.75;
    flex: 1;
}

.card-footer { margin-top: 28px; }

.card-link {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray);
    transition: color 0.15s;
    margin-right: 1rem;
}

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

.card:has(.card-link:hover) .card-link { color: var(--gray); }
.card-link:hover { color: var(--white) !important; }

.tag {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 2px;
    border: 1px solid;
}

.tag-active   { color: #4caf50; border-color: #4caf5044; }
.tag-wip      { color: #e0a020; border-color: #e0a02044; }
.tag-archived { color: var(--gray-light); border-color: var(--gray-dim); }


/* ── Hero ──────────────────────────────────────────────────────── */

.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 80px var(--pad-x) 60px;
    background: no-repeat left/cover url("/src/footer.svg") var(--black);
    box-shadow: inset 0 100vh 0 #000c;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(255,255,255,0.03) 0%, transparent 70%),
        repeating-linear-gradient(0deg,   transparent, transparent 39px, rgba(255,255,255,0.025) 39px, rgba(255,255,255,0.025) 40px),
        repeating-linear-gradient(90deg,  transparent, transparent 39px, rgba(255,255,255,0.015) 39px, rgba(255,255,255,0.015) 40px);
    pointer-events: none;
}

.hero-title {
    font-size: clamp(2rem, 5.5vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-align: right;
    color: var(--white);
    max-width: 820px;
    position: relative;
    animation: fadeUp 0.9s ease both;
}

.hero-sub {
    margin-top: 28px;
    font-size: 1rem;
    color: var(--gray);
    font-weight: 400;
    text-align: right;
    max-width: 480px;
    line-height: 1.7;
    position: relative;
    animation: fadeUp 0.9s 0.15s ease both;
}

.hero-actions {
    margin-top: 32px;
    position: relative;
    animation: fadeUp 0.9s 0.3s ease both;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 999px;
    background: var(--white);
    color: var(--black);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border: 1px solid #fff;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.hero-cta:hover {
    background: #f5f5f5;
    border-color: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}


/* ── Page hero ─────────────────────────────────────────────────── */

.page-hero {
    padding: 120px var(--pad-x) 72px;
    border-bottom: 1px solid #111;
}

.page-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--white);
    margin-top: 20px;
    animation: fadeUp 0.8s ease both;
}

.page-sub {
    margin-top: 20px;
    font-size: 1rem;
    color: var(--gray);
    line-height: 1.7;
    max-width: 480px;
    animation: fadeUp 0.8s 0.1s ease both;
}


/* ── About ─────────────────────────────────────────────────────── */

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

.about-lead {
    grid-column: 1 / -1;
    font-size: clamp(1.2rem, 2.2vw, 1.65rem);
    font-weight: 300;
    line-height: 1.6;
    color: #e0e0e0;
    letter-spacing: -0.01em;
}

.about-lead strong { color: var(--white); font-weight: 600; }

.divider {
    border: none;
    border-top: 1px solid #1e1e1e;
    grid-column: 1 / -1;
}

.about-block h3 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 16px;
}

.about-block p {
    font-size: 0.95rem;
    color: #999;
    line-height: 1.75;
}


/* ── Principles ────────────────────────────────────────────────── */

.principles { background: #050505; border-top: 1px solid #111; }


/* ── Contacts ──────────────────────────────────────────────────── */

.contact-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #111;
    text-decoration: none;
    transition: border-color 0.15s;
}

.contact-row:first-child { border-top: 1px solid #111; }
.contact-row:hover .contact-handle { color: var(--white); }

.contact-name {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-light);
}

.contact-handle {
    font-size: 0.88rem;
    color: var(--gray);
    transition: color 0.15s;
}


/* ── Footer ────────────────────────────────────────────────────── */

footer {
    background: no-repeat right/contain url("/src/footer.svg") var(--black);
    border-top: 1px solid #111;
    padding: 48px var(--pad-x) 40px;
    margin-top: auto;
}

footer h1 {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    padding-bottom: 1rem;
}

.footer-meta {
    color: var(--gray);
    font-size: 0.78rem;
    line-height: 2;
    letter-spacing: 0.04em;
}

.footer-meta a { color: #666; text-decoration: none; transition: color 0.15s; }
.footer-meta a:hover { color: var(--white); }


/* ── Mobile ────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    :root {
        --pad-x: 24px;
        --pad-y: 60px;
    }

    header { padding: 14px 20px; }

    nav {
        position: fixed;
        top: -100dvh; left: 0; right: 0;
        height: 100dvh;
        padding: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: #0009;
        gap: 36px;
        transition: top 0.3s ease;
        &[active] {
            top: 0;
            z-index: 200;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }
        & a { margin-left: 0; font-size: 2rem; }
    }

    .menu {
        display: flex;
        position: fixed;
        top: 11px; right: 20px;
        z-index: 201;
    }

    nav[active] ~ .menu {
        & .bar:nth-child(1) { transform: rotate(45deg)  translate(6px, 6px);  width: 24px; }
        & .bar:nth-child(2) { opacity: 0; }
        & .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); width: 24px; }
    }

    .lang-switch { margin-left: 0; }

    .hero {
        background-position: 30% !important;
        padding: 60px 24px 48px;
        min-height: 70vh;
    }

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

    .grid-2,
    .grid-3 { grid-template-columns: 1fr; }

    .page-hero { padding: 90px 24px 56px; }

    footer { padding: 40px 24px 32px; }
}
