/* =========================================================================
   TIMELINE DIMENSIONS — immersive experience stylesheet
   -------------------------------------------------------------------------
   All brand colors live in the :root variables below. Replace --tld-navy
   with the exact logo navy hex as soon as it is available; everything else
   references these variables so the whole experience updates at once.
   Color balance target: ~70% navy/black, ~20% ivory/white/transparent,
   ~7% cyan glow, ~3% bronze accent. Keep new UI within that ratio.
   ========================================================================= */

:root {
  /* ---- Brand colors (swap --tld-navy for the exact logo hex later) ---- */
  --tld-navy: #071A2F;
  --tld-navy-light: #123A5A;
  --tld-black: #03070C;
  --tld-ivory: #F4F1EA;
  --tld-white: #FFFFFF;
  --tld-cyan-light: #78DCE8;
  --tld-bronze: #A87C4F;

  /* ---- Derived / utility tones (all built from the palette above) ---- */
  --tld-navy-90: rgba(7, 26, 47, 0.9);
  --tld-navy-70: rgba(7, 26, 47, 0.7);
  --tld-navy-40: rgba(7, 26, 47, 0.4);
  --tld-black-85: rgba(3, 7, 12, 0.85);
  --tld-ivory-70: rgba(244, 241, 234, 0.7);
  --tld-ivory-40: rgba(244, 241, 234, 0.4);
  --tld-cyan-glow: rgba(120, 220, 232, 0.35);
  --tld-cyan-glow-soft: rgba(120, 220, 232, 0.12);
  --tld-bronze-glow: rgba(168, 124, 79, 0.45);

  /* ---- Typography ---- */
  --tld-font-display: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --tld-font-body: "Jost", "Helvetica Neue", Arial, sans-serif;
  --tld-font-arabic: "Aref Ruqaa", "Segoe UI", serif;

  /* ---- Motion / layout ---- */
  --tld-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tld-radius: 2px;
  --tld-nav-height: 84px;
}

/* -------------------------------------------------------------------------
   Hard reset for the immersive template's <html>/<body> specifically.
   The template still calls wp_head()/wp_footer(), so the ACTIVE THEME'S
   stylesheet is still loaded (intentionally — plugins/SEO/analytics keep
   working) even though we never render the theme's own header/footer
   markup. Many themes set body/base layout rules (margin, max-width
   wrappers, a light default background, sidebar containers) that assume
   that markup exists. Without this reset those leftover rules can show up
   as stray colored bars/rectangles around our full-bleed canvas. Scoped
   to body.tld-immersive-page (added by TLD_Template::add_body_class) so
   it can never leak onto any other page on the site.
   ------------------------------------------------------------------------- */
html:has(body.tld-immersive-page),
body.tld-immersive-page {
  margin: 0 !important;
  padding: 0 !important;
  background: var(--tld-black) !important;
  overflow-x: hidden;
  max-width: none !important;
}

/* Applied to <html> while the content panel or project portal is open
   (see content-panel.js / project-portal.js) — blocks the underlying page
   from scrolling so a wheel/trackpad gesture outside the open card's own
   scrollable box can't silently move the (invisible, camera-driving)
   document scroll position instead of the card's content. */
html.tld-scroll-locked,
html.tld-scroll-locked body.tld-immersive-page {
  overflow: hidden !important;
}

body.tld-immersive-page > *:not(#tld-app) {
  /* Belt-and-suspenders: hide any stray element a theme/plugin injects
     directly into <body> outside our own root (e.g. skip links, sidebar
     containers some themes render unconditionally). */
  display: none !important;
}

/* Reset scoped to the TLD app root only — never touches the rest of the site */
#tld-app,
#tld-app * {
  box-sizing: border-box;
}

#tld-app {
  /* NOTE: stays in normal document flow (not position:fixed) — the tall
     #tld-scroll-stage inside it is what gives the document its scroll
     height, which #tld-scroll-stage.js's ScrollTrigger reads directly off
     window scroll position. Taking #tld-app out of flow would collapse
     the page to viewport height and break the entire scroll-camera. */
  --tld-vh: 1vh; /* set via JS to fix mobile viewport height */
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: calc(var(--tld-vh, 1vh) * 100);
  background: var(--tld-black);
  color: var(--tld-ivory);
  font-family: var(--tld-font-body);
  overflow: hidden;
  isolation: isolate;
}

#tld-app.tld-nav-revealed {
  overflow: auto;
}

#tld-app [dir="rtl"],
#tld-app .tld-arabic {
  font-family: var(--tld-font-arabic);
  direction: rtl;
}

#tld-app a {
  color: inherit;
}

#tld-app button {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

#tld-app button:focus-visible,
#tld-app a:focus-visible,
#tld-app [tabindex]:focus-visible {
  outline: 1px solid var(--tld-cyan-light);
  outline-offset: 4px;
}

/* -------------------------------------------------------------------------
   Scroll stage — the tall scroll track that drives the 3D camera. Its
   height determines how much scrolling the whole journey takes.
   ------------------------------------------------------------------------- */
#tld-scroll-stage {
  position: relative;
  width: 100%;
  height: 700vh; /* scroll distance for the full timeline journey */
}

#tld-canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: var(--tld-navy);
}

#tld-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  /* Defensive: an unpainted <canvas> is transparent by spec, so without
     this a slow WebGL init could flash whatever sits behind it. Matches
     the scene's own clear color (see scene-core.js) once it paints. */
  background: var(--tld-navy);
}

/* Soft navy vignette over the canvas keeps focus centered and the edges
   near-black, per the "70% navy/black" balance requirement. */
#tld-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 35%, var(--tld-black) 115%),
    linear-gradient(to bottom, var(--tld-black-85) 0%, transparent 12%, transparent 88%, var(--tld-black-85) 100%);
}

/* =========================================================================
   LOADING SCREEN
   ========================================================================= */
#tld-loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: var(--tld-black);
  transition: opacity 1.1s var(--tld-ease), visibility 1.1s var(--tld-ease);
}

#tld-loading.tld-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tld-loading-mark {
  font-family: var(--tld-font-display);
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: 0.35em;
  color: var(--tld-ivory);
}

.tld-loading-sub {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--tld-ivory-40);
}

