/* ============================================================
   Starlie landing — brand styles
   ============================================================ */

:root {
  --bg: #fcf8f4;
  --card: #ffffff;
  --heading: #29417D;
  --accent: #3A6BA4;
  --accent-grad-a: #6088C3;
  --accent-grad-b: #4A71A7;
  --secondary: #8B8FA8;
  --star-yellow: #FCC858;
  --text: #3c4258;
  --text-soft: #555b74;
  --card-radius: 22px;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --card-border: 1px solid rgba(0, 0, 0, 0.04);
  --header-bg: rgba(252, 248, 244, 0.88);
  --header-border: rgba(0, 0, 0, 0.04);
  --pill-bg: #fff;
  --pill-border: rgba(0, 0, 0, 0.06);
  --pill-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --pill-active-bg: var(--heading);
  --pill-active-fg: #fff;
  --btn-shadow: 0 4px 14px rgba(74, 113, 167, 0.35);
  --btn-shadow-hover: 0 8px 20px rgba(74, 113, 167, 0.4);
  --icon-blue: #e8f0fb;
  --icon-yellow: #fdf1d8;
  --icon-peach: #fde9dd;
  --icon-violet: #efeafb;
  --icon-green: #e4f4e8;
  --premium-shadow: 0 10px 30px rgba(74, 113, 167, 0.35);
  --input-bg: #fff;
  --input-border: #e5e7eb;
  --input-placeholder: #b6b9c9;
  --focus-ring: rgba(58, 107, 164, 0.12);
  --error: #d64545;
  --footer-bg: rgba(255, 255, 255, 0.4);
  --footer-border: rgba(0, 0, 0, 0.05);
  --quote-bg: #f4f7fb;
  --quote-text: #4a5068;
  --rule: rgba(0, 0, 0, 0.07);
  --code-bg: #f1f2f6;
  --hero-star-glow: drop-shadow(0 10px 25px rgba(252, 200, 88, 0.4));
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Dark "starry night" theme — palette sampled from the app icon:
   deep #021e49, glow #1d4071, mid #052658, star yellow #fdc851. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #021e49;
  --card: rgba(9, 30, 66, 0.75);
  --heading: #eaf1fb;
  --accent: #8fb3e0;
  --accent-grad-a: #4a71a7;
  --accent-grad-b: #315586;
  --secondary: #93a5c4;
  --text: #c9d5ea;
  --text-soft: #b7c6e0;
  --card-shadow: none;
  --card-border: 1px solid rgba(255, 255, 255, 0.08);
  --header-bg: rgba(3, 21, 48, 0.72);
  --header-border: rgba(255, 255, 255, 0.08);
  --pill-bg: rgba(255, 255, 255, 0.07);
  --pill-border: rgba(255, 255, 255, 0.14);
  --pill-shadow: none;
  --pill-active-bg: #fdc851;
  --pill-active-fg: #1d2a47;
  --btn-shadow: 0 4px 16px rgba(2, 10, 30, 0.5);
  --btn-shadow-hover: 0 8px 22px rgba(2, 10, 30, 0.6);
  --icon-blue: rgba(96, 136, 195, 0.22);
  --icon-yellow: rgba(253, 200, 81, 0.16);
  --icon-peach: rgba(244, 160, 120, 0.16);
  --icon-violet: rgba(167, 139, 250, 0.18);
  --icon-green: rgba(110, 200, 140, 0.18);
  --premium-shadow: 0 10px 30px rgba(2, 10, 30, 0.5);
  --input-bg: rgba(2, 16, 40, 0.55);
  --input-border: rgba(255, 255, 255, 0.16);
  --input-placeholder: #7f92b5;
  --focus-ring: rgba(143, 179, 224, 0.25);
  --error: #ff9b9b;
  --footer-bg: rgba(2, 14, 36, 0.45);
  --footer-border: rgba(255, 255, 255, 0.08);
  --quote-bg: rgba(255, 255, 255, 0.05);
  --quote-text: #b7c6e0;
  --rule: rgba(255, 255, 255, 0.1);
  --code-bg: rgba(255, 255, 255, 0.09);
  --hero-star-glow: drop-shadow(0 0 28px rgba(253, 200, 81, 0.45)) drop-shadow(0 10px 25px rgba(253, 200, 81, 0.25));
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Dark theme: starry night sky ---------- */

/* Fixed night-sky gradient behind everything (edges #021e49, soft
   center glow #1d4071, deep bottom #04265a). */
html[data-theme="dark"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 65% at 50% 32%, #1d4071 0%, rgba(29, 64, 113, 0) 72%),
    linear-gradient(180deg, #021e49 0%, #052658 55%, #04265a 100%);
}

/* Subtle star field: each layer is one tiny dot tiled at its own size,
   so the pattern never reads as a grid. */
html[data-theme="dark"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 24px 34px, rgba(255, 255, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 140px 120px, rgba(255, 255, 255, 0.35) 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 250px 60px, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 82px 210px, rgba(255, 255, 255, 0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 310px 260px, rgba(255, 255, 255, 0.4) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 190px 320px, rgba(255, 255, 255, 0.28) 50%, transparent 51%),
    radial-gradient(1px 1px at 360px 170px, rgba(255, 255, 255, 0.32) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 110px 30px, rgba(253, 200, 81, 0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 290px 380px, rgba(253, 200, 81, 0.4) 50%, transparent 51%);
  background-size:
    390px 390px, 430px 430px, 470px 470px, 350px 350px, 510px 510px,
    450px 450px, 410px 410px, 550px 550px, 590px 590px;
}

/* ---------- Decorative background stars ---------- */

.bg-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-star {
  position: absolute;
  color: var(--star-yellow);
  opacity: 0.55;
  animation: twinkle 4s ease-in-out infinite;
}

.bg-star:nth-child(2n) { animation-delay: 1.3s; }
.bg-star:nth-child(3n) { animation-delay: 2.4s; opacity: 0.35; }

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.9); }
  50%      { opacity: 0.7;  transform: scale(1.1); }
}

.site-header, main, .site-footer { position: relative; z-index: 1; }

/* ---------- Theme transition (enabled by app.js after first paint) ---------- */

html.theme-ready body,
html.theme-ready .site-header,
html.theme-ready .site-footer,
html.theme-ready .lang-switch,
html.theme-ready .theme-toggle,
html.theme-ready .legal-card,
html.theme-ready .card {
  transition:
    background-color 250ms ease,
    color 250ms ease,
    border-color 250ms ease,
    opacity 600ms ease,
    transform 600ms ease;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-star { width: 30px; height: 30px; }

.brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: 0.2px;
}

.header-nav {
  display: flex;
  gap: 16px;
  margin-left: 6px;
}

.header-nav a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 150ms ease;
}

