/* =========================================================
   Николай Бузовский — iOS-style design system
   ========================================================= */

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

:root,
[data-theme="light"] {
  --bg: #F2F2F7;
  --bg-elevated: #FFFFFF;
  --bg-secondary: #E5E5EA;
  --bg-tertiary: #FAFAFC;
  --label: #000000;
  --label-secondary: rgba(60, 60, 67, 0.6);
  --label-tertiary: rgba(60, 60, 67, 0.35);
  --separator: rgba(60, 60, 67, 0.22);
  --accent: #007AFF;
  --accent-rgb: 0, 122, 255;
  --violet: #5856D6;
  --green: #34C759;
  --orange: #FF9500;
  --pink: #FF2D55;
  --teal: #30B0C7;
  --nav-blur: rgba(242, 242, 247, 0.78);
  --island-bg: #0B0B0D;
  --island-label: #FFFFFF;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1C1C1E;
  --bg-secondary: #2C2C2E;
  --bg-tertiary: #17171A;
  --label: #FFFFFF;
  --label-secondary: rgba(235, 235, 245, 0.6);
  --label-tertiary: rgba(235, 235, 245, 0.35);
  --separator: rgba(84, 84, 88, 0.55);
  --accent: #0A84FF;
  --accent-rgb: 10, 132, 255;
  --violet: #5E5CE6;
  --green: #30D158;
  --orange: #FF9F0A;
  --pink: #FF375F;
  --teal: #40C8E0;
  --nav-blur: rgba(15, 15, 17, 0.72);
  --island-bg: #000000;
  --island-label: #FFFFFF;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
  padding-bottom: 84px; /* space for mobile tab bar */
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Nav bar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: var(--nav-blur);
  border-bottom: 1px solid var(--separator);
}
.navbar-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
  font-weight: 500;
  color: var(--label-secondary);
}
.nav-links a:hover { color: var(--label); }
.nav-links .nav-back { display:none; }

/* theme switch — replicates iOS UISwitch */
.theme-switch {
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .25s ease;
  padding: 0;
}
.theme-switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
[data-theme="dark"] .theme-switch { background: var(--green); }
[data-theme="dark"] .theme-switch::after { transform: translateX(20px); }
[data-theme="light"] .theme-switch,
:root:not([data-theme]) .theme-switch { background: var(--bg-secondary); }

/* ---------- Dynamic Island status pill ---------- */
.island {
  max-width: 780px;
  margin: 18px auto 0;
  padding: 0 20px;
}
.island-pill {
  background: var(--island-bg);
  color: var(--island-label);
  border-radius: 999px;
  padding: 10px 18px 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52,199,89,.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52,199,89,.55); }
  70% { box-shadow: 0 0 0 8px rgba(52,199,89,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,199,89,0); }
}

/* ---------- Hero / Large title ---------- */
.hero {
  padding: 28px 0 8px;
}
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 10px;
}
.large-title {
  font-size: 40px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.large-title .accent-word {
  background: linear-gradient(100deg, var(--accent), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: 17px;
  line-height: 1.55;
  color: var(--label-secondary);
  max-width: 58ch;
  margin: 0 0 26px;
}

.lottie-hero {
  width: 100%;
  max-width: 320px;
  margin: 4px auto 8px;
}

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--bg-secondary); color: var(--label); }
.btn-primary:hover, .btn-secondary:hover { opacity: 0.88; }

/* ---------- Section titles (iOS grouped list header) ---------- */
.section { padding: 34px 0; }
.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--label-secondary);
  margin: 0 0 10px;
  padding-left: 4px;
}
.section-heading {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}
.section-sub {
  font-size: 16px;
  color: var(--label-secondary);
  line-height: 1.55;
  margin: 0 0 22px;
  max-width: 60ch;
}

/* ---------- Grouped list (iOS Settings style) ---------- */
.ios-list {
  background: var(--bg-elevated);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ios-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--separator);
}
.ios-row:last-child { border-bottom: none; }
a.ios-row { cursor: pointer; }
a.ios-row:hover { background: rgba(var(--accent-rgb), 0.05); }

.app-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 17px;
}
.row-text { flex: 1; min-width: 0; }
.row-title { font-size: 16px; font-weight: 600; margin: 0; }
.row-desc { font-size: 13px; color: var(--label-secondary); margin: 2px 0 0; }
.chevron { color: var(--label-tertiary); font-size: 14px; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elevated);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  margin-bottom: 14px;
}
.card h3 { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.card p { font-size: 15px; color: var(--label-secondary); line-height: 1.5; margin: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 620px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Steps ---------- */
.steps { display: flex; flex-direction: column; gap: 2px; }
.step {
  display: flex;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--separator);
}
.step:last-child { border-bottom: none; }
.step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--bg-secondary);
  color: var(--label);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.step h4 { margin: 2px 0 4px; font-size: 16px; font-weight: 700; }
.step p { margin: 0; font-size: 14.5px; color: var(--label-secondary); line-height: 1.5; }

/* ---------- FAQ (disclosure rows) ---------- */
.faq-item { border-bottom: 1px solid var(--separator); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 16px 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--label);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.faq-q .fa-chevron-down { font-size: 13px; color: var(--accent); transition: transform .25s ease; }
.faq-item.open .fa-chevron-down { transform: rotate(180deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  font-size: 14.5px;
  color: var(--label-secondary);
  line-height: 1.6;
}
.faq-item.open .faq-a { max-height: 260px; }
.faq-a-inner { padding: 0 4px 16px; }

/* ---------- Contact block ---------- */
.contact-card {
  background: linear-gradient(160deg, var(--accent), var(--violet));
  border-radius: 22px;
  padding: 28px 24px;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.contact-card h3 { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.contact-card p { font-size: 15px; opacity: 0.92; margin: 0 0 20px; max-width: 46ch; }
.contact-rows { display: flex; flex-direction: column; gap: 10px; }
.contact-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
}
.contact-row:hover { background: rgba(255,255,255,0.22); }
.contact-row i { width: 20px; text-align: center; }

/* ---------- Footer / Tab bar ---------- */
.site-footer {
  max-width: 780px;
  margin: 40px auto 0;
  padding: 24px 20px 40px;
  color: var(--label-tertiary);
  font-size: 13px;
  border-top: 1px solid var(--separator);
}
.footer-links { display: flex; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
.footer-links a { color: var(--label-secondary); font-weight: 500; }
.footer-links a:hover { color: var(--accent); }

.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 60;
  display: none;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: var(--nav-blur);
  border-top: 1px solid var(--separator);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.tabbar-inner { display: flex; justify-content: space-around; }
.tab-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--label-tertiary);
  padding: 4px 10px;
}
.tab-item i { font-size: 20px; }
.tab-item.active { color: var(--accent); }

@media (max-width: 700px) {
  .tabbar { display: block; }
  .large-title { font-size: 32px; }
  .nav-links > a:not(.icon-link) { display: none; }
}

/* icon color helpers */
.bg-wordpress { background: #21759B; }
.bg-tilda { background: #101010; }
.bg-craftum { background: #6C4FF5; }
.bg-yandexkit { background: #FF3333; }
.bg-maps { background: #34C759; }
.bg-delivery { background: #FF9500; }
.bg-violet { background: var(--violet); }
.bg-pink { background: var(--pink); }
.bg-teal { background: var(--teal); }

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }
