/* ---------- Fonts ---------- */
/* Self-hosted subset of Cormorant Garamond (latin + cyrillic only, matching
   the site's two locales) instead of a Google Fonts stylesheet request. */
@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/assets/fonts/cormorant-garamond-600-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/assets/fonts/cormorant-garamond-600-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/assets/fonts/cormorant-garamond-700-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/assets/fonts/cormorant-garamond-700-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- Tokens ---------- */
:root {
    --bg-top: #FFF0F2;
    --bg-bottom: #F7A3B5;
    --bg: #FFF0F2;
    --text: #3D0C1C;
    --text-secondary: #815C67;
    --accent: #D61F4B;
    --accent-hover: #B71B42;
    --on-accent: #FFFFFF;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-border: rgba(61, 12, 28, 0.06);
    --ring-line: rgba(255, 255, 255, 0.48);
    --ring-dot: rgba(255, 255, 255, 0.80);
    --device-back: #1A1A1C;
    --phone-shadow: 0 55px 110px rgba(80, 10, 30, 0.25);
    --card-shadow: 0 20px 50px rgba(80, 10, 30, 0.10);
    --badge-filter: none;

    --font-heading: "Cormorant Garamond", Georgia, serif;
    --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-top: #170A10;
        --bg-bottom: #43152A;
        --bg: #170A10;
        --text: #FBE9EE;
        --text-secondary: #AB9BA0;
        --accent: #FF7A9A;
        --accent-hover: #FE96AF;
        --on-accent: #170A10;
        --surface: rgba(251, 233, 238, 0.06);
        --surface-border: rgba(251, 233, 238, 0.08);
        --ring-line: rgba(247, 163, 181, 0.28);
        --ring-dot: rgba(247, 163, 181, 0.55);
        --device-back: #101113;
        --phone-shadow: 0 0 140px rgba(240, 106, 142, 0.35);
        --card-shadow: none;
        --badge-filter: invert(1);
    }
}

:root[data-theme="dark"] {
    --bg-top: #170A10;
    --bg-bottom: #43152A;
    --bg: #170A10;
    --text: #FBE9EE;
    --text-secondary: #AB9BA0;
    --accent: #FF7A9A;
    --accent-hover: #FE96AF;
    --on-accent: #170A10;
    --surface: rgba(251, 233, 238, 0.06);
    --surface-border: rgba(251, 233, 238, 0.08);
    --ring-line: rgba(247, 163, 181, 0.28);
    --ring-dot: rgba(247, 163, 181, 0.55);
    --device-back: #101113;
    --phone-shadow: 0 0 140px rgba(240, 106, 142, 0.35);
    --card-shadow: none;
    --badge-filter: invert(1);
}

/* ---------- Reset / base ---------- */
* {
    box-sizing: border-box;
}

html {
    font-size: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.55;
    font-weight: 400;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    transition: background-color .3s, color .3s;
}

h1, h2, h3 {
    margin: 0;
    font-family: var(--font-heading);
    color: var(--text);
    text-wrap: balance;
}

h1 {
    font-size: clamp(44px, 4vw + 24px, 96px);
    line-height: 1.12;
    letter-spacing: -0.01em;
    font-weight: 700;
}

h2 {
    font-size: clamp(34px, 2.5vw + 20px, 60px);
    line-height: 1.15;
    letter-spacing: -0.01em;
    font-weight: 700;
}

p {
    margin: 0;
}

.accent {
    color: var(--accent);
}

a {
    text-decoration: none;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

@supports (padding: max(0px)) {
    .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* ---------- Site header ---------- */
.site-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

#logo {
    height: 28px;
    width: auto;
}

#logo path[fill="black"] {
    fill: var(--text);
}

#logo path[fill="#DB2430"] {
    fill: var(--accent);
}

.theme-toggle {
    appearance: none;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    backdrop-filter: blur(20px);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    padding: 0;
}

.theme-toggle__icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle__icon--moon {
    fill: currentColor;
    stroke: none;
    display: none;
}

:root[data-theme="dark"] .theme-toggle__icon--sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle__icon--moon {
    display: block;
}

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

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

/* ---------- Buttons ---------- */
.btn-appstore {
    display: inline-block;
    transition: transform 150ms ease;
}

@media (any-hover: hover) {
    .btn-appstore:hover {
        transform: scale(1.03);
    }
}

.btn-appstore svg {
    display: block;
    height: 52px;
    width: auto;
    filter: var(--badge-filter);
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 28px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    min-width: 44px;
}

.btn-primary {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    transition: background-color 150ms ease;
}

@media (any-hover: hover) {
    .btn-primary:hover {
        background: var(--accent-hover);
    }
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    padding: 48px 16px 64px;
}

.hero__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    text-align: center;
}

