/* Arab Titans Trading Est. — custom styles layered on top of Tailwind */

:root {
  --red: #c1121f;
  --red-dark: #a10e19;
  --red-tint: #f7d6d8;
  --ink: #1b1b1b;
  --paper: #f4f4f4;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.77, 0, .18, 1);
}

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  font-family: "Inter", "IBM Plex Sans Arabic", system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  animation: pageIn .9s ease-out both;
}
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Typography refinements ---------- */
.font-display { letter-spacing: -0.02em; }
h2.font-display { font-weight: 600; letter-spacing: -0.025em; }
h3.font-display { letter-spacing: -0.012em; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ---------- Bilingual content ----------
   Every translatable text has an English (.en) and Arabic (.ar) twin.
   The <html lang> attribute decides which one is shown. */
html[lang="ar"] .en,
html:not([lang="ar"]) .ar { display: none !important; }

/* Arabic letters must never be spaced apart, or they lose their joins */
html[dir="rtl"] body,
html[dir="rtl"] body * { letter-spacing: 0 !important; }
html[dir="rtl"] body,
html[dir="rtl"] .font-display,
html[dir="rtl"] .font-tight { font-family: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif; }
html[dir="rtl"] h1, html[dir="rtl"] h2 { line-height: 1.3; }
html[dir="rtl"] .hero-title { font-size: 34px; line-height: 1.25; }
@media (min-width: 768px) { html[dir="rtl"] .hero-title { font-size: 54px; } }
@media (min-width: 1024px) { html[dir="rtl"] .hero-title { font-size: 66px; line-height: 1.2; } }

/* Outlined pill labels ("About Us", "Services", ...) with a red brand dot */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid currentColor;
  border-radius: 9999px;
  padding: 4px 11px 4px 9px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 9999px; background: var(--red); flex-shrink: 0; }

/* ======================================================================
   HEADER — transparent over the hero, solid white once scrolled
   ====================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  color: #fff;
  transition: background-color .5s var(--ease-out), box-shadow .5s var(--ease-out), color .5s var(--ease-out);
}
.header-inner { height: 72px; transition: height .5s var(--ease-out); }
@media (min-width: 1024px) { .header-inner { height: 92px; } }
.site-header .logo-sub { color: rgba(255,255,255,.72); transition: color .5s; }
.site-header .lang-btn { border-color: rgba(255,255,255,.38); transition: border-color .3s, color .3s, background-color .3s; }
.site-header .lang-btn:hover { border-color: var(--red); color: #fff; background: var(--red); }

.site-header.is-scrolled {
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 14px 34px -22px rgba(0,0,0,.35);
}
.site-header.is-scrolled .header-inner { height: 62px; }
@media (min-width: 1024px) { .site-header.is-scrolled .header-inner { height: 74px; } }
/* soft top fade so the transparent header always reads over bright footage */
.site-header::before { content: ""; position: absolute; inset: 0 0 -40px 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,0)); transition: opacity .5s; }
.site-header.is-scrolled::before { opacity: 0; }
.site-header.is-scrolled .logo-sub { color: #777; }
.site-header.is-scrolled .lang-btn { border-color: #d9d9d9; }

/* nav underline */
.nav-link { position: relative; padding: 6px 0; transition: color .3s; }
.nav-link::after {
  content: ""; position: absolute; inset-inline-start: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease-out);
}
[dir="rtl"] .nav-link::after { transform-origin: right; }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }

/* reading progress */
.scroll-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; background: var(--red); transform: scaleX(var(--p, 0)); transform-origin: left; }
[dir="rtl"] .scroll-progress span { transform-origin: right; }

/* hamburger */
.burger { width: 40px; height: 40px; margin-inline-end: -8px; display: inline-flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 5px; padding: 0 8px; }
[dir="rtl"] .burger { align-items: flex-start; }
.burger span { display: block; height: 2px; width: 22px; background: currentColor; border-radius: 2px; transition: width .35s var(--ease-out); }
.burger span:nth-child(2) { width: 15px; }
.burger:hover span:nth-child(2) { width: 22px; }

/* ======================================================================
   SIDE MENU — slides in from the right (from the left in Arabic)
   ====================================================================== */
.drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; pointer-events: none; transition: visibility 0s linear .6s; }
.drawer.is-open { visibility: visible; pointer-events: auto; transition: visibility 0s; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(10,10,10,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .5s ease; }
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; bottom: 0; inset-inline-end: 0;
  width: min(86vw, 390px); background: var(--ink); color: #fff;
  display: flex; flex-direction: column; overflow-y: auto;
  transform: translateX(100%); transition: transform .6s var(--ease-out);
  box-shadow: -30px 0 60px rgba(0,0,0,.35);
}
[dir="rtl"] .drawer-panel { transform: translateX(-100%); box-shadow: 30px 0 60px rgba(0,0,0,.35); }
.drawer.is-open .drawer-panel { transform: none; }
.drawer-panel::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 3px; background: var(--red); }

