/* Technology Experts Group — landing hub */

/* ---------- HERO ---------- */
.hero {
  position: relative; overflow: clip;
  background:
    radial-gradient(120% 90% at 85% -10%, oklch(38% 0.16 268 / 0.13), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, oklch(85% 0.16 95 / 0.12), transparent 50%),
    var(--color-paper);
  padding-block: clamp(3rem, 7vw, 6rem) clamp(2.5rem, 5vw, 4.5rem);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--space-2xl); align-items: center; }
.hero-eyebrow { color: var(--color-ink-faint); }
.hero-grid > div:first-child { container-type: inline-size; }

/* --text-display is sized off the viewport, but the headline wraps inside its
 * grid column — a little over half the window at desktop. That mismatch is what
 * pushed the authored two-line headline onto four lines. Cap the size against
 * the column itself with container units. The coefficient is the measured
 * widest authored line per language (EN 9.19cqw, AR 13.56cqw), rounded down. */
.hero h1 {
  font-size: min(var(--text-display), 9cqw, calc(var(--h1-base, 5rem) * var(--h1-step, .87) * var(--h1-short, 1))); line-height: 0.98; letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
}
[dir="rtl"] .hero h1 { font-size: min(var(--text-display), 13cqw, calc(var(--h1-base, 5rem) * var(--h1-step, .87) * var(--h1-short, 1))); }
.hero h1 .accent { color: var(--color-accent); }
.hero h1 .gold { position: relative; white-space: nowrap; }
.hero h1 .gold::after { content:""; position:absolute; left:0; right:0; bottom:0.08em; height:0.14em; background: var(--brand-gold); z-index:-1; }
.hero-lede { font-size: var(--text-lg); color: var(--color-ink-soft); max-width: 46ch; margin-bottom: var(--space-xl); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.hero-meta { display: flex; flex-wrap: wrap; gap: var(--space-lg) var(--space-xl); margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: var(--rule) solid var(--color-line); }
.hero-meta .stat-num { font-size: var(--text-2xl); }

/* orbital droplet motif */
.hero-art { position: relative; aspect-ratio: 1; max-width: 460px; margin-inline: auto; width: 100%; }
.hero-art svg { width: 100%; height: 100%; overflow: visible; }
.orbit { transform-origin: center; }
.orbit-1 { animation: spin 26s linear infinite; }
.orbit-2 { animation: spin 38s linear infinite reverse; }
.orbit-node { animation: spin 26s linear infinite; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.droplet { animation: bob 6s var(--ease-in-out) infinite; transform-origin: center; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.field-orbit { animation: spin 55s linear infinite; transform-origin: 200px 200px; }

/* slow, elegant atom reaction on hover: orbit expands to a higher shell + gold waves emanate */
.hero-e-scale, .hero-ring-scale { transition: transform 1.4s var(--ease-out); transform-origin: 200px 200px; }
.hero-art:hover .hero-e-scale { transform: scale(1.16); }
.hero-art:hover .hero-ring-scale { transform: scale(1.08); }
.hero-wave { opacity: 0; transform-box: fill-box; transform-origin: center; }
.hero-art:hover .hero-wave { animation: emanate 3.4s var(--ease-out) infinite; }
.hero-art:hover .w2 { animation-delay: 1.15s; }
.hero-art:hover .w3 { animation-delay: 2.3s; }
@keyframes emanate { 0% { transform: scale(.55); opacity: .55; } 80% { opacity: 0; } 100% { transform: scale(2.1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .orbit-1, .orbit-2, .orbit-node, .droplet, .field-orbit, .orbit-rings { animation: none; }
  .hero-art:hover .hero-e-scale, .hero-art:hover .hero-ring-scale, .hero-art:hover .hero-wave { animation: none; transform: none; }
}

/* ---------- FIELD GATEWAY (editorial index) ---------- */
.gateway-intro { display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: end; justify-content: space-between; margin-bottom: var(--space-xl); }

/* Orbital hub: central "one standard" core + 7 field nodes on an ellipse */
.orbit-hub {
  position: relative; width: 100%; max-width: 660px; aspect-ratio: 1 / 1;
  margin: var(--space-2xl) auto 0;
}
.orbit-rings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; animation: spin 44s linear infinite; transform-origin: 50% 50%; }

/* central core */
.orbit-core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 30%; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  animation: hub-float 9s var(--ease-in-out) infinite;
}
.orbit-logo { width: 60%; max-width: 118px; height: auto; display: block; position: relative; z-index: 2; }
.orbit-ripple { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; border: 1.5px solid color-mix(in oklch, var(--brand-blue) 26%, transparent); }
.orbit-ripple.r1 { width: 82%; height: 82%; }
.orbit-ripple.r2 { width: 116%; height: 116%; opacity: 0.6; }
.orbit-core-lbl {
  font-family: var(--font-display); font-size: clamp(0.7rem, 0.55rem + 0.7vw, 0.95rem);
  font-weight: 600; line-height: 1.18; color: var(--brand-blue); letter-spacing: -0.01em;
}
[dir="rtl"] .orbit-core-lbl { font-family: var(--font-ar-display); letter-spacing: 0; }

@keyframes hub-float { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, calc(-50% - 8px)); } }

/* field nodes */
.hub-node {
  position: absolute; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 0.55em;
  padding: 0.5em 0.95em; max-width: 44%;
  background: var(--color-paper); color: var(--color-ink); text-decoration: none;
  border: var(--rule) solid var(--color-line); border-radius: 999px;
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-mid) var(--ease-out), color var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out);
}
[dir="rtl"] .hub-node { font-family: var(--font-ar-display); }
.hub-node .dot {
  width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0;
  background: var(--field);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--field) 22%, transparent);
  transition: box-shadow var(--dur-mid) var(--ease-out);
}
.hub-node:hover, .hub-node:focus-visible {
  transform: translate(-50%, -50%) scale(1.07);
  color: color-mix(in oklab, var(--field) 55%, var(--color-ink));
  border-color: color-mix(in oklab, var(--field) 50%, var(--color-line));
  box-shadow: var(--shadow-md);
}
.hub-node:hover .dot, .hub-node:focus-visible .dot {
  box-shadow: 0 0 0 6px color-mix(in oklch, var(--field) 30%, transparent);
}
.hub-node:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { .orbit-core { animation: none; } }

