/* Mirsah — harbour ink on sea-mist, brass for the one action that matters.
   Layout: RTL-first single column of quiet sections; the 9:16 reel frame in the hero is the only loud element. */
:root {
  --mist: #EEF3F1;      /* page */
  --glass: #DCE9E5;     /* set-off surfaces */
  --ink: #0F2E36;       /* text, marks */
  --rope: #4F6E74;      /* secondary text */
  --line: #C3D4CF;      /* rules, borders */
  --brass: #8E6219;     /* primary action */
  --brass-ink: #FFFFFF; /* text on brass */
  --live: #1F7A5C;      /* status: available */
  --wa: #128C4A;        /* WhatsApp green, dark enough for white text */
  --wa-shadow: rgba(18, 140, 74, 0.55);

  --reel-frame: #0F2E36;
  --reel-cap-bg: rgba(15, 46, 54, 0.82);
  --reel-cap-fg: #FFFFFF;

  --font: "Readex Pro", "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.1rem, 1.4rem + 3vw, 3.4rem);
  --gap: clamp(1rem, 0.6rem + 2vw, 2rem);
  --section: clamp(3.5rem, 2rem + 6vw, 6.5rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mist: #0B2127; --glass: #12323A; --ink: #E3EEEB; --rope: #9DB8B6;
    --line: #23464E; --brass: #D7A957; --brass-ink: #0B2127; --live: #5FC9A1;
    --reel-frame: #E3EEEB;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --mist: #0B2127; --glass: #12323A; --ink: #E3EEEB; --rope: #9DB8B6;
  --line: #23464E; --brass: #D7A957; --brass-ink: #0B2127; --live: #5FC9A1;
  --reel-frame: #E3EEEB;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  font-weight: 300;
  line-height: 1.75;
  overflow-x: hidden;
}
html[lang="en"] body { line-height: 1.6; }

/* language switching: show only the active language */
html[lang="ar"] [data-l="en"],
html[lang="en"] [data-l="ar"] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
h1 { font-size: var(--step-3); line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
html[lang="en"] h1 { line-height: 1.1; letter-spacing: -0.025em; }
h2 { font-size: var(--step-2); line-height: 1.3; }
h3 { font-size: var(--step-1); line-height: 1.4; }
p { margin: 0; }

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 3px;
  border-radius: 6px;
}

/* header */
.bar { border-bottom: 1px solid var(--line); }
.bar-inner {
  display: flex; align-items: center; gap: var(--gap);
  padding-block: 0.9rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  text-decoration: none; font-weight: 600; font-size: var(--step-1);
}
.brand-mark { width: 1.9rem; height: 1.9rem; color: var(--brass); flex: none; }
.nav { display: flex; gap: 1.4rem; margin-inline-start: auto; font-size: var(--step--1); }
.nav a { text-decoration: none; color: var(--rope); }
.nav a:hover { color: var(--ink); }
.lang {
  font: inherit; font-size: var(--step--1); font-weight: 500;
  color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.3rem 0.9rem; cursor: pointer;
}
.lang:hover { border-color: var(--rope); }
@media (max-width: 760px) {
  .nav { display: none; }
  .lang { margin-inline-start: auto; }
}

/* hero */
.hero { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) var(--section); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(2rem, 1rem + 5vw, 5rem);
  align-items: center;
}
.hero-copy { display: grid; gap: 1.4rem; min-width: 0; }
.hero-product {
  font-weight: 600; color: var(--brass); font-size: var(--step-0);
  direction: ltr; justify-self: start;
}
.lede { color: var(--rope); max-width: 38rem; font-size: 1.125rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.fine { font-size: var(--step--1); color: var(--rope); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.6rem 1.4rem;
  border-radius: 999px; text-decoration: none;
  font-weight: 500; font-size: var(--step-0); line-height: 1.3;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn-main { background: var(--brass); color: var(--brass-ink); }
.btn-main:hover { filter: brightness(1.08); }
.btn-quiet { border: 1px solid var(--line); color: var(--ink); }
.btn-quiet:hover { border-color: var(--rope); }

/* the reel frame: the one loud thing */
.reel { margin: 0; justify-self: center; width: min(100%, 19rem); display: grid; gap: 0.7rem; }
.reel-screen {
  position: relative; aspect-ratio: 9 / 16; max-width: 100%;
  border-radius: 1.6rem; overflow: hidden;
  border: 6px solid var(--reel-frame);
  background: #C98257;
  isolation: isolate;
}
.reel-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pan { transform-origin: 50% 55%; animation: pan 12s ease-in-out infinite; }
@keyframes pan {
  0%   { transform: scale(1.0) translateX(0); }
  33%  { transform: scale(1.12) translateX(-22px); }
  66%  { transform: scale(1.22) translateX(-58px) translateY(-10px); }
  100% { transform: scale(1.0) translateX(0); }
}
.reel-progress {
  position: absolute; inset: 0.7rem 0.7rem auto; z-index: 2;
  display: flex; gap: 4px; direction: ltr;
}
.reel-progress i {
  flex: 1; height: 3px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.35); overflow: hidden; position: relative;
}
.reel-progress i::after {
  content: ""; position: absolute; inset: 0; background: #FFFFFF;
  transform: scaleX(0); transform-origin: left;
  animation: fill 12s linear infinite;
}
.reel-progress i:nth-child(1)::after { animation-name: fill1; }
.reel-progress i:nth-child(2)::after { animation-name: fill2; }
.reel-progress i:nth-child(3)::after { animation-name: fill3; }
@keyframes fill1 { 0% { transform: scaleX(0); } 33%, 100% { transform: scaleX(1); } }
@keyframes fill2 { 0%, 33% { transform: scaleX(0); } 66%, 100% { transform: scaleX(1); } }
@keyframes fill3 { 0%, 66% { transform: scaleX(0); } 100% { transform: scaleX(1); } }

.reel-captions {
  position: absolute; inset: auto 0.8rem 4.2rem; z-index: 2;
  display: grid;
}
.cap {
  grid-area: 1 / 1; justify-self: center; text-align: center;
  background: var(--reel-cap-bg); color: var(--reel-cap-fg);
  padding: 0.35rem 0.8rem; border-radius: 0.6rem;
  font-size: 0.95rem; font-weight: 500; line-height: 1.5;
  opacity: 0; animation: cap 12s linear infinite;
}
.cap-2 { animation-delay: 4s; }
.cap-3 { animation-delay: 8s; }
@keyframes cap {
  0% { opacity: 0; } 3% { opacity: 1; } 30% { opacity: 1; } 33.3%, 100% { opacity: 0; }
}
.reel-logo {
  position: absolute; inset: auto 0 1.1rem; z-index: 2; text-align: center;
  color: #FFFFFF; font-size: 0.75rem; font-weight: 500; opacity: 0.9;
}
.reel figcaption { text-align: center; font-size: var(--step--1); color: var(--rope); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .reel { width: min(100%, 16rem); }
}

/* sections */
.section { padding-block: var(--section); border-top: 1px solid var(--line); }
.section h2 { margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem); }

