/* Maktoub website: landing page and legal pages.
   Colors match src/theme/colors.ts. Logical properties only (start/end),
   so the Arabic version flips correctly. */

:root {
  --bg: #fff9f0;
  --surface: #ffffff;
  --tint: #f5efe4;
  --text: #1d2421;
  --muted: #5e6b64;
  --primary: #123f36;
  --primary-pressed: #0b2a24;
  --on-primary: #ffffff;
  --accent: #d97963;
  --accent-text: #a94a36;
  --secondary: #a8b9a5;
  --border: #e6dfd3;
  --phone-frame: #1d2421;
  --shadow: 0 24px 60px -24px rgba(18, 63, 54, 0.35);
  --radius: 18px;
  --max: 1120px;
  --doc: 760px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121816;
    --surface: #1d2421;
    --tint: #18201d;
    --text: #f2ede4;
    --muted: #9ba8a1;
    --primary: #5fb39c;
    --primary-pressed: #4a9985;
    --on-primary: #0c1f1a;
    --accent: #e8927e;
    --accent-text: #e8927e;
    --secondary: #3b4a42;
    --border: #2e3833;
    --phone-frame: #000000;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--primary);
}

img,
svg {
  display: block;
}

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

.skip {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-start: -60px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  z-index: 10;
}

.skip:focus {
  inset-block-start: 12px;
}

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

/* Header */

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-block-end: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

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

.brand .brand-ar {
  font-weight: 500;
  font-size: 18px;
  color: var(--accent-text);
}

.lang-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.lang-switch button {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 6px 12px;
  min-height: 34px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--on-primary);
}

/* Footer */

.site-footer {
  margin-block-start: 64px;
  border-block-start: 1px solid var(--border);
  padding-block: 32px 40px;
  color: var(--muted);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  background: var(--primary-pressed);
}

.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-soon {
  background: var(--primary);
  color: var(--on-primary);
  cursor: default;
}

.btn-soon small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
  line-height: 1.2;
}

.btn-soon span {
  line-height: 1.25;
}

/* Legal documents */

.doc {
  max-width: var(--doc);
  margin-inline: auto;
  padding: 40px 20px 0;
}

.doc h1 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: clamp(32px, 6vw, 44px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.015em;
}

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

.doc .summary {
  margin: 0 0 32px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--tint);
  border: 1px solid var(--border);
}

.doc .summary p {
  margin: 0 0 8px;
}

.doc .summary ul {
  margin: 0;
  padding-inline-start: 20px;
}

.doc .toc {
  margin: 0 0 36px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  counter-reset: toc;
  font-size: 15px;
}

.doc .toc a {
  color: var(--text);
}

.doc h2 {
  margin: 40px 0 10px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
  scroll-margin-block-start: 84px;
}

.doc h3 {
  margin: 24px 0 8px;
  font-size: 18px;
  font-weight: 600;
}

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

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

.doc li {
  margin-block: 4px;
}

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

.doc th,
.doc td {
  text-align: start;
  vertical-align: top;
  padding: 10px 12px;
  border-block-end: 1px solid var(--border);
}

.doc th {
  color: var(--muted);
  font-weight: 500;
}

.doc .table-scroll {
  overflow-x: auto;
}

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

.doc .steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}

.doc .steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px;
  padding-inline-start: 58px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  margin: 0;
}

.doc .steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 16px;
  inset-block-start: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
}

html[dir="rtl"] body {
  line-height: 1.75;
}

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

/* Landing page */

:root {
  --band: #123f36;
  --on-band: #fff9f0;
  --band-accent: #e8927e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --band: #173b33;
  }
}

.hero {
  display: grid;
  gap: 48px;
  align-items: center;
  padding-block: 44px 24px;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    padding-block: 72px 48px;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-text);
  font-weight: 500;
  font-size: 14px;
}

.hero h1 {
  margin: 0 0 18px;
  color: var(--primary);
  font-weight: 600;
  font-size: clamp(38px, 6.4vw, 62px);
  line-height: 1.07;
  letter-spacing: -0.025em;
}

html[dir="rtl"] .hero h1,
html[dir="rtl"] .section h2 {
  letter-spacing: 0;
  line-height: 1.35;
}

.lead {
  margin: 0 0 28px;
  max-width: 34em;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 21px);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.hero-note svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--accent-text);
}

/* Phone mockup */

.hero-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 380px);
  padding-block: 8px;
}

