/* =================================================================
   {{APP_NAME}} — landing page styles
   Apple HIG-inspired. Professional blue accent.
   ================================================================= */

/* ---- Theme tokens ------------------------------------------------ */
:root {
  --accent:        #0071e3;
  --accent-hover:  #0077ed;
  --accent-soft:   #e8f1fd;
  --gradient:      linear-gradient(135deg, #0071e3 0%, #42a5f5 100%);

  --bg:            #ffffff;
  --bg-alt:        #f5f5f7;
  --surface:       #ffffff;
  --text:          #1d1d1f;
  --text-soft:     #6e6e73;
  --border:        #d2d2d7;
  --shadow:        0 12px 40px rgba(0, 0, 0, 0.10);
  --shadow-sm:     0 2px 14px rgba(0, 0, 0, 0.07);

  --radius:        18px;
  --radius-sm:     12px;
  --max:           1180px;
  --nav-h:         60px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --accent:        #2997ff;
  --accent-hover:  #47a6ff;
  --accent-soft:   #11233a;
  --gradient:      linear-gradient(135deg, #2997ff 0%, #6db8ff 100%);

  --bg:            #000000;
  --bg-alt:        #0e0e10;
  --surface:       #1c1c1e;
  --text:          #f5f5f7;
  --text-soft:     #a1a1a6;
  --border:        #38383a;
  --shadow:        0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-sm:     0 2px 14px rgba(0, 0, 0, 0.40);
}

/* ---- Reset ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 22px; }

/* ---- Accessibility ----------------------------------------------- */
.skip-link {
  position: absolute; left: 12px; top: -48px;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: 8px; z-index: 200; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---- Buttons ----------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font: inherit; font-weight: 600; font-size: 1rem;
  padding: 13px 26px; border-radius: 980px; border: 1px solid transparent;
  background: var(--accent); color: #fff; cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,113,227,0.32); }
.btn:active { transform: translateY(0); }
.btn--small { padding: 9px 18px; font-size: 0.9rem; }
.btn--ghost {
  background: transparent; color: var(--accent);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent); box-shadow: none; }

/* ---- Navigation -------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--border); }

.nav__inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); }
.nav__brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; }
.nav__icon { display: flex; }
.nav__name { font-size: 1.05rem; letter-spacing: -0.01em; }

.nav__links { display: flex; gap: 26px; }
.nav__links a { color: var(--text-soft); font-size: 0.92rem; font-weight: 500; transition: color 0.18s var(--ease); }
.nav__links a:hover { color: var(--text); }

.nav__actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.theme-toggle:hover { transform: rotate(12deg) scale(1.05); border-color: var(--accent); }
.theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: block; }

.nav__burger { display: none; flex-direction: column; gap: 5px; width: 38px; height: 38px;
  background: none; border: none; cursor: pointer; padding: 8px; }
.nav__burger span { display: block; height: 2px; width: 100%; background: var(--text);
  border-radius: 2px; transition: transform 0.25s var(--ease), opacity 0.2s var(--ease); }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__mobile { display: none; flex-direction: column; padding: 8px 22px 18px; border-bottom: 1px solid var(--border); }
.nav__mobile a { padding: 12px 4px; color: var(--text); font-weight: 500; border-bottom: 1px solid var(--border); }
.nav__mobile a:last-child { border-bottom: none; }

/* ---- Hero -------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: 64px 0 90px; }
.hero__bg {
  position: absolute; inset: -20% -10% auto -10%; height: 720px; z-index: 0;
  background:
    radial-gradient(560px 380px at 78% 8%, rgba(66,165,245,0.28), transparent 70%),
    radial-gradient(520px 420px at 12% 22%, rgba(0,113,227,0.20), transparent 70%);
  filter: blur(8px); will-change: transform;
}
.hero__inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center;
}

.hero__icon img { width: 120px; height: 120px; border-radius: 27px; box-shadow: var(--shadow); }
.hero__icon img.img-fallback,
.hero__icon .img-fallback { background: var(--gradient); }

.hero__title { font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; margin-top: 22px; }
.hero__tagline { font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 600; margin-top: 10px;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__desc { color: var(--text-soft); font-size: 1.06rem; margin-top: 14px; max-width: 30rem; }

.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; }
.hero__meta { display: flex; align-items: center; gap: 10px; margin-top: 20px; color: var(--text-soft); font-size: 0.92rem; }
.hero__stars { color: #ffb400; letter-spacing: 2px; }

.appstore-badge { display: inline-flex; border-radius: 9px; transition: transform 0.18s var(--ease); }
.appstore-badge:hover { transform: scale(1.04); }
.appstore-badge svg { border-radius: 9px; display: block; }

/* ---- iPhone mockup ---------------------------------------------- */
.hero__device { display: flex; justify-content: center; will-change: transform; }
.iphone {
  position: relative; width: 290px; aspect-ratio: 9 / 19.5;
  background: #1d1d1f; border-radius: 46px; padding: 12px;
  box-shadow: var(--shadow), 0 0 0 2px rgba(0,0,0,0.06);
}
.iphone--sm { width: 232px; }
.iphone__notch {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 42%; height: 26px; background: #1d1d1f; border-radius: 0 0 16px 16px; z-index: 2;
}
.iphone__screen {
  position: relative; height: 100%; border-radius: 35px; overflow: hidden; background: #000;
}
.iphone__screen img { width: 100%; height: 100%; object-fit: cover; }

/* generated placeholder screen (injected by JS) */
.ph-screen {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0071e3, #42a5f5);
  color: #fff; font-weight: 600; font-size: 1rem; letter-spacing: 0.02em;
}

/* ---- Section scaffolding ---------------------------------------- */
.section { padding: 92px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 40rem; margin: 0 auto 56px; text-align: center; }
.section__eyebrow { color: var(--accent); font-weight: 600; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.08em; }
.section__title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; }
.section__lead { color: var(--text-soft); font-size: 1.05rem; margin-top: 12px; }
.section__lead code, code { background: var(--accent-soft); color: var(--accent); padding: 1px 7px; border-radius: 6px; font-size: 0.92em; }

/* ---- Features ---------------------------------------------------- */
.features__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 26px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.feature-card__icon {
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 14px; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px;
}
.feature-card h3 { font-size: 1.18rem; font-weight: 600; letter-spacing: -0.01em; }
.feature-card p { color: var(--text-soft); margin-top: 7px; font-size: 0.97rem; }

/* ---- Screenshots carousel --------------------------------------- */
.carousel { position: relative; display: flex; align-items: center; gap: 8px;
  max-width: var(--max); margin-inline: auto; padding-inline: 22px; }
.carousel__track {
  display: flex; gap: 26px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 18px 4px; scrollbar-width: none; flex: 1;
}
.carousel__track::-webkit-scrollbar { display: none; }
.shot { scroll-snap-align: center; flex: 0 0 auto; transition: transform 0.3s var(--ease); }

.carousel__arrow {
  display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.carousel__arrow:hover { background: var(--accent); color: #fff; transform: scale(1.08); }

.carousel__dots { display: flex; justify-content: center; gap: 9px; margin-top: 12px; }
.carousel__dots button {
  width: 9px; height: 9px; border-radius: 50%; border: none; padding: 0;
  background: var(--border); cursor: pointer; transition: all 0.2s var(--ease);
}
.carousel__dots button[aria-selected="true"] { background: var(--accent); width: 26px; border-radius: 6px; }

/* ---- How it works ----------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; list-style: none; position: relative; }
.steps::before {
  content: ""; position: absolute; top: 34px; left: 16%; right: 16%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--border) 0 8px, transparent 8px 16px); z-index: 0;
}
.step {
  position: relative; z-index: 1; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 24px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.step:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.step__num {
  display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 16px;
  border-radius: 50%; background: var(--gradient); color: #fff; font-weight: 700; font-size: 1.2rem;
  box-shadow: 0 6px 16px rgba(0,113,227,0.35);
}
.step h3 { font-size: 1.15rem; font-weight: 600; }
.step p { color: var(--text-soft); margin-top: 7px; font-size: 0.97rem; }

/* ---- Developer --------------------------------------------------- */
.developer { display: grid; grid-template-columns: 220px 1fr; gap: 44px; align-items: center; }
.developer__photo img, .developer__photo .ph-avatar {
  width: 200px; height: 200px; border-radius: 50%; object-fit: cover;
  box-shadow: var(--shadow); border: 4px solid var(--surface);
}
.ph-avatar { display: grid; place-items: center; background: var(--gradient); color: #fff; font-size: 3.4rem; font-weight: 700; }
.developer__bio { color: var(--text-soft); font-size: 1.05rem; margin-top: 14px; max-width: 38rem; }
.developer__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* ---- Changelog --------------------------------------------------- */
.changelog { list-style: none; max-width: 46rem; margin-inline: auto; }
.changelog__item {
  display: grid; grid-template-columns: 160px 1fr; gap: 20px;
  padding: 22px 0; border-bottom: 1px solid var(--border);
}
.changelog__item:last-child { border-bottom: none; }
.changelog__ver { display: flex; flex-direction: column; }
.changelog__ver strong { font-size: 1.05rem; }
.changelog__ver time { color: var(--text-soft); font-size: 0.88rem; }
.changelog__item p { color: var(--text-soft); }

/* ---- Support grid ----------------------------------------------- */
.support-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 44px; }
.info-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
}
.info-card h3 { font-size: 1.15rem; font-weight: 600; }
.info-card p { color: var(--text-soft); font-size: 0.96rem; margin-top: 8px; }
.info-card .btn { margin-top: 16px; }

.rating { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.rating__num { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.02em; }
.rating__stars { color: #ffb400; font-size: 1.2rem; letter-spacing: 2px; }
.rating__count { font-size: 0.9rem; }

.link-list { list-style: none; margin-top: 14px; }
.link-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.link-list li:last-child { border-bottom: none; }
.contact-email { font-size: 1.05rem; margin-top: 12px; }

/* ---- Contact form ----------------------------------------------- */
.contact {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px; max-width: 720px; margin-inline: auto;
}
.contact h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 18px; }
.contact__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field span { font-size: 0.88rem; font-weight: 600; }
.field input, .field textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; resize: vertical; transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input:invalid:not(:placeholder-shown) { border-color: #e3354b; }
.contact__note { color: var(--text-soft); font-size: 0.86rem; margin-top: 10px; }

/* ---- Footer ------------------------------------------------------ */
.footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 60px 0 28px; }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; }
.footer__brand p { color: var(--text-soft); font-size: 0.94rem; margin: 6px 0 16px; }
.footer__col { display: flex; flex-direction: column; gap: 10px; }
.footer__col h4 { font-size: 0.92rem; font-weight: 600; margin-bottom: 4px; }
.footer__col a { color: var(--text-soft); font-size: 0.92rem; transition: color 0.18s var(--ease); }
.footer__col a:hover { color: var(--accent); }
.footer__social { display: flex; gap: 12px; }
.footer__social a {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 50%; color: var(--text-soft);
  transition: all 0.2s var(--ease);
}
.footer__social a:hover { color: #fff; background: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.footer__bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border);
  color: var(--text-soft); font-size: 0.86rem;
}

/* ---- Back to top ------------------------------------------------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(12px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.to-top.is-visible { opacity: 1; transform: translateY(0); }
.to-top:hover { background: var(--accent); color: #fff; }

/* ---- Reveal-on-scroll ------------------------------------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---- Responsive -------------------------------------------------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .nav__mobile.is-open { display: flex; }
  .hero__inner { grid-template-columns: 1fr; text-align: center; gap: 36px; }
  .hero__copy { display: flex; flex-direction: column; align-items: center; }
  .hero__cta, .hero__meta { justify-content: center; }
  .features__grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .steps::before { display: none; }
  .support-grid { grid-template-columns: 1fr; }
  .developer { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .developer__links { justify-content: center; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .section { padding: 64px 0; }
  .features__grid { grid-template-columns: 1fr; }
  .contact { padding: 24px; }
  .contact__row { grid-template-columns: 1fr; }
  .changelog__item { grid-template-columns: 1fr; gap: 6px; }
  .footer__inner { grid-template-columns: 1fr; }
  .nav__name { display: none; }
  .iphone { width: 244px; }
}

/* ---- Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