.drawer-close { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.22); border-radius: 9999px; transition: background-color .3s, border-color .3s, transform .45s var(--ease-out); }
.drawer-close:hover { background: var(--red); border-color: var(--red); transform: rotate(90deg); }

.drawer-nav a {
  display: flex; align-items: baseline; gap: 16px; padding: 15px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-family: "Inter Tight", "Inter", "IBM Plex Sans Arabic", sans-serif;
  font-size: 23px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em;
  opacity: 0; transform: translateX(28px);
  transition: opacity .5s ease, transform .6s var(--ease-out), color .25s;
}
[dir="rtl"] .drawer-nav a { transform: translateX(-28px); font-family: "IBM Plex Sans Arabic", sans-serif; }
.drawer-nav a .num { font-family: "Inter", sans-serif; font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--red); min-width: 18px; }
.drawer-nav a:hover { color: var(--red); }
.drawer.is-open .drawer-nav a { opacity: 1; transform: none; transition-delay: calc(.15s + var(--i, 0) * .055s), calc(.15s + var(--i, 0) * .055s), 0s; }
.drawer-foot { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .6s var(--ease-out); }
.drawer.is-open .drawer-foot { opacity: 1; transform: none; transition-delay: .5s; }
body.menu-open { overflow: hidden; }

/* ======================================================================
   HERO — cinematic background video
   ====================================================================== */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; }
.hero-inner { width: 100%; }
.hero-media { transform: scale(1.1); animation: heroZoom 2.6s var(--ease-out) .05s forwards; }
@keyframes heroZoom { to { transform: scale(1); } }
.hero-media { object-position: 62% 50%; }
/* cinematic grade: darker top (header) and bottom (content), text side shaded */
.hero-shade {
  background:
    linear-gradient(180deg, rgba(8,8,10,.62) 0%, rgba(8,8,10,.30) 32%, rgba(8,8,10,.42) 60%, rgba(8,8,10,.88) 100%),
    linear-gradient(90deg, rgba(8,8,10,.55) 0%, rgba(8,8,10,.15) 55%, rgba(8,8,10,0) 80%);
}
[dir="rtl"] .hero-shade {
  background:
    linear-gradient(180deg, rgba(8,8,10,.62) 0%, rgba(8,8,10,.30) 32%, rgba(8,8,10,.42) 60%, rgba(8,8,10,.88) 100%),
    linear-gradient(270deg, rgba(8,8,10,.55) 0%, rgba(8,8,10,.15) 55%, rgba(8,8,10,0) 80%);
}
.hero-accent { background: radial-gradient(60% 45% at 0% 100%, rgba(193,18,31,.22) 0%, rgba(193,18,31,0) 70%); }
[dir="rtl"] .hero-accent { background: radial-gradient(60% 45% at 100% 100%, rgba(193,18,31,.22) 0%, rgba(193,18,31,0) 70%); }
.hero-title { text-shadow: 0 2px 30px rgba(0,0,0,.25); }

/* headline lines slide up out of a mask, one after another */
.hero-title .line { display: block; overflow: hidden; padding: .1em 0; margin: -.1em 0; }
.hero-title .line > span { display: inline-block; transform: translateY(110%); animation: lineUp 1.1s var(--ease-out) forwards; }
.hero-title .line:nth-child(1) > span { animation-delay: .15s; }
.hero-title .line:nth-child(2) > span { animation-delay: .27s; }
.hero-title .line:nth-child(3) > span { animation-delay: .39s; }
@keyframes lineUp { to { transform: none; } }