.header-nav a:hover { color: var(--accent); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: flex;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--pill-shadow);
}

.lang-btn {
  border: none;
  background: transparent;
  display: inline-block;
  text-decoration: none;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--secondary);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 150ms ease;
}

.lang-btn:hover { color: var(--accent); }

.lang-btn.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-fg);
}

/* ---------- Theme toggle ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  box-shadow: var(--pill-shadow);
  color: var(--secondary);
  cursor: pointer;
  transition: color 150ms ease;
}

.theme-toggle:hover { color: var(--accent); }

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

.theme-toggle svg { display: block; }

.theme-toggle .icon-sun { display: none; }

html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

html[data-theme="dark"] .theme-toggle { color: var(--star-yellow); }
html[data-theme="dark"] .theme-toggle:hover { color: #ffdc8a; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-grad-a), var(--accent-grad-b));
  color: #fff;
  box-shadow: var(--btn-shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-shadow-hover);
  filter: brightness(1.03);
}

.btn-small { font-size: 0.85rem; padding: 8px 16px; }

.btn-cta {
  font-size: 1.05rem;
  padding: 14px 28px;
  margin-top: 24px;
}

.cta-apple { font-size: 1.15em; line-height: 1; margin-top: -2px; }

.btn-block { width: 100%; font-size: 1rem; padding: 13px 20px; }

/* ---------- Hero ---------- */

.hero { padding: 56px 0 30px; }

.hero-inner {
  display: flex;
  align-items: center;
  gap: 32px;
}

.hero-copy { flex: 1 1 auto; max-width: 620px; }

.hero-title {
  font-size: clamp(2.6rem, 7vw, 4rem);
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 18px;
}

.hero-sparkle {
  color: var(--star-yellow);
  font-size: 0.55em;
  vertical-align: super;
}

.hero-text {
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 56ch;
}

.hero-art { flex: 0 0 auto; }

.hero-star {
  width: clamp(140px, 22vw, 240px);
  height: auto;
  filter: var(--hero-star-glow);
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-14px) rotate(3deg); }
}

/* ---------- Sections ---------- */

.section { padding: 44px 0; }

.section-title {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: 800;
  color: var(--heading);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
  margin-bottom: 32px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border-radius: var(--card-radius);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 26px;
}

/* ---------- Features ---------- */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* 7 карток у 3 колонки: остання (сьома) — по центру останнього ряду. */
.features-grid .feature-card:last-child {
  grid-column: 2;
}

.feature-card h3 {
  color: var(--heading);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 14px 0 8px;
  line-height: 1.4;
}

.feature-card p {
  font-size: 0.94rem;
  color: var(--text-soft);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.icon-blue   { background: var(--icon-blue); }
.icon-yellow { background: var(--icon-yellow); }
.icon-peach  { background: var(--icon-peach); }
.icon-violet { background: var(--icon-violet); }
.icon-green  { background: var(--icon-green); }

/* ---------- Plans ---------- */

.plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 860px;
  margin: 0 auto;
}

.plan-card { text-align: center; padding: 34px 28px; }

