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

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: Geist, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #010101;
}

button {
    font: inherit;
    border: 0;
    cursor: pointer;
}

a {
    text-decoration: none;
}

/* Brand colours sampled from the current cedar logo */
:root {
    --cedar: #256b45;
    --cedar-cream: #faf7f0;
    /* Accent tracks the text flip below: the flat brand green reads well on
       the white capsule and the light mobile video, but goes muddy against
       the darker desktop frame, so it lifts to a tint at lg. */
    --accent: #256b45;
}

@media (min-width: 1024px) {
    :root {
        /* saturated enough to hold up over the brightest video frames */
        --accent: #62c08d;
    }
}

/* ---------- hero shell ---------- */
/* Small screens: fill the viewport but grow if the content needs it, so
   nothing is ever clipped on a short phone. Locked to a single
   non-scrolling screen at lg+ (see the lg block below). */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* dvh accounts for mobile browser chrome */
@supports (min-height: 100dvh) {
    .hero {
        min-height: 100dvh;
    }
}

.hero-video {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.hero-inner {
    position: relative;
    z-index: 10;
    display: flex;
    flex: 1;
    flex-direction: column;
}

/* ---------- responsive colour flips ---------- */
/* The video reads light behind the stacked mobile layout and dark behind
   the desktop layout, so text inverts at the lg breakpoint. */
.flip {
    color: #010101;
}
.flip-80 {
    color: rgba(1, 1, 1, 0.8);
}
.flip-70 {
    color: rgba(1, 1, 1, 0.7);
}
.flip-60 {
    color: rgba(1, 1, 1, 0.6);
}

@media (min-width: 1024px) {
    .flip {
        color: #fff;
    }
    .flip-80 {
        color: rgba(255, 255, 255, 0.8);
    }
    .flip-70 {
        color: rgba(255, 255, 255, 0.7);
    }
    .flip-60 {
        color: rgba(255, 255, 255, 0.6);
    }
}

/* ---------- shared tokens ---------- */
.cta-gradient {
    background: linear-gradient(to bottom, #2b2b2b, #101010);
    color: #fff;
    transition: opacity 150ms ease;
}
.cta-gradient:hover {
    opacity: 0.9;
}

.glass {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

/* ---------- nav ---------- */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-mark {
    height: 28px;
    width: 28px;
    flex-shrink: 0;
    border-radius: 0.375rem;
}

.brand-name {
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.nav-desktop {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 9999px;
    padding: 0.375rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 9999px;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    transition:
        color 150ms ease,
        background-color 150ms ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-cta {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0 1.25rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    white-space: nowrap;
    background: #fff;
    color: #010101;
    transition: opacity 150ms ease;
}

.nav-cta:hover {
    opacity: 0.9;
}

/* ---------- hamburger ---------- */
.burger {
    position: relative;
    z-index: 50;
    height: 2.5rem;
    width: 2.5rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.burger svg {
    position: absolute;
    height: 20px;
    width: 20px;
    transition: all 300ms ease;
}

.icon-menu {
    transform: rotate(0deg) scale(1);
    opacity: 1;
}
.icon-x {
    transform: rotate(-90deg) scale(0);
    opacity: 0;
    /* stays legible against the near-black drawer behind it */
    color: #fff;
}

.menu-open .icon-menu {
    transform: rotate(90deg) scale(0);
    opacity: 0;
}
.menu-open .icon-x {
    transform: rotate(0deg) scale(1);
    opacity: 1;
}

/* ---------- mobile overlay + drawer ---------- */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.menu-open .overlay {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    right: 0;
    top: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 18rem;
    background: rgba(0, 0, 0, 0.9);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    transform: translateX(100%);
    /* visibility keeps the off-screen drawer out of the tab order; it flips
       only once the slide-out has finished. `inert` in the markup covers the
       same ground for assistive tech. */
    visibility: hidden;
    transition:
        transform 500ms cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s linear 500ms;
}

.menu-open .drawer {
    transform: translateX(0);
    visibility: visible;
    transition:
        transform 500ms cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s;
}

.drawer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 6rem 1.5rem 0;
}

.drawer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    opacity: 0;
    transform: translateX(24px);
    transition:
        opacity 300ms ease,
        transform 300ms ease,
        background-color 150ms ease,
        color 150ms ease;
    transition-delay: 0ms;
}

.drawer-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* --stagger is set per link in the markup, so they fan in on open but all
   snap back together on close */
.menu-open .drawer-link {
    opacity: 1;
    transform: translateX(0);
    transition-delay: var(--stagger);
}

.drawer-footer {
    margin-top: auto;
    padding: 0 1.5rem 2.5rem;
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 400ms ease,
        transform 400ms ease;
    transition-delay: 0ms;
}

.menu-open .drawer-footer {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 300ms;
}

.drawer-cta {
    display: block;
    width: 100%;
    border-radius: 9999px;
    padding: 0.875rem 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
}

/* ---------- main content ---------- */
.main {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0 1.25rem 2rem;
}

.main-left {
    min-width: 0;
}

.headline {
    margin: 0;
    max-width: 36rem;
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.subhead {
    margin: 0.875rem 0 0;
    max-width: 32rem;
    font-size: 0.875rem;
    line-height: 1.625;
}

/* only break the headline once there is room for two long lines */
.lg-break {
    display: none;
}

/* ---------- version switcher ---------- */
.version {
    position: relative;
    z-index: 20;
}

.version-toggle {
    display: flex;
    align-items: flex-end;
    gap: 0.3125rem;
    padding: 0;
    background: none;
    text-align: left;
    color: inherit;
}

.version-chevron {
    width: 0.875rem;
    height: 0.5rem;
    margin-bottom: 0.625rem;
    flex-shrink: 0;
    /* keeps the pixel edges hard instead of antialiasing them */
    shape-rendering: crispEdges;
    transition: transform 200ms ease;
}

.version-open .version-chevron {
    transform: rotate(180deg);
}

/* opens upward: the card is anchored to the bottom of the hero */
.version-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin: 0 0 0.625rem;
    padding: 0.375rem;
    min-width: 11rem;
    list-style: none;
    border: 1px solid rgba(250, 247, 240, 0.12);
    border-radius: 0.75rem;
    background: rgba(10, 10, 11, 0.95);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        visibility 0s linear 180ms;
}

.version-open .version-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition:
        opacity 180ms ease,
        transform 180ms ease,
        visibility 0s;
}

.version-menu a {
    display: block;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: rgba(250, 247, 240, 0.8);
    transition:
        background-color 150ms ease,
        color 150ms ease;
}

.version-menu a:hover {
    background: rgba(250, 247, 240, 0.08);
    color: var(--cedar-cream);
}

.version-menu a[aria-current] {
    color: var(--cedar-cream);
    font-weight: 600;
}

/* ---------- install command ---------- */
.install {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.install-code {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.75rem 1.25rem;
    font-family: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #111827;
    white-space: nowrap;
}

.install-code .prompt {
    color: var(--cedar);
    font-weight: 500;
}

.install-copy {
    border-radius: 0.375rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
}

/* ---------- glass cards ---------- */
.cards {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 1rem;
}

.card {
    border-radius: 1rem;
    padding: 1.25rem;
}

.card-stats {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-number {
    font-family: Silkscreen, cursive;
    font-weight: 400;
    font-size: 1.875rem;
    line-height: 2.25rem;
    letter-spacing: -0.025em;
}

/* "Version 5.0" on one line is wider than the card, so the word sits above
   the number and the number keeps its display size */
.stat-label {
    display: block;
    font-size: 0.8125rem;
    line-height: 1.5;
    letter-spacing: 0.04em;
    opacity: 0.7;
}

.stat-body {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    line-height: 1.625;
}

/* ---------- sm: 640px ---------- */
@media (min-width: 640px) {
    .nav {
        padding: 1.5rem 2rem;
    }

    .main {
        gap: 2rem;
        padding: 0 2rem 3rem;
    }

    .headline {
        font-size: 2.25rem;
    }

    /* the input and button merge into one white capsule */
    .install {
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        align-self: flex-start;
        gap: 0;
        border-radius: 0.5rem;
        background: #fff;
        padding: 0.375rem;
        margin-top: 2rem;
    }

    .install-code {
        width: auto;
        border-radius: 0;
        background: transparent;
        padding: 0.5rem 1rem;
    }

    .install-copy {
        padding: 0.625rem 1.5rem;
    }

    .cards {
        flex-direction: row;
    }

    .card {
        width: 16rem;
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }

    .stat-body {
        margin-top: 1rem;
    }
}

/* ---------- md: 768px ---------- */
@media (min-width: 768px) {
    .nav-desktop {
        display: flex;
    }

    .burger {
        display: none;
    }
}

/* ---------- lg: 1024px ---------- */
@media (min-width: 1024px) {
    /* the hero is exactly one screen; the page scrolls past it */
    .hero {
        height: 100vh;
        overflow: hidden;
    }

    .nav {
        padding-left: 3rem;
        padding-right: 3rem;
    }

    .main {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 2.5rem;
        padding: 0 3rem 4rem;
    }

    .headline {
        font-size: 2.5rem;
        max-width: 26rem;
    }

    .lg-break {
        display: inline;
    }

    .subhead {
        max-width: 26rem;
    }

    .cards {
        width: auto;
        flex-shrink: 0;
        gap: 1.25rem;
    }
}

/* ---------- xl: 1280px ---------- */
@media (min-width: 1280px) {
    .headline {
        font-size: 3.5rem;
        max-width: 36rem;
    }

    .subhead {
        max-width: 32rem;
    }
}

/* ---------- phones: tighten so it lands in one screen ---------- */
@media (max-width: 639px) {
    .main {
        gap: 1.25rem;
        padding-bottom: 1.75rem;
    }

    .headline {
        font-size: 1.75rem;
    }

    .subhead {
        margin-top: 0.75rem;
        font-size: 0.8125rem;
    }

    .install {
        margin-top: 1.25rem;
    }

    .cards {
        gap: 0.75rem;
    }

    .card {
        padding: 1.125rem;
    }

    .stat-body {
        margin-top: 0.625rem;
    }
}

/* =================================================================
   Below the hero: dark bands, cream text, cedar-green accents.
   These sections are self-contained and do not use the .flip system.
   ================================================================= */

.band {
    background: #0b0b0c;
    color: var(--cedar-cream);
    padding: 4rem 0;
}

.wrap {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.wrap-center {
    text-align: center;
}

.band-title {
    margin: 0;
    font-size: 1.625rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    max-width: 34rem;
}

.wrap-center .band-title {
    max-width: none;
}

.band-lede {
    margin: 1rem 0 0;
    max-width: 44rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: rgba(250, 247, 240, 0.65);
}

.wrap-center .band-lede {
    margin-left: auto;
    margin-right: auto;
}

.band-note {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.7;
    color: rgba(250, 247, 240, 0.55);
    text-align: center;
}

.band-note-left {
    margin-top: 1.75rem;
    max-width: 44rem;
    text-align: left;
}

/* ---------- three-up tiles ---------- */
.triple {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.tile {
    border: 1px solid rgba(250, 247, 240, 0.1);
    border-radius: 1rem;
    background: rgba(250, 247, 240, 0.03);
    padding: 1.5rem;
}

.tile-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.tile-body {
    margin: 0.625rem 0 0;
    font-size: 0.875rem;
    line-height: 1.7;
    color: rgba(250, 247, 240, 0.6);
}

/* ---------- sponsors ---------- */
/* no outer frame; the individual sponsor cards carry the structure */
.trust-card {
    margin-bottom: 3.5rem;
}

.trust-note {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(250, 247, 240, 0.85);
    text-align: center;
}

.sponsor-row {
    display: grid;
    gap: 1rem;
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
}

.sponsor-item {
    border: 1px solid rgba(250, 247, 240, 0.09);
    border-radius: 0.875rem;
    transition:
        border-color 150ms ease,
        background-color 150ms ease;
}

.sponsor-item:hover {
    border-color: rgba(250, 247, 240, 0.2);
    background: rgba(250, 247, 240, 0.03);
}

.sponsor-item a {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    color: var(--cedar-cream);
}

/* Only the dark and transparent marks get a light backing; the colourful
   ones read fine straight on the band, same as the docs site does it. */
.sponsor-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    width: 3rem;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.375rem;
}

.sponsor-chip img,
.sponsor-mark {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.sponsor-mark {
    height: 3rem;
    width: 3rem;
    flex-shrink: 0;
}

.sponsor-name {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ---------- code panels ---------- */
.code-panel {
    margin: 2rem 0 0;
    border: 1px solid rgba(250, 247, 240, 0.1);
    border-radius: 0.875rem;
    background: #08080a;
    overflow: hidden;
}

.code-tab {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid rgba(250, 247, 240, 0.08);
    background: rgba(250, 247, 240, 0.03);
    font-family: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
    font-size: 0.75rem;
    color: rgba(250, 247, 240, 0.55);
}

.code {
    margin: 0;
    padding: 1rem;
    font-family: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
    font-size: 0.75rem;
    line-height: 1.75;
    color: rgba(250, 247, 240, 0.85);
    overflow-x: auto;
}

.code-grid {
    display: grid;
    gap: 1rem;
}

/* syntax tokens */
.c-key {
    color: #a58bff;
}
.c-type {
    color: #6fb3ff;
}
.c-str {
    color: #8fd694;
}
.c-fn {
    color: #f2d478;
}
.c-dir {
    color: #f0a868;
}
.c-ok {
    color: var(--accent);
}
.c-dim {
    color: rgba(250, 247, 240, 0.45);
}

/* ---------- final cta ---------- */
.band-cta {
    border-top: 1px solid rgba(250, 247, 240, 0.08);
}

/* inline-flex, so .wrap-center's text-align does the centring */
.install-dark {
    margin-top: 2rem;
}

/* ---------- footer ---------- */
.footer {
    background: #08080a;
    border-top: 1px solid rgba(250, 247, 240, 0.08);
    color: var(--cedar-cream);
    padding: 3rem 0 2rem;
}

.footer-grid {
    display: grid;
    gap: 2rem;
}

.footer .brand-name {
    color: var(--cedar-cream);
}

.footer-tagline {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(250, 247, 240, 0.5);
    max-width: 18rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.footer-head {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(250, 247, 240, 0.45);
}

.footer-col a {
    font-size: 0.875rem;
    color: rgba(250, 247, 240, 0.7);
    transition: color 150ms ease;
}

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

.footer-base {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
}

.footer-base p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(250, 247, 240, 0.4);
}

/* ---------- band breakpoints ---------- */
@media (min-width: 640px) {
    .band {
        padding: 5rem 0;
    }

    .wrap {
        padding: 0 2rem;
    }

    .band-title {
        font-size: 2rem;
    }

    .triple {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

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

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

    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .band {
        padding: 7rem 0;
    }

    .wrap {
        padding: 0 3rem;
    }

    .band-title {
        font-size: 2.5rem;
    }

    .band-lede {
        font-size: 1rem;
    }

    .sponsor-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.25rem;
    }
}
