:root {
  --accent: #5b4de6;
  --accent-strong: #4a3dd1;
  --bg: #f5f5fa;
  --card: #ffffff;
  --text: #1b1b28;
  --muted: #5f6070;
  --border: #e4e4ee;
  --green: #12b76a;
  --orange: #f79009;
  --purple: #7a5af8;
  --radius: 18px;
  --max: 1040px;
}

:root { color-scheme: light; }

/* Dark: automatic (device setting) unless the visitor chose Light, or forced with the theme button (data-theme, set by assets/theme.js) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent: #8379ff;
    --accent-strong: #9a92ff;
    --bg: #0f0f17;
    --card: #181824;
    --text: #f1f1f8;
    --muted: #a3a4b8;
    --border: #2a2a3a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #8379ff;
  --accent-strong: #9a92ff;
  --bg: #0f0f17;
  --card: #181824;
  --text: #f1f1f8;
  --muted: #a3a4b8;
  --border: #2a2a3a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--card); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.nav { display: flex; gap: 20px; flex-wrap: wrap; }
.nav a { color: var(--muted); font-size: 15px; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 72px 0 56px; text-align: center; }
.hero img.app-icon { width: 120px; height: 120px; margin: 0 auto 24px; border-radius: 27px; box-shadow: 0 12px 32px rgba(91, 77, 230, .25); }
.hero h1 { font-size: clamp(34px, 6vw, 54px); line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero p.lead { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: 640px; margin: 0 auto 28px; }

.badge { display: inline-block; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 14px; font-weight: 600; }
.cta { display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: 16px; }
.cta:hover { background: var(--accent-strong); text-decoration: none; }
.cta.secondary { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.cta.secondary:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

/* Sections */
section { padding: 44px 0; }
section h2 { font-size: clamp(26px, 4vw, 34px); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
section .sub { color: var(--muted); max-width: 640px; margin: 0 0 32px; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card h3 { margin: 0 0 8px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 8px; vertical-align: baseline; }
.dot.g { background: var(--green); } .dot.o { background: var(--orange); } .dot.p { background: var(--purple); }

.langs { display: flex; flex-wrap: wrap; gap: 10px; }
.langs span { padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); font-size: 15px; }

.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* Document pages (privacy, terms, support) */
.doc { padding: 48px 0 32px; max-width: 760px; }
.doc h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.02em; }
.doc .meta { color: var(--muted); margin: 0 0 32px; font-size: 15px; }
.doc h2 { font-size: 22px; margin: 36px 0 8px; }
.doc p, .doc li { color: var(--text); }
.doc ul { padding-left: 22px; }
.doc .note { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 18px; color: var(--muted); font-size: 15px; }

/* Footer */
.site-footer { margin-top: 48px; border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

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

/* Skip link, header right side, language switcher */
.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 0 0 8px 0; z-index: 10; }
.skip:focus { left: 0; }
.head-right { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.lang { position: relative; font-size: 15px; }
.lang summary { cursor: pointer; list-style: none; color: var(--muted); font-weight: 500; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: " ▾"; font-size: 12px; }
.lang[open] summary { color: var(--text); }
.lang ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; margin: 0; padding: 6px; list-style: none; min-width: 150px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .15); }
.lang li a { display: block; padding: 7px 12px; border-radius: 8px; color: var(--text); }
.lang li a:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); text-decoration: none; }

/* Screenshots in iPhone frames (pure CSS; the screenshots already contain the status bar and Dynamic Island) */
.shots-section { padding-bottom: 20px; }
.shots { display: flex; gap: 36px; overflow-x: auto; scroll-snap-type: x proximity; padding: 24px max(20px, calc((100vw - var(--max)) / 2)) 40px; -webkit-overflow-scrolling: touch; }
.shots figure { margin: 0; flex: 0 0 auto; scroll-snap-align: center; text-align: center; }
.shots figcaption { margin-top: 16px; font-size: 15px; color: var(--muted); font-weight: 500; }
.phone { width: 250px; }  /* the screenshots carry their own phone frame (transparent PNG-style WebP) */
.phone img { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 28px rgba(20, 16, 60, .28)); }

/* Help */
.toc { columns: 2 220px; column-gap: 24px; padding-left: 20px; margin: 0 0 8px; }
.toc a { color: var(--text); }
.doc h2[id] { scroll-margin-top: 16px; }

