@import url('/assets/fonts.css');

/* ==========================================================================
   TLN — Tarabysh Live Network · Phase 0
   Design tokens.

   The 2022 brand book shipped exactly two colours (#ED1C24 red, black) and no
   digital palette at all — no greys, no text colours, no states. Everything below
   that isn't red/ink is therefore NEW, derived to sit with the brand rather than
   replace it. Brand red and the logo are untouched.

   ACCESSIBILITY NOTE, load-bearing: brand red on white measures 4.41:1. That PASSES
   WCAG AA for large text (3:1) and UI components, but FAILS the 4.5:1 body-text bar.
   So: red is only ever used for large display text, icons, and filled buttons with
   white labels at >=18px. Small red-on-white text uses --red-ink instead, which is
   darkened purely to clear 4.5:1 — it is not a second brand colour.
   ========================================================================== */

:root {
  --red: #ED1C24;          /* brand red — exact value from the delivered logo files */
  --red-hover: #cf171e;
  --red-ink: #C4141B;      /* accessibility-only darkening for small red text on white */
  --ink: #231F20;          /* brand near-black — the value the SVGs actually use */
  --ink-2: #4A4548;
  --ink-3: #6E686B;
  --line: #E6E2E3;
  --surface: #FFFFFF;
  --surface-2: #FAF8F8;
  --surface-3: #F2EEEF;

  --font-display: 'DG Trika', 'Montserrat', system-ui, sans-serif;
  --font-body: 'Montserrat', system-ui, -apple-system, sans-serif;

  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4:  clamp(2.4rem, 1.8rem + 3.2vw, 4.4rem);

  --gap: clamp(1rem, 0.8rem + 1vw, 1.75rem);
  --pad-section: clamp(3.5rem, 2.5rem + 5vw, 7rem);
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(35,31,32,.05), 0 8px 24px -12px rgba(35,31,32,.16);
  --shadow-lg: 0 2px 4px rgba(35,31,32,.06), 0 24px 60px -24px rgba(35,31,32,.26);
  --maxw: 1180px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* Arabic swaps the body family only. The display family (DG Trika) is bilingual,
   so the brand voice stays identical across both scripts. */
[dir="rtl"] {
  --font-body: 'Alexandria', system-ui, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* belt and braces: nothing may cause a horizontal scrollbar */
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
/* DG Trika is a geometric display face; in Arabic it needs a little more leading
   to stop descenders colliding with the line below. */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { line-height: 1.3; letter-spacing: 0; }
p { margin: 0; }
img, svg { max-width: 100%; height: auto; display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.5rem); }
.section { padding-block: var(--pad-section); }
.section--tint { background: var(--surface-2); }

/* Focus is never removed — only replaced with something on-brand and visible. */
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red-ink); /* small text, so the accessible red — see note at top */
  margin-bottom: .85rem;
}
[dir="rtl"] .eyebrow { letter-spacing: 0; }

.lede { font-size: var(--step-1); color: var(--ink-2); max-width: 60ch; line-height: 1.55; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--font-body);
  font-size: 1.0625rem; /* >=18px-equivalent weight/size pairing keeps white-on-red AA-legal */
  font-weight: 700;
  padding: .95rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-hover); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--onred { background: #fff; color: var(--red-ink); }
.btn--onred-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn--onred-ghost:hover { border-color: #fff; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.hdr[data-scrolled="true"] { border-bottom-color: var(--line); }
.hdr__in { display: flex; align-items: center; gap: var(--gap); min-height: 68px; }
.hdr__logo { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.hdr__logo img { width: 34px; }
.hdr__name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; line-height: 1; }
.hdr__sub { font-family: var(--font-body); font-weight: 600; font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin-top: .22rem; }
[dir="rtl"] .hdr__sub { letter-spacing: 0; font-size: .66rem; }
.hdr__nav { display: none; margin-inline-start: auto; gap: 1.6rem; }
.hdr__nav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; font-weight: 600; }
.hdr__nav a:hover { color: var(--red-ink); }
.hdr__actions { display: flex; align-items: center; gap: .6rem; margin-inline-start: auto; }
@media (min-width: 900px) {
  .hdr__nav { display: flex; }
  .hdr__actions { margin-inline-start: 1.6rem; }
}
.langbtn {
  font-family: var(--font-body); font-weight: 700; font-size: .85rem;
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: .5rem .9rem; cursor: pointer;
}
.langbtn:hover { border-color: var(--ink); }
.hdr .btn { padding: .68rem 1.15rem; font-size: .95rem; }
.hdr__cta { display: none; }
@media (min-width: 620px) { .hdr__cta { display: inline-flex; } }

/* ---------- generic cards ---------- */
.grid { display: grid; gap: var(--gap); }
@media (min-width: 700px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--2 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(1.3rem, 1rem + 1.2vw, 2rem);
}
.card h3 { font-size: var(--step-1); margin-bottom: .5rem; }
.card p { color: var(--ink-2); font-size: .98rem; }

.ico {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; margin-bottom: 1rem;
  background: rgba(237,28,36,.09); color: var(--red);
}
.ico svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- how it works ---------- */
.steps { counter-reset: step; display: grid; gap: var(--gap); }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; padding-top: 3.2rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; inset-block-start: 0; inset-inline-start: 0;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  display: grid; place-items: center;
}
.step h3 { font-size: var(--step-1); margin-bottom: .4rem; }
.step p { color: var(--ink-2); }

