/* Dotty site. The app's palette: warm paper, deep ink, Dotty's teal body,
   yellow crest and coral wing tips. Soft cards with a lip, like the app's
   buttons. */
:root {
  --bg: #FFF7E8;
  --paper-deep: #F6E7CC;
  --ink: #1F2A44;
  --muted: #5E6478;
  --surface: #FFFFFF;
  --teal: #25B8A9;
  --teal-deep: #1A8C80;
  --crest: #FFD23F;
  --coral: #FF7A6B;
  --line: #EADBC0;
  --lip: rgba(31, 42, 68, .16);
  --bezel: #1F2A44;
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161D2F;
    --paper-deep: #1F2840;
    --ink: #F3EEE3;
    --muted: #B3B8C7;
    --surface: #222B44;
    --line: #313B57;
    --lip: rgba(0, 0, 0, .35);
    --bezel: #0B0F1A;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 17px/1.55 var(--font);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-weight: 700; text-wrap: balance; }

/* Language: the page carries both; the root class hides one. */
html.ru [lang="en"], html:not(.ru) [lang="ru"] { display: none !important; }

.wrap { max-width: 1080px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }

header.top { padding-block: 16px; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 22px; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 12px; }
.lang { display: flex; border-radius: 999px; overflow: hidden; background: var(--surface); box-shadow: 0 3px 0 var(--lip); }
.lang button { font: 700 14px var(--font); color: var(--ink); background: none; border: 0; padding: 7px 13px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--teal); color: #fff; }

/* Hero */
.hero { padding-block: 16px 48px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.04; margin: 0 0 16px; letter-spacing: -0.5px; }
.hero h1 em { font-style: normal; color: var(--teal); }
.hero p.lede { font-size: 20px; color: var(--muted); margin: 0 0 26px; max-width: 32ch; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px 11px 14px; border-radius: 18px;
  background: var(--surface); box-shadow: 0 4px 0 var(--lip);
  color: var(--ink); cursor: default;
}
.store svg { width: 26px; height: 26px; flex: none; }
.store small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.1; }
.store b { display: block; font-size: 17px; font-weight: 700; line-height: 1.15; }
.note { margin-top: 14px; font-size: 14px; color: var(--muted); }

.hero-art { position: relative; display: grid; place-items: center; }
.hero-art::before {
  content: ""; position: absolute; width: min(420px, 90%); aspect-ratio: 1; border-radius: 50%;
  background: var(--teal); opacity: .9;
}
.hero-art img { position: relative; width: min(380px, 80%); filter: drop-shadow(0 16px 18px rgba(31, 42, 68, .18)); }

/* How it works */
.how { padding-block: 48px; background: var(--paper-deep); }
.how h2, .demo h2 { font-size: clamp(28px, 4vw, 34px); margin: 0 0 24px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.steps li { background: var(--surface); border-radius: 24px; padding: 18px 18px 22px; box-shadow: 0 4px 0 var(--lip); counter-increment: step; }
.steps img { width: 96px; height: 110px; object-fit: contain; margin: -4px 0 6px; }
.steps h3 { margin: 0 0 6px; font-size: 19px; line-height: 1.25; }
.steps h3::before { content: counter(step) ". "; color: var(--teal); }
.steps p { margin: 0; color: var(--muted); font-size: 16px; }

/* Demo slideshow. Without JS it is a plain row of phones that wraps. With
   JS (html.js) it becomes one phone with captions that scroll-snaps, so
   swiping is the browser's own. */
.demo { padding-block: 56px; }
.slides { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; }
.slide { margin: 0; width: 240px; text-align: center; }
.phone {
  border: 9px solid var(--bezel); border-radius: 42px; overflow: hidden;
  background: var(--bezel); box-shadow: 0 18px 30px -12px rgba(31, 42, 68, .35);
  aspect-ratio: 540 / 1174;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 33px; }
.slide figcaption { margin-top: 14px; font-weight: 700; font-size: 16px; }
.slide figcaption span { display: block; font-weight: 500; color: var(--muted); font-size: 15px; }

html.js .slides { position: relative; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 0; }
html.js .slides::-webkit-scrollbar { display: none; }
html.js .slide { flex: 0 0 100%; width: auto; scroll-snap-align: center; display: grid; justify-items: center; padding-inline: 8px; }
html.js .slide .phone { width: min(280px, 72vw); }
@media (min-width: 900px) {
  html.js .slide { flex-basis: 33.333%; }
}
.controls { display: none; }
html.js .controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.controls button.arrow {
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: 0 3px 0 var(--lip);
  display: grid; place-items: center;
}
.controls button.arrow svg { width: 22px; height: 22px; }
.dots { display: flex; gap: 6px; }
.dots button { width: 10px; height: 10px; padding: 0; border-radius: 99px; border: 0; background: var(--line); cursor: pointer; transition: width .2s, background .2s; }
.dots button[aria-current="true"] { width: 26px; background: var(--teal); }
/* A tap target of 24px around each dot without changing how it looks. */
.dots button { position: relative; }
.dots button::after { content: ""; position: absolute; inset: -8px -3px; }

/* For grown-ups */
.grownups { padding-block: 8px 56px; }
.box { border-radius: 28px; padding: 28px; background: var(--surface); box-shadow: 0 5px 0 var(--lip); display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.box h2 { margin: 0 0 10px; font-size: 26px; }
.box ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.box .ic { width: 72px; height: 72px; border-radius: 22px; background: var(--crest); display: grid; place-items: center; }
.box .ic svg { width: 38px; height: 38px; }

footer { padding-block: 28px 40px; border-top: 2px solid var(--line); font-size: 15px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }
footer nav { display: flex; gap: 8px 20px; flex-wrap: wrap; }
footer a { font-weight: 700; color: var(--ink); }

/* Text pages */
.doc { padding-block: 16px 64px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); margin: 8px 0 6px; line-height: 1.1; }
.doc .updated { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
.doc h2 { font-size: 22px; margin: 32px 0 8px; }
.doc ul { padding-left: 22px; display: grid; gap: 6px; }
.doc .card { background: var(--surface); border-radius: 20px; padding: 18px 20px; margin: 20px 0; box-shadow: 0 4px 0 var(--lip); }
.doc .card p { margin: 0; }
.doc .table-scroll { overflow-x: auto; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 700; }
.mail { font-weight: 700; font-size: 20px; user-select: all; }

@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art img { width: min(240px, 60%); }
  .hero-art::before { width: min(270px, 66%); }
  .box { grid-template-columns: 1fr; padding: 22px; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .steps li { display: grid; grid-template-columns: 72px 1fr; gap: 0 14px; align-items: center; }
  .steps img { width: 72px; height: 84px; margin: 0; grid-row: span 2; }
  .slide { width: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  html.js .slides { scroll-behavior: auto; }
  .dots button { transition: none; }
}

@font-face { font-family: "Nunito"; src: url("fonts/Nunito-Medium.ttf") format("truetype"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/Nunito-Bold.ttf") format("truetype"); font-weight: 700 900; font-display: swap; }

/* Grid children default to min-width:auto, which lets wide images push the
   columns past a phone screen. */
.hero .wrap > *, .steps > *, .box > * { min-width: 0; }
