/* =========================================================
   HIDRYX — SHARED CHROME
   Navbar, mobile nav, cursor, loader, buttons, section
   headers, "why" grid, final CTA and footer — copied
   verbatim from homepage/style.css (the canonical design
   reference) so every page shares the exact same look.
========================================================= */

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

:root {
  --bg: #0A0A0C;
  --surface: #0F0D12;
  --surface-2: #121014;

  --border: #241E2C;

  --deep: #2E0B4E;
  --purple: #4B1878;
  --accent: #8A4FD1;

  --text: #EDEBF2;
  --soft: #B9AFCB;
  --muted: #6E6480;

  /* Sigil glyph fill, tinted with --accent so the mark follows
     the active theme instead of hardcoding dark-theme purple. */
  --sigil-fill: rgba(138,79,209,.16);

  --ease: cubic-bezier(.2,.8,.2,1);

  --max: 1240px;
}

[data-theme="light"] {
  --bg: #F7F5FA;
  --surface: #FFFFFF;
  --surface-2: #EFEAF5;

  --border: #DED6E8;

  --deep: #E7DCF5;
  --purple: #6B2FA8;
  --accent: #7A3FC4;

  --text: #17131C;
  --soft: #4A4256;
  --muted: #77708A;

  --sigil-fill: rgba(122,63,196,.13);
}

[data-theme="light"] body::before {
  opacity: .015;
}

[data-theme="light"] .footer {
  background: #EFEAF5;
}

[data-theme="light"] ::selection {
  color: var(--bg);
}

[data-theme="light"] .nav-toggle-btn {
  background: rgba(0,0,0,.02);
}


html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  cursor: none;
  transition: background .3s ease, color .3s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: .025;
  background-image: repeating-linear-gradient(
    0deg, #fff 0, #fff 1px, transparent 1px, transparent 4px
  );
}

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

::selection {
  background: var(--accent);
  color: var(--bg);
}


/* ================= LANGUAGE / RTL ================= */

[lang="en"] .lang-ar {
  display: none;
}

[lang="ar"] .lang-en {
  display: none;
}

[dir="rtl"] body {
  font-family: "IBM Plex Sans Arabic", "Space Grotesk", sans-serif;
}

/* Numeric / code / UI-chrome elements stay left-to-right even in
   Arabic, matching normal practice for bilingual technical sites. */
[dir="rtl"] pre,
[dir="rtl"] code,
[dir="rtl"] .terminal-body,
[dir="rtl"] .hero-terminal,
[dir="rtl"] .prompt-line,
[dir="rtl"] .countdown-boxes,
[dir="rtl"] .hero-ascii {
  direction: ltr;
  text-align: left;
}


/* ================= PAGE LOADER ================= */

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--accent);
  animation: loaderOut .7s ease 1.2s forwards;
  pointer-events: none;
}

.loader-mark {
  font-size: 42px;
  color: var(--accent);
  animation: loaderPulse 800ms infinite alternate;
}

.loader-text {
  margin-top: 15px;
  font-size: 12px;
  letter-spacing: 7px;
  color: var(--soft);
}

.loader-text span {
  color: var(--accent);
}

@keyframes loaderPulse {
  from { opacity: .35; transform: scale(.9); }
  to { opacity: 1; transform: scale(1.1); }
}

@keyframes loaderOut {
  to { opacity: 0; visibility: hidden; }
}


/* ================= CURSOR ================= */

.cursor-dot {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  top: -2px;
  left: -2px;
  z-index: 10000;
  pointer-events: none;
}

.cursor-ring {
  position: fixed;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1px solid rgba(138,79,209,.6);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
  transition: width .2s, height .2s, border-color .2s;
}


/* ================= NAV ================= */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1240px) / 2));
  background: rgba(10,10,12,.82);
  border-bottom: 1px solid rgba(36,30,44,.8);
  backdrop-filter: blur(18px);
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 5px;
}

.brand-symbol {
  width: 29px;
  height: 29px;
}

.brand-symbol svg {
  width: 100%;
  height: 100%;
}

.nav-links {
  display: flex;
  gap: 27px;
  font-size: 9px;
  letter-spacing: 1.8px;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  transition: color .2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 1px;
  background: var(--accent);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 1.5px;
}

.status-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1.8s infinite;
}


/* ================= NAV TOGGLES (theme / language) ================= */

/* Lives in the top navbar, next to the hamburger button, and —
   unlike .nav-links / .nav-status — is never hidden by the
   responsive rules below, so it stays in the same top strip on
   phone, tablet and laptop alike. */
.nav-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
}

.nav-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--soft);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .5px;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}

.nav-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.nav-toggle-btn svg {
  width: 15px;
  height: 15px;
}


/* ================= MOBILE NAV ================= */

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  margin-left: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
}

.mobile-menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  transition: transform .25s ease, opacity .25s ease;
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px 20px;
  z-index: 200;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform .2s ease, opacity .2s ease;
}

