/* ============================================
   SOULTHREAD SUB-BRAND PAGES — Shared Styles
   Extends the Group design system.
   ============================================ */

:root {
  --bg-deep: #161620;
  --bg: #1B1B24;
  --bg-elevated: #212128;
  --bg-surface: #2E2E3A;

  --text: #E8E4DF;
  --text-secondary: #B8B3AC;
  --text-muted: #7A756F;
  --text-dim: #4A4640;

  --accent: #5B9E9E; /* overridden per page */
  --accent-glow: rgba(91, 158, 158, 0.1);

  --font-sans: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Cormorant Garamond', 'Georgia', serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --font-arabic: 'Tajawal', 'Syne', sans-serif;
}

/* Arabic font — .lang-ar class added to body when Arabic is selected */
.ghost-locale__option[data-lang="ar"] {
  font-family: var(--font-arabic);
}

.lang-ar,
.lang-ar .sub-hero__title,
.lang-ar .sub-hero__anchor,
.lang-ar .statement__text,
.lang-ar .domain__title,
.lang-ar .domain__text,
.lang-ar .closing__text,
.lang-ar .sub-footer__inner,
.lang-ar .sub-footer__legal {
  font-family: var(--font-arabic);
  font-style: normal;
}

/* RTL text direction for content — but NOT for UI chrome */
.lang-ar .sub-hero__anchor,
.lang-ar .statement__text,
.lang-ar .domain__text,
.lang-ar .closing__text,
.lang-ar .sub-footer__legal {
  direction: rtl;
}

/* Technologies */
.page--tech {
  --accent: #5B9E9E;
  --accent-glow: rgba(91, 158, 158, 0.08);
}

/* Studios */
.page--studios {
  --accent: #D4A06A;
  --accent-glow: rgba(212, 160, 106, 0.08);
}

/* Analytics */
.page--analytics {
  --accent: #9B8BC8;
  --accent-glow: rgba(155, 139, 200, 0.08);
}

/* ============================================
   LIGHT THEME
   ============================================ */

[data-theme="light"] {
  --bg-deep: #F0EDE8;
  --bg: #E8E4DF;
  --bg-elevated: #DDD9D3;
  --bg-surface: #C8C4BD;

  --text: #1A1A22;
  --text-secondary: #3A3A44;
  --text-muted: #6A6A74;
  --text-dim: #9A9AA0;
}

[data-theme="light"].page--tech { --accent: #3D7A7A; --accent-glow: rgba(61, 122, 122, 0.1); }
[data-theme="light"].page--studios { --accent: #A87840; --accent-glow: rgba(168, 120, 64, 0.1); }
[data-theme="light"].page--analytics { --accent: #6A5A98; --accent-glow: rgba(106, 90, 152, 0.1); }

[data-theme="light"] body {
  background: linear-gradient(135deg, var(--bg-deep) 0%, #E5E1DC 50%, var(--bg) 100%);
}

[data-theme="light"] .sub-hero {
  background: var(--bg-deep);
}

[data-theme="light"] .sub-hero__bg {
  opacity: 0.12;
  mix-blend-mode: luminosity;
  filter: invert(1) brightness(0.8);
}

[data-theme="light"] .sub-hero__bg::after {
  background: radial-gradient(ellipse at center, transparent 20%, var(--bg-deep) 70%);
}

[data-theme="light"] .statement,
[data-theme="light"] .closing {
  background: var(--bg-deep);
}


[data-theme="light"] body::after {
  opacity: 0.012;
}

/* ============================================
   GHOST CONTROLS (imported from Group site)
   ============================================ */

.ghost-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 2rem;
  z-index: 200;
  pointer-events: none;
}

.ghost-bar > * {
  pointer-events: auto;
}

.ghost-bar__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ghost-home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text);
  transition: color 0.4s var(--ease-out);
}

.ghost-home:hover {
  color: var(--text);
  filter: drop-shadow(0 0 4px currentColor);
}

.ghost-home svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ghost-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.4rem;
  transition: color 0.4s var(--ease-out);
  position: relative;
}

.ghost-toggle:hover {
  color: var(--text);
}

.ghost-toggle__icon {
  width: 18px;
  height: 18px;
  display: block;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.ghost-toggle__moon {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  opacity: 0;
  transform: rotate(-30deg) scale(0.8);
}

[data-theme="light"] .ghost-toggle__sun {
  opacity: 0;
  transform: rotate(30deg) scale(0.8);
}

[data-theme="light"] .ghost-toggle__moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Locale — two separate dropdowns (styles inherited from style.css for Group page,
   duplicated here for sub-brand pages which use sub-brand.css only) */
.ghost-locale-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ghost-locale-sep {
  color: var(--text-dim);
  font-size: 0.55rem;
  opacity: 0.4;
}

.ghost-dropdown {
  position: relative;
}

.ghost-dropdown__trigger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.4rem 0;
  transition: color 0.4s var(--ease-out);
}

