/* Shared layout for every public page (site + blog): header, mobile menu, footer,
   buttons, page header and article typography. One source so pages can't drift.
   Header/footer markup is stamped by scripts/build-chrome.mjs. */

:root {
  --cream: #fff8f0;
  --lavender: #f2efff;
  --navy: #1a1a2e;
  --dark-violet: #242047;
  --violet: #6c63ff;
  --violet-dark: #4d46b8;
  --mint: #00d9a5;
  --border: #e7e3f5;
  --header-h: 64px;
  --gutter: 20px;
}
@media (min-width: 640px) { :root { --gutter: 32px; } }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body { font-family: Inter, system-ui, sans-serif; color: var(--navy); background: var(--cream); -webkit-font-smoothing: antialiased; }

/* One content width everywhere: 1152px, so large screens don't spread content out */
.site-container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }

/* Size copy against its own column, including when a split layout stacks. */
.copy-block, .page-head .site-container, .page-head .reading { container-type: inline-size; }
.section-heading { max-width: 48rem; margin-inline: auto; text-align: center; container-type: inline-size; }
.section-title { font-size: clamp(32px, 7cqi, 56px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
/* Intrinsic mock content must not force a grid wider than its available space. */
main .grid > *, .card-grid > * { min-width: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 24px; }
.card-featured { grid-column: 1 / -1; }
.card-preview { container-type: inline-size; }
.card-preview-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 16px; width: 100%; }
.card-preview-row > * { min-width: 0; }
.card-preview-row > :last-child { justify-self: start; max-width: 100%; }
@container (max-width: 18rem) { .card-preview-row { grid-template-columns: 1fr; } }
.mode-card-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.mode-card-heading h3 { flex: 1 1 12rem; min-width: 0; }

/* Keep device previews readable; reflow them instead of shrinking them. */
.hero-layout > div { min-width: 0; }
.hero-title { font-size: 42px; line-height: 1.05; font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
.hero-visual { width: 100%; max-width: 504px; justify-self: center; }
.hero-devices { display: grid; grid-template-columns: repeat(auto-fit, 240px); justify-content: center; gap: 24px; }
@media (max-width: 639px) {
  .hero-layout .hero-downloads { gap: 8px; }
  .hero-downloads .btn { padding-inline: 12px; }
}
@media (min-width: 640px) { .hero-title { font-size: clamp(54px, calc(10cqi - 4px), 76px); } }
@media (min-width: 960px) {
  .hero-layout { grid-template-columns: minmax(0, 1fr) 504px; gap: 32px; }
  .hero-title { font-size: clamp(44px, 10cqi, 56px); }
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 240, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header-row { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-logo { display: inline-flex; flex-shrink: 0; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--navy); text-decoration: none; }
.site-logo img { width: 36px; height: 36px; border-radius: 12px; box-shadow: 0 4px 24px -8px rgba(76, 64, 175, 0.18); }
.site-logo-light { color: #fff; }
.site-nav { display: none; align-items: center; gap: 28px; font-size: 14.5px; font-weight: 500; }
.site-nav a { color: rgba(26, 26, 46, 0.75); text-decoration: none; transition: color 0.15s; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--violet); }
.site-nav a[aria-current="page"] { font-weight: 700; }
@media (min-width: 1024px) { .site-nav { display: flex; } }
.site-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; border-radius: 999px; padding: 12px 22px; font-size: 15px; font-weight: 700; text-align: center; text-decoration: none; transition: background 0.15s, transform 0.15s; white-space: normal; }
.btn svg { flex-shrink: 0; }
.site-actions > .btn, .hero-downloads > .btn { white-space: nowrap; }
.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-primary { background: var(--violet); color: #fff; box-shadow: 0 4px 24px -8px rgba(76, 64, 175, 0.35); }
.btn-primary:hover { background: var(--violet-dark); }
.btn-secondary { background: #fff; color: var(--violet); border: 1px solid rgba(108, 99, 255, 0.2); }
.btn-secondary:hover { background: var(--lavender); }
/* Keep both stores visible, with compact controls on phones. */
@media (max-width: 639px) {
  .site-header-row { gap: 12px; }
  .site-actions { gap: 6px; }
  .site-actions > .btn { padding: 9px 10px; font-size: 12px; gap: 6px; }
  .site-actions > .btn svg { width: 14px; height: 14px; }
}
@media (max-width: 479px) { .site-header .site-logo > span { display: none; } }
@media (max-width: 379px) {
  .site-header-row { padding-inline: 12px; gap: 8px; }
  .site-header .site-logo img { width: 28px; height: 28px; border-radius: 9px; }
  .site-actions { gap: 4px; }
  .site-actions > .btn { padding-inline: 7px; gap: 4px; }
  .site-header .site-menu > summary { width: 32px; }
}

/* ---------- mobile menu (no-JS <details>; JS only closes it) ---------- */
.site-menu > summary {
  list-style: none; cursor: pointer; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: #fff; display: grid; place-items: center;
}
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu-icon, .site-menu-icon::before, .site-menu-icon::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--navy); transition: transform 0.2s, background 0.2s; }
.site-menu-icon { position: relative; }
.site-menu-icon::before, .site-menu-icon::after { content: ""; position: absolute; left: 0; }
.site-menu-icon::before { top: -6px; }
.site-menu-icon::after { top: 6px; }
.site-menu[open] .site-menu-icon { background: transparent; }
.site-menu[open] .site-menu-icon::before { transform: translateY(6px) rotate(45deg); }
.site-menu[open] .site-menu-icon::after { transform: translateY(-6px) rotate(-45deg); }
.site-menu-panel {
  position: absolute; left: 0; right: 0; top: var(--header-h);
  background: var(--cream); border-bottom: 1px solid var(--border);
  box-shadow: 0 24px 40px -24px rgba(76, 64, 175, 0.35);
  padding: 8px var(--gutter) 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px;
}
.site-menu-panel > a { padding: 13px 0; font-size: 16px; font-weight: 600; color: var(--navy); text-decoration: none; border-bottom: 1px solid var(--border); }
.site-menu-panel > a[aria-current="page"] { color: var(--violet); }
@media (min-width: 1024px) { .site-menu { display: none; } }

/* ---------- page header (blog hub, posts, support/legal) ---------- */
.page-head { position: relative; overflow: hidden; padding-block: 48px 32px; }
@media (min-width: 640px) { .page-head { padding-block: 64px 40px; } }
.page-head::before, .page-head::after { content: ""; position: absolute; z-index: -1; border-radius: 999px; filter: blur(64px); }
.page-head::before { width: 420px; height: 420px; left: -140px; top: -160px; background: var(--lavender); opacity: 0.9; }
.page-head::after { width: 360px; height: 360px; right: -120px; top: 40px; background: #effff8; opacity: 0.9; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--violet); }
.page-title { margin-top: 12px; font-size: clamp(36px, 7.5cqi, 64px); line-height: 1.06; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.page-lead { margin-top: 16px; max-width: 42rem; font-size: 17px; line-height: 1.7; color: rgba(26, 26, 46, 0.7); }
@media (min-width: 640px) { .page-lead { font-size: 18px; } }
.page-meta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; font-weight: 600; color: rgba(26, 26, 46, 0.5); }
.back-link { display: inline-flex; gap: 6px; font-size: 14px; font-weight: 700; color: var(--violet); text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.page-body { padding-bottom: 72px; }
@media (min-width: 640px) { .page-body { padding-bottom: 96px; } }

/* reading column + typography shared by blog posts and legal pages */
.reading { max-width: 46rem; margin-inline: auto; }
.prose { color: rgba(26, 26, 46, 0.78); font-size: 17px; line-height: 1.8; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.5rem 0 0.75rem; color: var(--navy); font-size: 1.625rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
.prose h3 { margin: 1.75rem 0 0.5rem; color: var(--navy); font-size: 1.2rem; line-height: 1.3; font-weight: 800; }
.prose p { margin: 1rem 0; }
.prose ul, .prose ol { margin: 1rem 0; padding-left: 1.4rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 0.4rem 0; }
.prose strong { color: var(--navy); font-weight: 800; }
.prose a { color: var(--violet); font-weight: 700; text-decoration: none; }
.prose a:hover { color: var(--violet-dark); text-decoration: underline; }

/* card surface used across home, blog and support */
.card { min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: 28px; background: #fff; box-shadow: 0 10px 40px -12px rgba(76, 64, 175, 0.18); }

/* ---------- footer ---------- */
.site-footer { background: var(--dark-violet); color: #fff; }
.site-footer-grid { display: grid; gap: 32px; padding-block: 48px 32px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-footer-brand { grid-column: 1 / -1; }
.site-footer #download { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
.site-footer #download > p { flex-basis: 100%; }
@media (min-width: 640px) {
  .site-footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .site-footer #download { grid-column: auto; flex-direction: column; flex-wrap: nowrap; }
  .site-footer #download > p { flex-basis: auto; }
}
@media (min-width: 1024px) {
  .site-footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; padding-block: 56px 40px; }
  .site-footer-brand { grid-column: auto; }
}
.site-footer-brand p { margin-top: 14px; max-width: 18rem; font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, 0.7); }
.site-footer-mail { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 600; color: #c7c3ff; text-decoration: none; }
.site-footer-mail:hover { color: #fff; }
.site-footer-col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.site-footer-col > p { margin-bottom: 4px; font-weight: 700; color: #fff; }
.site-footer-col > a:not(.store-badge) { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.site-footer-col > a:not(.store-badge):hover { color: #fff; }
.store-badge { display: flex; flex-direction: column; width: 180px; max-width: 100%; padding: 9px 16px; border-radius: 14px; background: #000; color: #fff; font-size: 15px; font-weight: 700; line-height: 1.2; text-decoration: none; }
.store-badge small { font-size: 10px; font-weight: 500; color: rgba(255, 255, 255, 0.7); }
.store-badge:hover { background: rgba(0, 0, 0, 0.7); }
.site-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px 28px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 12.5px; color: rgba(255, 255, 255, 0.55); }
.site-footer-bottom a { color: inherit; }
