:root {
    --bg: #0A0A0A;
    --bg-soft: #121212;
    --panel: rgba(18, 18, 18, 0.88);
    --panel-strong: rgba(22, 22, 22, 0.96);
    --border: rgba(217, 31, 38, 0.18);
    --border-soft: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.72);
    --muted-soft: rgba(255, 255, 255, 0.55);
    --red: #D91F26;
    --red-dark: #b8171c;
    --red-glow: rgba(217, 31, 38, 0.18);
    --max-width: 1180px;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(217, 31, 38, 0.08), transparent 28%),
        radial-gradient(circle at bottom left, rgba(217, 31, 38, 0.05), transparent 24%),
        linear-gradient(180deg, #0d0d0d 0%, #090909 100%);
    color: var(--text);
    line-height: 1.6;
}

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

.container {
    padding: 40px 0 64px;
}

main {
    display: block;
}

section {
    position: relative;
}

.section {
    padding: 20px 0 32px;
}

.section-title {
    margin: 0 0 10px;
    font-size: clamp(1.65rem, 2.6vw, 2.2rem);
    line-height: 1.15;
    color: var(--text);
}

.section-intro {
    margin: 0 0 24px;
    max-width: 820px;
    color: var(--muted);
    font-size: 1rem;
}

/* Header */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.96);
    border-bottom: 1px solid rgba(217, 31, 38, 0.22);
    backdrop-filter: blur(10px);
}

.topbar-inner {
    min-height: 84px;
    display: flex;
    align-items: center;
    padding: 10px 0;
}

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

.brand-mark {
    width: 92px;
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 12px rgba(217, 31, 38, 0.12));
}

.brand-text {
    font-size: 1.65rem;
    font-weight: 700;
    font-family: Consolas, "Courier New", monospace;
    letter-spacing: 0.01em;
    line-height: 1;
}

.mono {
    color: var(--red);
    font-family: Consolas, "Courier New", monospace;
}

/* Subnav */
.subnav-bar {
    border-bottom: 1px solid rgba(217, 31, 38, 0.18);
    background: rgba(8, 8, 8, 0.9);
}

.subnav-inner {
    min-height: 54px;
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.subnav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.subnav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.subnav a:hover,
.subnav a.active {
    background: rgba(217, 31, 38, 0.16);
    box-shadow: inset 0 0 0 1px rgba(217, 31, 38, 0.25);
}

/* Hero */
.hero {
    padding: 42px 0 22px;
}

.hero-panel {
    background:
        linear-gradient(180deg, rgba(217, 31, 38, 0.08), rgba(217, 31, 38, 0.02)),
        var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: clamp(28px, 4vw, 46px);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: auto -80px -100px auto;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(217, 31, 38, 0.12), transparent 68%);
    pointer-events: none;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--red);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero h1,
.hero-panel h1 {
    margin: 0 0 14px;
    font-size: clamp(2.7rem, 5vw, 4.25rem);
    line-height: 1.04;
    max-width: 900px;
}

.hero p,
.hero-panel p {
    margin: 0;
    max-width: 860px;
    color: var(--muted);
    font-size: clamp(1rem, 1.6vw, 1.08rem);
}

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

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

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

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

/* Special project stack */
.projects-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

.projects-stack .card {
    margin-bottom: 0;
}

/* Cards */
.card {
    background: var(--panel-strong);
    padding: 24px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.grid .card {
    margin-bottom: 0;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(217, 31, 38, 0.45), transparent 55%);
}

.card h2,
.card h3 {
    margin-top: 0;
    line-height: 1.2;
}

.card h2 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

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

.card p + p {
    margin-top: 12px;
}

.card img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #0f0f0f;
}

/* Pill */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(217, 31, 38, 0.12);
    color: #ffd2d4;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(217, 31, 38, 0.16);
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    background: linear-gradient(180deg, var(--red), #bf1a20);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    margin-top: 10px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 22px rgba(217, 31, 38, 0.24);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover {
    background: linear-gradient(180deg, #e3252d, var(--red-dark));
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(217, 31, 38, 0.3);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(217, 31, 38, 0.22);
    box-shadow: none;
}

.button-secondary:hover {
    background: rgba(217, 31, 38, 0.12);
    box-shadow: inset 0 0 0 1px rgba(217, 31, 38, 0.16);
    transform: translateY(-1px);
}

/* CTA */
.cta {
    background:
        linear-gradient(180deg, rgba(217, 31, 38, 0.08), rgba(217, 31, 38, 0.03)),
        rgba(18, 18, 18, 0.9);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: clamp(24px, 3.2vw, 36px);
    box-shadow: var(--shadow);
}

.cta h3 {
    margin: 0 0 10px;
    font-size: clamp(1.4rem, 2.2vw, 2rem);
}

.cta p {
    margin: 0;
    color: var(--muted);
}

.cta .hero-actions,
.cta .button {
    margin-top: 18px;
}

/* Lists */
ul,
ol {
    padding-left: 20px;
    color: var(--muted);
}

li + li {
    margin-top: 8px;
}

.list {
    margin: 10px 0 0;
    padding-left: 20px;
    color: var(--muted);
}

/* Footer */
footer {
    border-top: 1px solid rgba(217, 31, 38, 0.16);
    margin-top: 28px;
    padding: 22px 0 34px;
    color: var(--muted-soft);
    font-size: 0.95rem;
}

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

/* Utilities */
.container .card h2:first-child,
.container .card h3:first-child {
    margin-top: 0;
}

a {
    color: inherit;
}

strong {
    color: var(--text);
}

/* Responsive */
@media (max-width: 980px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 34px;
    }

    .brand-mark {
        width: 78px;
    }

    .brand-text {
        font-size: 1.35rem;
    }
}

iframe {
    border-radius: 12px;
    filter: brightness(0.92) contrast(1.1);
}

.loading {
    font-family: Consolas, monospace;
    font-size: 0.9rem;
    opacity: 0.5;
    margin-top: 12px;
    letter-spacing: 0.08em;
}

@media (max-width: 640px) {
    .wrap,
    .container,
    footer .wrap {
        width: min(var(--max-width), calc(100% - 24px));
    }

    .hero-panel,
    .cta,
    .card {
        border-radius: 18px;
    }

    .brand-mark {
        width: 64px;
    }

    .brand-text {
        font-size: 1.1rem;
    }

    .subnav a {
        padding: 9px 10px;
        font-size: 0.92rem;
    }

    .button {
        width: 100%;
    }

    .hero-actions {
        flex-direction: column;
    }
}
