/* ---------- Reset ---------- */
* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* Hidden but not deleted — content stays in the DOM for easy re-enabling later. */
.is-hidden { display: none; }

/* ---------- Theme tokens ---------- */
:root {
  --brand-green: #5fa233;
  --brand-green-light: #7cc350;
  --brand-green-dark: #3f7a1f;
  --navy: #0b1c2c;
  /* Orbit colour for the hero qubit. One place to change it — an rgb triplet so
     the rings can vary their own alpha for depth. */
  --orbit-rgb: 122, 222, 214;

  --bg: #ffffff;
  --bg-alt: #f4f7f5;
  --bg-hero-1: #0b1c2c;
  --bg-hero-2: #13314a;
  --text-primary: #0b1c2c;
  --text-secondary: #48585f;
  --text-on-dark: #eef3f0;
  --border: #e3e9e4;
  --card-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.85);
  --shadow: 0 10px 30px rgba(11, 28, 44, 0.08);
  --radius: 14px;
}

:root[data-theme="dark"] {
  --bg: #0a141f;
  --bg-alt: #0e1c2b;
  --bg-hero-1: #060d16;
  --bg-hero-2: #0d2135;
  --text-primary: #eef3f0;
  --text-secondary: #a7b6bd;
  --text-on-dark: #eef3f0;
  --border: #1c3245;
  --card-bg: #0f2032;
  --header-bg: rgba(10, 20, 31, 0.85);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
}
:root[dir="rtl"] body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 24px;
}

section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
/* A hidden section (e.g. case-studies) still sits between its neighbors in the
   DOM, so the next section's top padding would stack on top of the previous
   section's bottom padding with nothing rendered in between. Collapse it. */
.is-hidden + section { padding-top: 0; }

.eyebrow {
  display: inline-block;
  color: var(--brand-green);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 0.78rem;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 12px; }
.section-head p { color: var(--text-secondary); font-size: 1.05rem; }
.section-head.centered { margin-inline: auto; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-green-light), var(--brand-green-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(95, 162, 51, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(95, 162, 51, 0.45); }
.btn-ghost {
  background: transparent;
  color: var(--text-on-dark);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}
.btn-ghost:hover { border-color: var(--brand-green-light); color: var(--brand-green-light); }
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--brand-green); color: var(--brand-green); }

/* ---------- Icon (qubit logo mark) ---------- */
.qubit-icon { display: inline-block; }
.qubit-icon svg { width: 100%; height: 100%; display: block; }

/* ---------- Interactive 3D quantum sphere (hero) ---------- */
.quantum-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  perspective: 900px;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  outline-offset: 10px;
}
.quantum-scene:active { cursor: grabbing; }
.quantum-scene::before {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 195, 80, 0.35), rgba(124, 195, 80, 0) 70%);
  animation: quantum-halo-pulse 4.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.quantum-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  /* Softens the hard rectangular cut you would otherwise see once you zoom
     inside the qubit. Stays clear of the orbits, which reach ~80% of half-width. */
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 86%, transparent 100%);
  mask-image: radial-gradient(circle at 50% 50%, #000 86%, transparent 100%);
}

@keyframes quantum-halo-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.985); }
  50% { opacity: 0.78; transform: scale(1.015); }
}
@media (prefers-reduced-motion: reduce) {
  .quantum-scene::before { animation: none; }
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.35rem;
}
.logo .qubit-icon { width: 34px; height: 34px; flex-shrink: 0; }
.logo .logo-text { color: var(--text-primary); }
.logo .logo-text .accent { color: var(--brand-green); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--text-primary); border-color: var(--brand-green); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.header-contact-btn { padding: 10px 20px; font-size: 0.9rem; white-space: nowrap; }

.lang-toggle {
  height: 40px;
  padding: 0 14px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}
.lang-toggle:hover { border-color: var(--brand-green); color: var(--brand-green); }

.theme-toggle {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.theme-toggle:hover { border-color: var(--brand-green); color: var(--brand-green); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--text-primary); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 168px 0 110px;
  background: radial-gradient(circle at 15% 20%, rgba(95, 162, 51, 0.25), transparent 45%),
              radial-gradient(circle at 85% 0%, rgba(95, 162, 51, 0.15), transparent 40%),
              linear-gradient(160deg, var(--bg-hero-1), var(--bg-hero-2));
  color: var(--text-on-dark);
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
}
.hero-icon-wrap {
  justify-self: center;
  width: min(460px, 92%);
  opacity: 0.95;
}
.quantum-scene { animation: float 6s ease-in-out infinite; }