/* Thin animated timeline instead of a spinner */
.tld-loading-track {
  position: relative;
  width: min(360px, 60vw);
  height: 1px;
  background: rgba(244, 241, 234, 0.15);
}

.tld-loading-track::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--tld-progress, 0%);
  background: linear-gradient(90deg, var(--tld-cyan-light), var(--tld-ivory));
  box-shadow: 0 0 12px var(--tld-cyan-glow);
  transition: width 0.25s linear;
}

.tld-loading-track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--tld-progress, 0%);
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--tld-ivory);
  box-shadow: 0 0 10px 2px var(--tld-cyan-glow);
  transition: left 0.25s linear;
}

.tld-loading-percent {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--tld-ivory-70);
}

/* =========================================================================
   OPENING SCENE TEXT
   ========================================================================= */
#tld-opening {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 24px;
  /* Biases the vertically-centered content upward so the dimensional
     core's bright central point (which the camera frames dead-center,
     see timeline-path.js) has clear space below the text instead of the
     two competing for the exact same screen point. */
  padding-bottom: 16vh;
}

.tld-opening-title {
  font-family: var(--tld-font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.12em;
  font-size: clamp(38px, 9vw, 96px);
  color: var(--tld-ivory);
  text-transform: uppercase;
}

/* Each line animates in independently (see loading-screen.js
   playOpeningReveal) — opacity/transform live on the spans, not the
   parent <h1>, since a parent's opacity:0 would hide children too even
   after their own opacity is animated back to 1. */
.tld-opening-title span {
  display: block;
  opacity: 0;
  transform: translateY(14px);
}

/* "DIMENSIONS" stays ivory like "TIMELINE" — cyan is a controlled accent,
   not a headline color — with only a faint glow hinting at the
   dimensional theme instead of a fully saturated cyan word. */
.tld-opening-title .tld-accent {
  color: var(--tld-ivory);
  text-shadow: 0 0 28px var(--tld-cyan-glow-soft);
}

.tld-opening-arabic {
  margin-top: 14px;
  font-size: clamp(18px, 3vw, 26px);
  letter-spacing: 0.02em;
  color: var(--tld-ivory-70);
  opacity: 0;
}

.tld-opening-statement {
  margin-top: 34px;
  max-width: 480px;
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.7;
  color: var(--tld-ivory-70);
  font-style: italic;
  opacity: 0;
}

.tld-opening-prompt {
  /* Icon-only exploration cue — deliberately taken OUT of #tld-opening's
     centered flex column (which still reserves layout space for the
     permanently-invisible title/statement block above it — see those
     rules' opacity:0 comments) and pinned near the bottom edge of the
     viewport instead, per "sit discreetly near the bottom center", not
     wherever the invisible title stack happens to leave it. #tld-opening
     is position:fixed/inset:0, so this positions relative to the full
     viewport.
  */
  position: absolute;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
  opacity: 0;
  /* Revived as the "exploration prompt" for the quiet opening moment (see
     loading-screen.js's playMinimalBrandReveal/playOpeningReveal and
     main.js's first-interaction handling) — clickable/tappable even
     though its parent #tld-opening is pointer-events:none (a child can
     re-enable hit-testing for itself regardless of an ancestor's value),
     and keyboard-reachable via the role="button"/tabindex on the element
     itself (see the template). No visible label text — the WP-editable
     "Scroll Prompt" copy (opening_prompt/opening_prompt_ar) is rendered
     as this element's aria-label instead (see the template), so it stays
     screen-reader-accessible and still editable from Settings, without
     competing visually with the plain icon per "an icon without text".
     Transition lets its own opacity-out (once the visitor interacts) feel
     like part of the same reveal instead of an abrupt cut.
  */
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.6s var(--tld-ease);
}

.tld-opening-prompt:focus-visible {
  outline: 1px solid var(--tld-bronze);
  outline-offset: 8px;
  border-radius: 50%;
}

.tld-opening-prompt:hover .tld-scroll-cue,
.tld-opening-prompt:focus-visible .tld-scroll-cue {
  border-color: var(--tld-ivory);
}

/* A single minimal downward chevron — the "simple downward arrow" option
   from the brief, refined with a soft bronze glow (drop-shadow, since a
   rotated border-only shape doesn't take a box-shadow the way a filled
   shape would) so it reads as gently illuminated rather than flat. The
   downward travel is a touch longer than a plain idle pulse so the motion
   itself clearly reads as "go this way", not just a flicker in place. */
.tld-scroll-cue {
  width: 11px;
  height: 11px;
  border-right: 1.5px solid var(--tld-bronze);
  border-bottom: 1.5px solid var(--tld-bronze);
  transform: rotate(45deg);
  transition: border-color 0.3s var(--tld-ease);
  filter: drop-shadow(0 0 5px var(--tld-bronze-glow)) drop-shadow(0 0 2px var(--tld-bronze-glow));
  animation: tld-scroll-cue-bob 2.6s var(--tld-ease) infinite;
}

@keyframes tld-scroll-cue-bob {
  0% { opacity: 0.35; transform: translateY(-2px) rotate(45deg); }
  55% { opacity: 1; transform: translateY(9px) rotate(45deg); }
  100% { opacity: 0.35; transform: translateY(-2px) rotate(45deg); }
}

/* =========================================================================
   BILINGUAL NARRATIVE LAYER (additive — synchronized text over the
   existing scroll-driven camera journey)
   -------------------------------------------------------------------------
   Three new, independent fixed-position overlays, all `pointer-events:
   none` so they never intercept scroll/click input meant for the 3D
   scene, node labels, or quick-action buttons:
     .tld-brand-top      — fixed identifier pinned under the nav bar
     .tld-narrative       — the dynamic crossfading center statement
     .tld-concept-anchor  — smaller fixed "Timeline Dimensions" anchor
   Driven by narrative.js listening to the SAME `tld:progress` event
   timeline-path.js already dispatches — no new ScrollTrigger, no change
   to scroll math. #tld-opening (the original hero title) is untouched
   in markup/CSS; only its own reveal-in animation is no longer triggered
   (see loading-screen.js), so it stays inert rather than double-showing
   alongside this new layer.
   ========================================================================= */
.tld-brand-top {
  position: fixed;
  top: calc(var(--tld-nav-height) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}

.tld-brand-top-mark {
  font-family: var(--tld-font-display);
  font-size: 13px;
  letter-spacing: 0.35em;
  color: var(--tld-ivory);
}

.tld-brand-top-tagline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tld-brand-top-en {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tld-ivory-40);
}

.tld-brand-top-ar {
  font-size: 11px;
  color: var(--tld-ivory-40);
}

/* Compact left-side column — deliberately NOT centered and NOT a card
   (transparent, no background/border) so the screen center stays fully
   open for the dimensional core, project/category circles, and node
   interaction. Sits below those in stacking order (z-index 15, vs. 20/21
   for node + quick-action labels — see those rules) and is pointer-
   events:none throughout, so it can never intercept a click or hover
   meant for the 3D scene. `top` is a plain custom property so JS can
   nudge it vertically (see narrative.js's shiftIfOverlapping) without
   fighting this rule's specificity — default keeps it vertically
   centered on the left edge. */
.tld-narrative {
  --tld-narrative-top: 50%;
  /* Reveal-only knobs, scrubbed by loading-screen.js's
     revealNarrativeOnScroll() as the visitor scrolls through the first
     ~5% of the journey (opacity 0->1, a few px of settle, a subtle
     scale-in) — unitless so GSAP interpolates them as plain numbers; the
     transform below applies the actual px/scale units. Default to their
     rest values (no offset/no scale) so this is a complete no-op if JS
     never touches them (e.g. prefers-reduced-motion, where the scale/
     parallax settle is skipped — see loading-screen.js). Never re-tweened
     once that short scroll window ends — the headline must stay
     perfectly still for the rest of the journey. */
  --tld-reveal-y: 0;
  --tld-reveal-scale: 1;
  position: fixed;
  top: var(--tld-narrative-top);
  transition: top 0.5s var(--tld-ease);
  z-index: 15;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
  background: none;
  border: none;
  box-shadow: none;
  opacity: 0;
  /* left/right/width/max-width/transform are supplied by the
     .tld-narrative--center/--left/--right modifier classes below —
     narrative.js toggles exactly one of these at the same instant it
     swaps the statement text (inside the fully-faded-out gap), so the
     column never visibly slides across the screen; it simply appears
     in its new spot once faded back in. Deliberately NOT included in
     the `transition` list above (which only covers `top`, for the
     overlap-avoidance nudge) so left/right/transform changes are
     always instant, never animated. */
}

/* Chapter 1 (index 0) — the opening/main concept statement. Centered,
   slightly larger and a touch more opaque than the side statements so it
   reads as the primary line, but still restrained ("softly transparent",
   "must not overpower the scene") — see the desktop-only font-size/
   opacity overrides further below, which intentionally stop applying
   under 600px so the mobile treatment (below) stays uniform regardless
   of chapter. */
.tld-narrative--center {
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%) translateY(calc(var(--tld-reveal-y, 0) * 1px)) scale(var(--tld-reveal-scale, 1));
  width: min(460px, 42vw);
  max-width: 520px;
  /* NOT position:relative — the element already gets position:fixed from
     .tld-narrative above, which already establishes the containing block
     the ::before backdrop below needs; adding `relative` here would win
     the cascade (this rule loads later) and silently break the fixed
     overlay positioning for this chapter. */
}