/* mobile fallback: drop the ellipse, stack nodes as centred pills */
@media (max-width: 760px) {
  .orbit-hub { aspect-ratio: auto; max-width: 440px; display: flex; flex-wrap: wrap;
    justify-content: center; gap: var(--space-sm); margin-top: var(--space-xl); }
  .orbit-rings, .orbit-core { display: none; }
  .hub-node { position: static; transform: none; max-width: none; font-size: var(--text-base); padding: 0.6em 1.1em; }
  .hub-node:hover, .hub-node:focus-visible { transform: scale(1.04); }
}

/* ---------- GROUP / about strip ---------- */
.group-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2xl); align-items: center; }
.group-split.group-single { grid-template-columns: 1fr; max-width: 820px; }
.value-card { padding: var(--space-lg); border: var(--rule) solid var(--color-line); border-radius: var(--radius-md); }
.value-card :is(h2,h3,h4) { font-size: var(--text-lg); margin-bottom: var(--space-2xs); }
.value-card p { color: var(--color-ink-soft); font-size: var(--text-sm); }

/* stats band styles now live in styles.css (shared by hub + field pages) */

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2xl); align-items: start; }
.contact-card { background: var(--color-paper-2); border: var(--rule) solid var(--color-line); border-radius: var(--radius-lg); padding: var(--space-xl); }
.field-input { width: 100%; padding: 0.85em 1em; border: var(--rule) solid var(--color-line-strong); border-radius: var(--radius-md); background: var(--color-paper); font: inherit; color: var(--color-ink); margin-bottom: var(--space-md); transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.field-input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
/* tel/email inputs default their placeholder to LTR; in RTL align it like the other fields */
[dir="rtl"] .field-input { text-align: right; }
[dir="rtl"] .field-input::placeholder { text-align: right; }

/* ---------- file field ----------
 * A browser renders its own "Choose File" label and will not let CSS or HTML
 * change that text, so the native control is hidden from sight (never from the
 * keyboard or the accessibility tree) and a <label> stands in for it. */
.filefield { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap;
  margin-bottom: var(--space-md); }
.filefield-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.filefield-btn { display: inline-flex; align-items: center; gap: 0.5em; cursor: pointer;
  padding: 0.7em 1.2em; border-radius: var(--radius-md);
  border: var(--rule) solid var(--color-line-strong); background: var(--color-paper);
  font: inherit; font-size: var(--text-sm); font-weight: 600; color: var(--color-ink);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.filefield-btn svg { width: 17px; height: 17px; }
.filefield-btn:hover { border-color: var(--color-accent); background: var(--color-paper-2); }
/* the ring has to live on the stand-in, since the real control is off-screen */
.filefield-input:focus-visible + .filefield-btn { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.filefield-name { font-size: var(--text-sm); color: var(--color-ink-faint); min-width: 0;
  overflow-wrap: anywhere; }
.filefield-name.has-file { color: var(--color-ink); font-weight: 600; }
.filefield-name.is-error { color: oklch(55% 0.19 27); font-weight: 600; }
.form-result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-md); padding: var(--space-xl) var(--space-md); }
.form-result svg { width: 48px; height: 48px; color: var(--f-environment-ink); background: color-mix(in oklab, var(--f-environment) 20%, var(--color-paper)); border-radius: 50%; padding: 10px; }
.form-result p { font-size: var(--text-lg); color: var(--color-ink); max-width: 32ch; }
.contact-line { display: flex; gap: var(--space-md); align-items: flex-start; padding: var(--space-md) 0; border-bottom: var(--rule) solid var(--color-line); }
.contact-line svg { width: 22px; height: 22px; color: var(--color-accent); flex-shrink: 0; margin-top: 2px; }
.contact-line .lbl { font-size: var(--text-xs); color: var(--color-ink-faint); text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-mono); }
[dir="rtl"] .contact-line .lbl { font-family: var(--font-ar); letter-spacing: 0; }
.contact-line .val { font-size: var(--text-lg); font-weight: 500; }