/* ---------- qubit controls ---------- */
.quantum-actions {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  margin-top: 18px; flex-wrap: wrap;
  /* H, X, Z are Latin gate notation and read in that order in any language, so
     this row stays LTR even when the page flips to RTL. */
  direction: ltr;
}
/* Arabic is a connected script - letter-spacing breaks the joins. */
:root[data-lang="ar"] .qbtn-wide { letter-spacing: 0; text-transform: none; }
:root[data-lang="ar"] .hero .quantum-hint { letter-spacing: 0; }
.qbtn {
  min-width: 36px; height: 36px; padding: 0 13px; border-radius: 999px;
  border: 1px solid rgba(var(--orbit-rgb), 0.32);
  background: rgba(var(--orbit-rgb), 0.07);
  color: var(--text-on-dark);
  font-weight: 700; font-size: 13px; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.qbtn:hover { background: rgba(var(--orbit-rgb), 0.18); border-color: rgba(var(--orbit-rgb), 0.72); }
.qbtn:active { transform: scale(0.94); }
.qbtn:focus-visible { outline: 2px solid var(--brand-green-light); outline-offset: 3px; }
.qbtn-wide { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; }
/* .hero p sets font-size at (0,1,1); this must match or beat it or the hint
   inherits the lede's type size. */
.hero .quantum-hint {
  margin: 10px 0 0; text-align: center; max-width: none;
  font-size: 11.5px; line-height: 1.5;
  letter-spacing: 0.04em; color: rgba(238, 243, 240, 0.34);
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.hero-eyebrow {
  display: inline-block;
  color: var(--brand-green-light);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero h1 .accent { color: var(--brand-green-light); }
.hero p {
  font-size: 1.1rem;
  color: rgba(238, 243, 240, 0.78);
  max-width: 540px;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: center;
}
.about-visual {
  background: linear-gradient(160deg, var(--bg-hero-1), var(--bg-hero-2));
  border-radius: 24px;
  padding: 56px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  min-height: 320px;
}
.about-visual .qubit-icon { width: 200px; height: 200px; position: relative; z-index: 3; }
.about-visual .qubit-icon-pulse { animation: qubit-pulse 3.6s ease-in-out infinite; filter: drop-shadow(0 0 0 rgba(124, 195, 80, 0)); }

/* Orbiting "compute" rings & nodes */
.orbit-layer {
  position: absolute;
  top: 50%; left: 50%;
  display: grid;
  place-items: center;
  z-index: 2;
  animation: orbit-spin linear infinite;
}
.orbit-layer1 { width: 270px; height: 270px; margin: -135px 0 0 -135px; animation-duration: 18s; }
.orbit-layer2 { width: 350px; height: 350px; margin: -175px 0 0 -175px; animation-duration: 28s; animation-direction: reverse; }
.orbit-ring {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(124, 195, 80, 0.35);
  border-radius: 50%;
}
.orbit-node {
  position: absolute;
  top: -6px; left: 50%;
  width: 12px; height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c8f19a, var(--brand-green-light) 60%, var(--brand-green-dark) 100%);
  box-shadow: 0 0 10px rgba(124, 195, 80, 0.7);
}
.orbit-node-b { top: auto; bottom: -6px; }

/* Floating computing / software factor tags */
.tech-tag {
  position: absolute;
  z-index: 2;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-weight: 700;
  color: var(--brand-green-light);
  background: rgba(124, 195, 80, 0.12);
  border: 1px solid rgba(124, 195, 80, 0.3);
  border-radius: 8px;
  padding: 3px 8px;
  line-height: 1;
  animation: tag-float 5s ease-in-out infinite;
}
.tag-code { top: 14%; left: 10%; font-size: 0.95rem; animation-delay: 0s; }
.tag-binary1 { top: 20%; right: 12%; font-size: 0.8rem; animation-delay: 0.8s; }
.tag-braces { bottom: 18%; left: 12%; font-size: 0.9rem; animation-delay: 1.6s; }
.tag-binary2 { bottom: 22%; right: 10%; font-size: 0.8rem; animation-delay: 2.4s; }
.tag-func { top: 48%; left: 4%; font-size: 0.85rem; animation-delay: 1.2s; }

@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes qubit-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(124, 195, 80, 0.25)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 22px rgba(124, 195, 80, 0.55)); }
}
@keyframes tag-float {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(-10px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .orbit-layer, .qubit-icon-pulse, .tech-tag { animation: none; }
}
.about-text p { color: var(--text-secondary); margin-bottom: 16px; }
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.stat h3 { font-size: 1.8rem; color: var(--brand-green); }
.stat span { font-size: 0.88rem; color: var(--text-secondary); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-narrow { max-width: 560px; margin-inline: auto; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); }

.service-card .service-visual {
  height: 140px;
  border-radius: 12px;
  margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(95, 162, 51, 0.16), rgba(11, 28, 44, 0.05));
  display: grid;
  place-items: center;
}
:root[data-theme="dark"] .service-card .service-visual {
  background: linear-gradient(135deg, rgba(95, 162, 51, 0.18), rgba(255, 255, 255, 0.04));
}
.service-card .service-visual svg { width: 82%; height: 82%; }
.service-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.service-card p { color: var(--text-secondary); font-size: 0.96rem; }

