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

:root {
    color-scheme: dark light;
    --bg: #050505;
    --fg: #f7f7f3;
    --muted: rgba(247, 247, 243, 0.62);
    --quiet: rgba(247, 247, 243, 0.42);
    --line: rgba(247, 247, 243, 0.16);
    --panel: rgba(247, 247, 243, 0.055);
    --panel-strong: rgba(247, 247, 243, 0.1);
    --button-bg: rgba(247, 247, 243, 0.06);
    --button-hover: rgba(247, 247, 243, 0.11);
    --shadow: rgba(0, 0, 0, 0.38);
    --particle-strong: rgba(247, 247, 243, 0.92);
    --particle-soft: rgba(247, 247, 243, 0.32);
    --logo-filter: brightness(0) invert(1);
    --max: 920px;
    --nav-h: 70px;
    --radius: 8px;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f7f6f1;
        --fg: #10100f;
        --muted: rgba(16, 16, 15, 0.64);
        --quiet: rgba(16, 16, 15, 0.44);
        --line: rgba(16, 16, 15, 0.14);
        --panel: rgba(16, 16, 15, 0.04);
        --panel-strong: rgba(16, 16, 15, 0.075);
        --button-bg: rgba(16, 16, 15, 0.05);
        --button-hover: rgba(16, 16, 15, 0.09);
        --shadow: rgba(16, 16, 15, 0.16);
        --particle-strong: rgba(16, 16, 15, 0.82);
        --particle-soft: rgba(16, 16, 15, 0.28);
        --logo-filter: brightness(0);
    }
}

html {
    min-height: 100%;
    background: var(--bg);
    color: var(--fg);
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, Monaco, monospace;
    font-weight: 200;
    letter-spacing: 0;
    text-transform: lowercase;
    overflow-x: hidden;
}

a {
    color: inherit;
}

button,
input,
textarea {
    font: inherit;
}

.particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 560ms ease;
}

.particle-canvas.is-visible {
    opacity: 1;
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: var(--nav-h);
    padding: 18px clamp(18px, 4vw, 40px);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.logo-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none;
}

.logo-link img {
    display: block;
    width: 82px;
    height: auto;
    filter: var(--logo-filter);
}

.top-nav nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(12px, 2.2vw, 24px);
    overflow-x: auto;
    scrollbar-width: none;
}

.copy-ticker {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 45;
    height: 34px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 220ms ease, transform 260ms ease;
}

.app-open .copy-ticker {
    opacity: 1;
    transform: translateY(0);
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: tickerMove 18s linear infinite;
}

.ticker-track span {
    flex: 0 0 auto;
    padding-right: 0;
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.top-nav nav::-webkit-scrollbar {
    display: none;
}

.top-nav nav a {
    flex: 0 0 auto;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.86rem;
    transition: color 180ms ease;
}

.top-nav nav a:hover,
.top-nav nav a.active {
    color: var(--fg);
}

main {
    position: relative;
    z-index: 1;
}

.section {
    width: min(var(--max), calc(100vw - 36px));
    margin: 0 auto;
}

.hero {
    min-height: 88svh;
    display: grid;
    place-items: center;
    padding: 116px 0 44px;
    text-align: center;
}

.home-hero {
    min-height: 100svh;
    padding-bottom: 38px;
}

.app-open .home-hero {
    min-height: 100svh;
    place-items: start center;
    padding-top: calc(var(--nav-h) + 58px);
}

.home-stack {
    width: 100%;
    display: grid;
    justify-items: center;
    gap: clamp(24px, 5vw, 46px);
}

.hero.compact {
    min-height: auto;
    padding: 132px 0 54px;
}

.hero-icon {
    width: clamp(92px, 18vw, 136px);
    height: clamp(92px, 18vw, 136px);
    border-radius: 28px;
    object-fit: cover;
    margin: 0 auto 28px;
    box-shadow: 0 22px 80px var(--shadow);
}

h1 {
    margin: 0;
    font-size: clamp(2.15rem, 8vw, 4.65rem);
    line-height: 1.05;
    font-weight: 200;
    letter-spacing: 0;
}

.hero-lines {
    display: grid;
    gap: 0.42em;
    transition: opacity 240ms ease, transform 300ms cubic-bezier(0.16, 1, 0.3, 1), max-height 320ms ease, margin 320ms ease;
}

.hero-lines span {
    display: block;
}

.has-js .hero-lines span {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    filter: blur(8px);
    transition:
        opacity 420ms ease,
        transform 520ms cubic-bezier(0.18, 0.9, 0.2, 1),
        filter 520ms ease;
}

.has-js .hero-lines span.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.app-open .hero-lines {
    max-height: 0;
    margin: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-16px) scale(0.96);
}