.h-anim { opacity: 0; transform: translateY(26px); animation: fadeUp 1s var(--ease-out) var(--d, 0s) forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

.hero-card { box-shadow: 0 34px 70px -34px rgba(193,18,31,.65), inset 0 1px 0 rgba(255,255,255,.12); }

.scroll-cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); width: 26px; height: 42px; border: 1.5px solid rgba(255,255,255,.5); border-radius: 14px; justify-content: center; padding-top: 8px; opacity: 0; animation: fadeIn 1s ease 1.4s forwards; }
.scroll-cue span { width: 3px; height: 8px; border-radius: 2px; background: #fff; animation: cue 1.9s var(--ease-in-out) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@keyframes fadeIn { to { opacity: 1; } }

/* ======================================================================
   SCROLL REVEALS (only when JS is running — content stays visible otherwise)
   ====================================================================== */
.js [data-reveal] {
  opacity: 0; transform: translateY(34px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: var(--rd, 0s);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* images: red brand curtain lifts away + slow settle.
   (A pseudo-element curtain, not clip-path, so IntersectionObserver can still "see" the image.) */
.media { position: relative; overflow: hidden; }
.media > img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1s var(--ease-out); }
.js .media[data-reveal="img"] { opacity: 1; transform: none; }
.js .media[data-reveal="img"]::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: var(--red); transform-origin: top; transform: scaleY(1);
  transition: transform 1.25s var(--ease-in-out) calc(var(--rd, 0s) + .1s);
}
.js .media[data-reveal="img"].is-visible::after { transform: scaleY(0); }
.js .media[data-reveal="img"] > img { transform: scale(1.18); transition: transform 1.8s var(--ease-out) var(--rd, 0s); }
.js .media[data-reveal="img"].is-visible > img { transform: scale(1); }

/* ======================================================================
   CARDS & BUTTONS
   ====================================================================== */
.lift { transition: transform .55s var(--ease-out), box-shadow .55s var(--ease-out), border-color .3s; }
.lift:hover { transform: translateY(-6px); box-shadow: 0 30px 55px -30px rgba(17,17,17,.38); }
.lift:hover .media > img, .lift:hover .cat-img img { transform: scale(1.06); }
.cat-img img { transition: transform .8s var(--ease-out); }

.approval { border: 1px solid #ececec; }
.approval img { filter: grayscale(.15); transition: filter .4s, transform .5s var(--ease-out); }
.approval:hover img { filter: none; transform: scale(1.05); }

.svc { position: relative; }
.svc h3 { transition: color .35s; }
.svc:hover h3 { color: #ff4d57; }
.svc::after { content: ""; position: absolute; inset-inline-start: 0; bottom: -1px; height: 1px; width: 100%; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease-out); }
[dir="rtl"] .svc::after { transform-origin: right; }
.svc:hover::after { transform: scaleX(1); }

.btn { position: relative; overflow: hidden; isolation: isolate; transition: transform .4s var(--ease-out), background-color .3s, color .3s, border-color .3s, box-shadow .4s var(--ease-out); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn.bg-brand:hover { box-shadow: 0 16px 30px -14px rgba(193,18,31,.7); }
.btn.bg-brand::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .8s var(--ease-out);
}
.btn.bg-brand:hover::after { transform: translateX(120%); }
.btn-arrow { transition: transform .4s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(4px); }
[dir="rtl"] .btn-arrow { transform: scaleX(-1); }
[dir="rtl"] .btn:hover .btn-arrow { transform: scaleX(-1) translateX(4px); }

/* Logo marquee (trusted partners strip) */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 45s linear infinite; }
.marquee-track img { filter: grayscale(1) contrast(1.05); opacity: .75; transition: filter .4s, opacity .4s; }
.marquee-track img:hover { filter: none; opacity: 1; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Collapsible content (cards, accordion, FAQ) */
.reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease-out); }
.reveal > div { overflow: hidden; }
.is-open > .reveal, .is-open .reveal { grid-template-rows: 1fr; }
.is-open .chev { transform: rotate(180deg); }
.is-open .plus { transform: rotate(45deg); }
.chev, .plus { transition: transform .4s var(--ease-out); }
[data-single] [data-toggle] { transition: color .3s; }
[data-single] [data-toggle]:hover { color: var(--red); }

/* "Read More" / "Show Less" labels */
.lbl-less { display: none; }
.is-open .lbl-less { display: inline; }
.is-open .lbl-more { display: none; }

/* Accordion active title turns red */
.acc-item.is-open .acc-title { color: var(--red); }

/* Bulleted lists inside cards */
.dot-list li { position: relative; padding-inline-start: 14px; }
.dot-list li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .62em;
  width: 5px; height: 5px; border-radius: 9999px; background: var(--red);
}

/* Product catalog */
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.cat-tab { transition: background-color .3s, border-color .3s, color .3s, transform .3s var(--ease-out); }
.cat-tab:hover { transform: translateY(-1px); }
.cat-tab[aria-selected="true"] { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 10px 22px -12px rgba(193,18,31,.7); }
.cat-tab[aria-selected="true"] .cat-count { color: rgba(255,255,255,.75); }
.cat-card { animation: fadeUp .75s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }

/* Spec tables (plates) */
.spec-table { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 18px; }
.spec-table th { text-align: start; font-weight: 600; color: var(--ink); background: var(--paper); padding: 6px 8px; }
.spec-table td { padding: 6px 8px; border-top: 1px solid #eee; color: #444; vertical-align: top; }
.spec-table td:first-child { color: #888; white-space: nowrap; }

/* Testimonial slides */
.slide { display: none; }
.slide.is-active { display: block; animation: fadeUp .7s var(--ease-out); }

/* Footer watermark */
.watermark {
  background: linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ======================================================================
   REDUCED MOTION — everything visible, nothing moves
   ====================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important;
  }
  .js [data-reveal], .js .media[data-reveal="img"] { opacity: 1 !important; transform: none !important; }
  .js .media[data-reveal="img"]::after { display: none !important; }
  .js .media[data-reveal="img"] > img, .hero-media { transform: none !important; }
  .marquee-track { animation: none !important; }
  .scroll-cue { display: none !important; }
}