/* Products */
.product-card { display: flex; flex-direction: column; gap: 14px; }
.product-card .badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand-green);
  background: rgba(95, 162, 51, 0.12);
  padding: 5px 12px;
  border-radius: 999px;
}
.product-card .product-thumb {
  height: 140px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(95, 162, 51, 0.18), rgba(11, 28, 44, 0.06));
  display: grid;
  place-items: center;
}
:root[data-theme="dark"] .product-card .product-thumb {
  background: linear-gradient(135deg, rgba(95, 162, 51, 0.18), rgba(255, 255, 255, 0.04));
}
.product-card .product-thumb .qubit-icon { width: 56px; height: 56px; opacity: 0.7; }
.product-card .product-thumb .qubit-icon svg { stroke: var(--brand-green); }
.product-thumb-photo { padding: 24px; }
.product-thumb-photo img { max-width: 96px; max-height: 96px; width: 100%; height: 100%; object-fit: contain; border-radius: 18px; }
.product-card h3 { font-size: 1.1rem; }
.product-card p { color: var(--text-secondary); font-size: 0.94rem; }
.product-card .badge-live { color: #fff; background: var(--brand-green); }
.product-card .product-link { align-self: flex-start; margin-top: auto; }
.product-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.product-links .product-link {
  align-self: auto;
  margin-top: 0;
  padding: 7px 12px;
  gap: 5px;
  font-size: 0.78rem;
}
.product-link .store-icon { width: 13px; height: 13px; flex-shrink: 0; }

/* Team */
.team-card { text-align: center; }
.team-avatar {
  width: 92px; height: 92px;
  border-radius: 50%;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--brand-green-light), var(--brand-green-dark));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.3rem;
}
.team-avatar-photo { background: none; overflow: hidden; padding: 0; }
.team-avatar-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.team-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.team-card span { color: var(--brand-green); font-size: 0.88rem; font-weight: 600; }

/* News */
.news-track {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-green) transparent;
}
.news-track::-webkit-scrollbar { height: 8px; }
.news-track::-webkit-scrollbar-track { background: transparent; }
.news-track::-webkit-scrollbar-thumb { background: var(--brand-green); border-radius: 999px; }

.news-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 calc((100% - 56px) / 3);
  scroll-snap-align: start;
  overflow: hidden;
}
.news-thumb {
  height: 180px;
  margin: -32px -28px 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(95, 162, 51, 0.18), rgba(11, 28, 44, 0.06));
}
:root[data-theme="dark"] .news-thumb {
  background: linear-gradient(135deg, rgba(95, 162, 51, 0.22), rgba(255, 255, 255, 0.04));
}
.news-thumb img, .news-thumb svg { max-width: 45%; max-height: 45%; object-fit: contain; }
.news-thumb-photo img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: cover; }
.news-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.news-card .badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand-green);
  background: rgba(95, 162, 51, 0.12);
  padding: 5px 12px;
  border-radius: 999px;
}
.news-meta time { font-size: 0.82rem; color: var(--text-secondary); }
.news-card h3 { font-size: 1.1rem; }
.news-card p { color: var(--text-secondary); font-size: 0.94rem; }

