@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;700;800&family=Space+Grotesk:wght@500;700&display=swap");

:root {
    --bg: #ffffff;
    --ink: #0b0b0b;
    --muted: #5f6673;
    --subtle: #9aa0aa;
    --line: #e8e8e8;
    --soft: #f5f5f5;
    --accent: #ff3b30;
    --positive: #10b981;
    --font-sans: "Plus Jakarta Sans", "Inter", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "Space Grotesk", "IBM Plex Mono", ui-monospace, monospace;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 80px;
    --max-width: 1180px;
    color-scheme: light;
}

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    text-rendering: geometricPrecision;
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
    margin: 0;
}

h1,
h2,
h3,
h4 {
    color: var(--ink);
    font-weight: 800;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(44px, 7vw, 78px);
    line-height: 0.98;
}

h2 {
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.06;
}

h3 {
    font-size: 20px;
    line-height: 1.15;
}

p,
li {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.58;
}

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

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

strong {
    color: var(--ink);
    font-weight: 800;
}

code {
    background: var(--soft);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.92em;
    padding: 0 4px;
}

pre {
    max-width: 100%;
    margin: var(--space-5) 0 0;
    overflow-x: auto;
    border-top: 2px solid var(--ink);
    background: var(--soft);
    color: var(--ink);
    padding: var(--space-4);
}

pre code {
    background: transparent;
    padding: 0;
}

main {
    flex: 1;
}

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

header {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

header .container {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}

.logo {
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

nav {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-link {
    position: relative;
    padding: 24px 0;
}

.nav-link::after {
    position: absolute;
    left: 0;
    bottom: 18px;
    width: 0;
    height: 2px;
    background: var(--accent);
    content: "";
    transition: width 140ms ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--ink);
}

.language-switch {
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1.4px;
    opacity: 0.55;
    padding: 24px 0;
    text-transform: uppercase;
}

.language-switch:hover,
.language-switch:focus-visible {
    color: var(--accent);
    opacity: 1;
}

.hamburger {
    position: relative;
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease;
}

.hamburger span {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 2px;
    background: var(--ink);
    transform: translateX(-50%);
    transform-origin: center;
    transition: top 180ms ease, transform 180ms ease, opacity 140ms ease;
}

.hamburger span:nth-child(1) {
    top: 14px;
}

.hamburger span:nth-child(2) {
    top: 21px;
}

.hamburger span:nth-child(3) {
    top: 28px;
}

header:has(nav.open) .hamburger {
    border-color: var(--ink);
    background: var(--soft);
}

header:has(nav.open) .hamburger span:nth-child(1) {
    top: 21px;
    transform: translateX(-50%) rotate(45deg);
}

header:has(nav.open) .hamburger span:nth-child(2) {
    opacity: 0;
}

header:has(nav.open) .hamburger span:nth-child(3) {
    top: 21px;
    transform: translateX(-50%) rotate(-45deg);
}

main {
    padding: var(--space-8) 0 var(--space-7);
}

section {
    margin-bottom: var(--space-8);
}

section:last-child {
    margin-bottom: 0;
}

.kicker {
    color: var(--accent);
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.2;
    text-transform: uppercase;
}

.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-6);
}

.hero {
    align-items: end;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-6);
    min-height: 430px;
    padding: var(--space-4) 0 var(--space-7);
}

.hero-copy {
    grid-column: 1 / span 10;
}

.hero-side {
    border-left: 1px solid var(--line);
    grid-column: 10 / span 3;
    padding-left: var(--space-5);
}

.lead {
    max-width: 690px;
    margin-top: var(--space-5);
    color: var(--muted);
    font-size: 17px;
    line-height: 1.58;
}

.metric {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    margin-top: var(--space-5);
}

.status {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-family: var(--font-mono);
    font-size: 12px;
    gap: var(--space-2);
}

.status::before {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 999px;
    content: "";
}

.section-heading {
    border-top: 2px solid var(--ink);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-6);
    padding-top: var(--space-4);
}

.section-heading h1,
.section-heading h2 {
    grid-column: 1 / span 7;
}

.section-heading p {
    grid-column: 9 / span 4;
    padding-top: 6px;
}

.item-list {
    list-style: none;
    padding: 0;
}

.item {
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(88px, 1fr) minmax(0, 6fr) minmax(72px, 1fr);
    gap: var(--space-5);
    padding: 18px 0;
}

.item:first-child {
    border-top-color: var(--ink);
    border-top-width: 2px;
}

.item a:first-child,
.item-main {
    display: contents;
}

.item-index,
.meta,
.article-meta {
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.35;
    text-transform: uppercase;
}

.item h3 {
    margin-bottom: 7px;
}

.item p {
    max-width: 720px;
}

.item-action {
    align-self: start;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: right;
    text-transform: uppercase;
}

.item-with-demo {
    align-items: start;
}