.phone {
  position: relative;
  width: 292px;
  max-width: 80vw;
  margin-inline: auto;
  aspect-ratio: 9 / 18.5;
  padding: 10px;
  border-radius: 46px;
  background: var(--phone-frame);
  box-shadow: var(--shadow);
}

.phone::before {
  content: "";
  position: absolute;
  inset-block-start: 20px;
  inset-inline: 0;
  margin-inline: auto;
  width: 74px;
  height: 20px;
  border-radius: 999px;
  background: var(--phone-frame);
  z-index: 2;
}

.phone-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 46px 12px 14px;
  border-radius: 36px;
  overflow: hidden;
  background: var(--bg);
}

.app-bar {
  padding-inline: 6px;
  color: var(--text);
  font-weight: 600;
  font-size: 19px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}

.photo {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: end center;
  background: linear-gradient(165deg, #c9d6c5 0%, #7fa596 50%, #2f5f53 100%);
}

.photo svg {
  width: 72%;
  height: auto;
  color: rgba(255, 249, 240, 0.92);
}

.photo-dots {
  position: absolute;
  inset-block-start: 10px;
  inset-inline: 12px;
  display: flex;
  gap: 4px;
}

.photo-dots i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.45);
}

.photo-dots i:first-child {
  background: #ffffff;
}

.profile-body {
  padding: 12px 14px 14px;
}

.profile-name {
  margin: 0;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.25;
}

.profile-city {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.profile-city svg {
  width: 14px;
  height: 14px;
}

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

.chips li {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--tint);
  border: 1px solid var(--border);
  font-size: 11.5px;
  line-height: 1.4;
}

.phone-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
}

.round {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.35);
}

.round.like {
  width: 60px;
  height: 60px;
  background: var(--accent);
  border-color: transparent;
  color: #ffffff;
}

.round svg {
  width: 24px;
  height: 24px;
}

.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  animation: float 6s ease-in-out infinite;
}

.float-card svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.float-card.match {
  inset-block-start: 16%;
  inset-inline-start: 0;
  color: var(--accent-text);
}

.float-card.bubble {
  inset-block-end: 20%;
  inset-inline-end: 0;
  max-width: 190px;
  border-end-end-radius: 4px;
  font-weight: 400;
  animation-delay: -3s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Meaning band */

.meaning-card {
  display: grid;
  gap: 8px 40px;
  align-items: center;
  padding: 30px 26px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
}

@media (min-width: 800px) {
  .meaning-card {
    grid-template-columns: auto 1fr;
    padding: 36px 48px;
  }
}

.meaning-word {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: clamp(60px, 10vw, 96px);
  line-height: 1.2;
}

.meaning-card p {
  margin: 0;
  font-size: 18px;
}

.meaning-card p + p {
  margin-block-start: 8px;
  color: var(--muted);
  font-size: 16px;
}

/* Sections */

.section {
  padding-block: 72px 0;
  scroll-margin-block-start: 64px;
}

.section-head {
  max-width: 660px;
  margin-block-end: 32px;
}

.section h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.features,
.how {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.feature {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-block-end: 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 11%, transparent);
  color: var(--primary);
}

.icon svg {
  width: 24px;
  height: 24px;
}

.feature h3,
.how h3 {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.35;
}

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

.how {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  counter-reset: how;
}

.how li {
  counter-increment: how;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--tint);
  border: 1px solid var(--border);
}

.how li::before {
  content: counter(how);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-block-end: 16px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

/* Privacy band */

.band {
  padding: 40px 26px;
  border-radius: 28px;
  background: var(--band);
  color: var(--on-band);
}

@media (min-width: 800px) {
  .band {
    padding: 56px;
  }
}

.band h2 {
  color: var(--on-band);
}

.band .section-head p {
  color: color-mix(in srgb, var(--on-band) 78%, transparent);
}

.checks {
  display: grid;
  gap: 16px 32px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.checks li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.checks svg {
  width: 24px;
  height: 24px;
  flex: none;
  margin-block-start: 2px;
  color: var(--band-accent);
}

.band-link {
  color: var(--on-band);
  font-weight: 600;
}

/* Closing call to action */

.final {
  padding-block: 80px 0;
  text-align: center;
}

.final h2 {
  margin-inline: auto;
}

.final p {
  margin: 0 auto 24px;
  max-width: 34em;
  color: var(--muted);
  font-size: 18px;
}

.final .cta-row {
  justify-content: center;
}