@media (max-width: 960px) {
  .news-card { flex-basis: calc((100% - 28px) / 2); }
}
@media (max-width: 720px) {
  .news-card { flex-basis: 82%; }
}

/* Case studies */
.case-card .case-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-green);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.case-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.case-card p { color: var(--text-secondary); font-size: 0.94rem; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.contact-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}
.contact-item { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.contact-item:last-child { margin-bottom: 0; }
.contact-item .icon-badge {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(95, 162, 51, 0.12);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.contact-item .icon-badge svg { width: 20px; height: 20px; stroke: var(--brand-green); }
.contact-item h4 { font-size: 0.95rem; margin-bottom: 4px; }
.contact-item p, .contact-item a { color: var(--text-secondary); font-size: 0.96rem; }

.contact-map {
  margin-top: 26px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  filter: grayscale(0.15);
}
.contact-map iframe { display: block; }

.social-row { display: flex; gap: 12px; margin-top: 26px; }
.social-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.social-icon:hover { color: var(--brand-green); border-color: var(--brand-green); }
.social-icon svg { width: 18px; height: 18px; }

.contact-highlight {
  border-radius: var(--radius);
  padding: 40px;
  background: linear-gradient(160deg, var(--bg-hero-1), var(--bg-hero-2));
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.contact-highlight h3 { font-size: 1.5rem; margin-bottom: 14px; }
.contact-highlight p { color: rgba(238, 243, 240, 0.75); margin-bottom: 24px; }

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: rgba(238, 243, 240, 0.85); }
.form-field input,
.form-field textarea {
  font: inherit;
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 11px 14px;
  resize: vertical;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: rgba(238, 243, 240, 0.4); }
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brand-green-light);
  background: rgba(255, 255, 255, 0.1);
}
.form-field input:invalid:not(:placeholder-shown),
.form-field textarea:invalid:not(:placeholder-shown) { border-color: #e0745f; }
.form-submit { align-self: flex-start; }
.form-status { font-size: 0.9rem; color: var(--brand-green-light); min-height: 1.2em; }
.form-status.is-error { color: #f0a08f; }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-hero-1);
  color: rgba(238, 243, 240, 0.75);
  padding: 56px 0 28px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.site-footer .logo .logo-text { color: var(--text-on-dark); }
.footer-tagline { margin-top: 12px; max-width: 300px; font-size: 0.92rem; }
.footer-links { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h5 { color: var(--text-on-dark); font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 16px; }
.footer-col a, .footer-col span { display: block; font-size: 0.92rem; margin-bottom: 10px; color: rgba(238, 243, 240, 0.7); }
.footer-col a:hover { color: var(--brand-green-light); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  font-size: 0.85rem;
}
.footer-bottom .social-row .social-icon { border-color: rgba(255, 255, 255, 0.18); color: rgba(238, 243, 240, 0.7); }

/* ---------- Mobile ---------- */
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-icon-wrap { order: -1; width: 280px; }
  .hero p { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .about-visual { padding: 36px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .grid-2.grid-narrow { max-width: 420px; }
}

@media (max-width: 720px) {
  .main-nav { position: fixed; top: 76px; left: 0; right: 0; bottom: 0; background: var(--bg); flex-direction: column; align-items: flex-start; padding: 28px 24px; gap: 22px; transform: translateX(100%); transition: transform 0.25s ease; overflow-y: auto; }
  .main-nav.open { transform: translateX(0); }
  .main-nav a { font-size: 1.05rem; }
  .nav-toggle { display: flex; }
  .header-contact-btn { padding: 8px 14px; font-size: 0.82rem; }
  .header-actions { gap: 8px; }
  .lang-toggle { height: 34px; padding: 0 10px; font-size: 0.78rem; }
  .theme-toggle, .nav-toggle { width: 34px; height: 34px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; }
  section { padding: 72px 0; }
}

/* ================= Quantum guide page (quantum.html) ================= */
.q-hero {
  position: relative;
  padding: 150px 0 90px;
  background: radial-gradient(circle at 15% 20%, rgba(95, 162, 51, 0.25), transparent 45%),
              radial-gradient(circle at 85% 0%, rgba(95, 162, 51, 0.15), transparent 40%),
              linear-gradient(160deg, var(--bg-hero-1), var(--bg-hero-2));
  color: var(--text-on-dark);
  overflow: hidden;
}
.q-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.q-hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1.12; margin: 16px 0 18px; }
.q-lede { font-size: 1.12rem; line-height: 1.65; color: rgba(238, 243, 240, 0.78); max-width: 46ch; }
.q-lede em { color: var(--brand-green-light); font-style: italic; }
.q-meta { margin-top: 22px; font-size: 0.82rem; letter-spacing: 0.05em; color: rgba(238, 243, 240, 0.42); }
.quantum-more { margin-top: 12px; text-align: center; }
.quantum-more a {
  font-size: 0.86rem; font-weight: 600; color: var(--brand-green-light);
  border-bottom: 1px solid rgba(124, 195, 80, 0.35); padding-bottom: 2px;
}
.quantum-more a:hover { border-bottom-color: var(--brand-green-light); }

/* ---- bit vs qubit ---- */
.q-demo { align-items: stretch; }
.q-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center; padding: 32px 24px;
}
.q-panel:hover { transform: none; }
.q-panel-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-secondary);
}
.q-panel-note { font-size: 0.92rem; color: var(--text-secondary); min-height: 2.6em; }
.q-panel-note b { color: var(--brand-green); }