/* Press */
.press-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-top: 12px; }
.press-grid a { display: block; color: var(--muted); font-size: 14px; text-align: center; }
.press-grid a:hover { text-decoration: none; color: var(--text); }
.press-grid img { width: 100%; height: auto; margin-bottom: 6px; }

@media (max-width: 560px) { .phone { width: 220px; } .shots { gap: 24px; } }

/* The app icon has a near-white background: a hairline keeps its edge visible on light pages */
.brand img, .hero img.app-icon { box-shadow: 0 0 0 1px rgba(0, 0, 0, .09); }
.hero img.app-icon { box-shadow: 0 0 0 1px rgba(0, 0, 0, .09), 0 12px 32px rgba(91, 77, 230, .25); }

/* Screenshots: drag with the mouse, click to enlarge (assets/site.js) */
.shots { scrollbar-width: none; }
.shots::-webkit-scrollbar { display: none; }
@media (hover: hover) and (pointer: fine) { .shots { cursor: grab; } }
.shots.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.shots a.shot { display: block; color: inherit; cursor: zoom-in; -webkit-user-drag: none; }
.shots.dragging a.shot { cursor: grabbing; }
.shots a.shot:hover { text-decoration: none; }
.shots a.shot .phone { transition: transform .2s ease; }
.shots a.shot:hover .phone, .shots a.shot:focus-visible .phone { transform: translateY(-4px); }
.shots img { -webkit-user-drag: none; user-select: none; }

html.lb-open { overflow: hidden; }
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(8, 8, 14, .92); color: #fff; }
.lightbox::backdrop { background: transparent; }
.lb-stage { height: 100%; display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 40px); padding: 16px; box-sizing: border-box; }
.lightbox figure { margin: 0; text-align: center; }
.lightbox .phone { width: min(80vw, calc((100vh - 130px) * 0.47)); }
.lightbox .phone img { filter: none; }
.lightbox figcaption { margin-top: 14px; color: #d8d8e6; font-size: 16px; font-weight: 500; }
.lb-close, .lb-nav { appearance: none; border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .14); border-radius: 999px; line-height: 1; }
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .26); }
.lb-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; font-size: 30px; }
.lb-nav { flex: 0 0 auto; width: 46px; height: 46px; font-size: 34px; padding-bottom: 4px; }
@media (max-width: 560px) {
  .lb-nav { width: 38px; height: 38px; font-size: 28px; }
  .lightbox .phone { width: min(66vw, calc((100vh - 130px) * 0.47)); }
}

/* Spacing that used to be inline style attributes (blocked by the site's Content-Security-Policy) */
.hero .badge + h1 { margin-top: 18px; }
.sub.spaced { margin-top: 18px; }
.grid.spaced-lg { margin-top: 24px; }
.card-mail { margin-top: 10px; }

.doc code { font-size: 0.92em; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.doc .note { margin: 0 0 8px; }

.legal-notice { margin-top: 36px; color: var(--muted); font-size: 15px; }

/* Flags (language menu, language chips, holiday countries) */
.flag { width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); flex: 0 0 auto; display: inline-block; }
.langs span { display: inline-flex; align-items: center; gap: 8px; }
.lang summary { display: inline-flex; align-items: center; gap: 8px; }
.lang li a { display: flex; align-items: center; gap: 10px; }