.plan-title {
  color: var(--heading);
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.plan-card p { font-size: 0.96rem; color: var(--text-soft); }

.plan-premium {
  position: relative;
  background: linear-gradient(150deg, var(--accent-grad-a), var(--accent-grad-b));
  box-shadow: var(--premium-shadow);
}

.plan-premium .plan-title { color: #fff; }
.plan-premium p { color: rgba(255, 255, 255, 0.92); }

html[data-theme="dark"] .plan-premium {
  background: linear-gradient(150deg, #33619f, #1d4071);
  border-color: rgba(255, 255, 255, 0.18);
}

.plan-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--star-yellow);
  color: #5b4514;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(252, 200, 88, 0.5);
}

/* ---------- Reviews ---------- */

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.review-card { padding: 24px; }

.review-wide { grid-column: 1 / -1; }

.stars {
  color: var(--star-yellow);
  font-size: 1.05rem;
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.review-card h3 {
  color: var(--heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.review-card p {
  font-size: 0.92rem;
  color: var(--text-soft);
}

/* ---------- Contact form ---------- */

.contact-wrap { max-width: 640px; }

.contact-lead {
  text-align: center;
  color: var(--text-soft);
  margin: -14px auto 28px;
  max-width: 52ch;
}

.contact-card { padding: 30px; }

.form-field { margin-bottom: 18px; }

.form-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 6px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 16px;
  padding: 12px 16px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--input-placeholder); }

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-error {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--error);
}

.form-error a { color: var(--error); font-weight: 700; }

.success-card {
  text-align: center;
  padding: 44px 30px;
  animation: pop-in 400ms ease;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

.success-star {
  font-size: 2.4rem;
  color: var(--star-yellow);
  margin-bottom: 8px;
}

.success-card h3 {
  color: var(--heading);
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.success-card p { color: var(--text-soft); }

/* ---------- AI disclaimer ---------- */

.section-disclaimer { padding-top: 6px; padding-bottom: 30px; }

.ai-disclaimer {
  text-align: center;
  color: var(--secondary);
  font-size: 0.92rem;
  max-width: 62ch;
  margin: 0 auto;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--footer-border);
  padding: 34px 0 44px;
  background: var(--footer-bg);
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--secondary);
  font-size: 0.92rem;
  font-weight: 600;
}

.footer-brand .brand-star { width: 24px; height: 24px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--secondary);
  font-size: 0.88rem;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover { text-decoration: underline; }

.footer-fine {
  font-size: 0.78rem;
  color: var(--secondary);
  max-width: 76ch;
  margin-bottom: 8px;
}

.footer-fine a { color: var(--accent); }

/* ---------- Reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  /* На 2 колонках сьома картка — по центру ряду, тієї ж ширини, що сусідні. */
  .features-grid .feature-card:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 10px);
  }
  .reviews-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .hero { padding-top: 34px; }

  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-copy { display: flex; flex-direction: column; align-items: center; }

  .hero-star { width: 130px; }

  .header-nav { display: none; }

  .plans-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .features-grid { grid-template-columns: 1fr; }
  .features-grid .feature-card:last-child {
    grid-column: auto;
    justify-self: stretch;
    width: auto;
  }
  .reviews-grid { grid-template-columns: 1fr; }
  .feature-card { padding: 22px; }
  .footer-top { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .header-inner { gap: 8px; }
  .brand-name { font-size: 1.15rem; }
  .lang-btn { padding: 5px 7px; font-size: 0.72rem; }
  .header-actions { gap: 8px; }
  .theme-toggle { width: 31px; height: 31px; }
  .header-store-btn { padding: 7px 12px; font-size: 0.8rem; }
}

/* ---------- Legal pages ---------- */

.legal-header {
  padding: 18px 0;
}

.legal-header .brand { gap: 10px; }

.legal-back {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.legal-back:hover { text-decoration: underline; }

.legal-card {
  background: var(--card);
  border-radius: var(--card-radius);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  max-width: 760px;
  margin: 10px auto 56px;
  padding: clamp(24px, 5vw, 48px);
}

.legal-card h1 {
  color: var(--heading);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.25;
  margin-bottom: 20px;
}

.legal-card h2 {
  color: var(--heading);
  font-size: 1.25rem;
  margin: 30px 0 12px;
  line-height: 1.35;
}

.legal-card h3 {
  color: var(--heading);
  font-size: 1.05rem;
  margin: 24px 0 10px;
}

.legal-card p { margin-bottom: 14px; font-size: 0.97rem; }

.legal-card ul, .legal-card ol {
  margin: 0 0 14px 24px;
}

.legal-card li { margin-bottom: 8px; font-size: 0.97rem; }

.legal-card li > ul, .legal-card li > ol { margin-top: 8px; margin-bottom: 0; }

.legal-card a { color: var(--accent); }

.legal-card blockquote {
  border-left: 4px solid var(--accent-grad-a);
  background: var(--quote-bg);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  margin: 0 0 14px;
  color: var(--quote-text);
}

.legal-card blockquote p:last-child { margin-bottom: 0; }

.legal-card hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 26px 0;
}

.legal-card code {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

.legal-card em { color: var(--text-soft); }
