/* iSpentWhat public site — black/white with one accent. No JavaScript required. */
:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #525252;
  --line: #e5e5e5;
  --surface: #f5f5f5;
  --accent: #c6f432;
  /* Filled controls: white text in light, black in dark; the light fill is the accent darkened to 4.5:1. */
  --fill: #677f1a;
  --on-fill: #ffffff;
  --radius: 20px;
  --wrap: 72rem;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0a0a0a; --fg: #fafafa; --muted: #a3a3a3; --line: #262626; --surface: #161616; --fill: #c6f432; --on-fill: #0a0a0a; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; box-shadow: 0 0 0 6px var(--accent); border-radius: 6px; }
main:focus { outline: none; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 700; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.6rem); font-weight: 650; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--fill); color: var(--on-fill); padding: 0.75rem 1rem; border-radius: 999px; font-weight: 600; }
.skip-link:focus { top: 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.summary, .lead { font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--muted); max-width: 44rem; }

/* Buttons */
.button { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.35rem; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1.5px solid var(--fg); line-height: 1.2; }
.button-primary { background: var(--fill); color: var(--on-fill); border-color: var(--fill); }
.button-primary:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); text-decoration: none; }
.button-secondary { background: transparent; color: var(--fg); }
.button-secondary:hover { background: var(--fg); color: var(--bg); text-decoration: none; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); z-index: 5; }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; flex-wrap: wrap; padding-block: 0.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.03em; text-decoration: none; }
/* Header logo: the bare "iSpentWhat" wordmark; the dot of the "i" in the fill colour (accent on dark, accent darkened to 4.5:1 on
   light). */
.brand-lockup { display: block; height: 1.95rem; width: auto; color: var(--fg); }
.brand-accent { fill: var(--fill); }
@media (max-width: 47.99rem) {
  .brand-lockup { height: 1.6rem; }
}
.header-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.cta-short { display: none; }
/* Phones: one header row. The button says just "Open" (its accessible name stays "Open app"). */
@media (max-width: 29.99rem) {
  .header-inner { flex-wrap: nowrap; gap: 0.75rem; }
  .header-actions { gap: 0.5rem; }
  .header-cta { padding: 0.65rem 1rem; }
  .cta-long { display: none; }
  .cta-short { display: inline; }
}
/* The narrowest phones (320px): the flag alone says the language; it is still named for screen readers. */
@media (max-width: 22.49rem) {
  .brand-lockup { height: 1.4rem; }
  .lang-code { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .language-switcher summary .flag { margin-right: 0; }
}
.language-switcher { position: relative; z-index: 6; }
.language-switcher summary { display: flex; align-items: center; cursor: pointer; list-style: none; padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: 0.875rem; }
.language-switcher summary::-webkit-details-marker { display: none; }
.language-switcher ul { position: absolute; right: 0; top: calc(100% + 0.5rem); list-style: none; margin: 0; padding: 0.5rem; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; min-width: 10rem; }
.language-switcher a { display: flex; align-items: center; white-space: nowrap; padding: 0.45rem 0.75rem; border-radius: 8px; text-decoration: none; }
.language-switcher a[aria-current] { background: var(--surface); font-weight: 600; }

/* Sections */
.page-head { padding-block: clamp(3rem, 8vw, 6rem) 1rem; }
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.prose { max-width: 44rem; }
.prose h2 { margin-top: 1.5em; font-size: 1.6rem; }
.prose h3 { margin-top: 1.25em; }
.prose ul, .prose ol { padding-left: 1.25rem; }
/* Support, privacy and terms: the title and the text share one reading column. */
.page > .wrap { width: min(100% - 2.5rem, 44rem); }
.page .page-head { padding-block: clamp(2.5rem, 6vw, 4rem) 0.25rem; }
.page h1 { font-size: clamp(1.85rem, 5vw, 2.9rem); hyphens: auto; overflow-wrap: break-word; } /* «конфиденциальности» on a 320px phone */
.page .prose h2 { font-size: 1.35rem; margin-top: 1.4em; }
.page .section { padding-block: 0; }
.page .section:last-child { padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.page-action { margin-top: 0.5rem; margin-bottom: 1.25rem; }

@media (prefers-reduced-motion: no-preference) {
  .button { transition: background-color 0.15s, color 0.15s, text-decoration-color 0.15s; }
}

/* Language flags (switcher in the header) */
.flag { display: inline-block; width: 21px; height: 14px; border-radius: 2px; margin-right: 0.45rem; vertical-align: -2px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.12); }

/* Home page: one black screen — headline and the sign-up card on the left, two phones on the right. */
.landing {
  --bg: #000000; --fg: #fafafa; --muted: #a3a3a3; --line: #262626; --surface: #111111; --fill: #c6f432; --on-fill: #0a0a0a;
  color-scheme: dark; background: var(--bg); color: var(--fg);
  min-height: 100vh; display: flex; flex-direction: column;
}
.landing main { flex: 1; display: flex; }
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }

