/*
 * brokease.app — the website's one stylesheet.
 *
 * The app's own type and colours: IBM Plex, the light scheme's off-white page and teal,
 * and at night the dark scheme's near-black page with the slips left as paper, the way
 * the app keeps its slip cream in every scheme. Logical properties throughout, so the
 * Arabic pages mirror without a second stylesheet.
 */

@font-face {
  font-family: 'Plex';
  src: url('/fonts/IBMPlexSans_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plex';
  src: url('/fonts/IBMPlexSans_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Arabic';
  src: url('/fonts/IBMPlexSansArabic_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Arabic';
  src: url('/fonts/IBMPlexSansArabic_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  --page: #f4f5f2;
  --text: #1c1f1d;
  --text-2: #3b403d;
  --muted: #5c625e;
  --line: #d9dcd5;
  --accent: #1b6e86;
  --accent-deep: #12525f;
  --slip: #fbfcfa;
  --slip-ink: #1c1f1d;
  --slip-muted: #5c625e;
  --slip-line: #e7e9e4;
  --wash: #f1f6f8;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #101311;
    --text: #dcd7c9;
    --text-2: #c9c4b6;
    --muted: #9a968a;
    --line: #2a2e2b;
    --accent: #7fd1e4;
    --accent-deep: #7fd1e4;
    /* The slip stays paper at night, as in the app. */
    --slip: #dcd7c9;
    --slip-ink: #23241f;
    --slip-muted: #5f5c50;
    --slip-line: #cbc5b5;
    --wash: #1a1f1c;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: 'Plex', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

:lang(ar) body,
body:lang(ar) {
  font-family: 'Plex Arabic', 'Plex', system-ui, sans-serif;
  line-height: 1.75;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.brand svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.lang {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* -------------------------------------------------------------------- hero ---- */

.hero {
  padding-block: 40px 28px;
}

h1 {
  font-size: clamp(32px, 6vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  font-weight: 600;
}

:lang(ar) h1 {
  letter-spacing: 0;
  line-height: 1.3;
}

.lead {
  font-size: 19px;
  color: var(--text-2);
  margin: 0 0 14px;
  max-width: 34em;
}

.note {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

.soon {
  display: inline-block;
  margin-top: 22px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--wash);
  border: 1px solid var(--line);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
}

/* --------------------------------------------------------------- sections ---- */

h2 {
  font-size: 24px;
  line-height: 1.25;
  margin: 48px 0 16px;
  font-weight: 600;
}

h3 {
  font-size: 18px;
  margin: 0 0 6px;
  font-weight: 600;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

/* A slip: paper, a hairline, and a dashed tear above its words. */
.slip {
  background: var(--slip);
  color: var(--slip-ink);
  border: 1px solid var(--slip-line);
  border-radius: 6px;
  padding: 16px 18px 18px;
}

.slip p {
  margin: 0;
  color: var(--slip-muted);
  font-size: 16px;
}

.slip .num {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slip-muted);
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1.5px dashed var(--slip-line);
}

/* Letter-spacing pulls Arabic's joined letters apart. */
:lang(ar) .slip .num {
  letter-spacing: 0;
  font-size: 14px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px 28px;
  margin: 0;
}

.facts div {
  border-inline-start: 2px solid var(--accent);
  padding-inline-start: 14px;
}

.facts dt {
  font-weight: 600;
  margin-bottom: 4px;
}

.facts dd {
  margin: 0;
  color: var(--text-2);
  font-size: 16px;
}

/* ------------------------------------------------------------- long pages ---- */

.doc {
  padding-block: 24px 8px;
}

.doc h1 {
  font-size: clamp(30px, 5vw, 38px);
}

.doc .updated {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 28px;
}

.doc h2 {
  font-size: 21px;
  margin: 36px 0 10px;
}

.doc p,
.doc li {
  color: var(--text-2);
  max-width: 38em;
}

.doc ul {
  padding-inline-start: 22px;
}

.doc li {
  margin-bottom: 8px;
}

.doc li strong,
.doc p strong {
  color: var(--text);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 8px;
  font-size: 15px;
}

.doc th,
.doc td {
  text-align: start;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}

:lang(ar) .doc th,
:lang(ar) .doc td {
  padding: 10px 0 10px 12px;
}

.doc th {
  color: var(--text);
  font-weight: 600;
}

.box {
  background: var(--slip);
  color: var(--slip-ink);
  border: 1px solid var(--slip-line);
  border-radius: 6px;
  padding: 18px 20px;
  margin: 18px 0;
}

.box p,
.box li {
  color: var(--slip-muted);
}

.box p:first-child {
  margin-top: 0;
}

.box p:last-child,
.box ol:last-child {
  margin-bottom: 0;
}

/* Specific enough to beat `.doc li strong`: at night the page's text colour is the slip's. */
.doc .box strong,
.box strong {
  color: var(--slip-ink);
}

.box a {
  color: var(--accent-deep);
}

@media (prefers-color-scheme: dark) {
  .box a {
    color: #12525f;
  }
}

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

.foot {
  margin-top: 64px;
  padding-block: 24px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 15px;
  color: var(--muted);
}

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

.foot .copy {
  margin-inline-start: auto;
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }
  .hero {
    padding-block: 24px 16px;
  }
  .lead {
    font-size: 17px;
  }
  .foot .copy {
    margin-inline-start: 0;
    width: 100%;
  }
}