.lead {
    max-width: 42rem;
    margin: 18px auto 0;
    color: var(--muted);
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    line-height: 1.65;
}

.byline {
    margin: 10px 0 0;
    color: var(--quiet);
    font-size: 0.82rem;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.app-open .actions {
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--button-bg);
    color: var(--fg);
    text-decoration: none;
    white-space: nowrap;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--fg) 42%, transparent);
    background: var(--button-hover);
}

.btn.primary {
    background: var(--fg);
    color: var(--bg);
}

.app-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 8vw, 92px);
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 14px 0;
}

.app-open .app-grid {
    gap: clamp(18px, 5vw, 56px);
    padding: 4px 0;
}

.app-card {
    appearance: none;
    border: 0;
    border-radius: 30px;
    background: transparent;
    color: var(--fg);
    width: clamp(76px, 14vw, 112px);
    height: clamp(76px, 14vw, 112px);
    padding: 0;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    will-change: transform, opacity;
    transition: filter 180ms ease;
}

.app-open .app-card {
    width: clamp(58px, 9vw, 78px);
    height: clamp(58px, 9vw, 78px);
}

.has-js .app-card {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.88);
    transition:
        opacity 320ms ease,
        transform 420ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 180ms ease;
}

.icons-ready .app-card {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.icons-ready .app-card:nth-child(2) {
    transition-delay: 55ms;
}

.icons-ready .app-card:nth-child(3) {
    transition-delay: 110ms;
}

.icons-ready.app-open .app-card,
.app-card.is-selected {
    transition-delay: 0ms !important;
}

.app-card:hover,
.app-card.is-active {
    filter: brightness(1.08);
}

.app-card.is-selected {
    opacity: 0 !important;
    pointer-events: none;
    transform: translate3d(0, -8px, 0) scale(0.78) !important;
}

.app-card img,
.stage-icon,
.inline-icon {
    width: clamp(76px, 14vw, 112px);
    height: clamp(76px, 14vw, 112px);
    border-radius: clamp(18px, 3vw, 28px);
    object-fit: cover;
    box-shadow: 0 18px 56px var(--shadow);
}

.app-open .app-card img {
    width: clamp(58px, 9vw, 78px);
    height: clamp(58px, 9vw, 78px);
    border-radius: clamp(14px, 2.4vw, 20px);
}

.app-stage {
    max-width: 620px;
    margin: 0 auto;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    text-align: center;
    box-shadow: 0 24px 80px var(--shadow);
    transform-origin: top center;
}

.app-open .app-stage {
    max-width: 560px;
    padding: 22px;
}

.app-stage[hidden] {
    display: none;
}

.app-stage.is-entering {
    animation: stageIn 320ms ease both;
}

.stage-icon {
    margin: 0 auto 18px;
    width: 92px;
    height: 92px;
    border-radius: 23px;
}

.app-open .stage-icon {
    width: 74px;
    height: 74px;
    margin-bottom: 14px;
    border-radius: 19px;
}

.stage-title {
    margin: 0;
    font-size: clamp(1.7rem, 5vw, 2.65rem);
    font-weight: 200;
    letter-spacing: 0;
}

.app-open .stage-title {
    font-size: clamp(1.35rem, 4vw, 2.15rem);
}

.stage-copy {
    max-width: 36rem;
    margin: 14px auto 0;
    color: var(--muted);
    line-height: 1.65;
}

.app-open .stage-copy {
    margin-top: 10px;
    font-size: 0.94rem;
}

.features {
    padding: 22px 0 104px;
}

.features h2 {
    margin: 0 0 24px;
    color: var(--quiet);
    text-align: center;
    font-size: 0.92rem;
    font-weight: 200;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(214px, 1fr));
    gap: 16px;
}