/* ---------- closing band ---------- */
.band { background: var(--red); color: #fff; }
.band h2 { font-size: var(--step-3); margin-bottom: .8rem; }
.band p { color: rgba(255,255,255,.92); font-size: var(--step-1); max-width: 52ch; }
.band__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

/* ---------- footer ---------- */
.ftr { background: var(--ink); color: #fff; padding-block: clamp(2.5rem, 2rem + 2vw, 4rem); }
.ftr a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.3); }
.ftr a:hover { border-bottom-color: #fff; }
.ftr__top { display: grid; gap: 2rem; }
@media (min-width: 760px) { .ftr__top { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.ftr__contact { display: grid; gap: .6rem; font-size: .98rem; }
.ftr__row { display: flex; align-items: center; gap: .6rem; }
.ftr__row svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: none; }
.ftr__legal {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.16);
  font-size: .85rem; color: rgba(255,255,255,.7);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}

/* ---------- modal ---------- */
.modal { border: none; padding: 0; background: transparent; max-width: min(560px, 94vw); width: 100%; }
/* A CSS reset that zeroes dialog margins kills native centring — margin:auto restores it. */
.modal { margin: auto; }
.modal::backdrop { background: rgba(35,31,32,.55); backdrop-filter: blur(3px); }
.modal__in { background: #fff; border-radius: var(--radius-lg); padding: clamp(1.4rem, 1rem + 2vw, 2.2rem); box-shadow: var(--shadow-lg); }
.modal__hd { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.4rem; }
.modal__hd h2 { font-size: var(--step-2); }
.modal__hd p { color: var(--ink-2); font-size: .95rem; margin-top: .35rem; }
.modal__x { margin-inline-start: auto; background: transparent; border: none; cursor: pointer; padding: .4rem; color: var(--ink-3); border-radius: 8px; flex: none; }
.modal__x:hover { color: var(--ink); background: var(--surface-3); }
.modal__x svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .38rem; }
.field .req { color: var(--red-ink); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: .8rem .9rem; border: 1.5px solid var(--line); border-radius: 11px;
  background: #fff; transition: border-color .15s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red); outline: none; }
.field textarea { resize: vertical; min-height: 92px; }
.field__err { display: none; color: var(--red-ink); font-size: .85rem; margin-top: .3rem; font-weight: 600; }
.field[data-invalid="true"] input, .field[data-invalid="true"] select, .field[data-invalid="true"] textarea { border-color: var(--red); }
.field[data-invalid="true"] .field__err { display: block; }

.check { display: flex; gap: .7rem; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: .85rem .95rem; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .18rem; flex: none; accent-color: var(--red); }
.check label { font-weight: 500; font-size: .92rem; line-height: 1.5; margin: 0; }

/* Honeypot — visually and semantically hidden, but still submitted by bots.
   Not display:none, because some bots skip those; off-screen is stickier. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.modal__foot { margin-top: 1.4rem; }
.modal__foot .btn { width: 100%; }
.formnote { font-size: .82rem; color: var(--ink-3); margin-top: .8rem; text-align: center; }

.done { text-align: center; padding: 1.5rem .5rem; }
.done__tick { width: 62px; height: 62px; border-radius: 50%; background: rgba(237,28,36,.1); color: var(--red); display: grid; place-items: center; margin: 0 auto 1.1rem; }
.done__tick svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.done h3 { font-size: var(--step-2); margin-bottom: .5rem; }
.done p { color: var(--ink-2); }

[hidden] { display: none !important; } /* the bare [hidden] attribute loses to any class that sets display */