.ghost-dropdown__trigger:hover {
  color: var(--text);
}

#region-dropdown .ghost-dropdown__label { font-size: 0.6rem; opacity: 0.6; }
#lang-dropdown .ghost-dropdown__label { font-size: 0.7rem; letter-spacing: 0.2em; }

.ghost-dropdown__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  list-style: none;
  background: var(--bg-elevated);
  border: 1px solid rgba(232, 228, 223, 0.08);
  padding: 0.35rem 0;
  min-width: 120px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s 0.3s;
  backdrop-filter: blur(12px);
}

.ghost-dropdown.open .ghost-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s 0s;
}

.ghost-dropdown__option {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  transition: color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.ghost-dropdown__option:hover {
  color: var(--text);
  background: rgba(232, 228, 223, 0.04);
}

.ghost-dropdown__option--active {
  color: var(--text-secondary);
}

.ghost-dropdown__option--active::after {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-left: auto;
}

.ghost-dropdown__option[data-lang="ar"] {
  font-family: var(--font-arabic);
}

[data-theme="light"] .ghost-dropdown__menu {
  background: var(--bg-elevated);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

@media (max-width: 600px) {
  .ghost-bar { padding: 1rem 1.2rem; }
  .ghost-toggle__icon { width: 16px; height: 16px; }

}

/* ============================================
   RESET & BASE
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Global grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.02;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 512px 512px;
}

/* ============================================
   BACK LINK (top-left wordmark)
   ============================================ */

/* ============================================
   SUB-BRAND SLIDE SYSTEM
   ============================================ */

.sub-slide {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  opacity: 0;
  visibility: hidden;
  transform: translateY(40px);
  will-change: transform, opacity;
  overflow-y: auto;
}

/* Allow scrolling within the domains slide */
.sub-slide--domains {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0 2rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sub-slide--domains .domains {
  padding: clamp(3rem, 6vh, 5rem) 0;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* Compact domain spacing when inside a slide */
.sub-slide--domains .domain {
  padding: clamp(1.5rem, 3vh, 2.5rem) 0;
}

/* Slightly smaller text to fit more content */
.sub-slide--domains .domain__text {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  line-height: 1.7;
}

.sub-slide--domains .domain__title {
  margin-bottom: 1rem;
}

/* Statement and closing as slides */
.sub-slide--statement,
.sub-slide--closing {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer as slide */
.sub-slide--footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Content reveal when slide is active */
.sub-slide--active .domain {
  opacity: 0;
  transform: translateY(20px);
  animation: subSlideIn 0.8s var(--ease-out) forwards;
}

.sub-slide--active .domain:nth-child(1) { animation-delay: 0.1s; }
.sub-slide--active .domain:nth-child(2) { animation-delay: 0.2s; }
.sub-slide--active .domain:nth-child(3) { animation-delay: 0.3s; }
.sub-slide--active .domain:nth-child(4) { animation-delay: 0.4s; }

.sub-slide--active .statement__text,
.sub-slide--active .closing__text {
  opacity: 0;
  animation: subSlideIn 1s var(--ease-out) 0.15s forwards;
}

.sub-slide--active .sub-footer__mark {
  opacity: 0;
  animation: subFooterMarkIn 1s var(--ease-out) 0.1s forwards;
}

@keyframes subFooterMarkIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 0.45; transform: translateY(0); }
}

.sub-slide--active .sub-footer__inner,
.sub-slide--active .sub-footer__group-link,
.sub-slide--active .sub-footer__legal {
  opacity: 0;
  animation: subSlideIn 0.8s var(--ease-out) 0.2s forwards;
}

@keyframes subSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   SLIDE DOTS (right edge)
   ============================================ */

.sub-dots {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.sub-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.4s var(--ease-out), border-color 0.4s var(--ease-out), transform 0.3s var(--ease-out);
}

.sub-dot:hover {
  border-color: var(--text-muted);
  transform: scale(1.3);
}

.sub-dot--active {
  background: var(--text-muted);
  border-color: var(--text-muted);
}

/* ============================================
   CROSS-NAV (sibling brand switcher)
   ============================================ */

.cross-nav {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 200;
}

.cross-nav__bar {
  width: 24px;
  height: 2px;
  border-radius: 1px;
  background: var(--text-dim);
  transition: background 0.4s var(--ease-out), transform 0.3s var(--ease-out), opacity 0.4s var(--ease-out);
  opacity: 0.5;
}

.cross-nav__bar:hover {
  opacity: 0.8;
  transform: scaleY(1.5);
}

.cross-nav__bar--active {
  opacity: 1;
  background: var(--accent);
}

.cross-nav__bar--tech:hover,
.cross-nav__bar--tech.cross-nav__bar--active { background: #5B9E9E; }
.cross-nav__bar--studios:hover,
.cross-nav__bar--studios.cross-nav__bar--active { background: #D4A06A; }
.cross-nav__bar--analytics:hover,
.cross-nav__bar--analytics.cross-nav__bar--active { background: #9B8BC8; }

[data-theme="light"] .cross-nav__bar--tech:hover,
[data-theme="light"] .cross-nav__bar--tech.cross-nav__bar--active { background: #3D7A7A; }
[data-theme="light"] .cross-nav__bar--studios:hover,
[data-theme="light"] .cross-nav__bar--studios.cross-nav__bar--active { background: #A87840; }
[data-theme="light"] .cross-nav__bar--analytics:hover,
[data-theme="light"] .cross-nav__bar--analytics.cross-nav__bar--active { background: #6A5A98; }

@media (max-width: 600px) {
  .sub-dots { right: 1rem; gap: 8px; }
  .sub-dot { width: 6px; height: 6px; }
  .cross-nav__bar { width: 18px; }
}

/* ============================================
   HERO
   ============================================ */

.sub-hero {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-deep);
  z-index: 10;
}

.sub-hero .sub-hero__content {
  will-change: transform, opacity, filter;
  transform-origin: center center;
}

/* Particle canvas background (Analytics) */
.sub-hero__particles {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Circuit grid background (Technologies) */
.sub-hero__grid {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Three.js terrain background (Studios) */
.sub-hero__terrain {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* Interactive wave path divider */
.domain--with-wave {
  position: relative;
}

.wave-path {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 1px;
  width: 180px;
  color: var(--accent);
}

.sub-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
}

.sub-hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 20%, var(--bg-deep) 75%);
}

.sub-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 2rem;
}

.sub-hero__title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: heroFadeUp 1.2s var(--ease-out) 0.3s forwards;
}

.sub-hero__anchor {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  opacity: 0;
  animation: heroFadeUp 1.2s var(--ease-out) 0.7s forwards;
}

/* Accent underline */
.sub-hero__anchor::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 2rem auto 0;
  opacity: 0.5;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll indicator */
.sub-hero__scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--text-dim), transparent);
  opacity: 0;
  animation: heroFadeUp 1s var(--ease-out) 1.2s forwards;
}

/* ============================================
   OPENING STATEMENT
   ============================================ */

.statement {
  padding: clamp(6rem, 15vh, 12rem) 2rem;
  display: flex;
  justify-content: center;
  background: var(--bg-deep);
}

.statement__text {
  max-width: 720px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  line-height: 1.75;
  color: var(--text-secondary);
  text-align: center;
}

/* ============================================
   DOMAINS
   ============================================ */

.domains {
  padding: 2rem 2rem 4rem;
  max-width: 900px;
  margin: 0 auto;
}

.domain {
  padding: clamp(3rem, 8vh, 6rem) 0;
}

/* Thin line separator between domains (not on the first one) */
.domain + .domain {
  position: relative;
}

.domain + .domain::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
}

/* The wave-path domain replaces the line separator */
.domain--with-wave::before {
  display: none;
}

.domain__title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0.8;
  text-align: right;
}

.domain__text {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 680px;
}

/* ============================================
   CLOSING
   ============================================ */

.closing {
  padding: clamp(6rem, 15vh, 12rem) 2rem;
  display: flex;
  justify-content: center;
  background: var(--bg-deep);
  position: relative;
}

/* Top accent line */
.closing::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 1px;
  background: var(--accent);
  opacity: 0.4;
}

