/* Tamalak website: layout and components. Colours come only from tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 23px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--s-screen); }
@media (min-width: 768px) { .wrap { padding: 0 40px; } }

.skip { position: absolute; inset-inline-start: 16px; top: 8px; transform: translateY(-200%); background: var(--btn); color: var(--on-btn); padding: 10px 16px; border-radius: var(--r-chip); z-index: 100; }
.skip:focus { transform: none; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 14px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gold-text);
  margin: 0 0 var(--s-md);
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--gold); }
:lang(ar) .eyebrow { font-family: var(--sans); letter-spacing: 0; font-size: 12.5px; font-weight: 500; }

.display, .title, .h1, .h2 { font-family: var(--serif); font-weight: 400; margin: 0; color: var(--ink); text-wrap: balance; }
.display { font-size: clamp(40px, 7vw, 62px); line-height: 1.02; letter-spacing: -2px; }
.title { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.06; letter-spacing: -1.5px; }
.h1 { font-size: 30px; line-height: 32px; letter-spacing: -0.6px; }
.h2 { font-size: 22px; line-height: 26px; letter-spacing: -0.3px; }
:lang(ar) .display, :lang(ar) .title, :lang(ar) .h1, :lang(ar) .h2 { letter-spacing: 0; line-height: 1.45; }
:lang(ar) .display { font-size: clamp(34px, 6vw, 54px); }
:lang(ar) .title { font-size: clamp(28px, 4vw, 42px); }

.lead { font-size: 17px; line-height: 27px; color: var(--ink2); max-width: 36em; margin: var(--s-lg) 0 0; }
.muted { color: var(--ink2); }
.small { font-size: 13.5px; line-height: 20px; }
.xs { font-size: 12px; line-height: 17px; }
p { margin: 0 0 var(--s-md); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: var(--s-lg); }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 34px; width: auto; }
:lang(ar) .brand img { height: 40px; }
.nav-links { display: none; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-size: 14px; color: var(--ink2); transition: color .2s var(--ease); }
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.lang { font-size: 14px; text-decoration: none; color: var(--ink); padding: 8px 4px; }
.lang:hover { text-decoration: underline; text-underline-offset: 4px; }
.menu-btn { width: 44px; height: 44px; border-radius: var(--r-input); border: 1px solid var(--line); background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; }
.nav .btn { display: none; }
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .menu-btn { display: none; }
  .nav .btn { display: inline-flex; height: 44px; padding: 0 20px; border-radius: 14px; font-size: 14px; }
}
.mobile-menu { display: none; border-top: 1px solid var(--line); background: var(--bg); }
.mobile-menu.open { display: block; }
.mobile-menu ul { list-style: none; margin: 0; padding: 8px 0 20px; }
.mobile-menu a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line2); text-decoration: none; font-family: var(--serif); font-size: 22px; }
@media (min-width: 960px) { .mobile-menu { display: none !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 26px; border-radius: var(--r-btn);
  font-family: var(--sans); font-size: 15px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--btn); color: var(--on-btn); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink2); }
.btn svg { width: 18px; height: 18px; }
:lang(ar) .btn .arrow { transform: scaleX(-1); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s-xl); }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: var(--r-chip); font-size: 12px; font-weight: 500; }
.chip-pending { background: var(--gold-soft); color: var(--gold-text); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip .dia { width: 6px; height: 6px; background: currentColor; transform: rotate(45deg); }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
@media (max-width: 767px) { section { padding: 72px 0; } }
.section-head { max-width: 720px; margin-bottom: 56px; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.rule-wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--s-screen); }
@media (min-width: 768px) { .rule-wrap { padding: 0 40px; } }

/* ---------- Hero (motif: plan grid) ---------- */
.hero { position: relative; padding: 56px 0 96px; overflow: hidden; }
.plan-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 30%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 80% at 70% 30%, #000 30%, transparent 75%);
}
:lang(ar) .plan-grid { -webkit-mask-image: radial-gradient(ellipse 70% 80% at 30% 30%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 70% 80% at 30% 30%, #000 30%, transparent 75%); }
.hero-grid { position: relative; display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 64px; padding-top: 40px; } }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-meta span { font-size: 13.5px; color: var(--ink2); display: flex; align-items: center; gap: 8px; }
.hero-meta svg { width: 18px; height: 18px; color: var(--cool); }

/* Hero image card (placeholder until photography is supplied) */
.hero-card {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-hero); overflow: hidden;
  background: var(--deep); color: var(--on-deep);
  box-shadow: 0 30px 60px -30px var(--scrim);
  margin: 0;
}
@media (max-width: 959px) { .hero-card { aspect-ratio: 1 / 1; } }
.hero-card img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-card .placeholder {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-on-deep) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-on-deep) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  display: grid; place-items: start center; padding-top: 16%;
}
.hero-card .placeholder svg { width: 56%; height: auto; color: var(--gold-on-deep); opacity: .85; }
.hero-card .ph-label { position: absolute; top: 20px; inset-inline-start: 20px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--on-deep2); }
.hero-card .caption {
  position: absolute; inset-inline: 16px; bottom: 16px;
  padding: 18px 20px; border-radius: var(--r-card);
  background: var(--glass-on-deep);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--grid-on-deep);
}
.hero-card .caption .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold-on-deep); margin-bottom: 6px; }
:lang(ar) .hero-card .caption .k { font-family: var(--sans); letter-spacing: 0; font-size: 12px; }
.hero-card .caption .v { font-family: var(--serif); font-size: 22px; line-height: 28px; color: var(--on-deep); }