/* A soft, perfectly STATIC focus backdrop sitting directly behind the
   chapter-1 headline only. Root-cause of the reported "the first main
   sentence is moving / shaking too much": the dimensional core sits
   dead-center at t=0 (see scene-core.js), exactly where this centered
   headline reads, and its several independently-spinning luminous rings
   + pulsing beacon + additive glow sprites keep animating directly
   behind the semi-transparent letters — nothing on the text itself ever
   moves (confirmed empirically: zero change in bounding box/transform
   over a sampled 4s window), but the constantly shifting brightness and
   line-work right behind the glyphs reads as the text itself vibrating.
   This backdrop softens the scene immediately behind the headline (pure
   CSS, no WebGL change) so the letters sit on a calm, steady surface —
   the 3D scene, palette, lighting, and dimensional core are completely
   untouched everywhere else (item 5: "keep the rest of the approved
   design"). Sized in % of the text column so it scales with the
   existing responsive width/font-size rules automatically, softly
   feathered via a radial mask so it never reads as a hard panel, and
   inert: no pointer-events, no animation of its own — it fades in with
   the rest of `.tld-narrative` (see the opacity fade below) and then
   never moves again. */
.tld-narrative--center::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 160%;
  height: 190%;
  background: var(--tld-navy-40);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Chapters 3 & 5 (indices 2 & 4) — left side, same size/opacity/transition
   treatment as the right-side statements below. */
.tld-narrative--left {
  left: clamp(20px, 6vw, 90px);
  right: auto;
  transform: translateY(-50%) translateY(calc(var(--tld-reveal-y, 0) * 1px)) scale(var(--tld-reveal-scale, 1));
  width: min(340px, 32vw);
  max-width: 380px;
}

/* Chapters 2 & 4 (indices 1 & 3) — right side, keeping the screen center
   clear for the main geometric object / project circles. */
.tld-narrative--right {
  right: clamp(20px, 6vw, 90px);
  left: auto;
  transform: translateY(-50%) translateY(calc(var(--tld-reveal-y, 0) * 1px)) scale(var(--tld-reveal-scale, 1));
  width: min(340px, 32vw);
  max-width: 380px;
}

@media (min-width: 601px) {
  .tld-narrative--center .tld-narrative-ar {
    font-size: clamp(28px, 3vw, 46px);
    opacity: 0.78;
    text-align: center;
  }
  .tld-narrative--center .tld-narrative-en {
    opacity: 0.5;
    text-align: center;
  }
}

.tld-narrative-line {
  transition: opacity 0.4s var(--tld-ease), filter 0.4s var(--tld-ease), transform 0.4s var(--tld-ease);
  transform: translateY(0);
  filter: blur(0);
  /* Resting opacity is set per-line below (.tld-narrative-ar /
     .tld-narrative-en), deliberately NOT here — .tld-narrative-exit's
     compound selector then always wins regardless of source order. */
}