.hero__content {
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.hero__subheading {
    font-size: 18px;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 440px;
}

.hero__visual {
    display: flex;
    justify-content: center;
    width: 100%;
}

.hero__scene {
    position: relative;
    aspect-ratio: 1350 / 2760;
    width: 80%;
    max-width: 340px;
}

.hero__scene .phone-mock {
    width: 100%;
    height: 100%;
}

/* ---------- Ring motif ---------- */
.ring {
    position: absolute;
    left: 50%;
    top: 68%;
    width: 187.2%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

.ring__outer {
    fill: none;
    stroke: var(--ring-line);
    stroke-width: 0.35;
}

.ring__dots {
    fill: var(--ring-dot);
    transform-origin: 50% 50%;
    animation: ring-rotate 120s linear infinite;
}

@keyframes ring-rotate {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ring__dots {
        animation: none;
    }
}

/* ---------- Phone mock ---------- */
.phone-mock {
    position: relative;
    display: block;
    aspect-ratio: 1350 / 2760;
}

.phone-mock__back {
    position: absolute;
    left: 1.48%;
    top: 0.906%;
    width: 97.04%;
    height: 98.28%;
    border-radius: 18.13% / 8.76%;
    background: var(--device-back);
    box-shadow: var(--phone-shadow);
}

.phone-mock__screen {
    position: absolute;
    left: 5.333%;
    top: 2.5%;
    width: 89.333%;
    height: 95%;
    border-radius: 15.96% / 7.34%;
    overflow: hidden;
}

.phone-mock__pic {
    position: absolute;
    inset: 0;
}

.phone-mock__pic img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.phone-mock__pic--dark {
    display: none;
}

:root[data-theme="dark"] .phone-mock__pic--light {
    display: none;
}

:root[data-theme="dark"] .phone-mock__pic--dark {
    display: block;
}

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

    :root:not([data-theme="light"]) .phone-mock__pic--dark {
        display: block;
    }
}

.phone-mock__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ---------- Features ---------- */
.features {
    padding: 64px 16px;
    background: var(--bg);
}

.features h2 {
    max-width: 720px;
    margin: 0 auto 40px;
    text-align: center;
}

.features__grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 16px;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 20px 16px 20px;
    scrollbar-width: none;
}

.features__grid::-webkit-scrollbar {
    display: none;
}

.feature-card {
    flex: 0 0 85%;
    max-width: 320px;
    scroll-snap-align: start;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 28px;
    backdrop-filter: blur(20px);
    box-shadow: var(--card-shadow);
    padding: 28px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.feature-card .phone-mock {
    width: 88%;
    max-width: 280px;
}

.feature-card__caption {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

/* ---------- CTA (closing) ---------- */
.cta {
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    padding: 72px 16px;
    text-align: center;
}

.cta__content {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

/* ---------- Footer ---------- */
footer {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 32px;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 14px;
}

footer > * {
    display: flex;
    flex-wrap: wrap;
}

footer a {
    color: inherit;
}

@media (any-hover: hover) {
    footer a:hover {
        color: var(--accent);
    }
}

#firstLine {
    gap: 10px;
}

#firstLine > * {
    padding: 4px 0;
}

#secondLine {
    align-items: center;
    padding-top: 16px;
    gap: 12px;
}

#info {
    flex: 9999 1 auto;
}

.select {
    position: relative;
    flex: 1 0 auto;
    max-width: 90px;
}

.select svg {
    position: absolute;
    right: 14px;
    top: calc(50% - 3px);
    width: 10px;
    height: 6px;
    stroke-width: 2px;
    stroke: var(--text-secondary);
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.select select {
    appearance: none;
    -webkit-appearance: none;
    padding: 6px 24px 6px 10px;
    width: 100%;
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

.select select option {
    color: #223254;
}

.select select option[value=""][disabled] {
    display: none;
}

.sprites {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    user-select: none;
}

@supports (padding: max(0px)) {
    footer {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* ---------- Responsive: desktop ---------- */
@media (min-width: 900px) {
    .hero {
        padding: 72px 16px;
    }

    .hero__inner {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        text-align: left;
        gap: 48px;
    }

    .hero__content {
        align-items: flex-start;
        text-align: left;
        flex: 1 1 480px;
    }

    .hero__visual {
        flex: 1 1 420px;
    }

    .hero__scene {
        width: auto;
        height: min(80vh, 760px);
        max-width: none;
    }

    .features__grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        overflow: visible;
        scroll-snap-type: none;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0;
        gap: 24px;
    }

    .feature-card {
        flex: none;
        max-width: none;
        scroll-snap-align: none;
        padding: 32px 24px 24px;
    }

    .feature-card .phone-mock {
        width: 60%;
        max-width: 220px;
    }
}
