/* VYRA Systems site styles. Phone first; wider screens add to it. Logical properties only (RTL first).
   Colours, sizes and fonts come from tokens.css. No inline styles anywhere (the CSP forbids them). */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-block: calc(var(--header-h) + var(--space-4)) calc(var(--bar-h) + var(--space-4));
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  overflow-x: clip;
  overflow-wrap: anywhere;
}
:lang(ar) body, body:lang(ar) { font-size: 1.0625rem; line-height: 1.75; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
:lang(ar) :is(h1, h2, h3) { line-height: 1.45; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.25em; }
::selection { background: var(--selection); color: var(--text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: calc(var(--page-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.icon { width: 22px; height: 22px; flex: none; }
.icon-sm { width: 20px; height: 20px; }
/* Arrows point forward: mirror them on Arabic pages. Phone, camera and brand icons never mirror. */
[dir="rtl"] .icon-dir { transform: scaleX(-1); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: absolute;
  inset-inline-start: var(--space-4);
  inset-block-start: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.skip:focus { inset-block-start: var(--space-3); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-2) var(--space-5);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { border-color: currentColor; color: var(--accent); background: transparent; }
.btn-sm { min-height: 44px; padding-inline: var(--space-4); }
.btn-lg { min-height: 52px; }
@media (hover: hover) {
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-secondary:hover { background: var(--accent-soft); }
}
/* On the navy panels the primary button turns light teal (contrast 7.9:1 with navy text). */
.on-panel { --focus: var(--panel-focus); }
.on-panel .btn-primary { background: var(--panel-cta); color: var(--on-panel-cta); }
.on-panel .btn-secondary { color: var(--panel-text); }
@media (hover: hover) {
  .on-panel .btn-primary:hover { background: var(--panel-cta-hover); }
  .on-panel .btn-secondary:hover { background: var(--panel-line); }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
@media (hover: hover) { .icon-btn:hover { background: var(--inset); } }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  border-block-end: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(10px);
}
.header-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  text-decoration: none;
  margin-inline-end: auto;
}
.brand img { width: 40px; height: auto; }
.brand-text { display: grid; line-height: 1.2; }
.brand-name { font-family: "Vyra Latin", sans-serif; font-weight: 800; font-size: 1.125rem; }
.brand-line { display: none; color: var(--text-muted); font-size: var(--fs-small); }
@media (min-width: 768px) { .brand-line { display: block; } }
/* When the header row is narrow for its text size (a narrow phone, or large text: em follows the text
   size) the logo mark stands alone; the link keeps its aria-label. */
.header-row { container-type: inline-size; }
.brand-name { white-space: nowrap; }
@container (max-width: 17em) { .brand-text { display: none; } }

.main-nav { display: none; }
.main-nav ul { display: flex; gap: var(--space-1); }
.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.main-nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent-line); }
@media (hover: hover) { .main-nav a:hover { color: var(--text); background: var(--inset); } }
.main-nav .nav-home { display: none; }

.header-actions { display: flex; align-items: center; gap: var(--space-2); }
.lang-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding-inline: var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
@media (hover: hover) { .lang-link:hover { background: var(--inset); } }
.header-cta { display: none; white-space: nowrap; }
@media (min-width: 768px) { .header-cta { display: inline-flex; } }
@media (min-width: 1080px) {
  .main-nav { display: block; }
  .menu-btn { display: none; }
}

/* ---------- Drawer menu (HTML popover: Esc, a tap outside or a link closes it; no script) ---------- */
.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  inset-inline-start: auto;
  width: min(22rem, 88%);
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: var(--space-4) var(--space-5) var(--space-6);
  border: 0;
  border-inline-start: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  overflow-y: auto;
}
.drawer::backdrop { background: rgb(11 16 38 / 45%); }
.drawer-top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.drawer-title { font-weight: 700; color: var(--text-muted); font-size: var(--fs-small); }
.drawer-nav { margin-block: var(--space-4); }
.drawer-nav a {
  display: flex;
  align-items: center;
  min-height: 52px;
  border-block-end: 1px solid var(--line);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
}
.drawer-nav a[aria-current="page"] {
  color: var(--accent);
  border-inline-start: 3px solid var(--accent-line);
  padding-inline-start: var(--space-3);
}
.drawer-actions { display: grid; gap: var(--space-3); margin-block-start: var(--space-5); }
.drawer-actions .lang-link { justify-content: center; border: 1px solid var(--line); }
.drawer-line { margin-block-start: var(--space-5); color: var(--text-muted); font-size: var(--fs-small); }

/* ---------- Hero (navy panel, one cut corner at the inline-end bottom) ---------- */
.hero { padding-block: var(--space-4) var(--space-6); }
.hero-panel {
  display: grid;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-5) var(--space-7);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--panel-text);
  /* Physical values on purpose: polygon() has no logical form. The RTL rule below mirrors it. */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
}
[dir="rtl"] .hero-panel {
  clip-path: polygon(0 0, 100% 0, 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.hero h1 { font-size: var(--fs-h1); font-weight: 800; }
:lang(ar) .hero h1 { font-weight: 700; }
/* The English headline is longer than the Arabic one: a step smaller so it keeps to about 4 lines. */
:lang(en) .hero h1 { font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.625rem); }
.hero-lead { margin-block-start: var(--space-4); color: var(--panel-muted); font-size: var(--fs-lead); max-width: 60ch; }
.hero-actions { display: grid; gap: var(--space-3); margin-block-start: var(--space-6); }
.hero-actions .btn-secondary { display: none; }
.hero-notes { display: grid; gap: var(--space-3); margin-block-start: var(--space-5); color: var(--panel-muted); font-size: var(--fs-small); }
.hero-notes li { display: flex; gap: var(--space-2); align-items: flex-start; }
.hero-notes .icon { color: var(--art-line); margin-block-start: 0.15em; }
.hero-art { max-width: 420px; width: 100%; justify-self: center; }

@media (min-width: 768px) {
  .hero-panel { padding: var(--space-7) var(--space-7) var(--space-8); }
  .hero-actions { display: flex; flex-wrap: wrap; }
  .hero-actions .btn-secondary { display: inline-flex; }
  .hero-notes { font-size: var(--fs-body); }
}
@media (min-width: 1080px) {
  .hero-panel { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center; padding: var(--space-8); }
  .hero-art { max-width: none; }
}

/* Inner-page header: the same navy panel, no drawing, one column. */
.hero-page .hero-copy { max-width: 52rem; }
.hero-page .hero-panel { padding-block-end: var(--space-7); }
@media (min-width: 1080px) {
  .hero-page .hero-panel { grid-template-columns: minmax(0, 1fr); padding-block-end: var(--space-8); }
}

/* Line drawings (no photos until real job photos arrive) */
.art .ln { fill: none; stroke: var(--art-line); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.art .ln-soft { fill: none; stroke: var(--art-soft); stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 4 6; }
.art .fill { fill: var(--art-fill); stroke: var(--art-line); stroke-width: 2; stroke-linejoin: round; }
.art .dot { fill: var(--art-line); }
.art .dim { opacity: 0.55; }

/* ---------- Sections and cards ---------- */
.section { padding-block: var(--space-7); }
.section-title { font-size: var(--fs-h2); font-weight: 800; margin-block-end: var(--space-5); }
:lang(ar) .section-title { font-weight: 700; }

.cards { display: grid; gap: var(--space-4); }
@media (min-width: 768px) {
  .cards-2, .cards-3, .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1080px) {
  .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card h3 { font-size: var(--fs-h3); font-weight: 700; }
.card p { color: var(--text-muted); }
.card-link { text-decoration: none; transition: border-color var(--fast) var(--ease); }
@media (hover: hover) { .card-link:hover { border-color: var(--accent-line); } }
/* The lift, shadow and press of a card are movement: only when the visitor allows motion. */
@media (prefers-reduced-motion: no-preference) {
  .card-link { transition: transform 220ms var(--ease), border-color var(--fast) var(--ease), box-shadow 220ms var(--ease); }
  .card-link:active { transform: scale(0.985); }
  @media (hover: hover) { .card-link:hover { transform: translateY(-5px); box-shadow: var(--shadow); } }
}
.card-art { width: 72px; height: 72px; color: var(--accent-line); }
.card-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-block-start: auto;
  padding-block-start: var(--space-2);
  min-height: 44px;
  color: var(--accent);
  font-weight: 700;
}
@media (min-width: 768px) { .card { padding: var(--space-6); } }

/* ---------- Home sections ---------- */
.section-head { margin-block-end: var(--space-5); }
.section-head .section-title { margin-block-end: var(--space-2); }
.section-lead { color: var(--text-muted); max-width: 62ch; }
.sub-title { font-size: var(--fs-h3); font-weight: 700; margin-block: var(--space-6) var(--space-3); }

.badge {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--inset);
  color: var(--accent);
}
.step-no {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: var(--fs-h3);
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.status {
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-small);
  font-weight: 700;
  white-space: nowrap;
}

/* Capability list inside a service card (a small teal marker on the start side) */
.ticks { display: grid; gap: var(--space-2); }
.ticks li {
  position: relative;
  padding-inline-start: var(--space-5);
  color: var(--text-muted);
}
.ticks a { padding-block: 13px; } /* a 44 px tap area for a link inside a sentence, without a taller line */
.hero-copy .cta-actions { margin-block-start: var(--space-5); }
.card .card-title { font-size: var(--fs-h3); font-weight: 700; }
.icon-back { transform: scaleX(-1); }
[dir="rtl"] .icon-back { transform: none; }
.back-link { margin-block-start: var(--space-5); }
.back-link a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; }
.ticks li::before {
  content: "";
  position: absolute;
  inset-inline-start: var(--space-1);
  inset-block-start: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-line);
}