.closing__text {
  max-width: 680px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  line-height: 1.75;
  color: var(--text);
  text-align: center;
}

/* ============================================
   FOOTER
   ============================================ */

.sub-footer {
  padding: 4rem 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.sub-footer__mark {
  width: 192px;
  color: var(--text);
  opacity: 0.45;
  margin-bottom: 0.5rem;
}

.sub-footer__mark svg {
  width: 100%;
  height: auto;
  display: block;
}

.sub-footer__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.sub-footer__sep {
  color: var(--text-dim);
  font-size: 0.5rem;
}

.sub-footer__link {
  transition: color 0.4s var(--ease-out);
}

.sub-footer__link:hover {
  color: var(--text);
}

.sub-footer__group-link {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  transition: color 0.4s var(--ease-out);
}

.sub-footer__group-link:hover {
  color: var(--text-muted);
}

.sub-footer__legal {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-align: center;
}

.sub-footer__privacy {
  text-align: center;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  opacity: 0.5;
  margin-top: 0.3rem;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
  .back-link {
    top: 1rem;
    left: 1.2rem;
  }

  .sub-footer__inner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .sub-footer__sep {
    display: none;
  }
}

/* ============================================
   PREFERS REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .sub-hero__title,
  .sub-hero__anchor,
  .sub-hero__scroll {
    opacity: 1;
  }
}