.q-switch {
  width: 104px; height: 56px; border-radius: 30px; position: relative; cursor: pointer;
  background: var(--bg-alt); border: 1px solid var(--border); transition: background 0.16s ease;
}
.q-switch .q-knob {
  position: absolute; top: 5px; inset-inline-start: 5px; width: 44px; height: 44px;
  border-radius: 50%; background: var(--text-secondary); color: var(--bg);
  display: grid; place-items: center; font-weight: 700;
  transition: transform 0.16s ease, background 0.16s ease;
}
.q-switch.on { background: rgba(124, 195, 80, 0.16); border-color: var(--brand-green); }
.q-switch.on .q-knob { transform: translateX(48px); background: var(--brand-green); color: #fff; }
:root[dir="rtl"] .q-switch.on .q-knob { transform: translateX(-48px); }

.q-coin-stage { height: 118px; display: grid; place-items: center; perspective: 700px; }
.q-coin {
  width: 104px; height: 104px; position: relative; transform-style: preserve-3d; cursor: pointer;
  border-radius: 50%; transition: transform 0.22s cubic-bezier(.2,.8,.3,1);
}
.q-coin.spinning { animation: q-coin-spin 0.5s linear infinite; transition: none; }
.q-coin.landed-1 { transform: rotateY(180deg); }
@keyframes q-coin-spin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.q-face {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  backface-visibility: hidden; font-size: 2.4rem; font-weight: 700; color: #0b1c2c;
  background: radial-gradient(circle at 34% 28%, #c8f19a, #7cc350 62%, #3f7a1f);
  box-shadow: 0 0 30px rgba(124, 195, 80, 0.32);
}
.q-face-b { transform: rotateY(180deg); }
@media (prefers-reduced-motion: reduce) { .q-coin.spinning { animation-duration: 2.4s; } }

.q-tally { width: 100%; max-width: 260px; }
.q-tally-bar { height: 6px; border-radius: 4px; background: var(--bg-alt); overflow: hidden; }
.q-tally-bar span {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--brand-green-dark), var(--brand-green-light));
  transition: width 0.12s linear;
}
.q-tally-nums {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-size: 0.76rem; color: var(--text-secondary); font-variant-numeric: tabular-nums;
}

.q-reveal {
  display: none; margin-top: 30px; padding: 24px 26px; border-radius: var(--radius);
  border: 1px solid rgba(124, 195, 80, 0.3);
  background: linear-gradient(180deg, rgba(124, 195, 80, 0.10), rgba(124, 195, 80, 0.03));
}
.q-reveal.show { display: block; animation: q-rise 520ms ease both; }
.q-reveal strong { display: block; font-size: 1.16rem; margin-bottom: 8px; color: var(--brand-green); }
.q-reveal p { color: var(--text-secondary); max-width: 66ch; }
@keyframes q-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .q-reveal.show { animation: none; } }

