/* Agile Edge AI: shared styles for the home page and the app pages.
   Colours come from the logo: indigo → violet → coral, with a warm "spark" yellow. */

:root {
  --bg: #F8F7FD;
  --surface: #FFFFFF;
  --surface-2: #F0EEFA;
  --fg: #16142B;
  --muted: #625F84;
  --line: #E4E2F1;
  --indigo: #3B2FD9;
  --violet: #7A3FE0;
  --coral: #F2785A;
  --spark: #FFD27A;
  --accent: #5B3FE0;
  --accent-soft: #ECE8FF;
  --brand: linear-gradient(135deg, var(--indigo) 0%, var(--violet) 55%, var(--coral) 100%);
  --shadow: 0 24px 60px -32px rgba(48, 36, 140, 0.35);
  --radius: 22px;
  --display: "Plus Jakarta Sans", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0D1A;
    --surface: #18172C;
    --surface-2: #211F3C;
    --fg: #F2F1FA;
    --muted: #A6A4C6;
    --line: #2C2A4A;
    --accent: #9C8CFF;
    --accent-soft: #262257;
    --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
    --brand-text: linear-gradient(135deg, #9D8DFF 0%, #C48BFF 50%, #FF9C7E 100%);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left, 0px));
}
.narrow { max-width: 780px; }

h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 6.4vw, 72px); font-weight: 800; }
h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); }
.muted { color: var(--muted); }
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.gradient-text {
  background: var(--brand-text, var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -0.01em;
  color: var(--fg);
}
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.nav ul { display: flex; gap: 22px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.nav ul a { color: var(--muted); font-weight: 500; font-size: 15px; }
.nav ul a:hover { color: var(--fg); text-decoration: none; }
@media (max-width: 560px) { .nav ul .optional { display: none; } }

/* Sections */
section { padding: 96px 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head p { margin-top: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: 16px; line-height: 1;
  border: 1.5px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 12px 30px -14px rgba(91, 63, 224, 0.8); }
.btn-ghost { border-color: var(--line); color: var(--fg); background: var(--surface); }
.btn-small { padding: 10px 16px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.store-badge img { height: 48px; width: auto; }

/* Home: hero */
.hero { padding: 110px 0 96px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 720px; height: 720px;
  background: radial-gradient(closest-side, rgba(122, 63, 224, 0.22), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: auto auto -10% -12%; width: 560px; height: 560px;
  background: radial-gradient(closest-side, rgba(242, 120, 90, 0.16), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: 22px; }
.hero .lead { max-width: 560px; margin-bottom: 32px; }
.hero-icons {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px;
  max-width: 380px; justify-self: center;
}
.hero-icons img {
  width: 100%; aspect-ratio: 1; border-radius: 22.5%;
  box-shadow: var(--shadow);
}
.hero-icons a:nth-child(2) { transform: translateY(28px); }
.hero-icons a:nth-child(4) { transform: translateY(28px); }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-icons { max-width: 300px; justify-self: start; }
}

/* Home: app cards */
.apps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 760px) { .apps { grid-template-columns: 1fr; } }
.app-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow);
}
.app-card header { display: flex; gap: 16px; align-items: center; }
.app-card header img { width: 72px; height: 72px; border-radius: 22.5%; flex: none; }
.app-card h3 { font-size: 24px; }
.app-card .tag { color: var(--muted); font-size: 15px; margin-top: 2px; }
.app-card p { margin: 0; }
.app-card .actions { margin-top: auto; padding-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}

/* Home: principles */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .pillars { grid-template-columns: 1fr; } }
.pillar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.pillar .icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--brand); color: #fff; margin-bottom: 18px;
}
.pillar .icon svg { width: 24px; height: 24px; }
.pillar h3 { margin-bottom: 8px; }
.pillar p { color: var(--muted); margin: 0; }

/* Lists with checkmarks */
.checks { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
.checks li { padding-left: 32px; position: relative; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><circle cx="10" cy="10" r="10"/></svg>');
}
.checks li::after {
  content: ""; position: absolute; left: 6px; top: 9px; width: 8px; height: 4.5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg);
}

/* App page: hero */
.app-hero { padding: 72px 0 56px; text-align: center; }
.app-hero .icon { width: 128px; height: 128px; border-radius: 22.5%; margin: 0 auto 26px; box-shadow: var(--shadow); }
.app-hero h1 { font-size: clamp(40px, 6vw, 64px); }
.app-hero .lead { max-width: 640px; margin: 18px auto 30px; }
.app-hero .actions { justify-content: center; }
.subnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 30px; }
.subnav a {
  font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.subnav a:hover { color: var(--fg); text-decoration: none; }

/* App page: screenshot strip */
.shots {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 8px max(20px, calc((100vw - 1080px) / 2)) 28px;
  scrollbar-width: thin;
}
.shots > * {
  flex: none; height: min(560px, 72vh); width: auto; border-radius: 24px; scroll-snap-align: center;
  box-shadow: var(--shadow); border: 1px solid var(--line); background: var(--surface);
}
.shots img.landscape { height: min(360px, 50vh); align-self: center; }

/* App page: features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature .emoji { font-size: 28px; line-height: 1; margin-bottom: 14px; }
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 16px; }

/* App page: long-form text (privacy, terms) */
.prose h2 { margin-bottom: 18px; }
.prose h3 { margin: 30px 0 8px; }
.prose ul { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin-bottom: 6px; }
.prose .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 28px 20px; }

/* FAQ accordion */
.faq-group { margin-top: 34px; }
.faq-group > h3 { margin-bottom: 12px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 0 22px; margin-bottom: 10px;
}
summary {
  cursor: pointer; list-style: none; padding: 18px 28px 18px 0; position: relative;
  font-weight: 600; font-family: var(--display); font-size: 17px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 24px; font-weight: 400; color: var(--muted); transition: transform .2s ease;
}
details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details > div { padding-bottom: 18px; color: var(--muted); }
details > div p:last-child, details > div ul:last-child { margin-bottom: 0; }
details ul { padding-left: 20px; }

/* Contact steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li {
  counter-increment: step; position: relative; padding: 18px 22px 18px 66px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 20px; top: 16px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
}
.steps img { margin-top: 14px; width: auto; max-width: 220px; max-height: 150px; border-radius: 12px; border: 1px solid var(--line); }

/* Before / after compare (gallery) */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
figure.compare-card { margin: 0; }
.compare-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.compare {
  aspect-ratio: 4 / 5;
  position: relative; overflow: hidden; cursor: ew-resize; touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .line {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: #fff;
  transform: translateX(-1px); box-shadow: 0 0 8px rgba(0,0,0,.35);
}
.compare .line::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 17px; letter-spacing: 2px;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.compare .label {
  position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(0,0,0,.5); color: #fff;
}
.compare .label.l { left: 12px; }
.compare .label.r { right: 12px; }
.compare-card figcaption { padding: 14px 18px; font-size: 15px; }
.compare-card figcaption b { font-family: var(--display); }
.compare-card figure { margin: 0; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; }
footer .links { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; }
footer .links a { color: var(--muted); }