/* ---------- About ---------- */
.about-grid { display: grid; gap: 40px; }
@media (min-width: 960px) { .about-grid { grid-template-columns: 1fr 1fr; gap: 80px; } }
.about-body p { font-size: 16px; line-height: 26px; color: var(--ink2); }
.about-body p:first-child { color: var(--ink); font-size: 18px; line-height: 28px; }

/* ---------- Solution cards ---------- */
.cards { display: grid; gap: 16px; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-card);
  padding: 28px; display: flex; flex-direction: column; gap: 14px;
}
.card .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--sunk); display: grid; place-items: center; color: var(--ink); }
.card .icon svg { width: 24px; height: 24px; }
.card p { color: var(--ink2); margin: 0; }
.card .chip { align-self: flex-start; margin-top: auto; }

/* ---------- How it works (motif: gold line + node) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.step { position: relative; padding: 0 0 40px 40px; }
:lang(ar) .step { padding: 0 40px 40px 0; }
.step::before { content: ""; position: absolute; top: 8px; bottom: 0; inset-inline-start: 6px; width: 1px; background: var(--line); }
.step:last-child::before { display: none; }
.step .node { position: absolute; top: 4px; inset-inline-start: 2px; width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg); }
.step .num { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.6px; color: var(--gold-text); margin-bottom: 8px; }
.step h3 { margin-bottom: 10px; }
.step p { color: var(--ink2); max-width: 32em; margin: 0; }
@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 32px; }
  .steps::before { content: ""; position: absolute; top: 4px; inset-inline: 0; height: 1px; background: var(--gold); }
  .step, :lang(ar) .step { padding: 36px 0 0; }
  .step::before { display: none; }
  .step .node { top: 0; inset-inline-start: 0; }
}

/* ---------- Principles ---------- */
.principles { background: var(--sunk); }
.principle-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .principle-list { grid-template-columns: repeat(2, 1fr); column-gap: 64px; } }
.principle { display: grid; grid-template-columns: 28px 1fr; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.principle svg { width: 24px; height: 24px; color: var(--cool); margin-top: 2px; }
.principle strong { display: block; font-weight: 600; margin-bottom: 4px; }
.principle span { color: var(--ink2); font-size: 14.5px; }

/* ---------- Team ---------- */
.team { display: grid; gap: 16px; }
@media (min-width: 640px) { .team { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .team { grid-template-columns: repeat(4, 1fr); } }
.person { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-card); overflow: hidden; }
.person .portrait {
  aspect-ratio: 1 / 1; background: var(--sunk); position: relative;
  display: grid; place-items: center;
}
.person .portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person .portrait span { font-family: var(--serif); font-size: 40px; color: var(--ink2); }
.person .body { padding: 20px 22px 24px; }
.person .role { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold-text); margin: 6px 0 12px; }
:lang(ar) .person .role { font-family: var(--sans); letter-spacing: 0; font-size: 12.5px; }
.person p { color: var(--ink2); font-size: 14px; line-height: 21px; margin: 0; }

/* ---------- Notice ---------- */
.notice {
  background: var(--card); border: 1px solid var(--line); border-inline-start: 3px solid var(--gold);
  border-radius: var(--r-card); padding: 28px 32px; color: var(--ink);
}
.notice h2 { font-family: var(--sans); font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.notice p { margin: 0 0 10px; font-size: 14.5px; line-height: 23px; }
.notice p:last-child { margin: 0; }

/* ---------- Contact ---------- */
.contact { padding-bottom: 120px; }
.contact-card {
  position: relative; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-hero);
  padding: 56px 28px; text-align: center;
}
@media (min-width: 768px) { .contact-card { padding: 80px 64px; } }
.contact-card .eyebrow { justify-content: center; }
.contact-card .lead { margin-inline: auto; }
.contact-card .btn-row { justify-content: center; }
.mail { font-family: var(--serif); font-size: clamp(22px, 3.4vw, 30px); letter-spacing: -0.6px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--gold); padding-bottom: 2px; }
/* corner ticks on the contact card (one motif element for this view) */
.ticks::before, .ticks::after { content: ""; position: absolute; width: var(--tick); height: var(--tick); border-color: var(--gold); border-style: solid; }
.ticks::before { top: 16px; inset-inline-start: 16px; border-width: 1px 0 0 1px; }
.ticks::after { bottom: 16px; inset-inline-end: 16px; border-width: 0 1px 1px 0; }
:lang(ar) .ticks::before { border-width: 1px 1px 0 0; }
:lang(ar) .ticks::after { border-width: 0 0 1px 1px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; font-size: 13.5px; line-height: 21px; color: var(--ink2); }
.footer-top { display: grid; gap: 32px; margin-bottom: 40px; }
@media (min-width: 900px) { .footer-top { grid-template-columns: 1.2fr 1fr 1fr; } }
.footer-top img { height: 30px; width: auto; margin-bottom: 16px; }
:lang(ar) .footer-top img { height: 36px; }
.footer-top h3 { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink); font-weight: 400; margin: 0 0 14px; }
:lang(ar) .footer-top h3 { font-family: var(--sans); letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
.footer-top ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-top a { text-decoration: none; }
.footer-top a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.legal { border-top: 1px solid var(--line); padding-top: 24px; display: grid; gap: 12px; }
.legal .ph { color: var(--gold-text); }

/* ---------- Legal page ---------- */
.doc { max-width: 760px; padding: 64px 0 96px; }
.doc h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -0.4px; margin: 48px 0 12px; }
.doc p, .doc li { color: var(--ink2); font-size: 15.5px; line-height: 25px; }
.doc .ph { color: var(--gold-text); }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * var(--stagger)); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transform: none; transition: opacity .2s linear; }
  .btn, .btn:hover { transition: none; transform: none; }
}
@media (max-width: 639px) { .person .portrait { aspect-ratio: 16 / 9; } }
