@font-face {
    font-family: "JetBrains Mono";
    src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("/fonts/JetBrainsMono-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("/fonts/JetBrainsMono-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    --bg: #e8f1fa;
    --bg-2: #dce9f6;
    --surface: #f8fbff;
    --surface-2: #eef6fd;
    --border: #c8d8e7;
    --text: #15212c;
    --muted: #53677a;
    --accent: #1f8fff;
    --accent-strong: #0a6fd6;
    --accent-soft: #cfe6ff;
    --yellow: #ffc400;
    --orange: #f5a623;
    --green: #3fae6b;
    --danger: #bd3a3a;
    --success: #1d7249;
    --shadow: 0 18px 40px rgba(18, 54, 88, 0.08);
    --petal-fill: #ffffff;
    --petal-stroke: #c4d4e2;
    --radius: 16px;
    --radius-lg: 24px;
    --shell: 1120px;
    --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0e141a;
        --bg-2: #0a0f14;
        --surface: #151d25;
        --surface-2: #1a242e;
        --border: #26323e;
        --text: #e7eef6;
        --muted: #97a8b8;
        --accent: #4aa8ff;
        --accent-strong: #79c2ff;
        --accent-soft: #15293d;
        --green: #5fd08a;
        --danger: #ff8585;
        --success: #6fd9a1;
        --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
        --petal-fill: #ffffff;
        --petal-stroke: #2a3641;
    }
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e141a;
    --bg-2: #0a0f14;
    --surface: #151d25;
    --surface-2: #1a242e;
    --border: #26323e;
    --text: #e7eef6;
    --muted: #97a8b8;
    --accent: #4aa8ff;
    --accent-strong: #79c2ff;
    --accent-soft: #15293d;
    --green: #5fd08a;
    --danger: #ff8585;
    --success: #6fd9a1;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --petal-fill: #ffffff;
    --petal-stroke: #2a3641;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        url("/img/pattern-light.svg"),
        radial-gradient(1000px 560px at 85% -10%, var(--accent-soft), transparent 70%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
    background-size: 540px 540px, auto, auto;
    background-repeat: repeat, no-repeat, no-repeat;
}

[data-theme="dark"] body {
    background-image:
        url("/img/pattern-dark.svg"),
        radial-gradient(1000px 560px at 85% -10%, rgba(74, 168, 255, 0.12), transparent 70%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) body {
        background-image:
            url("/img/pattern-dark.svg"),
            radial-gradient(1000px 560px at 85% -10%, rgba(74, 168, 255, 0.12), transparent 70%),
            linear-gradient(180deg, var(--bg), var(--bg-2));
    }
}

img,
svg {
    max-width: 100%;
}

a {
    color: var(--accent-strong);
    text-decoration: none;
    text-underline-offset: 3px;
}

a:hover {
    text-decoration: underline;
}

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

h1,
h2,
h3 {
    line-height: 1.18;
    letter-spacing: -0.03em;
    font-weight: 600;
}

h1 {
    font-size: clamp(2.4rem, 6.4vw, 4.8rem);
}

h2 {
    font-size: clamp(1.7rem, 3.6vw, 2.7rem);
}

h3 {
    font-size: 1.1rem;
}

.shell {
    width: min(100% - 40px, var(--shell));
    margin-inline: auto;
}

.section {
    padding: 78px 0;
    border-top: 1px solid transparent;
}

.section-head {
    display: grid;
    gap: 12px;
    max-width: 760px;
    margin-bottom: 40px;
}

.section-head h2,
.download-grid h2,
.feedback-card h2 {
    text-wrap: balance;
}

.kicker {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.lead {
    max-width: 720px;
    color: var(--muted);
    font-size: 1.02rem;
    white-space: pre-line;
}

.note {
    margin-top: 24px;
    color: var(--muted);
    font-size: 0.88rem;
    white-space: pre-line;
}

.note--accent {
    border-left: 3px solid var(--yellow);
    padding-left: 16px;
    color: var(--text);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.button:hover {
    text-decoration: none;
    transform: translateY(-1px);
    border-color: var(--accent);
}

.button-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.button-primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.button-ghost {
    background: transparent;
}

.button-disabled {
    cursor: default;
    color: var(--muted);
    background: var(--surface-2);
    border-style: dashed;
}

.button-disabled:hover {
    transform: none;
    border-color: var(--border);
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.brand:hover {
    text-decoration: none;
}

.brand-name {
    font-size: 1.02rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-inline: auto;
    font-size: 0.86rem;
}

.site-nav a {
    position: relative;
    color: var(--muted);
}

.site-nav a:hover {
    color: var(--text);
    text-decoration: none;
}

.site-nav a.is-active {
    color: var(--text);
    text-decoration: none;
}

.site-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -7px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--muted);
}

.lang-switch a {
    padding: 4px 2px;
    color: var(--muted);
}

.lang-switch a.is-active {
    color: var(--text);
    font-weight: 600;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--accent);
}

.theme-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-icon-sun {
    display: none;
}

.theme-icon-moon {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-icon-sun {
        display: block;
    }

    :root:not([data-theme="light"]) .theme-icon-moon {
        display: none;
    }
}

[data-theme="dark"] .theme-icon-sun {
    display: block;
}

[data-theme="dark"] .theme-icon-moon {
    display: none;
}

[data-theme="light"] .theme-icon-sun {
    display: none;
}

[data-theme="light"] .theme-icon-moon {
    display: block;
}

/* Hero */

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

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    align-items: center;
    gap: 32px;
}