/* Applied briefly while swapping to the next statement — a subtle fade +
   faint blur + small upward drift, per "restrained transition"; kept
   lighter than the original center-stage treatment since this text is
   now a quiet accompaniment, not the focal point. narrative.js toggles
   this class, waits for the transition, swaps the text, then removes it. */
.tld-narrative-line.tld-narrative-exit {
  opacity: 0;
  transform: translateY(-6px);
  filter: blur(2px);
}

.tld-narrative-ar {
  font-family: var(--tld-font-arabic);
  font-weight: 400;
  line-height: 1.35;
  font-size: clamp(24px, 2.5vw, 42px);
  color: var(--tld-ivory);
  opacity: 0.7;
  text-align: right; /* RTL — flush to the column's inner (right) edge */
  text-shadow: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* "maximum of two lines" */
  overflow: hidden;
}

.tld-narrative-en {
  margin-top: 8px;
  font-size: clamp(11px, 1.1vw, 14px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tld-ivory);
  opacity: 0.42;
  text-align: left; /* LTR */
}

.tld-concept-anchor {
  position: fixed;
  left: 50%;
  bottom: 9vh;
  transform: translateX(-50%);
  z-index: 16;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}

.tld-concept-anchor-en {
  font-family: var(--tld-font-display);
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--tld-ivory-70);
}

.tld-concept-anchor-ar {
  font-size: 12px;
  color: var(--tld-ivory-40);
}

/* Simple 5-dot chapter indicator, synced to the same narrative zones —
   purely informational (aria-hidden, no pointer events), sits on the
   opposite side of the screen from the quick-action nodes so it never
   overlaps their hit areas. */
.tld-chapter-dots {
  position: fixed;
  top: 50%;
  right: clamp(14px, 3vw, 32px);
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
}

.tld-chapter-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tld-ivory-40);
  transition: background 0.4s var(--tld-ease), box-shadow 0.4s var(--tld-ease), transform 0.4s var(--tld-ease);
}

.tld-chapter-dot.tld-active {
  background: var(--tld-cyan-light);
  box-shadow: 0 0 8px 2px var(--tld-cyan-glow);
  transform: scale(1.4);
}

@media (prefers-reduced-motion: reduce) {
  .tld-narrative-line {
    transition: opacity 0.2s linear;
  }
  .tld-narrative-line.tld-narrative-exit {
    transform: none;
    filter: none;
  }
  .tld-chapter-dot {
    transition: background 0.2s linear;
  }
  .tld-chapter-dot.tld-active {
    transform: none;
  }
}

/* =========================================================================
   NAVIGATION CHROME
   ========================================================================= */
#tld-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--tld-nav-height);
  padding: 0 clamp(18px, 4vw, 48px);
  pointer-events: none;
}

#tld-nav > * {
  pointer-events: auto;
}

.tld-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--tld-font-display);
  letter-spacing: 0.22em;
  font-size: 14px;
  color: var(--tld-ivory);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.6s var(--tld-ease);
}

.tld-logo.tld-visible { opacity: 1; }

.tld-logo img {
  height: 26px;
  width: auto;
  display: block;
}

.tld-nav-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transition: opacity 0.6s var(--tld-ease);
}

.tld-nav-controls.tld-visible { opacity: 1; }

.tld-icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(244, 241, 234, 0.2);
  border-radius: 50%;
  color: var(--tld-ivory-70);
  transition: border-color 0.3s var(--tld-ease), color 0.3s var(--tld-ease);
  font-size: 13px;
}

.tld-icon-btn:hover,
.tld-icon-btn[aria-pressed="true"] {
  border-color: var(--tld-cyan-light);
  color: var(--tld-cyan-light);
}

.tld-skip-btn {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--tld-ivory-40);
  padding: 9px 4px;
  border-bottom: 1px solid transparent;
}

.tld-skip-btn:hover {
  color: var(--tld-ivory);
  border-bottom-color: var(--tld-bronze);
}

/* AR|EN language switcher — additive, sits inside the existing nav-controls
   cluster (same visibility fade as the icon buttons beside it) so no new
   layout region has to be reserved for it. Scoped entirely under its own
   .tld-lang-* classes so it cannot affect any other panel/button style. */
.tld-lang-switch {
  display: flex;
  align-items: center;
  border: 1px solid rgba(244, 241, 234, 0.2);
  border-radius: 999px;
  overflow: hidden;
  margin-inline-end: 4px;
}

.tld-lang-btn {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 7px 12px;
  color: var(--tld-ivory-40);
  transition: color 0.3s var(--tld-ease), background 0.3s var(--tld-ease);
}

.tld-lang-btn.tld-lang-active {
  color: var(--tld-navy);
  background: var(--tld-cyan-light);
}

.tld-lang-btn:not(.tld-lang-active):hover {
  color: var(--tld-ivory);
}

/* Slide-down real WordPress navigation panel */
#tld-site-nav-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--tld-navy-90);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(244, 241, 234, 0.12);
  padding: 130px clamp(18px, 6vw, 80px) 60px;
  transform: translateY(-100%);
  transition: transform 0.6s var(--tld-ease);
}

#tld-site-nav-panel.tld-open {
  transform: translateY(0);
}

/* "Explore" quick-links (About/Services/Projects/Contact) — open the
   layered panel system directly (see navigation.js / main.js), styled to
   stand slightly apart from the real WordPress menu below it since they
   behave differently (no page navigation). */
#tld-site-nav-panel .tld-quick-nav {
  list-style: none;
  margin: 0 0 22px;
  padding: 0 0 22px;
  border-bottom: 1px solid rgba(244, 241, 234, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 40px;
}

#tld-site-nav-panel .tld-quick-nav button {
  font-family: var(--tld-font-display);
  font-size: clamp(20px, 3vw, 30px);
  color: var(--tld-ivory-70);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

#tld-site-nav-panel .tld-quick-nav button:hover {
  color: var(--tld-cyan-light);
}

#tld-site-nav-panel .tld-site-menu {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 40px;
}

#tld-site-nav-panel .tld-site-menu a {
  font-family: var(--tld-font-display);
  font-size: clamp(20px, 3vw, 30px);
  text-decoration: none;
  color: var(--tld-ivory-70);
}

#tld-site-nav-panel .tld-site-menu a:hover {
  color: var(--tld-cyan-light);
}

