/* Rivulet site (C-WEB-1, rev 2): DESIGN.md rev 4 palette (butter cream canvas, forest ink, ember touch),
   Alexandria + IBM Plex, self-hosted. Static and script-free. Light = cream, dark = forest. EN and AR pages. */

@font-face { font-family: "Alexandria"; src: url("fonts/alexandria.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm_plex_sans_regular.ttf") format("truetype"); font-weight: 400; font-display: swap; unicode-range: U+0000-05FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm_plex_sans_semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; unicode-range: U+0000-05FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm_plex_sans_arabic_regular.ttf") format("truetype"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm_plex_sans_arabic_semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  color-scheme: light dark;
  --bg: #EFE7D4;
  --surface1: #F6F0E2;
  --surface2: #EAE1CB;
  --hairline: #D5CAAD;
  --edge: #CBBFA0;
  --text: #0F3038;
  --muted: #4A5E62;
  --ember: #B03C11;
  --ember-fill: #E04E18;
  --on-ember: #05171C;
  --forest: #1E3B2F;
  --forest-deep: #132820;
  --forest-line: #355746;
  --cream: #F3ECDA;
  --cream-muted: #ACBAAF;
  --shadow: 0 1px 0 rgba(15, 48, 56, 0.04), 0 10px 30px -12px rgba(30, 59, 47, 0.35);
  --radius: 16px;
  --wrap: 68rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #132820;
    --surface1: #1E3B2F;
    --surface2: #28493B;
    --hairline: #355746;
    --edge: #355746;
    --text: #F3ECDA;
    --muted: #ACBAAF;
    --ember: #F79B4D;
    --ember-fill: #F28C38;
    --on-ember: #132820;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1rem/1.65 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
}
[lang="ar"] body, body[lang="ar"], html[lang="ar"] body { line-height: 1.8; }
h1, h2, h3, .brand-name { font-family: "Alexandria", "IBM Plex Sans", system-ui, sans-serif; line-height: 1.22; }
h1 { font-weight: 700; font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem); margin: 0 0 0.75rem; }
h2 { font-weight: 600; font-size: 1.35rem; margin: 2.25rem 0 0.75rem; }
h3 { font-weight: 600; font-size: 1.05rem; margin: 1.5rem 0 0.4rem; }
p, ul, ol { margin: 0 0 1rem; }
a { color: var(--ember); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ember-fill); outline-offset: 3px; border-radius: 6px; }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; display: block; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* Header */
.site-header { background: var(--forest); color: var(--cream); border-bottom: 1px solid var(--forest-line); }
.site-header nav {
  max-width: var(--wrap); margin: 0 auto; padding: 0.7rem 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.4rem;
}
.site-header a { color: var(--cream); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-header a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.site-header .brand { margin-inline-end: auto; display: inline-flex; align-items: center; padding: 0.2rem 0; }
.site-header .brand svg { height: 1.9rem; width: auto; color: var(--cream); }
.site-header .lang {
  border: 1px solid var(--cream-muted); border-radius: 999px; padding: 0.2rem 0.85rem; font-size: 0.92rem;
}
.site-header .lang:hover { background: var(--cream); color: var(--forest); text-decoration: none; }
.site-header :focus-visible { outline-color: #F28C38; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.9rem; padding: 0.6rem 1.3rem;
  border-radius: 999px; font-weight: 600; text-decoration: none; border: 1.5px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: #F28C38; color: #132820; }
.btn-primary:hover { background: #F79B4D; }
.btn-ghost { border-color: var(--cream-muted); color: var(--cream); }
.btn-ghost:hover { background: rgba(243, 236, 218, 0.1); }
.btn svg { width: 1.2rem; height: 1.2rem; flex: none; }

/* Hero */
.hero { background: var(--forest); color: var(--cream); overflow: hidden; }
.hero .inner {
  max-width: var(--wrap); margin: 0 auto; padding: 3.5rem 16px 3rem;
  display: grid; gap: 2.5rem; align-items: center;
}
.eyebrow { color: #F79B4D; font-weight: 600; font-size: 0.9rem; letter-spacing: 0.04em; margin-bottom: 0.9rem; }
[lang="ar"] .eyebrow { letter-spacing: 0; }
.hero h1 { color: var(--cream); font-size: clamp(2rem, 1.3rem + 2.8vw, 3.2rem); max-width: 32rem; }
.hero .lead { color: var(--cream-muted); font-size: 1.1rem; max-width: 34rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.6rem 0 1.2rem; }
.hero .soon { color: var(--cream-muted); font-size: 0.92rem; margin: 0; }
.showcase { position: relative; padding-bottom: 1.5rem; }
.tv {
  background: #0B1914; border: 10px solid #0B1914; border-radius: 14px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  margin-inline-end: 12%;
}
.tv img { border-radius: 4px; }
.tv-stand { width: 28%; height: 10px; margin: 0 auto; margin-inline-end: calc(12% + 36%); background: #0B1914; border-radius: 0 0 8px 8px; }
.phone {
  position: absolute; inset-inline-end: 0; bottom: 0; width: 27%;
  background: #0B1914; border: 6px solid #0B1914; border-radius: 22px; box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.7);
}
.phone img { border-radius: 16px; }
@media (min-width: 56rem) {
  .hero .inner { grid-template-columns: 1fr 1.15fr; padding-top: 4.5rem; }
  .showcase { padding-bottom: 2rem; }
}

/* Sections */
.section { max-width: var(--wrap); margin: 0 auto; padding: 3.5rem 16px 0; }
.section-head { max-width: 40rem; margin-bottom: 1.6rem; }
.section-head h2 { margin: 0 0 0.5rem; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem); }
.section-head p { color: var(--muted); margin: 0; }
.kicker { display: inline-block; width: 2.5rem; height: 3px; border-radius: 2px; background: var(--ember-fill); margin-bottom: 0.9rem; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0; }
.features li {
  background: var(--surface1); border: 1px solid var(--edge); border-radius: var(--radius); padding: 1.35rem 1.35rem 1.25rem;
  box-shadow: var(--shadow);
}
.features .icon {
  width: 2.6rem; height: 2.6rem; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface2); color: var(--ember); margin-bottom: 0.9rem;
}
.features .icon svg { width: 1.4rem; height: 1.4rem; }
.features h3 { margin: 0 0 0.35rem; }
.features p { margin: 0; color: var(--muted); }

.screens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0; }
.screens li { background: var(--surface2); border: 1px solid var(--edge); border-radius: 22px; padding: 8px; box-shadow: var(--shadow); }
.screens img { border-radius: 15px; }
.screens .cap { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 0.55rem 0 0.2rem; margin: 0; }
@media (max-width: 40rem) {
  .screens { grid-template-columns: repeat(3, 70%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; }
  .screens li { scroll-snap-align: start; }
}

.privacy-band { display: grid; gap: 1.5rem; }
@media (min-width: 56rem) { .privacy-band { grid-template-columns: 1fr 1fr; align-items: start; } }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.8rem; }
.checks li { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.6rem; align-items: start; }
.checks svg { width: 1.3rem; height: 1.3rem; color: var(--ember); margin-top: 0.2rem; }
.panel { background: var(--surface1); border: 1px solid var(--edge); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.panel h3 { margin-top: 0; }
.panel ul { padding-inline-start: 1.1rem; margin-bottom: 0; }
.panel li { margin-bottom: 0.35rem; }

.contact {
  background: var(--forest); color: var(--cream); border: 1px solid var(--forest-line); border-radius: 22px; padding: 2.2rem 1.6rem;
  display: grid; gap: 1.2rem; align-items: center;
}
@media (min-width: 48rem) { .contact { grid-template-columns: 1.4fr 1fr; padding: 2.6rem 2.6rem; } }
.contact h2 { color: var(--cream); margin: 0 0 0.4rem; }
.contact p { color: var(--cream-muted); margin: 0 0 0.6rem; }
.contact .email { font-family: "Alexandria", "IBM Plex Sans", sans-serif; font-weight: 600; font-size: clamp(1.15rem, 0.9rem + 1.2vw, 1.6rem); color: var(--cream); direction: ltr; unicode-bidi: isolate; word-break: break-all; }
.contact .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: flex-start; }
@media (min-width: 48rem) { .contact .actions { justify-content: flex-end; } }
.note { color: var(--muted); font-size: 0.92rem; }

.legal { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem; }
.legal a {
  display: block; height: 100%; padding: 1rem 1.15rem; border: 1px solid var(--edge); border-radius: 12px; background: var(--surface1);
  text-decoration: none; color: var(--text);
}
.legal a:hover { border-color: var(--ember); }
.legal strong { display: block; color: var(--ember); }
.legal span { color: var(--muted); font-size: 0.92rem; }

/* Footer */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 0.92rem; }
.site-footer .inner { max-width: var(--wrap); margin: 0 auto; padding: 1.6rem 16px 2.4rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer .copy { margin-inline-end: auto; }
[dir="rtl"] .site-footer .copy { direction: ltr; }

/* Document pages (privacy, licences, releases) */
main.doc { display: block; max-width: 46rem; margin: 0 auto; padding: 2.5rem 16px 0; }
main.doc h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
pre, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface2); border: 1px solid var(--hairline); border-radius: 10px; padding: 0.85rem; }
table { border-collapse: collapse; width: 100%; margin: 0 0 1rem; font-size: 0.92rem; }
td, th { border: 1px solid var(--hairline); padding: 0.45rem 0.55rem; text-align: start; vertical-align: top; overflow-wrap: anywhere; }
th { background: var(--surface2); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: 2rem 0; }

@media (max-width: 30rem) {
  .hero .inner { padding-top: 2.5rem; }
  .site-header nav { gap: 0.4rem 1rem; }
  .site-header .brand { flex-basis: 100%; }
}
@media print { .site-header, .site-footer, .hero .actions { display: none; } body { background: #fff; color: #000; } }