.hero-copy {
    max-width: 640px;
}

.hero-copy h1 {
    margin-bottom: 20px;
}

.hero-copy .lead {
    font-size: 1.08rem;
}

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

.hero-note {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.86rem;
}

.hero-platforms {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.hero-art::before {
    content: "";
    position: absolute;
    width: min(70%, 360px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft), transparent 68%);
    filter: blur(8px);
}

.logo {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.logo--mark {
    width: 42px;
    height: 42px;
}

.logo--footer {
    width: 38px;
    height: 38px;
}

.logo--hero {
    position: relative;
    width: clamp(220px, 30vw, 360px);
    filter: drop-shadow(0 20px 40px rgba(31, 143, 255, 0.18));
}

.logo--download {
    width: 220px;
}

/* Steps */

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 0;
    list-style: none;
}

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

.step {
    position: relative;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-bottom: 16px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 600;
}

.step h3 {
    margin-bottom: 8px;
}

.step p {
    color: var(--muted);
    font-size: 0.9rem;
    white-space: pre-line;
}

/* Features */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.feature-card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.feature-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature-card h3 {
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--muted);
    font-size: 0.9rem;
    white-space: pre-line;
}

/* Screenshots */

.shot-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.shot {
    display: grid;
    gap: 12px;
    justify-items: center;
}

.phone {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 36px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.phone img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 28px;
    background: var(--surface-2);
}

.shot figcaption {
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}

/* Download */

.download-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(200px, 0.8fr);
    align-items: center;
    gap: 32px;
}

.store-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 8px 18px 8px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: #0b0d10;
    color: #ffffff;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.store-badge:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 33, 51, 0.18);
}