.tld-exit-link {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tld-bronze);
  text-decoration: none;
  border-bottom: 1px solid var(--tld-bronze);
  padding-bottom: 2px;
}

/* Timeline progress indicator (bottom) */
#tld-progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(18px, 4vw, 48px) 22px;
  opacity: 0;
  transition: opacity 0.6s var(--tld-ease);
}

#tld-progress.tld-visible { opacity: 1; }

.tld-progress-dimension {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tld-ivory-70);
  min-width: 140px;
}

.tld-progress-track {
  position: relative;
  flex: 1;
  height: 1px;
  background: rgba(244, 241, 234, 0.15);
}

.tld-progress-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--tld-bronze), var(--tld-cyan-light));
}

.tld-progress-count {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--tld-ivory-40);
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   INTERACTIVE NODE LABELS (screen-projected over the 3D scene)
   ========================================================================= */
.tld-node-label {
  position: fixed;
  z-index: 20;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tld-ivory-40);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--tld-ease), color 0.3s var(--tld-ease);
}

.tld-node-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 rgba(120, 220, 232, 0);
  transition: box-shadow 0.3s var(--tld-ease);
}

.tld-node-label.tld-state-available {
  opacity: 0.85;
  color: var(--tld-ivory);
  pointer-events: auto;
  cursor: pointer;
}

.tld-node-label.tld-state-available::before {
  box-shadow: 0 0 8px 2px var(--tld-cyan-glow);
  animation: tld-node-pulse 2.6s ease-in-out infinite;
}

.tld-node-label.tld-state-hover {
  opacity: 1;
  color: var(--tld-cyan-light);
}

.tld-node-label.tld-state-hover::before {
  box-shadow: 0 0 14px 4px var(--tld-cyan-glow);
}

.tld-node-label.tld-state-completed {
  opacity: 0.6;
  color: var(--tld-bronze);
  /* This is the fix for the "node stops responding after the first visit"
     bug: the base .tld-node-label rule defaults to pointer-events: none
     (correct for an "inactive" node, which is also invisible). Only
     .tld-state-available re-enabled pointer-events — .tld-state-hover
     inherits it because nodes.js's setState() always keeps the
     "tld-state-available" class alongside "tld-state-hover", but
     "completed" was added ALONE (see setState()'s `next === "completed"`
     branch), so a completed node kept the CSS-invisible node's
     pointer-events: none forever after its first close, even though it
     was still fully visible (opacity 0.6) and even keyboard-focusable
     (tabindex="0" — keyboard/Enter reactivation still worked, which is
     why this was easy to miss testing by keyboard but broke every mouse/
     touch click). Re-declaring pointer-events here is the only change
     needed — nodes.js's state machine and click handlers were already
     correct for unlimited open/close cycles. */
  pointer-events: auto;
  cursor: pointer;
}

.tld-node-label.tld-state-completed::before {
  box-shadow: 0 0 6px 1px var(--tld-bronze-glow);
}

@keyframes tld-node-pulse {
  0%, 100% { box-shadow: 0 0 6px 1px var(--tld-cyan-glow-soft); }
  50% { box-shadow: 0 0 14px 4px var(--tld-cyan-glow); }
}

/* =========================================================================
   HOMEPAGE QUICK-ACTION NODES ("Book a Consultation" / "Meet Our Team")
   -------------------------------------------------------------------------
   Screen-projected labels for the two illuminated "mini dimensional
   portal" objects built in scene-core.js (buildQuickActionMarker) and
   driven by quick-actions.js. Deliberately a distinct, slightly more
   substantial two-line treatment than .tld-node-label above — these read
   as immediate, always-there invitations in the opening scene rather than
   the "discovered as you scroll" timeline stops. Kept within the same
   navy/ivory/cyan/bronze language and never competing with the centered
   #tld-opening title (positioned to flank it, see scene-core.js).
   ========================================================================= */
.tld-quick-action-label {
  position: fixed;
  z-index: 21;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  min-width: 148px;
  background: var(--tld-navy-40);
  border: 1px solid var(--tld-ivory-40);
  border-radius: 999px;
  backdrop-filter: blur(2px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.5s var(--tld-ease), border-color 0.3s var(--tld-ease), box-shadow 0.3s var(--tld-ease), background 0.3s var(--tld-ease);
  box-shadow: 0 0 10px 1px var(--tld-cyan-glow-soft);
}

.tld-quick-action-main {
  font-family: var(--tld-font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tld-ivory);
}

.tld-quick-action-sub {
  font-family: var(--tld-font-body);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--tld-ivory-70);
}

.tld-quick-action-label.tld-quick-hover {
  border-color: var(--tld-cyan-light);
  background: var(--tld-navy-70);
  box-shadow: 0 0 18px 4px var(--tld-cyan-glow);
}

.tld-quick-action-label.tld-quick-hover .tld-quick-action-main {
  color: var(--tld-cyan-light);
}

.tld-quick-action-label.tld-quick-active {
  border-color: var(--tld-bronze);
  background: var(--tld-navy-90);
  box-shadow: 0 0 20px 5px var(--tld-bronze-glow);
}

/* =========================================================================
   CONTENT PANEL (Origin / Design node content)
   ========================================================================= */
.tld-panel-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: radial-gradient(ellipse at center, var(--tld-navy-70) 0%, var(--tld-black-85) 80%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--tld-ease), visibility 0.6s var(--tld-ease);
}

.tld-panel-scrim.tld-open {
  opacity: 1;
  visibility: visible;
}

/* Anchored to the bottom edge of the viewport on every breakpoint (was
   previously centered via top:50%/left:50%, which left a floating gap
   underneath it — see the bottom-anchor fix). Opens with a slide-up-
   from-below transform instead of a scale/fade from center; the panel's
   bottom edge sits flush against the viewport bottom (bottom:0, no
   translateY offset once .tld-open is applied) with no border/radius
   on that edge so nothing reads as a "gap". Width stays capped so the
   3D scene remains visible around it on desktop; the 600px breakpoint
   below widens it to a full-bleed mobile bottom sheet. safe-area-inset
   is baked into padding-bottom here so it applies at every breakpoint,
   including the mobile bottom sheet, without needing to repeat it. */
