/* B&C site. Tokens mirror src/theme/tokens.ts (MASTER_PLAN §2): a home in the
   evening, lamplight on a warm dark wall, solid paper-like surfaces, the cats
   carry the colour, terracotta marks one thing per screen. */

@font-face { font-family: Onest; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/onest-400.woff2) format("woff2"); }
@font-face { font-family: Onest; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/onest-500.woff2) format("woff2"); }
@font-face { font-family: Onest; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/onest-600.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --bg-deep: #14100D;
  --bg-base: #1B1612;
  --surface-1: #241E19;
  --surface-2: #2D2620;
  --surface-3: #38302A;
  --surface-3-hover: #41382F;
  --line: rgba(255, 240, 225, 0.08);
  --line-strong: rgba(255, 240, 225, 0.14);
  --text-1: #F3ECE3;
  --text-2: #C4B9AD;
  --text-3: #A59A8E;
  --accent: #E8A06B;
  --accent-pressed: #D48F5C;
  --accent-soft: rgba(232, 160, 107, 0.14);
  --accent-ink: #2A1C12;
  --love: #E58B7B;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --edge: 20px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font: Onest, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[lang="ru"] [data-l="en"], html[lang="en"] [data-l="ru"], [hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-deep);
  /* L1: the wall (linear) plus one static lamp, accent at 7 %. */
  background-image:
    radial-gradient(ellipse 80% 55% at 50% -6%, rgba(232, 160, 107, 0.07), transparent 72%),
    linear-gradient(180deg, #1F1915 0, #14100D 100vh);
  background-repeat: no-repeat;
  color: var(--text-1);
  font-family: var(--font);
  font-size: 16px;
  line-height: 23px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 16px; border-radius: 999px; background: var(--surface-2); color: var(--text-1); font-weight: 500; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- chrome ---------- */
.top {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px var(--edge);
  padding-top: max(16px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mark { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; min-height: 44px; align-items: center; }
.mark-b { font-weight: 600; font-size: 20px; line-height: 24px; letter-spacing: -0.2px; color: var(--text-1); }
.mark-name { font-weight: 500; font-size: 13px; line-height: 18px; letter-spacing: 0.1px; color: var(--text-3); }

.lang { display: none; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-3); }
html.js .lang { display: inline-flex; }
.lang button {
  appearance: none; border: 0; margin: 0; cursor: pointer;
  min-width: 44px; height: 32px; padding: 0 12px; border-radius: 999px;
  background: transparent; color: var(--text-2);
  font: 500 13px/18px var(--font); letter-spacing: 0.1px;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}
.lang button[aria-pressed="true"] { background: var(--surface-1); color: var(--text-1); }
.lang button:hover { color: var(--text-1); }

.foot {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px var(--edge);
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  color: var(--text-3);
  font-weight: 500;
  font-size: 13px;
  line-height: 18px;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot a { text-decoration: none; color: var(--text-2); display: inline-flex; align-items: center; min-height: 44px; }
.foot a:hover { color: var(--text-1); }
.foot a[aria-current="page"] { color: var(--text-1); }

main { flex: 1 0 auto; width: 100%; }

/* ---------- type ---------- */
h1, h2, h3, p { margin: 0; }
.display {
  font-weight: 600;
  font-size: 30px;
  line-height: 36px;
  letter-spacing: -0.5px;
  text-wrap: balance;
}
.title { font-weight: 600; font-size: 22px; line-height: 28px; letter-spacing: -0.2px; text-wrap: balance; }
.headline { font-weight: 600; font-size: 17px; line-height: 22px; }
.lead { color: var(--text-2); font-size: 17px; line-height: 25px; text-wrap: pretty; }
.callout { color: var(--text-2); font-size: 15px; line-height: 21px; }
.caption { color: var(--text-3); font-weight: 500; font-size: 13px; line-height: 18px; letter-spacing: 0.1px; }

/* ---------- buttons (one shape: the pill) ---------- */
.btn {
  -webkit-appearance: none; appearance: none; border: 0; margin: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 8px 28px; border-radius: 999px;
  font: 500 16px/20px var(--font); text-align: center; text-decoration: none;
  transition: transform 120ms var(--ease-out), background-color 180ms var(--ease-out), opacity 120ms var(--ease-out);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-pressed); }
.btn-secondary { background: var(--surface-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-secondary:hover { background: var(--surface-3-hover); }
.btn-md { min-height: 48px; padding: 8px 22px; }
.btn-block { width: 100%; }

.store { flex-direction: column; gap: 0; padding: 7px 26px; min-width: 200px; line-height: 1; }
.store-k { font-weight: 500; font-size: 12px; line-height: 16px; opacity: 0.8; }
.store-n { font-weight: 600; font-size: 17px; line-height: 22px; letter-spacing: -0.1px; }

.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.stores .is-primary { order: -1; }

.quiet-link { color: var(--text-1); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.quiet-link:hover { text-decoration-color: var(--text-2); }

/* ---------- hero ---------- */
.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px var(--edge) 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero .art { width: min(100%, 420px); margin: 8px auto 20px; }
.hero .art svg { width: 100%; height: auto; }
.hero h1 + .lead { margin-top: 12px; max-width: 34ch; }
.hero .stores { margin-top: 32px; }

.page-index main { display: flex; align-items: center; }
.page-index .hero { padding-bottom: 40px; }
.page-index .hero .art { width: min(100%, 460px); margin-bottom: 28px; }

/* ---------- invite ---------- */
.page-invite .hero .art { width: min(100%, 440px); margin-bottom: 16px; }
.code-card {
  width: 100%;
  max-width: 400px;
  margin-top: 28px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.code {
  display: flex;
  gap: 0.4em;
  font-weight: 600;
  font-size: 44px;
  line-height: 52px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  color: var(--text-1);
  user-select: all;
  -webkit-user-select: all;
  margin-bottom: 16px;
}
.copy-status { min-height: 18px; margin-top: 8px; }
.copy-status:empty { display: none; }
.page-invite .stores { margin-top: 20px; }
.open-app { margin-top: 20px; color: var(--text-2); font-size: 15px; line-height: 21px; }
.open-app a { display: inline-block; padding: 12px 0; }
.desktop-note { margin-top: 20px; max-width: 36ch; }

.steps { max-width: 720px; margin: 0 auto; padding: 24px var(--edge) 8px; }
.steps h2 { text-align: center; margin-bottom: 16px; }
.steps ol { list-style: none; margin: 0 auto; padding: 0; max-width: 400px; display: flex; flex-direction: column; gap: 8px; }
.steps li {
  display: flex; align-items: center; gap: 14px;
  min-height: 56px; padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 16px; line-height: 22px;
}
.steps .n {
  flex: none; width: 28px; height: 28px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-2);
  font-weight: 600; font-size: 13px; line-height: 1; font-variant-numeric: tabular-nums;
}

/* ---------- reading pages (support, legal) ---------- */
.read { max-width: 760px; margin: 0 auto; padding: 8px var(--edge) 24px; }
.read-head { display: flex; align-items: center; gap: 20px; margin: 8px 0 32px; }
.read-head .art { flex: none; width: 104px; }
.read-head .art svg { width: 100%; height: auto; }
.read-head .caption { margin-top: 6px; }
.prose { max-width: 68ch; color: var(--text-2); font-size: 16px; line-height: 26px; }
.prose h2 { color: var(--text-1); font-weight: 600; font-size: 22px; line-height: 28px; letter-spacing: -0.2px; margin: 40px 0 12px; scroll-margin-top: 24px; }
.prose h3 { color: var(--text-1); font-weight: 600; font-size: 17px; line-height: 22px; margin: 28px 0 8px; scroll-margin-top: 24px; }
.prose h4 { color: var(--text-1); font-weight: 600; font-size: 16px; line-height: 22px; margin: 20px 0 6px; }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--text-3); }
.prose strong { color: var(--text-1); font-weight: 600; }
.prose a { color: var(--text-1); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; text-decoration-thickness: 1.5px; overflow-wrap: anywhere; }
.prose a:hover { text-decoration-color: var(--text-2); }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-1); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 32px 0; }
.prose blockquote { padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); }
.prose .table-wrap { overflow-x: auto; margin: 0 0 16px; border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 21px; margin: 0; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--text-1); font-weight: 600; background: var(--surface-1); }
.prose tr:last-child td { border-bottom: 0; }