.mobile-nav.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav a {
  padding: 14px 4px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 2px;
  border-bottom: 1px solid var(--border);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

.mobile-nav a.active,
.mobile-nav a:hover {
  color: var(--text);
}


/* ================= BUTTONS ================= */

.btn {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.7px;
  transition: background .2s, border-color .2s, color .2s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.btn b {
  font-size: 14px;
  font-weight: 400;
}

.btn.primary {
  background: var(--accent);
  color: #170B20;
}

.btn.primary:hover {
  background: #9a61df;
}

.btn.secondary {
  border: 1px solid var(--border);
  color: var(--soft);
}

.btn.secondary:hover {
  border-color: var(--accent);
  color: var(--text);
}


/* ================= PAGE HERO (secondary pages) ================= */

/* Row of call-to-action buttons under a hero or a section lede. Lives
   here because almost every page needs it; pages that want a different
   rhythm only override the spacing, since their stylesheet loads after
   this one. */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
}

.page-hero {
  max-width: var(--max);
  margin: auto;
  padding: 170px 35px 90px;
}

.page-hero .eyebrow {
  color: var(--accent);
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 3px;
}

.page-hero h1 {
  margin-top: 20px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: .95;
  letter-spacing: -3px;
}

.page-hero h1 span {
  color: var(--accent);
}

.page-hero p {
  margin-top: 24px;
  max-width: 640px;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.8;
}


/* ================= SECTION ================= */

.section {
  max-width: var(--max);
  margin: auto;
  padding: 130px 35px;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 65px;
}

.section-header span {
  color: var(--accent);
  font-family: monospace;
  font-size: 10px;
}

.section-header h2 {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 3px;
  font-weight: 500;
}


/* ================= WHY-STYLE NUMBERED GRID ================= */

.why-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.why-grid article {
  min-height: 280px;
  padding: 30px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background .25s;
}

.why-grid article:hover {
  background: var(--surface);
}

.number {
  color: var(--purple);
  font-family: monospace;
  font-size: 11px;
}

.why-grid h3 {
  margin-top: 65px;
  font-size: 21px;
  line-height: 1;
  letter-spacing: 1px;
}

.why-grid p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}


/* ================= CARD GRID (services-card style) ================= */

.service-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px;
  background: var(--bg);
  transition: background .25s, transform .25s;
}

.service-card:hover {
  background: var(--surface);
}

.service-top {
  display: flex;
  justify-content: space-between;
  font-family: monospace;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1px;
}

.service-icon {
  font-size: 26px;
  color: var(--accent);
  font-family: monospace;
}

.service-card h3 {
  font-size: 17px;
  letter-spacing: .5px;
}

.service-card p {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.service-link {
  margin-top: auto;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--accent);
}


/* ================= FINAL CTA ================= */

.final-cta {
  position: relative;
  min-height: 620px;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.cta-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(138,79,209,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138,79,209,.05) 1px, transparent 1px);
  background-size: 55px 55px;
  mask-image: radial-gradient(circle, black, transparent 75%);
}

.cta-content {
  position: relative;
  z-index: 2;
}

.cta-content > span {
  color: var(--accent);
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 3px;
}

.cta-content h2 {
  margin-top: 25px;
  font-size: clamp(50px, 8vw, 100px);
  line-height: .85;
  letter-spacing: -4px;
}

.cta-content h2 em {
  color: var(--accent);
  font-style: normal;
}

.cta-content p {
  margin: 30px auto;
  color: var(--soft);
  font-size: 14px;
}


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

.footer {
  padding: 70px 35px 25px;
  background: #080809;
}

.footer-main {
  max-width: var(--max);
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 80px;
}

.footer-brand p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 10px;
}

.footer-links {
  display: flex;
  gap: 100px;
}

.footer-links div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links span {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 8px;
  letter-spacing: 2px;
}

.footer-links a {
  color: var(--muted);
  font-size: 10px;
  transition: color .2s;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-links .social-tbd {
  color: var(--muted);
  font-size: 10px;
  opacity: .5;
  cursor: default;
}

.footer-bottom {
  max-width: var(--max);
  margin: 65px auto 0;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 1px;
}


/* ================= ANIMATIONS ================= */

@keyframes pulse {
  0%,100% { opacity: .4; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.2); }
}


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

.reveal {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


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

/* Any touch device (phone, iPad, tablet) — hide the custom
   mouse-follower cursor regardless of screen width, since a
   fixed pixel breakpoint can't reliably detect touch input. */
@media (hover: none), (pointer: coarse) {
  body {
    cursor: auto;
  }

  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

@media (max-width: 1100px) {
  .nav-links {
    gap: 15px;
  }

  .why-grid,
  .service-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

/* Tablet and below: switch to the mobile nav so the navbar
   never has to fit all six links + toggles + status in one
   row (this is what previously made iPad-width windows feel
   cramped). */
@media (max-width: 1024px) {
  .navbar {
    padding: 0 20px;
  }

  .nav-links,
  .nav-status {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }
}

@media (max-width: 800px) {
  body {
    cursor: auto;
  }

  .cursor-dot,
  .cursor-ring {
    display: none;
  }

  .page-hero {
    padding: 130px 20px 60px;
  }

  .why-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .footer-main {
    flex-direction: column;
  }

  .footer-links {
    gap: 60px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 500px) {
  .section {
    padding: 90px 20px;
  }

  .section-header {
    margin-bottom: 45px;
  }

  .final-cta {
    min-height: 520px;
  }

  .cta-content h2 {
    font-size: 57px;
  }

  .footer-links {
    gap: 40px;
  }

  .nav-toggle-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