.tld-panel {
  position: fixed;
  z-index: 71;
  top: auto;
  bottom: 0;
  left: 50%;
  width: min(560px, 88vw);
  max-height: 78vh;
  overflow-y: auto;
  transform: translate(-50%, 100%);
  background: linear-gradient(180deg, rgba(18, 58, 90, 0.35), rgba(3, 7, 12, 0.7));
  border: 1px solid rgba(244, 241, 234, 0.14);
  border-bottom: none;
  border-radius: var(--tld-radius) var(--tld-radius) 0 0;
  padding: clamp(28px, 5vw, 56px);
  padding-bottom: calc(clamp(28px, 5vw, 56px) + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--tld-ease), transform 0.5s var(--tld-ease), visibility 0.5s var(--tld-ease);
}

.tld-panel.tld-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Applied while the secondary (project detail) panel is on top of it —
   per the "max two panels, don't let them visually compete" requirement,
   the primary panel recedes rather than fully disappearing (its state is
   preserved so closing the secondary panel reveals it exactly as it
   was), and stops intercepting clicks so it can't be interacted with
   while hidden behind the detail panel. */
.tld-panel.tld-dimmed {
  opacity: 0.08;
  pointer-events: none;
  transition: opacity 0.4s var(--tld-ease);
}

.tld-panel-eyebrow {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--tld-bronze);
  margin-bottom: 14px;
}

.tld-panel-title {
  font-family: var(--tld-font-display);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.2;
  margin-bottom: 18px;
  color: var(--tld-ivory);
}

.tld-panel-body {
  font-size: 14px;
  line-height: 1.85;
  color: var(--tld-ivory-70);
}

.tld-panel-body p + p { margin-top: 14px; }

/* Chrome bar (back + close) sits above the content, which panel-system.js
   replaces wholesale per view (Origin text / Services / Contact /
   category grid / project list) — see #tld-panel-content below. */
.tld-panel-chrome {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.tld-panel-chrome > * { pointer-events: auto; }

.tld-panel-back,
.tld-panel-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(244, 241, 234, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--tld-ivory-70);
  background: rgba(3, 7, 12, 0.3);
}

.tld-panel-back:hover,
.tld-panel-close:hover {
  border-color: var(--tld-cyan-light);
  color: var(--tld-cyan-light);
}

.tld-panel-back[hidden] { display: none; }

.tld-panel-content {
  margin-top: 8px;
}

.tld-panel-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.tld-panel-list li {
  font-size: 13px;
  color: var(--tld-ivory-70);
  padding-left: 16px;
  position: relative;
}

.tld-panel-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 1px;
  background: var(--tld-cyan-light);
}

/* =========================================================================
   "TLD IN NUMBERS" — a stats strip INSIDE the About Us/Origin panel only
   (see panel-system.js's renderNumbersHtml/renderSimplePanel). NOT a new
   timeline node or panel — this is content enhancement of the existing
   About Us panel, per the approved homepage direction. Kept visually
   restrained (same ivory/bronze/navy language as the rest of the panel,
   a thin top divider rather than a boxed/carded look) so it reads as part
   of the same panel, not a separate widget.
   ========================================================================= */
.tld-numbers {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--tld-ivory-40);
}

.tld-numbers-heading {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tld-ivory-70);
  margin-bottom: 16px;
}

.tld-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px 16px;
}

.tld-stat-item {
  text-align: center;
}

.tld-stat-value {
  font-family: var(--tld-font-display);
  font-size: clamp(22px, 2.6vw, 30px);
  color: var(--tld-bronze);
  line-height: 1.1;
}

.tld-stat-label {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--tld-ivory-70);
  line-height: 1.4;
}

/* Generic "Return to Timeline" / "Back to all categories" text control —
   used throughout panel-system.js views. Always present per the "clear
   controls for close/back/return to timeline" requirement. */
.tld-return-link {
  display: block;
  margin-top: 22px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tld-bronze);
  text-align: left;
}

.tld-return-link:hover { color: var(--tld-cyan-light); }

/* =========================================================================
   PROJECT DIMENSION — category grid + per-category project list
   (primary panel views, see panel-system.js renderProjectsCategories /
   renderProjectsCategory)
   ========================================================================= */
.tld-category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.tld-category-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px;
  border: 1px solid rgba(244, 241, 234, 0.14);
  background: rgba(244, 241, 234, 0.03);
  text-align: left;
  transition: border-color 0.3s var(--tld-ease), background 0.3s var(--tld-ease);
}

.tld-category-tile:hover:not(:disabled) {
  border-color: var(--tld-cyan-light);
  background: rgba(120, 220, 232, 0.06);
}

.tld-category-tile:disabled {
  opacity: 0.35;
  cursor: default;
}

.tld-category-label {
  font-family: var(--tld-font-display);
  font-size: 16px;
  color: var(--tld-ivory);
}

.tld-category-count {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tld-ivory-40);
}

.tld-project-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.tld-project-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid rgba(244, 241, 234, 0.12);
  background: rgba(244, 241, 234, 0.02);
  text-align: left;
  transition: border-color 0.3s var(--tld-ease);
}

.tld-project-card:hover {
  border-color: var(--tld-cyan-light);
}

.tld-project-card-media {
  flex: none;
  width: 64px;
  height: 64px;
  background: var(--tld-navy) center / cover no-repeat;
  border: 1px solid rgba(244, 241, 234, 0.1);
}

.tld-project-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tld-project-card-title {
  font-family: var(--tld-font-display);
  font-size: 15px;
  color: var(--tld-ivory);
}

.tld-project-card-meta {
  font-size: 11px;
  color: var(--tld-ivory-40);
}

/* Gallery strip of dots over the secondary panel's media image (see
   panel-system.js renderProjectDetail) — click a dot to swap the shown
   image without leaving the panel. */
.tld-gallery-strip {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: flex;
  gap: 6px;
}

.tld-gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(244, 241, 234, 0.35);
  cursor: pointer;
  transition: background 0.3s var(--tld-ease), transform 0.3s var(--tld-ease);
}

.tld-gallery-dot:hover { background: rgba(244, 241, 234, 0.6); }

.tld-gallery-dot.tld-active {
  background: var(--tld-cyan-light);
  transform: scale(1.2);
}