/* offices & companies directory */
.office-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: var(--space-md); margin-top: var(--space-xl); }
.office-card { border: var(--rule) solid var(--color-line); border-radius: var(--radius-md); padding: var(--space-lg); background: var(--color-paper); display: flex; flex-direction: column; }
.office-card .tag { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent); }
[dir="rtl"] .office-card .tag { font-family: var(--font-ar); letter-spacing: 0; }
.office-card :is(h2,h3,h4) { font-size: var(--text-lg); margin: var(--space-2xs) 0 var(--space-xs); }
.office-card .addr { font-size: var(--text-sm); color: var(--color-ink-soft); line-height: 1.5; }
.office-card .rows { display: flex; flex-direction: column; gap: 0.3em; margin-top: var(--space-md); padding-top: var(--space-sm); border-top: var(--rule) solid var(--color-line); }
/* min-height keeps these at the 24px WCAG 2.2 target size — they measured 23.1px */
.office-card .rows a { display: flex; align-items: center; min-height: 24px; font-size: var(--text-sm); color: var(--color-accent); transition: color var(--dur-fast) var(--ease-out); }
.office-card .rows a:hover { color: var(--color-ink); }
[dir="rtl"] .office-card .rows a[href^="tel"] { text-align: right; }
.office-card .map-link { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 500; }
.office-card .map-link svg { width: 1em; height: 1em; }
[dir="rtl"] .office-card .map-link svg { transform: scaleX(-1); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  /* on a phone the headline is the first screen; the droplet follows it, smaller */
  .hero-art { grid-row: 2; max-width: 240px; margin-top: var(--space-md); }
  .group-split, .contact-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
}