.demo-link {
    align-self: start;
    border-bottom: 2px solid var(--ink);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    justify-self: end;
    padding-bottom: 3px;
    text-transform: uppercase;
}

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

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
}

.module {
    border-top: 2px solid var(--ink);
    padding-top: var(--space-4);
}

.module.is-accent {
    border-top-color: var(--accent);
}

.module h2,
.module h3 {
    margin: var(--space-3) 0 var(--space-3);
}

.note {
    border-left: 4px solid var(--accent);
    margin-top: var(--space-5);
    padding-left: 18px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 12px;
}

.table th {
    border-bottom: 2px solid var(--ink);
    color: var(--ink);
    padding: 12px 10px 12px 0;
    text-align: left;
    text-transform: uppercase;
}

.table td {
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    line-height: 1.4;
    padding: 16px 10px 16px 0;
    vertical-align: top;
}

.table tr.is-emphasis td {
    background: var(--soft);
    border-bottom: 1px solid var(--ink);
    color: var(--ink);
    font-weight: 800;
}

.back-link {
    display: flex;
    align-items: center;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    gap: var(--space-2);
    letter-spacing: 1px;
    margin-bottom: var(--space-6);
    text-transform: uppercase;
    width: fit-content;
}

.arrow-icon {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

article {
    max-width: 860px;
}

article.wide {
    max-width: none;
}

article h1 {
    margin-bottom: var(--space-4);
}

.article-meta {
    margin-bottom: var(--space-7);
}

article h2 {
    border-top: 2px solid var(--ink);
    font-size: 28px;
    line-height: 1.15;
    margin-top: var(--space-7);
    padding-top: var(--space-4);
}

article h3 {
    margin-top: var(--space-5);
}

article p,
article ul,
article ol {
    margin-top: var(--space-4);
}

article ul,
article ol {
    padding-left: 20px;
}

.callout {
    border-left: 4px solid var(--accent);
    margin: var(--space-5) 0;
    padding-left: 18px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
    margin-top: var(--space-5);
}

.image-grid img,
article img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
}

.figure-caption {
    color: var(--subtle);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.4;
    margin-top: var(--space-2);
}

footer {
    border-top: 1px solid var(--line);
    padding: var(--space-4) 0;
}

footer .container {
    align-items: center;
    color: var(--subtle);
    display: flex;
    font-family: var(--font-mono);
    font-size: 12px;
    gap: var(--space-4);
    justify-content: space-between;
}

.social-links {
    display: flex;
    gap: var(--space-4);
}

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

@media (max-width: 860px) {
    .container {
        width: min(calc(100% - 32px), var(--max-width));
    }

    header .container {
        position: relative;
    }

    .hamburger {
        display: flex;
    }

    nav {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        min-width: 0;
        border-top: 1px solid var(--ink);
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.98);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--space-2) 0 var(--space-3);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
        visibility: hidden;
    }

    nav.open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        transition-delay: 0s;
        visibility: visible;
    }

    .nav-link,
    .language-switch {
        align-items: center;
        border-bottom: 1px solid var(--line);
        display: flex;
        justify-content: space-between;
        min-height: 48px;
        padding: 0;
    }

    nav a:last-child {
        border-bottom: 0;
    }

    .nav-link::after {
        bottom: -1px;
        height: 1px;
    }

    nav.open a {
        animation: mobile-menu-item 240ms ease both;
    }

    nav.open a:nth-child(2) {
        animation-delay: 35ms;
    }

    nav.open a:nth-child(3) {
        animation-delay: 70ms;
    }

    nav.open a:nth-child(4) {
        animation-delay: 105ms;
    }

    main {
        padding: var(--space-7) 0;
    }

    .hero,
    .section-heading,
    .grid-12 {
        display: block;
    }

    .hero {
        min-height: auto;
        padding-bottom: var(--space-6);
    }

    .hero-side {
        border-left: 0;
        border-top: 1px solid var(--line);
        margin-top: var(--space-7);
        padding-left: 0;
        padding-top: var(--space-4);
    }

    .section-heading p {
        margin-top: var(--space-4);
    }

    .item {
        grid-template-columns: 56px minmax(0, 1fr);
        gap: var(--space-4);
    }

    .item-action,
    .demo-link {
        grid-column: 2;
        justify-self: start;
        text-align: left;
    }

    .module-grid,
    .image-grid {
        grid-template-columns: 1fr;
    }

    footer .container {
        align-items: flex-start;
        flex-direction: column;
    }
}

@keyframes mobile-menu-item {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

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

@media (prefers-reduced-motion: reduce) {
    .hamburger,
    .hamburger span,
    nav,
    nav.open a {
        animation: none;
        transition: none;
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: 42px;
    }

    h2 {
        font-size: 30px;
    }

    .lead {
        font-size: 16px;
    }
}