.landing-main { display: grid; gap: 2.5rem; align-items: center; padding-block: clamp(0.5rem, 3vw, 2rem) clamp(2rem, 4vw, 3rem); }
/* Phones and tablets: one column; the copy and the card stay a form's width, the phones follow below. */
@media (max-width: 59.99rem) {
  .landing-copy { width: 100%; max-width: 28rem; margin-inline: auto; }
}
@media (min-width: 60rem) {
  /* One screen: copy and card left, phones right. Top-aligned, so nothing moves when the card opens the email form;
   * the phones stay in view while it grows. */
  .landing-main { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); gap: clamp(3rem, 7vw, 7rem); align-items: start; padding-top: clamp(1.5rem, 5vh, 3.5rem); }
  .phones { position: sticky; top: 1.5rem; }
}
.landing-copy h1 { font-size: clamp(1.9rem, 2.8vw, 2.4rem); line-height: 1.12; max-width: 20ch; margin-bottom: 0.6rem; }
.landing-lead { color: var(--muted); font-size: 1rem; line-height: 1.5; margin: 0 0 1.5rem; max-width: 34ch; }

.auth-card { position: relative; border: 1px solid var(--line); border-radius: 24px; background: var(--bg); padding: 1.25rem 1.25rem 0.75rem; }
.auth-frame, .auth-waiting { display: none; }
.auth-frame { width: 100%; height: 27rem; border: 0; background: transparent; color-scheme: dark; }
.auth-links { display: grid; gap: 0.75rem; padding-bottom: 0.5rem; }
.auth-links .button { justify-content: center; }
.auth-card.is-loading { min-height: 27rem; }
.auth-card.is-loading .auth-frame { display: block; position: absolute; inset: 1.25rem; width: calc(100% - 2.5rem); height: calc(100% - 2.5rem); opacity: 0; pointer-events: none; }
.auth-card.is-loading .auth-waiting { display: grid; place-items: center; position: absolute; inset: 0; }
.auth-card.is-loading .auth-links, .auth-card.is-ready .auth-links { display: none; }
.auth-card.is-ready .auth-frame { display: block; }
/* Phones: no frame around the card, the buttons use the full width. */
@media (max-width: 47.99rem) {
  .auth-card { border: 0; border-radius: 0; padding: 0; }
  .auth-card.is-loading .auth-frame { inset: 0; width: 100%; height: 100%; }
}
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .spinner { animation: spin 0.9s linear infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Two phones (frames drawn for this site, cms/phones/*.svg) around real app screens with synthetic demo data.
 * The frame's screen is 90% wide and 97% tall; its top 49 of 910 units are the status bar the frame draws. */
.phones { display: flex; justify-content: center; align-items: flex-start; padding-block: 0.5rem 1.5rem; }
.phone { margin: 0; position: relative; flex: none; aspect-ratio: 440 / 938; }
.phone-front { z-index: 1; width: min(280px, 44vw); filter: drop-shadow(0 28px 40px rgb(0 0 0 / 0.85)) drop-shadow(0 0 60px rgb(198 244 50 / 0.12)); }
.phone-back { z-index: 0; width: min(250px, 40vw); margin-left: -11%; margin-top: 13%; filter: drop-shadow(0 24px 36px rgb(0 0 0 / 0.9)) brightness(0.88); }
.phone-screen { position: absolute; left: 5%; top: 1.4925%; width: 90%; height: 97.015%; overflow: hidden; background: #000; padding-top: 12.37%; }
.phone-front .phone-screen { border-radius: 15.15% / 6.6%; }
.phone-back .phone-screen { border-radius: 11.6% / 5.05%; }
.phone-screen picture, .phone-screen img { display: block; width: 100%; height: auto; }
.phone-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.site-footer { border-top: 1px solid var(--line); padding-block: 1rem 1.25rem; display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; align-items: center; justify-content: space-between; font-size: 0.8125rem; color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--fg); }
@media (max-width: 47.99rem) {
  .site-footer { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .footer-sep { display: none; }
  .footer-address { display: block; margin-top: 0.15rem; }
}