/* ---- one hero frame across the site --------------------------------------
   Field pages fill calc(100svh - 92px); the homepage and the group page used
   to stop at 79-81% of the viewport, which read as three near-but-different
   heights rather than a hierarchy. min-height is a floor, so a hero with more
   content than that still grows instead of clipping. */
[data-page="home"] .hero,
[data-page="404"] .hero {
  min-height: calc(100svh - 92px);       /* the nav measures 88.8px */
  display: grid; align-items: center;
}
@media (max-width: 860px) {
  [data-page="home"] .hero,
  [data-page="404"] .hero { min-height: calc(100svh - 80px); }  /* 76.8px here */
}

/* ---- landscape application form ------------------------------------------
   Fourteen fields in a half-width column ran three screens tall. Each label is
   bound to its control in a .fld, so a grid can place them side by side without
   ever separating a label from the input it names. */
.form-wide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md) var(--space-lg); align-items: start; }
/* anything that is not a field spans the row: the eyebrow, the CV upload, the
   note, the submit and the confidentiality line */
.form-wide > :not(.fld) { grid-column: 1 / -1; }
.form-wide > .fld--full { grid-column: 1 / -1; }
.form-wide .fld > :last-child { margin-bottom: 0; }
.form-wide .field-input { margin-bottom: 0; }
@media (min-width: 1080px) {
  .form-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .form-wide { grid-template-columns: minmax(0, 1fr); }
}

/* hero figures (same shape as the field pages' fact row, brand blue on paper) */
.hero .fact-row { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: var(--rule) solid var(--color-line); max-width: 36rem; }
.hero .fact { display: flex; flex-direction: column; gap: 2px; padding-inline-end: var(--space-lg); }
.hero .fact .n { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; line-height: 1.1; color: var(--color-accent); font-variant-numeric: tabular-nums; }
.hero .fact .l { font-size: var(--text-xs); color: var(--color-ink-faint); }
[data-theme="dark"] .hero .fact .n { color: var(--brand-gold); }
@media (max-width: 560px) { .hero .fact-row { margin-top: var(--space-lg); padding-top: var(--space-md); gap: var(--space-sm); } .hero .fact { padding-inline-end: var(--space-sm); } .hero .fact .n { font-size: var(--text-xl); } }

/* One rhythm on the home page: every gap between two blocks of content is two
   section-sm paddings, including hero -> fields and accreditations -> clients. */
:root { --home-pad: clamp(2.75rem, 5.5vw, var(--space-3xl)); }
@media (max-width: 560px) { :root { --home-pad: 2rem; } }
.hero { padding-bottom: var(--home-pad); }
.home-sub { margin-top: calc(2 * var(--home-pad)); }

/* ===== home accreditations: three groups by kind (replaces the pill row) ===== */
.acc-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); margin-top: var(--space-xl); }
.acc-grp { background: var(--color-paper); border: 1px solid var(--color-line); border-radius: var(--radius-lg); padding: var(--space-lg) var(--space-lg) var(--space-sm); }
.acc-grp h3 { margin: 0 0 var(--space-sm); font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-soft); }
.acc-item { padding: 0.8rem 0; border-top: 1px solid var(--color-line); }
.acc-item b { display: block; font-size: var(--text-base); font-weight: 600; color: var(--color-ink); line-height: 1.45; }
.acc-item span { display: block; margin-top: 0.15rem; color: var(--color-ink-soft); font-size: var(--text-sm); line-height: 1.5; }
@media (max-width: 900px) { .acc-groups { grid-template-columns: 1fr; } }