/* ---- glossary ---- */
.q-glossary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.q-term {
  padding: 24px 26px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card-bg);
}
.q-term dt { font-size: 1.12rem; font-weight: 700; margin-bottom: 4px; }
.q-alias {
  display: block; font-size: 0.76rem; letter-spacing: 0.04em;
  color: var(--brand-green); margin-bottom: 10px;
}
.q-term dd { color: var(--text-secondary); line-height: 1.6; }

/* ---- timeline ---- */
.q-timeline { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.q-timeline li {
  display: grid; grid-template-columns: 108px 1fr; gap: 20px; align-items: start;
  padding: 18px 0; border-top: 1px solid var(--border);
}
.q-timeline li:last-child { border-bottom: 1px solid var(--border); }
.q-year {
  font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--brand-green); letter-spacing: 0.02em;
}
.q-timeline p { color: var(--text-secondary); line-height: 1.6; }

@media (max-width: 860px) {
  .q-hero-grid { grid-template-columns: 1fr; }
  .q-hero { padding-top: 120px; }
  .q-glossary { grid-template-columns: 1fr; }
  .q-timeline li { grid-template-columns: 74px 1fr; gap: 14px; }
}

/* ---- quantum glossary term pages ---- */
.q-term { position: relative; }
.q-term-link { color: inherit; }
.q-term-link::after { content: ""; position: absolute; inset: 0; }   /* whole card clickable */
.q-term:hover { border-color: var(--brand-green); }
.q-term:hover .q-term-link { color: var(--brand-green); }

.q-term-hero { padding: 140px 0 72px; }
.q-crumb { font-size: 0.82rem; color: rgba(238, 243, 240, 0.5); margin-bottom: 20px; }
.q-crumb a { color: var(--brand-green-light); }
.q-crumb a:hover { text-decoration: underline; }
.q-crumb span { margin-inline: 8px; }
.q-term-hero h1 { font-size: clamp(2.1rem, 4.2vw, 3.1rem); margin: 14px 0 6px; }
.q-alias-lg {
  font-size: 0.9rem; color: var(--brand-green-light);
  margin-bottom: 18px; letter-spacing: 0.02em;
}

.q-article { max-width: 720px; }
.q-article h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  margin-bottom: 14px;
}
.q-article h2 + p { margin-top: 0; }
.q-article p {
  color: var(--text-secondary); line-height: 1.75;
  font-size: 1.03rem; margin-bottom: 18px;
}
.q-article p:last-child { margin-bottom: 0; }
.q-article h2:not(:first-child) { margin-top: 40px; }

.q-related { display: flex; flex-wrap: wrap; gap: 10px; }
.q-rel {
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card-bg);
  font-size: 0.92rem; font-weight: 600;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.q-rel:hover { border-color: var(--brand-green); color: var(--brand-green); }
.q-back { margin-top: 30px; }
.q-back a {
  font-weight: 600; color: var(--brand-green);
  border-bottom: 1px solid rgba(95, 162, 51, 0.4); padding-bottom: 2px;
}
.q-back a:hover { border-bottom-color: var(--brand-green); }

/* ---- term-page demos and enriched content ---- */
.q-demo-section { padding-top: 64px; padding-bottom: 64px; }
.q-stage {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 28px 22px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card-bg);
}
.q-stage .hero-icon-wrap { width: min(360px, 88%); }
.q-stage-wide { max-width: 720px; margin-inline: auto; }
.q-canvas {
  width: 100%; max-width: 640px; aspect-ratio: 16 / 9;
  display: block; border-radius: 10px; background: #07131e;
}
.q-stage-controls {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center;
}
.q-counter {
  font-variant-numeric: tabular-nums; font-weight: 700;
  color: var(--brand-green); min-width: 3.5ch; text-align: center;
}
.q-caption {
  max-width: 640px; margin: 18px auto 0; text-align: center;
  font-size: 0.92rem; color: var(--text-secondary); line-height: 1.6;
}
.q-slider { display: inline-flex; align-items: center; gap: 9px; font-size: 0.82rem; color: var(--text-secondary); }
.q-slider input { width: 120px; accent-color: var(--brand-green); }
.q-slider b { font-variant-numeric: tabular-nums; color: var(--brand-green); }