.callout {
  display: grid;
  gap: var(--space-4);
  justify-items: start;
  margin-block-start: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.callout-icon { color: var(--accent); }
@media (min-width: 1080px) {
  .callout { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-5); }
}

.chips { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.chips li {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.founder { max-width: 52rem; }
.founder .section-title { margin-block-end: 0; }
.founder h3 { color: var(--accent); }

.faq { max-width: 52rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: clip; }
.faq details + details { border-block-start: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-3) var(--space-4);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq .chevron { color: var(--accent); }
.faq details[open] .chevron { transform: rotate(180deg); }
@media (hover: hover) { .faq summary:hover { background: var(--inset); } }
.faq details p {
  padding: 0 var(--space-4) var(--space-4);
  padding-inline-start: calc(var(--space-4) + 20px + var(--space-3));
  color: var(--text-muted);
}

.cta-band {
  display: grid;
  gap: var(--space-4);
  justify-items: start;
  padding: var(--space-6) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
}
.cta-band .section-title { margin-block-end: 0; }
.cta-actions { display: grid; gap: var(--space-3); width: 100%; }
.cta-notes { display: grid; gap: var(--space-2); color: var(--text-muted); }
.cta-notes li { display: flex; gap: var(--space-2); align-items: center; }
.cta-notes a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 768px) {
  .cta-band { padding: var(--space-7); }
  .cta-actions { display: flex; flex-wrap: wrap; width: auto; }
}

/* ---------- Footer (navy in both modes) ---------- */
.site-footer {
  margin-block-start: var(--space-7);
  padding-block: var(--space-7) var(--space-5);
  background: var(--panel);
  color: var(--panel-text);
}
.footer-grid { display: grid; gap: var(--space-6); }
.footer-brand { display: grid; gap: var(--space-3); justify-items: start; align-content: start; }
.footer-brand img { width: 48px; height: auto; }
.footer-brand .brand-name { font-size: 1.25rem; }
.footer-brand p { color: var(--panel-muted); }
.site-footer h2 { font-size: var(--fs-body); font-weight: 700; margin-block-end: var(--space-3); color: var(--panel-muted); }
.footer-list li { display: flex; gap: var(--space-3); align-items: flex-start; padding-block: var(--space-2); }
.footer-list .icon { color: var(--art-line); margin-block-start: 0.2em; }
.footer-list a, .footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  margin-block: calc(-1 * var(--space-2));
  text-decoration: none; /* Asser, 2026-11-26: no link lines in the footer (design-brief section 10) */
}
@media (hover: hover) { .footer-list a:hover, .footer-links a:hover { text-decoration: underline; } }
.footer-list .note { color: var(--panel-muted); font-size: var(--fs-small); }
.footer-links { display: grid; }
.footer-links a { gap: var(--space-2); margin-block: 0; overflow-wrap: normal; }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-block-start: var(--space-6);
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--panel-line);
  color: var(--panel-muted);
  font-size: var(--fs-small);
}
.footer-base .lang-link { color: var(--panel-text); }
@media (hover: hover) { .footer-base .lang-link:hover { background: var(--panel-line); } }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .footer-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); } }

