/* Sibaq public pages. Tokens mirror apps/mobile/lib/core/theme/tokens
   (Direction A, Warm Playful). No external requests: fonts are self-hosted. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/BricolageGrotesque-VariableFont_opsz-wdth-wght.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Sora";
  src: url("/fonts/Sora-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --canvas: #faf6ed;
  --surface: #ffffff;
  --surface-sunken: #efe9dc;
  --surface-inverse: #241e15;
  --ink: #241e15;
  --ink-secondary: #6e675d;
  --ink-on-inverse: #faf6ed;
  --ink-on-inverse-secondary: #b7ae9c;
  --outline: #241e15;
  --hairline: #e4ded2;
  --action: #5b4cff;
  --action-ink: #ffffff;
  --action-text: #5b4cff;
  --action-subtle: #ede9ff;
  --celebration: #d8f34e;
  --celebration-ink: #241e15;
  --warning-subtle: #fff4d6;
  --warning: #8a5a00;
  --focus: #5b4cff;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Sora", "Segoe UI", system-ui, sans-serif;
  --arabic: "Segoe UI", "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", system-ui, sans-serif;

  --radius: 20px;
  --radius-small: 12px;
  --line: 2px;
  --shadow-x: 5px;
  --shadow-y: 5px;
  --measure: 66ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #17141f;
    --surface: #221e2e;
    --surface-sunken: #2e2940;
    --surface-inverse: #0d0b14;
    --ink: #f0ebe0;
    --ink-secondary: #a79fb8;
    --ink-on-inverse: #f0ebe0;
    --ink-on-inverse-secondary: #b7ae9c;
    --outline: #7c7491;
    --hairline: #3a3450;
    --action: #5b4cff;
    --action-ink: #ffffff;
    --action-text: #9d8df5;
    --action-subtle: #262040;
    --warning-subtle: #322a16;
    --warning: #e0a94a;
    --focus: #9d8df5;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body {
  font-family: var(--arabic);
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .wordmark {
  font-family: var(--arabic);
  letter-spacing: 0;
}

a {
  color: var(--action-text);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4.25rem);
}

h2 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
}

p,
li {
  max-width: var(--measure);
}

.page {
  width: min(100% - 2.5rem, 62rem);
  margin-inline: auto;
}

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.top nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: var(--line) solid var(--outline);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.pill:hover {
  background: var(--action-subtle);
}

/* Hero card, the inverse ink surface the app's Home leads with */

.hero {
  margin: 1rem 0 2rem;
  padding: clamp(1.5rem, 5vw, 3rem);
  background: var(--surface-inverse);
  color: var(--ink-on-inverse);
  border: var(--line) solid var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--outline);
}

.hero h1 {
  color: var(--ink-on-inverse);
}

.hero p {
  color: var(--ink-on-inverse);
  font-size: 1.15rem;
}

.hero .eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--celebration);
  color: var(--celebration-ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[lang="ar"] .hero .eyebrow {
  text-transform: none;
  letter-spacing: 0;
}

/* Cards */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

@media (min-width: 40rem) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  padding: 1.5rem;
  background: var(--surface);
  border: var(--line) solid var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-x) var(--shadow-y) 0 var(--outline);
}

.card h3 {
  margin-top: 0;
}

.card p {
  margin-bottom: 0;
  color: var(--ink-secondary);
}

.note {
  padding: 1rem 1.25rem;
  background: var(--warning-subtle);
  border: var(--line) solid var(--warning);
  border-radius: var(--radius-small);
}

.note p {
  margin: 0;
}

/* Long-form pages */

.prose {
  padding-bottom: 3rem;
}

.prose .meta {
  color: var(--ink-secondary);
  margin-top: -0.25rem;
}

.prose ul {
  padding-inline-start: 1.25rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  max-width: var(--measure);
  margin: 1rem 0;
  font-size: 0.95rem;
}

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

.prose th {
  font-family: var(--display);
  font-weight: 700;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps li {
  position: relative;
  padding-inline-start: 3rem;
  margin-bottom: 1rem;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: -0.1rem;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  background: var(--action);
  color: var(--action-ink);
  border: var(--line) solid var(--outline);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 800;
}

/* Footer */

footer {
  margin-top: 3rem;
  padding: 1.5rem 0 2.5rem;
  border-top: var(--line) solid var(--hairline);
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

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

@media (prefers-reduced-motion: no-preference) {
  .pill,
  .card {
    transition: transform 120ms ease;
  }

  .pill:hover {
    transform: translate(-1px, -1px);
  }
}