.tld-portal-return-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tld-portal-return-row .tld-return-link { margin-top: 14px; }

/* =========================================================================
   SERVICES PANEL
   ========================================================================= */
.tld-services-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.tld-service-item {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(244, 241, 234, 0.1);
}

.tld-service-item:last-child { border-bottom: none; }

.tld-service-title {
  font-family: var(--tld-font-display);
  font-size: 16px;
  color: var(--tld-ivory);
  margin-bottom: 4px;
}

.tld-service-description {
  font-size: 13px;
  line-height: 1.7;
  color: var(--tld-ivory-70);
}

/* =========================================================================
   CONTACT PANEL — inquiry form + info
   ========================================================================= */
.tld-contact-form {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.tld-form-row {
  display: grid;
  gap: 6px;
}

.tld-form-row label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tld-ivory-40);
}

/* Two-column layout used by the booking form's date/time row. */
.tld-form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tld-form-row-split > div {
  display: grid;
  gap: 6px;
}

.tld-form-row-split label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tld-ivory-40);
}

.tld-form-row-split input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(244, 241, 234, 0.04);
  border: 1px solid rgba(244, 241, 234, 0.18);
  border-radius: var(--tld-radius);
  color: var(--tld-ivory);
  font-family: inherit;
  font-size: 13px;
}

.tld-form-row-split input:focus {
  outline: none;
  border-color: var(--tld-cyan-light);
}

.tld-form-row input,
.tld-form-row textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(244, 241, 234, 0.04);
  border: 1px solid rgba(244, 241, 234, 0.18);
  border-radius: var(--tld-radius);
  color: var(--tld-ivory);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

.tld-form-row input:focus,
.tld-form-row textarea:focus {
  outline: none;
  border-color: var(--tld-cyan-light);
}

.tld-form-submit {
  justify-self: start;
  padding: 11px 26px;
  border: 1px solid var(--tld-bronze);
  color: var(--tld-ivory);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background 0.3s var(--tld-ease), border-color 0.3s var(--tld-ease);
}

.tld-form-submit:hover {
  background: var(--tld-bronze-glow);
  border-color: var(--tld-cyan-light);
}

.tld-form-status {
  font-size: 12px;
  min-height: 1.2em;
}

.tld-form-status-pending { color: var(--tld-ivory-40); }
.tld-form-status-success { color: var(--tld-cyan-light); }
.tld-form-status-error { color: var(--tld-bronze); }

/* Honeypot spam-trap field — visually hidden off-screen (not
   display:none/visibility:hidden, which some bots specifically check
   for and skip) so it never appears for real visitors. See
   panel-system.js's spamProtectionFields(). */
.tld-hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.tld-booking-btn {
  display: inline-block;
  margin-top: 18px;
  padding: 11px 26px;
  border: 1px solid var(--tld-cyan-light);
  color: var(--tld-ivory);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}

.tld-booking-btn:hover {
  background: var(--tld-cyan-glow-soft);
}

/* =========================================================================
   "MEET OUR TEAM" PANEL — the other homepage quick-action panel. Single
   primary-panel card (no separate Team page) with Previous/Next controls,
   reusing .tld-portal-controls/.tld-portal-nav-btn's look for consistency
   with the project-detail prev/next pattern.
   ========================================================================= */
.tld-team-card {
  margin-top: 20px;
  text-align: center;
}

.tld-team-photo {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(244, 241, 234, 0.06) center/cover no-repeat;
  border: 1px solid var(--tld-ivory-40);
}

.tld-team-name {
  font-family: var(--tld-font-display);
  font-size: 20px;
  color: var(--tld-ivory);
}

.tld-team-position {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--tld-cyan-light);
}

.tld-team-specialization {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tld-bronze);
}

.tld-team-bio {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--tld-ivory-70);
  text-align: left;
}

/* Multi-paragraph bios (wpautop'd server-side — see
   TLD_CPT_Team::get_team_data()) get the same comfortable paragraph
   spacing as the About Us/Design panel body text, instead of running
   straight into the next paragraph with no visual break. */
.tld-team-bio p + p {
  margin-top: 12px;
}

.tld-team-linkedin {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tld-cyan-light);
  text-decoration: none;
}

.tld-team-linkedin:hover {
  color: var(--tld-ivory);
}

.tld-team-count {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--tld-ivory-40);
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   PROJECT PORTAL
   ========================================================================= */
.tld-portal {
  position: fixed;
  z-index: 71;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--tld-ease), visibility 0.6s var(--tld-ease);
}

.tld-portal.tld-open {
  opacity: 1;
  visibility: visible;
}

.tld-portal-frame {
  position: relative;
  width: min(920px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(160deg, rgba(18, 58, 90, 0.4), rgba(3, 7, 12, 0.82));
  border: 1px solid rgba(244, 241, 234, 0.16);
  box-shadow: 0 0 60px rgba(120, 220, 232, 0.06);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.tld-portal-media {
  position: relative;
  min-height: 260px;
  background: var(--tld-navy) center / cover no-repeat;
}

.tld-portal-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(3, 7, 12, 0.6));
}

.tld-portal-body {
  padding: clamp(24px, 4vw, 46px);
}

.tld-portal-eyebrow {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--tld-bronze);
  margin-bottom: 10px;
}

.tld-portal-title {
  font-family: var(--tld-font-display);
  font-size: clamp(22px, 3vw, 30px);
  color: var(--tld-ivory);
  margin-bottom: 6px;
}

.tld-portal-meta {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--tld-ivory-40);
  margin-bottom: 20px;
}

.tld-portal-section {
  margin-bottom: 18px;
}

.tld-portal-section h4 {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--tld-cyan-light);
  margin-bottom: 8px;
}

.tld-portal-section p,
.tld-portal-section ul {
  font-size: 13px;
  line-height: 1.75;
  color: var(--tld-ivory-70);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tld-portal-phases {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tld-portal-phases li {
  font-size: 11px;
  padding: 5px 10px;
  border: 1px solid rgba(244, 241, 234, 0.18);
  color: var(--tld-ivory-70);
}

.tld-portal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(244, 241, 234, 0.12);
}

.tld-portal-nav-btn {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tld-ivory-70);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tld-portal-nav-btn:hover { color: var(--tld-cyan-light); }
.tld-portal-nav-btn:disabled { opacity: 0.3; cursor: default; }

.tld-portal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(244, 241, 234, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tld-ivory);
  background: rgba(3, 7, 12, 0.4);
  z-index: 2;
}