/* Beta sign-up form */
.steps { padding-left: 22px; margin: 0 0 16px; }
.beta-form { margin-top: 28px; display: grid; gap: 18px; }
.beta-form .field label, .beta-form .check { font-weight: 600; font-size: 15px; }
.beta-form .field label { display: block; margin-bottom: 6px; }
.beta-form input[type=text], .beta-form input[type=email], .beta-form select, .beta-form textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--card);
  border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 14px; appearance: none;
}
.beta-form select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
.beta-form textarea { resize: vertical; min-height: 100px; }
.beta-form input:focus, .beta-form select:focus, .beta-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.beta-form .hint { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.beta-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.beta-form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--muted); font-size: 15px; }
.beta-form .check input { margin-top: 4px; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); }
.beta-form button.cta { justify-self: start; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.beta-form button.cta:disabled { opacity: .6; cursor: progress; }
.form-status { margin: 0; min-height: 1.4em; color: var(--muted); }
.form-status.error { color: #d92d20; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 560px) { .beta-form .field-row { grid-template-columns: 1fr; } }

.turnstile { min-height: 65px; }

/* Language links in the footer (plain links so that search engines find every translation) */
.footer-langs { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 14px; margin-top: 2px; border-top: 1px solid var(--border); }
.footer-langs a, .footer-langs span { display: inline-flex; align-items: center; gap: 8px; }
.footer-langs span[aria-current] { color: var(--text); font-weight: 600; }

/* "Notify me once": the form lives in a small dialog opened by a button in the hero */
.notify-dialog { border: 1px solid var(--border); border-radius: 22px; padding: 28px 26px 22px; width: calc(100% - 32px); max-width: 480px; background: var(--card); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.notify-dialog::backdrop { background: rgba(8, 8, 14, .62); }
.nd-close { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.nd-close:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); }
.notify-form { text-align: left; }
.notify-h { margin: 0 28px 16px 0; font-size: 20px; line-height: 1.3; }
.notify-row { display: flex; gap: 10px; }
.notify-row input[type=email] { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1.5px solid var(--border); border-radius: 999px; padding: 11px 18px; appearance: none; }
.notify-row input[type=email]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.notify-row button { flex: 0 0 auto; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.notify-row button:disabled { opacity: .6; cursor: progress; }
.notify-form .check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; color: var(--muted); }
.notify-form .check input { margin-top: 3px; width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--accent); }
.notify-form .turnstile { margin-top: 14px; display: flex; justify-content: center; }
.notify-form .form-status { margin-top: 10px; }
.notify-ok { margin: 8px 0 0; padding: 16px 18px; border-radius: 14px; background: color-mix(in srgb, var(--green) 14%, transparent); font-weight: 600; }
@media (max-width: 480px) { .notify-row { flex-direction: column; } .notify-row button { width: 100%; } .notify-dialog { padding: 26px 18px 20px; } }

/* Support the developer (Ko-fi): our own button with Ko-fi's official symbol */
.support-section { padding-top: 12px; }
.support-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 24px; text-align: center; }
.support-card h2 { margin: 0 0 8px; }
.support-card p { margin: 0 auto 18px; max-width: 520px; color: var(--muted); }
/* the button itself is the shared .cta style (same as "Join the beta"); only the symbol needs a size */
.kofi-btn img { display: block; width: 30px; height: 24px; }

/* Back to top button (assets/top.js) */
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 5; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.to-top[hidden] { display: none; }
.to-top:hover { background: var(--accent-strong); }
.to-top:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
@media (min-width: 900px) { .to-top { right: 28px; bottom: 28px; } }

/* Apple's official pre-order badge (unaltered SVGs in assets/badges/): black on light, white on dark */
.store-badge { display: inline-flex; align-items: center; }
.store-badge img { display: block; height: 53px; width: auto; }

/* Theme button (Auto / Light / Dark): icon only, shown by assets/theme.js */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 30px; padding: 0; color: var(--muted); background: none; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.theme-toggle:hover { color: var(--text); }
.theme-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { display: none; }
.theme-toggle:not([data-mode]) .i-auto, .theme-toggle[data-mode="auto"] .i-auto, .theme-toggle[data-mode="light"] .i-light, .theme-toggle[data-mode="dark"] .i-dark { display: block; }

/* App Store badge: black version on light pages, white on dark (follows the theme button as well as the device setting) */
.store-badge .badge-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .store-badge .badge-light { display: none; }
  :root:not([data-theme="light"]) .store-badge .badge-dark { display: block; }
}
:root[data-theme="dark"] .store-badge .badge-light { display: none; }
:root[data-theme="dark"] .store-badge .badge-dark { display: block; }
/* Android screenshots: closed by default so the home page keeps one strip */
.shots-more summary { width: fit-content; margin-left: max(20px, calc((100vw - var(--max)) / 2)); display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 600; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 10px 20px; }
.shots-more summary::-webkit-details-marker { display: none; }
.shots-more summary::after { content: "▾"; font-size: 12px; color: var(--muted); }
.shots-more[open] summary::after { content: "▴"; }
.shots-more summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