/* entangled pair */
.q-pair { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; }
.q-pair-side { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.q-pair-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em; color: var(--text-secondary); }
.q-pair-gap {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-secondary);
}
.q-pair-gap i {
  display: block; width: 74px; height: 1px;
  background: repeating-linear-gradient(90deg, var(--border) 0 5px, transparent 5px 11px);
}

/* measurement histogram */
.q-hist { display: flex; gap: 40px; align-items: flex-end; height: 190px; }
.q-hist-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; width: 78px; height: 100%; }
.q-hist-bar {
  width: 100%; height: 2px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--brand-green-light), var(--brand-green-dark));
  transition: height 0.25s cubic-bezier(.2,.8,.3,1);
}
.q-hist-lbl { font-weight: 700; font-size: 1.05rem; }
.q-hist-n { font-size: 0.78rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* decoherence meter */
.q-coh { width: 100%; max-width: 460px; }
.q-coh-track { height: 10px; border-radius: 6px; background: var(--bg-alt); overflow: hidden; }
.q-coh-fill {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--brand-green-dark), var(--brand-green-light));
  transition: width 0.2s linear;
}
.q-coh-meta {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary);
}
.q-coh-meta b { color: var(--brand-green); font-variant-numeric: tabular-nums; }
.q-coh-state { margin-top: 14px; text-align: center; font-size: 0.95rem; color: var(--text-secondary); }

/* analogy / examples / myth / refs */
.q-analogy {
  margin: 30px 0; padding: 22px 24px; border-radius: var(--radius);
  border-inline-start: 3px solid var(--brand-green);
  background: rgba(124, 195, 80, 0.07);
}
.q-analogy-label {
  display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--brand-green); margin-bottom: 8px;
}
.q-analogy p { margin: 0; color: var(--text-primary); line-height: 1.7; }

.q-examples { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.q-examples li {
  position: relative; padding-inline-start: 22px;
  color: var(--text-secondary); line-height: 1.7;
}
.q-examples li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 10px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand-green);
}

.q-myth {
  margin: 30px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.q-myth-row { padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; }
.q-myth-row + .q-myth-row { border-top: 1px solid var(--border); background: rgba(124, 195, 80, 0.06); }
.q-myth-row p { margin: 0; line-height: 1.65; }
.q-myth-tag {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.q-tag-wrong { color: #c4703f; }
.q-tag-right { color: var(--brand-green); }

.q-refs { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.q-refs a {
  color: var(--brand-green); font-weight: 600;
  border-bottom: 1px solid rgba(95, 162, 51, 0.35); padding-bottom: 1px;
}
.q-refs a:hover { border-bottom-color: var(--brand-green); }
.q-refs-note { font-size: 0.8rem !important; color: var(--text-secondary); opacity: 0.75; margin-top: 14px; }

@media (max-width: 620px) {
  .q-hist { gap: 24px; height: 160px; }
  .q-canvas { aspect-ratio: 4 / 3; }
}

/* The demo stage is always dark, whatever the page theme: the qubit canvas and
   the orbit colours are built for a dark ground, and .qbtn uses --text-on-dark.
   Without this the controls render white-on-white on the light term pages. */
.q-stage {
  background: linear-gradient(160deg, var(--bg-hero-1), var(--bg-hero-2));
  border-color: rgba(122, 222, 214, 0.20);
  color: var(--text-on-dark);
}
.q-stage .qbtn { color: var(--text-on-dark); }
.q-stage .q-hist-lbl { color: var(--text-on-dark); }
.q-stage .q-counter { color: var(--brand-green-light); }
.q-stage .q-hist-n,
.q-stage .q-coh-meta,
.q-stage .q-coh-state,
.q-stage .q-slider,
.q-stage .q-pair-label,
.q-stage .q-pair-gap { color: rgba(238, 243, 240, 0.62); }
.q-stage .q-coh-meta b,
.q-stage .q-slider b { color: var(--brand-green-light); }
.q-stage .q-coh-track { background: rgba(255, 255, 255, 0.10); }
.q-stage .q-pair-gap i {
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 5px, transparent 5px 11px);
}
.q-stage .q-face { box-shadow: 0 0 30px rgba(124, 195, 80, 0.45); }
