/* ============================================================
   REVALUAR — Design System
   Refined editorial bilingual site
   ============================================================ */

/* ---- Teramo (brand primary, EN) — variable + optical-size statics (WOFF2) ---- */
@font-face { font-family:'Teramo'; src:url('fonts/ROHH - Teramo Variable.woff2') format('woff2'); font-weight:100 900; font-display:swap; }

/* Display optical cut — for the largest headlines */
@font-face { font-family:'Teramo Display'; src:url('fonts/Teramo-Light.woff2') format('woff2');   font-weight:300; font-display:swap; }
@font-face { font-family:'Teramo Display'; src:url('fonts/Teramo-Book.woff2') format('woff2');    font-weight:350; font-display:swap; }
@font-face { font-family:'Teramo Display'; src:url('fonts/Teramo-Regular.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Teramo Display'; src:url('fonts/Teramo-Medium.woff2') format('woff2');  font-weight:500; font-display:swap; }
@font-face { font-family:'Teramo Display'; src:url('fonts/Teramo-Bold.woff2') format('woff2');    font-weight:700; font-display:swap; }
@font-face { font-family:'Teramo Display'; src:url('fonts/Teramo-Black.woff2') format('woff2');   font-weight:900; font-display:swap; }

/* Text optical cut — for serif body / lead paragraphs */
@font-face { font-family:'Teramo Text'; src:url('fonts/ROHH - Teramo Text Book.woff2') format('woff2');    font-weight:350; font-display:swap; }
@font-face { font-family:'Teramo Text'; src:url('fonts/ROHH - Teramo Text Regular.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Teramo Text'; src:url('fonts/ROHH - Teramo Text Medium.woff2') format('woff2');  font-weight:500; font-display:swap; }
@font-face { font-family:'Teramo Text'; src:url('fonts/ROHH - Teramo Text Bold.woff2') format('woff2');    font-weight:700; font-display:swap; }

/* ---- Thmanyah Serif Display (Arabic headings) ---- */
@font-face { font-family:'Thmanyah Display'; src:url('fonts/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Light.woff2') format('woff2');   font-weight:300; font-display:swap; }
@font-face { font-family:'Thmanyah Display'; src:url('fonts/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Regular.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Thmanyah Display'; src:url('fonts/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Medium.woff2') format('woff2');  font-weight:500; font-display:swap; }
@font-face { font-family:'Thmanyah Display'; src:url('fonts/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Bold.woff2') format('woff2');    font-weight:700; font-display:swap; }
@font-face { font-family:'Thmanyah Display'; src:url('fonts/thmanyahserifdisplay/woff2/thmanyahserifdisplay-Black.woff2') format('woff2');   font-weight:900; font-display:swap; }

/* ---- Thmanyah Serif Text (Arabic body / leads) ---- */
@font-face { font-family:'Thmanyah Text'; src:url('fonts/thmanyahseriftext/woff2/thmanyahseriftext-Light.woff2') format('woff2');   font-weight:300; font-display:swap; }
@font-face { font-family:'Thmanyah Text'; src:url('fonts/thmanyahseriftext/woff2/thmanyahseriftext-Regular.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Thmanyah Text'; src:url('fonts/thmanyahseriftext/woff2/thmanyahseriftext-Medium.woff2') format('woff2');  font-weight:500; font-display:swap; }
@font-face { font-family:'Thmanyah Text'; src:url('fonts/thmanyahseriftext/woff2/thmanyahseriftext-Bold.woff2') format('woff2');    font-weight:700; font-display:swap; }
@font-face { font-family:'Thmanyah Text'; src:url('fonts/thmanyahseriftext/woff2/thmanyahseriftext-Black.woff2') format('woff2');   font-weight:900; font-display:swap; }

/* ---- Thmanyah Sans (universal UI sans + mono role: body, nav, buttons, eyebrows, labels — EN & AR) ---- */
@font-face { font-family:'Thmanyah Sans'; src:url('fonts/thmanyahsans/woff2/thmanyahsans-Light.woff2') format('woff2');   font-weight:300; font-display:swap; }
@font-face { font-family:'Thmanyah Sans'; src:url('fonts/thmanyahsans/woff2/thmanyahsans-Regular.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Thmanyah Sans'; src:url('fonts/thmanyahsans/woff2/thmanyahsans-Medium.woff2') format('woff2');  font-weight:500; font-display:swap; }
@font-face { font-family:'Thmanyah Sans'; src:url('fonts/thmanyahsans/woff2/thmanyahsans-Bold.woff2') format('woff2');    font-weight:700; font-display:swap; }
@font-face { font-family:'Thmanyah Sans'; src:url('fonts/thmanyahsans/woff2/thmanyahsans-Black.woff2') format('woff2');   font-weight:900; font-display:swap; }

:root {
  /* palette */
  --ink:        #402530;   /* plum-black primary */
  --ink-soft:   #5a3f49;
  --paper:      #f4f1ea;   /* warm off-white */
  --paper-2:    #efeae0;
  --white:      #ffffff;
  --sage:       #b6beaa;
  --sage-deep:  #9aa389;
  --yellow:     #ecf163;
  --orange:     #f15d3e;

  --line:       rgba(64, 37, 48, 0.16);
  --line-soft:  rgba(64, 37, 48, 0.08);

  /* type — brand fonts are self-hosted (fonts/); the rest are system fallbacks
     shown only for the brief swap window. No third-party (Google) fonts. */
  --serif:  'Teramo Display', 'Teramo', Georgia, 'Times New Roman', serif;
  --serif-text: 'Teramo Text', 'Teramo', Georgia, 'Times New Roman', serif;
  --sans:   'Thmanyah Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono:   'Thmanyah Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --arabic:         'Thmanyah Text',    'Segoe UI', Tahoma, 'Geeza Pro', 'Noto Sans Arabic', sans-serif;
  --arabic-display: 'Thmanyah Display', 'Segoe UI', Tahoma, 'Geeza Pro', 'Noto Sans Arabic', sans-serif;
  --arabic-sans:    'Thmanyah Sans',    'Segoe UI', Tahoma, 'Geeza Pro', 'Noto Sans Arabic', sans-serif;

  /* layout */
  --container: 1320px;
  --pad-x: clamp(22px, 6vw, 84px);
  --section-y: clamp(72px, 11vh, 160px);
  --radius: 18px;
  --radius-lg: 30px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 17px;
  overflow-x: hidden;
}

/* Arabic / RTL */
[dir="rtl"] body,
[dir="rtl"] { font-family: var(--arabic); }
[dir="rtl"] .display,
[dir="rtl"] .serif { font-family: var(--arabic-display); font-weight: 700; }
[dir="rtl"] .serif-text { font-family: var(--arabic); }
[dir="rtl"] .mono { font-family: var(--arabic-sans); letter-spacing: 0; font-weight: 500; }

::selection { background: var(--yellow); color: var(--ink); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ---------- type helpers ---------- */
.display {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.015em;
}
.serif { font-family: var(--serif); }
.serif-text { font-family: var(--serif-text); }
.mono {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.62;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
[dir="rtl"] .eyebrow { letter-spacing: 0.06em; }
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--ink);
  opacity: 0.5;
}

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--pad-x);
}
.section { padding-block: var(--section-y); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  padding: 15px 26px;
  border-radius: 999px;
  transition: transform .4s var(--ease), background .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
  will-change: transform;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .btn { padding: 16px 20px; font-size: 14px; }
  .nav-mobile-cta { padding: 16px 20px; }
}
[dir="rtl"] .btn { font-family: var(--arabic-sans); }
.btn .arrow { transition: transform .4s var(--ease); display: inline-block; }
.btn:hover .arrow { transform: translateX(5px); }
[dir="rtl"] .btn:hover .arrow { transform: translateX(-5px) scaleX(-1); }
[dir="rtl"] .btn .arrow { transform: scaleX(-1); }

.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(241,93,62,.7); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(64,37,48,.7); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  font-weight: 600; font-size: 14.5px;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: gap .3s var(--ease), border-color .3s var(--ease);
}
.link-arrow:hover { gap: 13px; border-color: var(--ink); }
[dir="rtl"] .link-arrow .arrow { transform: scaleX(-1); }

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
/* Above-the-fold: stay painted (opacity:1) so LCP fires at first paint, not at
   the end of a fade. The rise-in motion is preserved via transform only. */
.reveal.eager { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- shapes motif ---------- */
.shape-bar   { background: var(--ink); border-radius: 999px 999px 0 0; }
.shape-circle{ background: var(--ink); border-radius: 50%; }
.shape-trap  { background: var(--ink); clip-path: polygon(0 100%, 18% 0, 100% 0, 100% 100%); }

/* ---------- placeholder media ---------- */
.ph {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    repeating-linear-gradient(135deg, rgba(64,37,48,.05) 0 12px, rgba(64,37,48,0) 12px 24px),
    var(--sage);
  border-radius: var(--radius);
  display: flex; align-items: flex-end;
  color: var(--ink);
}
.ph.dark {
  background:
    repeating-linear-gradient(135deg, rgba(182,190,170,.10) 0 12px, rgba(0,0,0,0) 12px 24px),
    var(--ink);
  color: var(--sage);
}
.ph .ph-tag {
  font-family: var(--mono);
  font-size: 11.5px; letter-spacing: 0.08em;
  padding: 12px 14px;
  opacity: 0.85;
  white-space: nowrap;
}


/* ---------- yellow highlight for inline title words ---------- */
/* gradient trims the top so descenders from the previous line aren't covered */
.hl-yellow {
  background: linear-gradient(to bottom, transparent 0.2em, var(--yellow) 0.2em);
  color: var(--ink);
  padding: 0 4px 0.12em;
  border-radius: 2px;
  font-style: normal;
}

/* utility */
.divider { height: 1px; background: var(--line); border: 0; }

/* ---------- media logo badge — overlaid on all images/placeholders ---------- */
.media-logo-badge {
  position: absolute;
  bottom: 18px;
  left: 22px;
  opacity: 0.72;
  pointer-events: none;
  z-index: 2;
  line-height: 0;
}
[dir="rtl"] .media-logo-badge { left: auto; right: 22px; }
.img-wrap { position: relative; overflow: hidden; isolation: isolate; }

/* ---------- brand image grade — unifies all photography into the palette ---------- */
.ph-img {
  filter: saturate(0.85) sepia(0.18) contrast(1.05) brightness(1.0);
  transition: filter .5s ease;
}
.ph-tint {
  position: absolute; inset: 0; pointer-events: none;
  background: #402531;            /* plum */
  mix-blend-mode: soft-light;
  opacity: 0.5;
}
.ph.dark .ph-tint, .img-wrap.dark .ph-tint { opacity: 0.62; }
.work-card:hover .ph-img,
.service-row:hover .ph-img { filter: saturate(0.95) sepia(0.10) contrast(1.04) brightness(1.02); }
.grid { display: grid; gap: clamp(20px, 3vw, 40px); }
.flex { display: flex; }
.muted { opacity: 0.66; }

/* fade in app on load */
#root { animation: appin .6s var(--ease) both; }
@keyframes appin { from { opacity: 0; } to { opacity: 1; } }

/* page route transition — fade + subtle rise */
.route-fade { animation: pagein 0.35s var(--ease) both; }
@keyframes pagein {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .route-fade { animation: none; }
}

/* ============================================================
   NAV
   ============================================================ */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: var(--orange); z-index: 200;
  transition: width .1s linear;
}
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.solid {
  background: rgba(244, 241, 234, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.nav-brand { display: inline-flex; align-items: center; gap: 11px; }
.nav-brand .serif { font-size: 25px; font-weight: 500; letter-spacing: -0.01em; }
[dir="rtl"] .nav-brand .serif { font-family: var(--arabic-display); font-weight: 700; }
.nav-brand svg { transition: transform .5s var(--ease); }
.nav-brand:hover svg { transform: rotate(-8deg); }

.nav-links { display: flex; gap: clamp(14px, 2vw, 34px); }
.nav-links a {
  position: relative; font-size: 15px; font-weight: 500; padding: 6px 2px;
  opacity: 0.74; transition: opacity .25s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 100%;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
[dir="rtl"] .nav-links a::after { transform-origin: right; }
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { opacity: 1; }
.nav-links a.active::after { transform: scaleX(1); background: var(--orange); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.04em;
  padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); transition: background .25s var(--ease), color .25s var(--ease), border-color .25s;
  min-height: 44px; display: inline-flex; align-items: center;
}
.lang-toggle .lang-glyph {
  font-family: var(--arabic); font-size: 15px; line-height: 1;
  width: 18px; height: 18px; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); border-radius: 50%;
}
.lang-toggle:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.lang-toggle:hover .lang-glyph { background: var(--yellow); color: var(--ink); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 600; padding: 11px 19px;
  background: var(--ink); color: var(--paper); border-radius: 999px;
  transition: transform .35s var(--ease), background .3s;
}
[dir="rtl"] .nav-cta { font-family: var(--arabic-sans); }
.nav-cta:hover { transform: translateY(-2px); background: var(--orange); }
.nav-cta .arrow { transition: transform .35s var(--ease); }
.nav-cta:hover .arrow { transform: translateX(4px); }
[dir="rtl"] .nav-cta .arrow { transform: scaleX(-1); }
[dir="rtl"] .nav-cta:hover .arrow { transform: translateX(-4px) scaleX(-1); }

.nav-burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-burger span { width: 22px; height: 2px; background: var(--ink); transition: transform .3s var(--ease), opacity .3s; }
.nav.open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none; flex-direction: column; gap: 2px;
  padding: 8px var(--pad-x) 26px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  max-height: 0; overflow: hidden;
  transition: max-height .45s var(--ease);
}
.nav.open .nav-mobile { max-height: calc(100vh - 76px); }
.nav-mobile a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px; font-size: 22px; font-family: var(--serif); font-weight: 500;
  border-bottom: 1px solid var(--line-soft);
}
[dir="rtl"] .nav-mobile a { font-family: var(--arabic-display); }
[dir="rtl"] .nav-mobile a .arrow { transform: scaleX(-1); }
.nav-mobile a.active { color: var(--orange); }
.nav-mobile-cta {
  display: flex !important; align-items: center !important; justify-content: center !important;
  margin-top: 18px; font-family: var(--sans); font-size: 15px;
  padding: 15px 26px !important; white-space: normal !important;
  border-bottom: none !important;
}
[dir="rtl"] .nav-mobile-cta { font-family: var(--arabic-sans); }
[dir="rtl"] .nav-links a,
[dir="rtl"] .lang-toggle,
[dir="rtl"] .field-input,
[dir="rtl"] .footer-col-h { font-family: var(--arabic-sans); }

@media (max-width: 880px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .nav-mobile { display: flex; }
}

/* ============================================================
   SHAPE CLUSTER (brand motif)
   ============================================================ */
.shape-cluster {
  display: grid; width: 120px; height: 150px;
  grid-template-columns: 38px 1fr; grid-template-rows: 1fr 1fr;
  gap: 12px; transform-origin: top left;
}
.shape-cluster .shape-bar { grid-row: 1 / 3; border-radius: 999px 999px 0 0; }
.shape-cluster .shape-circle { width: 64px; height: 64px; border-radius: 50%; }
.shape-cluster .shape-trap { clip-path: polygon(0 100%, 16% 0, 100% 0, 100% 100%); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--ink); color: var(--paper);
  padding-block: clamp(60px, 8vh, 110px) 34px;
  margin-top: 0;
}
.footer-top {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px;
  padding-bottom: 54px; border-bottom: 1px solid rgba(244,241,234,0.16);
  align-items: start;
}
.footer-mark { margin-bottom: 26px; opacity: 0.95; }
.footer-tagline {
  font-size: clamp(28px, 4vw, 46px); font-weight: 500;
  max-width: 16ch; line-height: 1.02;
}
.footer-regions {
  display: inline-block; margin-top: 22px; font-size: 13px;
  opacity: 0.6; letter-spacing: 0.1em;
}
.footer-cols { display: flex; gap: clamp(30px, 6vw, 80px); justify-content: flex-end; }
.footer-col-h { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.5; margin-bottom: 18px; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a, .footer-langlink {
  color: var(--paper); opacity: 0.82; font-size: 15.5px;
  transition: opacity .25s, color .25s; font-family: var(--sans);
}
[dir="rtl"] .footer-col a, [dir="rtl"] .footer-langlink { font-family: var(--arabic-sans); }
.footer-col a:hover, .footer-langlink:hover { opacity: 1; color: var(--yellow); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-top: 26px; flex-wrap: wrap;
}
.footer-bottom .mono { font-size: 12px; letter-spacing: 0.05em; opacity: 0.7; }
@media (max-width: 760px) {
  .footer-top { grid-template-columns: 1fr; gap: 40px; }
  .footer-cols { justify-content: flex-start; }
  .footer-mark { display: flex; justify-content: center; }
  .footer-mark svg { width: 100% !important; height: auto !important; }
}
