/*
 * Backflick site stylesheet, identity "Compasso" (gate P3).
 *
 * Color tokens are the semantic roles of brand/cores.json (light and dark),
 * the same values as the app's DesignSystem. site/qa/contrast.mjs reads the
 * tokens below and measures every pair the rules use; change a value only
 * together with brand/cores.json.
 *
 * Logical properties only (the Arabic pages are right to left), no motion,
 * no script. The brand font Alexandria is used for headings only; body text
 * stays on the system stack. The @font-face blocks are printed by
 * site/fonts/build-fonts.py.
 */

/* latin: 22372 bytes */
@font-face {
  font-family: "Alexandria";
  src: url("/assets/fonts/alexandria-600-latin.b4a72b187b.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-017F, U+0218-021B, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2010-2011, U+2018-2027, U+2030-203A, U+20AC, U+2122, U+2212;
}

/* arabic: 12156 bytes */
@font-face {
  font-family: "Alexandria";
  src: url("/assets/fonts/alexandria-600-arabic.3ca74ed1a7.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200D, U+FB50-FDFF, U+FE70-FEFC;
}

/* Metric-matched fallback, so the heading keeps its size while the web font loads. */
@font-face {
  font-family: "Alexandria Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 119.32%;
  ascent-override: 81.12%;
  descent-override: 21.04%;
  line-gap-override: 0.00%;
}

:root {
  /* brand/cores.json, mode "light" */
  --bg: #FCFDFE;          /* background, mist.light.1 */
  --surface: #F5F8FA;     /* surface, mist.light.2 */
  --line: #D0D5D9;        /* separator, mist.light.6 */
  --text: #191E21;        /* textPrimary, mist.light.12 */
  --muted: #575B5F;       /* textSecondary, mist.light.11 */
  --brand: #82C6F9;       /* brandFill, sky.light.9 */
  --on-brand: #0A273A;    /* onBrandFill, sky.light.12 */
  --brand-text: #215D86;  /* brandText, sky.light.11 */
  --tint: #E3F3FF;        /* brandTint, sky.light.3 */
  --accent: #215D86;      /* focus ring: brandText */

  --heading: "Alexandria", "Alexandria Fallback", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --measure: 38rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* brand/cores.json, mode "dark" */
    --bg: #0C0D0F;          /* mist.dark.1 */
    --surface: #131517;     /* mist.dark.2 */
    --line: #33373A;        /* mist.dark.6 */
    --text: #ECEFF1;        /* mist.dark.12 */
    --muted: #B3B8BC;       /* mist.dark.11 */
    --brand: #82C6F9;       /* sky.dark.9 */
    --on-brand: #0A273A;    /* sky.light.12 */
    --brand-text: #96CFFA;  /* sky.dark.11 */
    --tint: #112B3E;        /* sky.dark.4 */
    --accent: #96CFFA;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

:lang(ja) {
  line-break: strict;
  word-break: auto-phrase;
}

:lang(ko) {
  word-break: keep-all;
}

h1,
h2,
h3 {
  font-family: var(--heading);
  font-weight: 600;
  line-height: 1.2;
  margin-block: 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.375rem, 1.15rem + 1vw, 1.75rem);
  margin-block-start: 2.5rem;
}

h3 {
  font-size: 1.1875rem;
}

p,
ul,
ol,
dl {
  margin-block: 0 1em;
}

a {
  color: var(--brand-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

.frame {
  max-inline-size: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -10rem;
  padding: 0.75rem 1rem;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  z-index: 1;
}

.skip:focus {
  inset-block-start: 1rem;
}

/* Header: lockup at the start, a plain link to the language list at the end. */

.masthead {
  border-block-end: 1px solid var(--line);
}

.masthead .frame {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-block-size: 4.5rem;
}

.lockup {
  display: inline-flex;
  padding-block: 0.25rem;
}

.lockup img {
  display: block;
  inline-size: 147px;
  block-size: 40px;
}

.to-langs {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: 0.25rem;
}

main {
  padding-block: 2.5rem 4rem;
}

/* Landing hero: the real app icon beside the store subtitle, text aligned to the start. */

.hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
  padding-block: clamp(1rem, 4vw, 3rem) clamp(2rem, 5vw, 4rem);
}

.app-icon img {
  display: block;
  inline-size: clamp(88px, 14vw, 120px);
  block-size: auto;
  aspect-ratio: 1;
  border-radius: 22.37%;
}

.hero-copy {
  max-inline-size: var(--measure);
}

.lead {
  color: var(--muted);
  font-size: 1.1875rem;
}

.hero .lead {
  color: var(--text);
}

.store {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  font-weight: 600;
}

.store.soon {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}

a.store {
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  text-decoration: none;
}

/* The way through the app: numbered steps on a vertical trail of discs. */

.flow ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
  max-inline-size: 44rem;
}

.flow li {
  position: relative;
  counter-increment: step;
  padding-inline-start: 4rem;
  padding-block-end: 1.75rem;
}

.flow li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0;
  display: grid;
  place-items: center;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--heading);
  font-weight: 600;
}

.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline-start: calc(1.25rem - 1px);
  inset-block: 2.75rem 0.25rem;
  border-inline-start: 2px solid var(--line);
}

.flow li p {
  color: var(--muted);
  margin: 0;
}

.shots {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: inline mandatory;
  list-style: none;
  padding: 0 0 1rem;
}

.shots li {
  flex: 0 0 14rem;
  scroll-snap-align: start;
}

.shots img {
  display: block;
  inline-size: 100%;
  block-size: auto;
}

/* Other editor tools: a two column definition list on wide screens. */

.extras dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem 3rem;
  margin: 0;
}

.extras dt {
  font-weight: 600;
  margin-block-end: 0.25rem;
}

.extras dd {
  margin: 0;
  color: var(--muted);
}

/* Privacy promise: the one tinted band of the page. */

.promise {
  margin-block-start: 3rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: var(--tint);
}

.promise h2 {
  margin-block-start: 0;
}

.promise > :last-child {
  margin-block-end: 0;
}

@media (min-width: 48rem) {
  .promise {
    padding: 2.5rem;
  }
}

.promise a {
  color: var(--text);
  font-weight: 600;
}

.closing {
  max-inline-size: var(--measure);
}

/* Text pages: support, accessibility and the legal pages. */

.doc {
  max-inline-size: 44rem;
}

.doc section {
  scroll-margin-block-start: 1rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9375rem;
}

.faq details {
  border-block-end: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  padding-block: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.faq details p {
  color: var(--muted);
}

.nf {
  list-style: none;
  padding: 0;
}

.nf li {
  margin-block-end: 0.75rem;
}

/* Language lists: in the footer on every page, and first on the root page. */

.langs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.langs a {
  display: inline-flex;
  align-items: center;
  min-block-size: 32px;
}

.langs a[aria-current] {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.langs-first {
  padding-block-end: 1.5rem;
  border-block-end: 1px solid var(--line);
}

.langs-title {
  margin-block-end: 0.25rem;
  font-weight: 600;
}

/* Footer */

.colophon {
  border-block-start: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9375rem;
}

.colophon .frame {
  display: grid;
  gap: 1.25rem;
  padding-block: 2rem 2.5rem;
}

.colophon p {
  margin: 0;
}

.pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pages a {
  display: inline-flex;
  align-items: center;
  min-block-size: 32px;
}

.pages a[aria-current] {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.company {
  color: var(--text);
}

@media (max-width: 30rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
}

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