/*
 * Solace Tree's website: one stylesheet, system fonts, nothing loaded from
 * anywhere else. Dark like the app, with its gold accent. Logical properties
 * throughout, so the Arabic pages lay out right to left without overrides.
 */

:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --surface: #141414;
  --text: #f4efe8;
  --muted: #b9b2a9;
  --accent: #e6b17e;
  --on-accent: #1b130e;
  --line: rgba(255, 255, 255, 0.12);
  --sans:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: ui-serif, 'New York', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
}

/* Serif faces rarely carry Arabic; the system's own Arabic face reads best. */
:root:lang(ar) {
  --sans: 'Geeza Pro', 'SF Arabic', 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif;
  --serif: var(--sans);
}

*,
*::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: 1.0625rem/1.65 var(--sans);
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  z-index: 1;
  padding: 0.6rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.site-header,
main,
.site-footer {
  max-width: 44rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.25rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
}

.languages {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.languages a {
  display: inline-block;
  padding-block: 0.6rem;
  color: var(--muted);
  text-decoration: none;
}

.languages a:hover {
  color: var(--text);
}

.languages a[aria-current='page'] {
  color: var(--text);
  font-weight: 600;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  margin: 2.5rem 0 0.5rem;
  font-size: clamp(2rem, 6vw, 2.75rem);
}

h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.375rem;
  color: var(--accent);
}

h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.125rem;
}

.updated,
.note {
  color: var(--muted);
  font-size: 0.9375rem;
}

.lead {
  font-size: 1.125rem;
}

.summary,
.notice {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.summary h2 {
  margin-top: 0.5rem;
}

ul,
ol {
  padding-inline-start: 1.4rem;
}

li + li {
  margin-top: 0.4rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th,
td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.site-footer {
  margin-top: 3rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin-bottom: 0.75rem;
}

.site-footer nav a {
  display: inline-block;
  padding-block: 0.6rem;
}

.hero {
  padding-block: 4rem 1.5rem;
  text-align: center;
}

.hero img {
  width: 112px;
  height: 112px;
  border-radius: 26px;
}

.hero h1 {
  margin-top: 1.25rem;
}

.button {
  display: inline-block;
  min-height: 44px;
  margin-top: 1rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  text-decoration: underline;
}

/*
 * The landing page (written by scripts/site-landing.js from the store
 * listing): the subtitle under the name, Apple's badge, three screenshots,
 * then the listing's sections.
 */

.tagline {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--muted);
}

/* Apple's badge, as supplied; the margin is the clear space Apple asks for around it. */
.store-badge {
  display: inline-block;
  margin: 0.75rem;
  line-height: 0;
}

/* After .hero img, which would otherwise size the badge like the icon. */
.store-badge img {
  width: auto;
  height: 48px;
  border-radius: 0;
}

.screens {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-block: 1rem 2rem;
}

.screens img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

/* On a phone: one screenshot and part of the next, scrolled sideways. */
@media (max-width: 36rem) {
  .screens {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 62%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .screens img {
    scroll-snap-align: center;
  }
}

/* The listing's section headings, in its capitals, as small labels. */
.feature h2 {
  margin-bottom: 0.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
}

/* Arabic has no capitals, and spacing letters apart breaks how they join. */
:root:lang(ar) .feature h2 {
  font-size: 1.125rem;
  letter-spacing: normal;
}

.cta {
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