.tld-portal-return {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tld-bronze);
  text-align: center;
  margin-top: 14px;
}

/* =========================================================================
   CONTACT / FINAL DIMENSION
   ========================================================================= */
.tld-contact-portal {
  text-align: center;
}

.tld-contact-list {
  display: grid;
  gap: 14px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.tld-contact-list a {
  font-size: 14px;
  color: var(--tld-ivory-70);
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 241, 234, 0.2);
  padding-bottom: 4px;
}

.tld-contact-list a:hover { color: var(--tld-cyan-light); }

/* =========================================================================
   WEBGL / REDUCED MOTION FALLBACKS
   ========================================================================= */
#tld-fallback {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  background: var(--tld-black);
}

#tld-fallback.tld-active { display: flex; }

#tld-fallback h2 {
  font-family: var(--tld-font-display);
  font-size: clamp(24px, 4vw, 34px);
  margin-bottom: 12px;
}

#tld-fallback p {
  max-width: 460px;
  color: var(--tld-ivory-70);
  line-height: 1.7;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  #tld-app:not(.tld-motion-forced) .tld-scroll-cue {
    animation: none;
    opacity: 0.7;
  }
}

/* =========================================================================
   TABLET (portrait + landscape, ~601px–1024px — e.g. iPad, iPad mini)
   -------------------------------------------------------------------------
   Layout-only adjustments: two-column grids that read as cramped at
   tablet-portrait widths (roughly 768–834px on real devices) drop to a
   single column here, same as mobile, but text sizing, nav height, and
   node/label proportions all stay at their full desktop scale — a tablet
   visitor is not treated like a phone visitor, just a narrower desktop
   one. Also widens tap targets slightly for touch input without changing
   how any of this looks on a desktop with a mouse.
   ========================================================================= */
@media (max-width: 1024px) {
  .tld-portal-frame {
    grid-template-columns: 1fr;
  }

  .tld-portal-media { min-height: 220px; }

  .tld-category-grid {
    grid-template-columns: 1fr;
  }

  .tld-form-row-split {
    grid-template-columns: 1fr;
  }

  .tld-panel { max-height: 84vh; }

  /* Touch-friendly hit targets (per the "clear touch interactions"
     responsive requirement) — a few extra px of padding around the
     interactive labels, same visual treatment otherwise. */
  .tld-node-label { padding: 8px 14px; }
  .tld-quick-action-label { padding: 11px 16px; }

  /* Narrative layer stays fully legible at tablet width via its own
     clamp() sizing already — only the side chapter dots need to tuck in
     a bit closer to the edge here. */
  .tld-chapter-dots {
    right: 12px;
    gap: 8px;
  }
}

/* =========================================================================
   MOBILE (~600px and below — phones)
   ========================================================================= */
@media (max-width: 600px) {
  :root { --tld-nav-height: 68px; }

  #tld-progress {
    padding-bottom: 16px;
    gap: 10px;
  }

  .tld-progress-dimension { min-width: 0; font-size: 9px; }

  .tld-node-label { font-size: 9px; padding: 5px 9px; }

  #tld-site-nav-panel { padding-top: 110px; }

  /* Keep the fixed nav to a single row on narrow screens — drop the
     wordmark subtitle so "TLD" plus the icon controls never wrap. */
  .tld-logo span:last-child {
    display: none;
  }

  .tld-nav-controls {
    gap: 8px;
  }

  .tld-lang-btn {
    font-size: 9px;
    padding: 6px 9px;
  }

  .tld-portal-return-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .tld-quick-action-label {
    min-width: 118px;
    padding: 9px 14px;
  }

  .tld-quick-action-main { font-size: 9px; }
  .tld-quick-action-sub { font-size: 8px; }

  .tld-team-photo {
    width: 96px;
    height: 96px;
  }

  /* Narrative layer: keep the Arabic statement (the required "main
     sentence") comfortably legible while shrinking everything around
     it, per "shrink texts and buttons without losing the main sentence". */
  .tld-brand-top {
    top: calc(var(--tld-nav-height) + 8px);
  }

  .tld-brand-top-mark { font-size: 11px; letter-spacing: 0.28em; }
  .tld-brand-top-en { font-size: 8px; letter-spacing: 0.16em; }
  .tld-brand-top-ar { font-size: 10px; }

  /* Mobile trades the desktop left-hand column for a compact centered
     block near the lower part of the screen — sized and placed to clear
     the quick-action buttons above it and the concept-name anchor /
     progress bar below it (see the surrounding rules in this block). */
  .tld-narrative {
    left: 50%;
    top: 60%;
    transform: translate(-50%, -50%) translateY(calc(var(--tld-reveal-y, 0) * 1px)) scale(var(--tld-reveal-scale, 1));
    width: min(280px, 78vw);
    max-width: 320px;
  }
  .tld-narrative-ar {
    font-size: clamp(20px, 6vw, 28px);
    text-align: center;
  }
  .tld-narrative-en {
    font-size: clamp(9px, 2.6vw, 12px);
    margin-top: 6px;
    text-align: center;
  }

  .tld-concept-anchor { bottom: 7vh; }
  .tld-concept-anchor-en { font-size: 11px; letter-spacing: 0.22em; }
  .tld-concept-anchor-ar { font-size: 10px; }

  .tld-chapter-dots {
    right: 8px;
    gap: 7px;
  }
  .tld-chapter-dot { width: 4px; height: 4px; }

  /* True bottom-sheet on phones: full-bleed width (no side gaps, no
     horizontal overflow risk since left/right:0 replaces the centered
     fixed width), taller (up to 90vh) but still anchored flush to the
     bottom edge via the base rule's bottom:0 + the translateY slide
     above. Safe-area bottom padding is already handled by the base
     rule's padding-bottom, so it applies here too without repeating it. */
  .tld-panel {
    left: 0;
    right: 0;
    width: auto;
    max-width: 100%;
    max-height: 90vh;
    transform: translateY(100%);
  }

  .tld-panel.tld-open {
    transform: translateY(0);
  }
}