.store-badge--rustore {
    background: linear-gradient(135deg, #0b0d10, #241542);
}

.store-badge__icon {
    display: inline-flex;
    width: 26px;
    height: 26px;
    flex: none;
}

.store-badge__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.store-badge__text {
    display: flex;
    flex-direction: column;
    line-height: 1.12;
}

.store-badge__text small {
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.72;
}

.store-badge__text strong {
    font-size: 0.98rem;
    font-weight: 600;
}

.store-badge--disabled {
    border-color: var(--border);
    background: transparent;
    color: var(--muted);
    cursor: default;
}

.store-badge--disabled:hover {
    transform: none;
    box-shadow: none;
}

.store-badge--disabled .store-badge__icon {
    opacity: 0.55;
}

.download-art {
    display: flex;
    justify-content: center;
}

.section--feedback {
    padding-top: 24px;
}

.feedback-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.feedback-card .lead {
    margin-top: 8px;
}

/* Legal */

.legal-shell {
    max-width: 860px;
}

.legal-head {
    margin-bottom: 32px;
}

.legal-head h1 {
    margin-top: 16px;
    font-size: clamp(2rem, 4.4vw, 3.2rem);
}

.back-link {
    font-size: 0.84rem;
    color: var(--muted);
}

.meta {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.82rem;
}

.prose {
    font-size: 0.95rem;
    line-height: 1.8;
}

.prose h2 {
    margin: 40px 0 14px;
    font-size: 1.28rem;
}

.prose h3 {
    margin: 26px 0 10px;
    font-size: 1.02rem;
}

.prose p {
    margin: 0 0 14px;
    color: var(--text);
}

.prose ul,
.prose ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.prose li {
    margin-bottom: 6px;
}

.prose a {
    overflow-wrap: anywhere;
}

.prose blockquote {
    margin: 18px 0;
    padding: 12px 18px;
    border-left: 3px solid var(--yellow);
    background: var(--surface-2);
}

.prose hr {
    margin: 28px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.legal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 44px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

/* Form */

.form-shell {
    max-width: 720px;
}

.form {
    display: grid;
    gap: 20px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.field {
    display: grid;
    gap: 8px;
}

.field label {
    font-size: 0.86rem;
    font-weight: 500;
}

.field input,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
}

.field textarea {
    resize: vertical;
    min-height: 160px;
}

.field input:focus,
.field textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.field-hint {
    color: var(--muted);
    font-size: 0.78rem;
}

.field-error,
.form-error {
    color: var(--danger);
    font-size: 0.8rem;
}

.form-error:empty {
    display: none;
}

.form-error ul {
    margin: 0;
    padding-left: 18px;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.86rem;
    color: var(--muted);
}

.checkbox input {
    margin-top: 4px;
    accent-color: var(--accent);
}

.form-success {
    margin-bottom: 24px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--success);
    border-radius: 12px;
    background: var(--surface);
    color: var(--success);
}

.form-info {
    margin-bottom: 24px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
}

.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Error */

.section--error {
    min-height: 55vh;
    display: flex;
    align-items: center;
}

.error-shell {
    max-width: 620px;
    text-align: center;
}

.error-code {
    margin-bottom: 12px;
    color: var(--accent-strong);
    font-size: 3.6rem;
    font-weight: 600;
    letter-spacing: -0.05em;
}

.error-shell .lead {
    margin: 14px auto 28px;
}

/* Footer */

.site-footer {
    padding: 44px 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: 28px;
    align-items: start;
}

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

.footer-brand strong {
    display: block;
    font-size: 0.95rem;
}

.footer-brand p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

.footer-nav {
    display: grid;
    gap: 8px;
    font-size: 0.86rem;
}

.footer-nav a {
    color: var(--muted);
}

.footer-meta {
    display: grid;
    gap: 8px;
    justify-items: end;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: right;
}

.footer-meta a {
    color: var(--muted);
}

/* Logo animation */

.petal-base {
    fill: var(--petal-fill);
    stroke: var(--petal-stroke);
    stroke-width: 2;
}

.petal-tint {
    fill: var(--green);
    opacity: 0;
}

.flower-center {
    fill: var(--yellow);
    stroke: var(--orange);
    stroke-width: 3;
}

.petal-tint {
    animation: petal-tint 1.7s ease-out both;
}

.flower-petals > g:nth-child(1) .petal-tint {
    animation-delay: 0ms;
}

.flower-petals > g:nth-child(2) .petal-tint {
    animation-delay: 80ms;
}

.flower-petals > g:nth-child(3) .petal-tint {
    animation-delay: 160ms;
}

.flower-petals > g:nth-child(4) .petal-tint {
    animation-delay: 240ms;
}

.flower-petals > g:nth-child(5) .petal-tint {
    animation-delay: 320ms;
}

.flower-petals > g:nth-child(6) .petal-tint {
    animation-delay: 400ms;
}

.flower-petals > g:nth-child(7) .petal-tint {
    animation-delay: 480ms;
}

.flower-petals > g:nth-child(8) .petal-tint {
    animation-delay: 560ms;
}

.flower-petals > g:nth-child(9) .petal-tint {
    animation-delay: 640ms;
}

.flower-petals > g:nth-child(10) .petal-tint {
    animation-delay: 720ms;
}

.flower-petals > g:nth-child(11) .petal-tint {
    animation-delay: 800ms;
}

.flower-petals > g:nth-child(12) .petal-tint {
    animation-delay: 880ms;
}

@keyframes petal-tint {
    0% {
        opacity: 0;
    }

    15% {
        opacity: 0.9;
    }

    55% {
        opacity: 0.45;
    }

    100% {
        opacity: 0;
    }
}

/* Accessibility */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 10px 16px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0 0 10px 0;
}

.skip-link:focus {
    left: 0;
}

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

/* Responsive */

@media (max-width: 980px) {
    .header-inner {
        flex-wrap: wrap;
        padding-block: 12px;
    }

    .site-nav {
        order: 3;
        width: 100%;
        margin-inline: 0;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .header-actions {
        margin-left: auto;
    }

    .hero-grid,
    .download-grid {
        grid-template-columns: 1fr;
    }

    .hero-art {
        order: -1;
        min-height: 240px;
    }

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

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

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

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

    .footer-meta {
        justify-items: start;
        text-align: left;
    }
}

@media (max-width: 620px) {
    .shell {
        width: min(100% - 28px, var(--shell));
    }

    .section {
        padding: 56px 0;
    }

    .hero {
        padding-top: 36px;
    }

    .steps,
    .steps--four,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .shot-grid {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 8px;
        scroll-snap-type: x mandatory;
    }

    .shot {
        flex: 0 0 78%;
        scroll-snap-align: start;
    }

    .feedback-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .form {
        padding: 20px;
    }

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

    .button {
        width: 100%;
    }

    .hero-actions,
    .store-badges {
        display: grid;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .petal-tint {
        animation: none;
        display: none;
    }

    .button {
        transition: none;
    }
}

@media print {
    .site-header,
    .site-footer,
    .back-link,
    .legal-footer,
    .skip-link {
        display: none;
    }

    body {
        background: #ffffff;
        color: #000000;
    }

    .section {
        padding: 0;
    }
}
