/* Carthage Fun brand site. One light "Mediterranean noon" theme on purpose: sandstone
   paper, harbour blue, and Tyrian purple used only as a solid accent. Logical properties
   (inline/block) throughout so the same rules serve Arabic (rtl) and English (ltr). */
:root {
  color-scheme: light;
  --paper: #f6efe1;      /* sandstone */
  --paper-2: #efe5d0;
  --card: #fbf7ee;
  --ink: #1b2230;
  --muted: #5a6072;
  --line: #ddd0b6;
  --sea: #1f5c86;        /* harbour blue, from the mark */
  --sea-ink: #ffffff;
  --sea-hover: #174a6d;
  --purple: #7a1f4b;     /* Tyrian purple: accents only */
  --display: "Reem Kufi", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}
:root:lang(en) { --body: "Inter", "Segoe UI", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.75 var(--body); }
:lang(en) body, body:lang(en) { line-height: 1.65; }
img, svg { max-width: 100%; display: block; }
a { color: var(--sea); text-underline-offset: 3px; }
a:hover { color: var(--sea-hover); }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1, h2 { font-family: var(--display); font-weight: 600; }
:lang(ar) h1, :lang(ar) h2 { word-spacing: .12em; }
h2 { font-size: clamp(28px, 4vw, 38px); }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0; }
/* Monospace fonts can't join Arabic letters, so Arabic code uses the Arabic text font. */
:lang(ar) code:not([dir="ltr"]) { font-family: var(--body); font-size: .95em; }
code { font: 0.88em ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; background: var(--paper-2); padding: 2px 7px; border-radius: 5px; white-space: nowrap; }

.wrap { max-width: 1080px; margin-inline: auto; padding-inline: max(20px, env(safe-area-inset-left, 0px)); }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--purple); }
.lede { color: var(--muted); max-width: 60ch; }

/* header */
.bar { border-block-end: 1px solid var(--line); background: var(--paper); }
.bar .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 19px; }
.brand img { width: 34px; height: 34px; }
.bar nav { display: flex; gap: 22px; margin-inline-start: auto; font-size: 15px; align-items: center; }
.bar nav a { color: var(--muted); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--ink); }
.lang { border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px; }
@media (max-width: 640px) { .bar nav .opt { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 10px; font: 600 16px var(--body); text-decoration: none; transition: background-color .18s ease, border-color .18s ease; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--sea); color: var(--sea-ink); }
.btn-primary:hover { background: var(--sea-hover); color: var(--sea-ink); }
.btn-ghost { color: var(--ink); border: 1px solid var(--line); background: var(--card); }
.btn-ghost:hover { border-color: var(--muted); color: var(--ink); }

/* hero */
.hero { padding-block: 64px 72px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-block: 40px 56px; } }
.hero h1 { font-size: clamp(40px, 6.4vw, 66px); line-height: 1.12; }
.hero h1 em { font-style: normal; color: var(--sea); }
.hero .lede { margin-block-start: 18px; font-size: 18px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 28px; }

/* The featured game, shown as a framed plate */
.plate { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.plate img { border-radius: 10px; aspect-ratio: 4 / 3; object-fit: cover; object-position: 78% center; width: 100%; height: auto; }
@media (max-width: 860px) { .plate img { aspect-ratio: 16 / 9; } }
.plate figcaption { display: flex; justify-content: space-between; gap: 12px; padding: 12px 8px 4px; font-size: 14px; color: var(--muted); }
.plate figcaption b { color: var(--ink); font-weight: 600; }

section.band { padding-block: 72px; border-block-start: 1px solid var(--line); }
.head { display: grid; gap: 10px; margin-block-end: 32px; }

/* game listing: one real row per game, no placeholder cards */
.game { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.game > img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.game .body { display: grid; gap: 12px; align-content: start; }
.game h3 { font-family: var(--display); font-size: 30px; font-weight: 600; }
.game .sub { color: var(--muted); font-size: 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.facts li { font-size: 14px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 2px 12px; }
.game .cta { margin-block-start: 6px; }
@media (max-width: 640px) { .game { grid-template-columns: minmax(0, 1fr); } .game > img { aspect-ratio: 16 / 9; } }
.more { margin-block-start: 16px; color: var(--muted); font-size: 15px; }

/* steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: s; }
.steps li { display: grid; gap: 8px; align-content: start; padding-block-start: 16px; border-block-start: 2px solid var(--ink); counter-increment: s; }
.steps li::before { content: counter(s); font-family: var(--display); font-size: 28px; color: var(--sea); line-height: 1; }
:lang(ar) .steps li::before { content: counter(s, arabic-indic); }
.steps p { color: var(--muted); font-size: 15.5px; }
@media (max-width: 760px) { .steps { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.points div { display: grid; gap: 6px; align-content: start; }
.points p { color: var(--muted); font-size: 15.5px; }
@media (max-width: 760px) { .points { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

/* long-form pages (privacy, terms) */
.doc { max-width: 760px; padding-block: 48px 72px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); }
.doc .meta { color: var(--muted); font-size: 14px; margin-block: 8px 28px; }
.doc h2 { font-size: 24px; margin-block: 36px 10px; }
/* Kufi display is for big titles; long-form section headings stay in the readable text face. */
:lang(ar) .doc h2 { font-family: var(--body); font-weight: 600; word-spacing: normal; }
.doc h3 { margin-block: 22px 6px; }
.doc p, .doc li { color: #2c3344; }
.doc p + p { margin-block-start: 10px; }
.doc ul { padding-inline-start: 22px; margin: 8px 0; }
.doc li + li { margin-block-start: 4px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-block: 10px; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
th, td { text-align: start; padding: 10px 14px; border-block-end: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--paper-2); }
tr:last-child td { border-block-end: 0; }

footer.site { border-block-start: 1px solid var(--line); padding-block: 28px 40px; color: var(--muted); font-size: 14px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
footer.site .wrap > span:first-child { margin-inline-end: auto; }
footer.site a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