/* steps: a real sequence, so it is numbered */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}
.steps li { display: grid; gap: 0.6rem; align-content: start; min-width: 0; }
.step-n {
  font-size: 3.2rem; line-height: 1; font-weight: 200; color: var(--brass);
}
.steps p { color: var(--rope); }
.note {
  margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
  max-width: 46rem; font-size: var(--step--1); color: var(--rope);
  padding-inline-start: 1rem; border-inline-start: 2px solid var(--line);
}
@media (max-width: 760px) { .steps { grid-template-columns: minmax(0, 1fr); gap: 2rem; } }

/* pricing table */
.table-scroll { overflow-x: auto; }
.prices {
  width: 100%; min-width: 30rem; border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.prices th, .prices td {
  text-align: start; padding: 1rem 0.75rem; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prices thead th { font-size: var(--step--1); font-weight: 400; color: var(--rope); padding-top: 0; }
.prices tbody th { font-weight: 500; }
.prices td { font-size: var(--step-1); font-weight: 400; }
.prices td[colspan] { font-size: var(--step-0); color: var(--rope); }
.prices tbody tr:first-child td { color: var(--live); font-weight: 500; }
@media (max-width: 560px) {
  .prices { min-width: 0; font-size: var(--step--1); }
  .prices th, .prices td { padding: 0.8rem 0.35rem; }
  .prices td { font-size: var(--step-0); }
  .prices td[colspan] { font-size: var(--step--1); }
}

/* product lines */
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.line {
  display: grid; gap: 0.5rem; padding: 1.4rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.line:last-child { border-bottom: 0; }
.line-live { background: var(--glass); border-radius: 1rem; border-bottom: 0; }
.line-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; }
.line h3 { direction: ltr; }
.ar-name { font-weight: 300; color: var(--rope); margin-inline-start: 0.4rem; }
.line p { color: var(--rope); max-width: 44rem; }
.status {
  font-size: var(--step--1); font-weight: 500;
  padding: 0.1rem 0.7rem; border-radius: 999px; border: 1px solid currentColor;
}
.status-live { color: var(--live); }
.status-soon { color: var(--rope); }
.status-consult { color: var(--brass); }
.text-link { justify-self: start; font-weight: 500; color: var(--brass); text-underline-offset: 0.3em; }

/* about */
.about-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--gap); }
.about h2 { margin-bottom: 0; }
.about p { max-width: 40rem; }
@media (max-width: 760px) { .about-grid { grid-template-columns: minmax(0, 1fr); } }

/* contact */
.contact { background: var(--glass); border-top: 0; }
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gap); align-items: end;
}
.contact h2 { margin-bottom: 0.6rem; }
.contact p { color: var(--rope); }
.contact-actions { display: grid; gap: 0.8rem; justify-items: start; }
.contact-mail { font-size: var(--step--1); }
.contact-mail a { color: var(--ink); font-weight: 500; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: minmax(0, 1fr); align-items: start; } }

/* footer */
.foot { font-size: var(--step--1); color: var(--rope); }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding-block: 1.6rem; }

/* floating WhatsApp button */
.wa-float {
  position: fixed; z-index: 20;
  right: max(16px, calc(env(safe-area-inset-right, 0px) + 12px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 3.4rem; padding: 0.5rem 1.2rem 0.5rem 1rem;
  border-radius: 999px; text-decoration: none;
  background: var(--wa); color: #FFFFFF;
  font-weight: 500; font-size: var(--step-0);
  box-shadow: 0 10px 24px -6px var(--wa-shadow), 0 3px 8px -2px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s, box-shadow 0.15s;
}
.wa-float svg { width: 1.6rem; height: 1.6rem; flex: none; }
.wa-float:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -6px var(--wa-shadow), 0 4px 10px -2px rgba(0, 0, 0, 0.2); }
.wa-float:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.foot { padding-bottom: 4.5rem; }
@media (max-width: 560px) {
  .wa-float { padding: 0.5rem; width: 3.4rem; justify-content: center; }
  .wa-float > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .wa-float, .wa-float:hover { transition: none; transform: none; }
  html { scroll-behavior: auto; }
  .pan, .reel-progress i::after { animation: none; }
  .reel-progress i::after { transform: scaleX(1); }
  .cap { animation: none; }
  .cap-1 { opacity: 1; }
}
