/* waymates.dev — one stylesheet for every page, in all three languages.
   Logical properties only (inline-start / inline-end), so Arabic mirrors by itself. */

@font-face {
  font-family: 'Readex Pro';
  src: url('/assets/fonts/ReadexPro-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Readex Pro';
  src: url('/assets/fonts/ReadexPro-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  /* The app icon's night navy, its W (orange) and M (cyan). */
  --navy: #090e2c;
  --navy-2: #141c4a;
  --orange: #ff9a2e;
  --cyan: #3fe0f0;
  --on-navy: #f3f5ff;
  --on-navy-muted: #b9c0e4;

  --bg: #f5f6fb;
  --surface: #ffffff;
  --text: #141833;
  --muted: #4a5070;
  --line: #e0e3ef;
  --link: #0a63a8;
  --soft: #eaf6fb;
  --focus: #0a63a8;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1030;
    --surface: #121940;
    --text: #eef1ff;
    --muted: #aeb5d6;
    --line: #263066;
    --link: #6fe6f2;
    --soft: #16224f;
    --focus: #6fe6f2;

    color-scheme: dark;
  }
}

*,
*::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: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.6rem);
}

h2 {
  font-size: 1.35rem;
  margin-top: 2.2em;
}

h3 {
  font-size: 1.08rem;
  margin-top: 1.6em;
}

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

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

li {
  margin-block-end: 0.4em;
}

strong {
  font-weight: 600;
}

.wrap {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-inline: 20px;
}

.wrap-wide {
  max-width: 1040px;
}

/* ---- header ------------------------------------------------------------ */

.top {
  background: var(--navy);
  color: var(--on-navy);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-block: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--on-navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.15rem;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.langs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.langs li {
  margin: 0;
}

.langs a,
.langs button {
  display: inline-block;
  color: var(--on-navy-muted);
  text-decoration: none;
  font: inherit;
  font-size: 0.92rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
}

.langs a:hover,
.langs button:hover {
  color: var(--on-navy);
  border-color: rgba(255, 255, 255, 0.25);
}

.langs [aria-current='true'],
.langs [aria-pressed='true'] {
  color: var(--navy);
  background: var(--on-navy);
}

.langs a:focus-visible,
.langs button:focus-visible {
  outline-color: var(--cyan);
}

/* ---- hero (home, invite) ------------------------------------------------ */

.hero {
  text-align: center;
  padding-block: 28px 56px;
}

.hero-icon {
  width: 148px;
  height: 148px;
  border-radius: 34px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 50px rgba(63, 224, 240, 0.18);
}

.hero h1 {
  margin-top: 22px;
  margin-bottom: 0.3em;
}

.hero .lead {
  color: var(--on-navy-muted);
  font-size: 1.15rem;
  max-width: 34em;
  margin-inline: auto;
}

.accent-w {
  color: var(--orange);
}

.accent-m {
  color: var(--cyan);
}

/* ---- store buttons ------------------------------------------------------ */

.stores {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.store {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 172px;
  padding: 9px 20px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: var(--on-navy);
  text-decoration: none;
  line-height: 1.25;
}

.store small {
  font-size: 0.78rem;
  color: var(--on-navy-muted);
}

.store span {
  font-size: 1.18rem;
  font-weight: 600;
}

.store:hover {
  background: rgba(255, 255, 255, 0.12);
}

.store:focus-visible {
  outline-color: var(--cyan);
}

/* The visitor's own store first, and stronger. */
html[data-platform='ios'] .store-ios,
html[data-platform='android'] .store-android {
  background: var(--on-navy);
  border-color: var(--on-navy);
  color: var(--navy);
}

html[data-platform='ios'] .store-ios small,
html[data-platform='android'] .store-android small {
  color: var(--navy-2);
}

html[data-platform='android'] .store-android {
  order: -1;
}

/* ---- home --------------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-block: -28px 8px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
}

.card h2 {
  font-size: 1.1rem;
  margin: 0 0 0.45em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-inline-end: 8px;
  vertical-align: 0.1em;
}

.dot-orange {
  background: var(--orange);
}

.dot-cyan {
  background: var(--cyan);
}

.dot-violet {
  background: #9b7bff;
}

.dot-green {
  background: #3ddc84;
}

.facts {
  text-align: center;
  color: var(--muted);
  margin-block: 36px 8px;
}

/* ---- documents (privacy, terms, support) -------------------------------- */

.doc {
  padding-block: 36px 56px;
}

.doc-head {
  padding-block: 8px 30px;
}

.doc-head h1 {
  margin-bottom: 0.2em;
}

.updated {
  color: var(--on-navy-muted);
  margin: 0;
}

.summary {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 22px 6px;
  margin-bottom: 1.6em;
}

.summary h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.doc h2:first-child {
  margin-top: 0;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 20px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding-block: 14px;
  list-style-position: outside;
}

.faq details[open] summary {
  border-block-end: 1px solid var(--line);
  margin-block-end: 12px;
}

.contact {
  margin-top: 2.4em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px 8px;
}

.contact h2 {
  margin-top: 0;
}

.mail {
  font-weight: 600;
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---- invite --------------------------------------------------------------- */

/* One block per language, the visitor's shown (invite.js); English without script. */
.lang-block {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lang-block > main {
  flex: 1;
}

.lang-block[hidden] {
  display: none;
}

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: -28px 0 0;
  display: grid;
  gap: 14px;
}

.steps > li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 22px 18px;
  margin: 0;
  position: relative;
  padding-inline-start: 68px;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 20px;
  top: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--cyan);
  font-weight: 600;
  display: grid;
  place-items: center;
  line-height: 1;
}

.steps h2 {
  font-size: 1.1rem;
  margin: 2px 0 0.3em;
}

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

.code-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.code {
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  padding: 6px 8px 6px 18px;
  border-radius: 12px;
  background: var(--navy);
  color: var(--on-navy);
  user-select: all;
  -webkit-user-select: all;
}

.copy {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--link);
  cursor: pointer;
}

.copy:hover {
  border-color: var(--link);
}

.tip {
  margin-top: 12px !important;
  font-size: 0.95rem;
}

.no-code .with-code,
.has-code .without-code {
  display: none;
}

/* ---- footer --------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  padding-block: 22px 28px;
  margin-top: 40px;
}

.foot nav {
  display: flex;
  gap: 6px 18px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.foot a {
  color: var(--muted);
}

.foot p {
  margin: 0;
}

@media (max-width: 520px) {
  body {
    font-size: 1rem;
  }

  .hero-icon {
    width: 120px;
    height: 120px;
    border-radius: 28px;
  }

  .store {
    min-width: 0;
    flex: 1 1 140px;
  }

  .steps > li {
    padding-inline-start: 60px;
  }

  .steps > li::before {
    inset-inline-start: 16px;
  }

  .code {
    font-size: 1.6rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .store,
  .copy {
    transition: background-color 0.15s, border-color 0.15s;
  }
}