/* ---------- Phone contact bar (below 768 px) ---------- */
.contact-bar {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-3) var(--gutter) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-block-start: 1px solid var(--line);
}
.contact-bar .btn { min-height: 48px; padding-inline: var(--space-3); white-space: nowrap; }
/* Narrow for its text size (em follows the text size): the labels keep the room, the icons go. */
.contact-bar { container-type: inline-size; }
@container (max-width: 19em) { .contact-bar .icon { display: none; } }
body { padding-block-end: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
@media (min-width: 768px) {
  .contact-bar { display: none; }
  body { padding-block-end: 0; }
}

/* ---------- Motion (all of it off under reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Page change: the old page lifts away, the new one rises in. The header and the phone bar keep their own
     name, so they stay in place while the page between them changes. */
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
  .contact-bar { view-transition-name: contact-bar; }
  ::view-transition-old(root) { animation: 200ms var(--ease) both vt-out; }
  ::view-transition-new(root) { animation: 600ms var(--ease) both vt-in; }

  .faq .chevron { transition: transform var(--fast) var(--ease); }
  /* Hero entrance (CSS, so nothing flashes while the script loads): headline, lead, buttons in turn, then the drawing. */
  .rise { animation: rise 1000ms var(--ease) both; }
  .rise-2 { animation-delay: 180ms; }
  .rise-3 { animation-delay: 360ms; }
  .hero-art { animation: art-in 1200ms var(--ease) 400ms both; }

  /* The drawer slides in from the inline-end side. translateX has no logical form, so each direction
     gets its own physical value (RTL: from the left, LTR: from the right). */
  .drawer {
    transition: transform 220ms var(--ease), opacity 220ms var(--ease), display 220ms allow-discrete,
      overlay 220ms allow-discrete;
  }
  [dir="ltr"] .drawer:not(:popover-open) { opacity: 0; transform: translateX(16px); }
  [dir="rtl"] .drawer:not(:popover-open) { opacity: 0; transform: translateX(-16px); }
  @starting-style {
    [dir="ltr"] .drawer:popover-open { opacity: 0; transform: translateX(16px); }
    [dir="rtl"] .drawer:popover-open { opacity: 0; transform: translateX(-16px); }
  }

  /* FAQ answers open and close smoothly where the browser can animate to "auto" height; elsewhere they just open. */
  @supports (interpolate-size: allow-keywords) and (selector(::details-content)) {
    .faq details { interpolate-size: allow-keywords; }
    .faq details::details-content {
      block-size: 0;
      overflow: clip;
      transition: block-size 280ms var(--ease), content-visibility 280ms allow-discrete;
    }
    .faq details[open]::details-content { block-size: auto; }
  }

  /* Fallback only: cards fade in as they scroll into view by CSS. When /assets/js/site.js runs, it takes over
     (it removes the .reveal class from the cards it handles). */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(56px); } }
@keyframes art-in { from { opacity: 0; transform: translateY(40px) scale(0.88); } }
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(40px); } }
@keyframes reveal { from { opacity: 0.2; transform: translateY(16px); } }