.toc { margin: 0 0 8px; padding: 16px 20px; border-radius: var(--radius-lg); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); }
.toc ol { margin: 8px 0 0; padding-left: 22px; color: var(--text-2); font-size: 15px; line-height: 21px; columns: 2 260px; column-gap: 32px; }
.toc li { margin: 4px 0; break-inside: avoid; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--text-1); }

.faq { list-style: none; margin: 0; padding: 0; border-radius: var(--radius-lg); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line); }
.faq > li { padding: 20px; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.faq > li:last-child { border-bottom: 0; }
.faq h2 { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; line-height: 22px; color: var(--text-1); margin: 0 0 6px; }
.faq h2 .paw { flex: none; width: 18px; height: 18px; color: var(--text-3); }
.faq p { color: var(--text-2); font-size: 15px; line-height: 22px; }
.faq p + p { margin-top: 8px; }
.faq a { color: var(--text-1); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0 0 32px; }

.not-found .hero { padding-top: 24px; }
.not-found .hero .art { width: 160px; }
.not-found .btn { margin-top: 28px; }

/* ---------- the one authored moment per page ---------- */
@media (prefers-reduced-motion: no-preference) {
  .art .cat, .art .ghost, .art .duo-heart, .art .yarn-ball { transform-box: fill-box; transform-origin: 50% 100%; }
  .art .cat-a { animation: rise 420ms var(--ease-out) both; }
  .art .cat-b { animation: rise 420ms var(--ease-out) 60ms both; }
  .art .duo-heart { transform-origin: 50% 50%; animation: heart 520ms var(--ease-out) 260ms both; }
  .art .ghost { animation: fade 600ms var(--ease-out) 180ms both; }
  .art .yarn { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 900ms var(--ease-out) 320ms forwards; }
  .art .yarn-ball { animation: fade 300ms var(--ease-out) 120ms both; }
  @keyframes rise { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
  @keyframes heart { from { opacity: 0; scale: 0.6; } to { opacity: 1; scale: 1; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .btn { transition: background-color 180ms var(--ease-out), opacity 120ms var(--ease-out); }
  .btn:active { transform: none; opacity: 0.7; }
}

/* ---------- larger screens ---------- */
@media (min-width: 720px) {
  :root { --edge: 32px; }
  .display { font-size: 40px; line-height: 46px; letter-spacing: -0.8px; }
  .page-index .display { font-size: 48px; line-height: 54px; letter-spacing: -1px; }
  .hero .art { width: min(100%, 480px); }
  .page-index .hero .art { width: min(100%, 560px); }
  .page-invite .hero .art { width: min(100%, 520px); }
  .read-head .art { width: 128px; }
}
@media (min-width: 1280px) {
  .page-index .hero .art { width: 620px; }
}

/* copy button: label swaps for 2 s after a successful copy */
[data-copy] .when-done { display: none; }
[data-copy][data-done] .when-idle { display: none; }
[data-copy][data-done] .when-done { display: inline; }