.feature {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 19px;
    background: var(--panel);
}

.feature h3 {
    margin: 0 0 8px;
    font-size: 0.96rem;
    font-weight: 400;
}

.feature p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.page-footer {
    position: relative;
    z-index: 1;
    padding: 42px 18px 58px;
    text-align: center;
    color: var(--quiet);
    font-size: 0.76rem;
}

.contact-shell {
    width: min(640px, calc(100vw - 36px));
    margin: 0 auto;
    padding: 132px 0 80px;
}

.contact-shell h1 {
    text-align: center;
}

.contact-shell .lead {
    text-align: center;
}

.contact-form {
    display: grid;
    gap: 18px;
    margin-top: 34px;
}

.contact-form .btn {
    justify-self: start;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    color: var(--muted);
    font-size: 0.86rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--fg);
    padding: 12px;
    text-transform: lowercase;
}

.form-group textarea {
    min-height: 124px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--fg) 42%, transparent);
}

.form-status {
    min-height: 1.2em;
    color: var(--quiet);
    font-size: 0.86rem;
}

.form-status.success {
    color: #4c9f63;
}

.form-status.error {
    color: #bd4d4d;
}

.contact-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 42px;
}

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

.contact-links a:hover {
    color: var(--fg);
}

.blog-shell {
    width: min(var(--max), calc(100vw - 36px));
    margin: 0 auto;
    padding: 132px 0 96px;
}

.blog-shell .lead {
    text-align: center;
}

.blog-list {
    display: grid;
    gap: 16px;
    margin-top: 42px;
}

.blog-post {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--fg);
    padding: 22px;
    text-decoration: none;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.blog-post:hover {
    border-color: color-mix(in srgb, var(--fg) 34%, transparent);
    background: var(--panel-strong);
    transform: translateY(-1px);
}

.post-kicker {
    color: var(--quiet);
    font-size: 0.76rem;
}

.blog-post h2 {
    margin: 0;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 200;
    letter-spacing: 0;
}

.blog-post p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.blog-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.blog-topics span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 9px;
    color: var(--quiet);
    font-size: 0.72rem;
}

.article-shell {
    width: min(760px, calc(100vw - 36px));
    margin: 0 auto;
    padding: 132px 0 102px;
}

.article-meta {
    margin: 0 0 18px;
    color: var(--quiet);
    font-size: 0.78rem;
}

.article-shell .lead {
    margin-left: 0;
    text-align: left;
}

.article-body {
    margin-top: 54px;
}

.article-body h2 {
    margin: 54px 0 14px;
    font-size: clamp(1.34rem, 4vw, 2rem);
    font-weight: 200;
    letter-spacing: 0;
}

.article-body p,
.article-body li {
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.75;
}

.article-body p {
    margin: 0 0 20px;
}

.article-body ul {
    margin: 0 0 24px;
    padding-left: 1.2rem;
}

.article-body code,
.article-body pre {
    text-transform: none;
}

.article-body code {
    color: var(--fg);
}

.article-body pre {
    overflow-x: auto;
    margin: 22px 0 28px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--fg);
    line-height: 1.55;
}

.article-body pre code {
    font-size: 0.82rem;
}

.article-note {
    margin: 32px 0;
    padding: 18px 0 18px 18px;
    border-left: 1px solid var(--line);
    color: var(--muted);
}

@keyframes stageIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tickerMove {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

@media (max-width: 680px) {
    :root {
        --nav-h: 62px;
    }

    .top-nav {
        padding: 14px 16px;
        align-items: center;
    }

    .logo-link img {
        width: 64px;
    }

    .top-nav nav {
        max-width: calc(100vw - 104px);
        padding: 0;
        justify-content: flex-start;
    }

    .top-nav nav a {
        font-size: 0.8rem;
    }

    .hero {
        min-height: 86svh;
        padding-top: 104px;
    }

    .home-hero {
        min-height: 100svh;
        padding-top: 112px;
    }

    .app-grid {
        gap: clamp(14px, 8vw, 34px);
    }

    .app-card {
        width: 76px;
        height: 76px;
    }

    .app-card img,
    .inline-icon {
        width: 76px;
        height: 76px;
        border-radius: 18px;
    }

    .app-stage {
        padding: 22px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