/* ===== home group: split view — the parent as a dark panel, four subsidiaries beside it ===== */
.grp-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-md); margin-top: var(--space-xl); }
.grp-mother { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-sm); padding: var(--space-2xl);
  border-radius: var(--radius-xl); color: #fff; background: linear-gradient(160deg, #1f2770, #12164a); }
.grp-mplate { display: flex; align-items: center; justify-content: center; width: 230px; height: 84px; padding: 12px 20px; background: #fff; border-radius: var(--radius-md); }
.grp-mplate img { max-height: 58px; max-width: 100%; object-fit: contain; }
.grp-mrole { margin-top: var(--space-sm); color: var(--brand-gold); font-weight: 600; font-size: var(--text-sm); }
.grp-mother h3 { margin: 0; font-size: var(--text-2xl); color: #fff; }
.grp-mother p { margin: 0; color: rgba(255, 255, 255, 0.8); line-height: 1.75; max-width: 46ch; }
.grp-mfacts { margin-top: auto; padding-top: var(--space-md); width: 100%; display: flex; flex-wrap: wrap; gap: var(--space-xl); border-top: 1px solid rgba(255, 255, 255, 0.18); }
.grp-mfacts b { display: block; font-size: var(--text-2xl); line-height: 1.1; color: #fff; font-family: var(--font-display); }
[dir="rtl"] .grp-mfacts b { direction: ltr; text-align: right; }
.grp-mfacts span { font-size: var(--text-xs); color: rgba(255, 255, 255, 0.72); }
.grp-kids { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.grp-kid { display: flex; flex-direction: column; gap: 0.45rem; padding: var(--space-lg); background: var(--color-paper); border: 1px solid var(--color-line);
  border-top: 4px solid var(--accent); border-radius: var(--radius-lg); }
.grp-kplate { display: flex; align-items: center; justify-content: center; height: 84px; padding: 10px 16px; background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius-md); }
.grp-kplate img { max-height: 60px; max-width: 72%; object-fit: contain; }
.grp-krole { margin-top: 0.35rem; color: var(--accent); font-weight: 600; font-size: var(--text-sm); }
.grp-kid h3 { margin: 0; font-size: var(--text-lg); }
.grp-kid p { margin: 0; color: var(--color-ink-soft); font-size: var(--text-sm); line-height: 1.65; }
.grp-ksite { margin-top: auto; padding-top: 0.25rem; display: inline-flex; align-items: center; gap: 0.35em; font-weight: 600; font-size: var(--text-sm); text-decoration: none; min-height: 44px; }
.grp-ksite svg { width: 1em; height: 1em; }
[data-theme="dark"] .grp-kplate { background: #eef0f4; }
@media (max-width: 900px) { .grp-split { grid-template-columns: 1fr; } .grp-mother { padding: var(--space-xl); } }
@media (max-width: 560px) {
  .grp-kids { grid-template-columns: 1fr; gap: var(--space-sm); }
  .grp-mplate { width: 200px; height: 72px; }
  /* phones: logo beside the text so four companies fit in about one screen */
  .grp-kid { display: grid; grid-template-columns: 76px 1fr; column-gap: var(--space-md); row-gap: 0.15rem; padding: var(--space-md); align-items: start; }
  .grp-kplate { grid-row: span 4; height: 64px; padding: 6px 8px; }
  .grp-kplate img { max-width: 100%; max-height: 50px; }
  .grp-krole { margin-top: 0; font-size: var(--text-xs); }
  .grp-kid h3 { font-size: var(--text-base); }
  .grp-ksite { min-height: 40px; padding-top: 0; }
}
@media (max-width: 560px) {
  .grp-mfacts { flex-wrap: nowrap; gap: var(--space-lg); justify-content: space-between; }
  .grp-mfacts b { font-size: var(--text-xl); }
}
