/* Optamix Tech: one stylesheet for the whole site. Light, brand teal, phone first.
   Brand colours from Marketing/Brand Identity/Optamix_Tech_Branding.pdf. */

:root {
  --teal: #11979a;
  --teal-dark: #0b7477;
  --teal-soft: #e7f5f5;
  --blue: #269ed8;
  --navy: #303642;
  --ink: #0e1417;
  --text: #39434a;
  --muted: #69747c;
  --line: #e4eaec;
  --bg: #ffffff;
  --bg-soft: #f4f8f8;
  --radius: 20px;
  --gutter: 20px;
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 2px rgba(14, 20, 23, 0.04), 0 12px 32px -12px rgba(14, 20, 23, 0.14);
  --font: "Avenir Next", "Avenir", "Segoe UI Variable Text", "Segoe UI", ui-sans-serif, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Avenir Next", "Avenir", "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: var(--teal-dark); }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--teal); color: #fff; }

h1, h2, h3 { font-family: var(--font-head); color: var(--ink); letter-spacing: -0.025em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 12px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(14, 20, 23, 0.25); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 46px; height: auto; }
.brand span { font-family: var(--font-head); font-weight: 800; font-size: 17px; letter-spacing: 0.02em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav-link { display: none; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 8px; transition: color 0.2s, background 0.2s; }
.nav-link:hover { color: var(--teal-dark); background: var(--teal-soft); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px;
  border-radius: 12px; border: 0;
  background: var(--teal); color: #fff;
  font-family: var(--font-head); font-weight: 650; font-size: 16px;
  text-decoration: none;
  box-shadow: 0 8px 20px -10px rgba(17, 151, 154, 0.8);
  transition: transform 0.25s var(--ease), background 0.2s, box-shadow 0.25s;
}
.button:hover { background: var(--teal-dark); transform: translateY(-2px); box-shadow: 0 14px 28px -12px rgba(17, 151, 154, 0.85); }
.button:focus-visible { outline: 3px solid rgba(38, 158, 216, 0.5); outline-offset: 3px; }
.button span { transition: transform 0.25s var(--ease); }
.button:hover span { transform: translateX(4px); }
.button.small { min-height: 40px; padding: 0 16px; font-size: 15px; border-radius: 10px; }
.button.outline { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.button.outline:hover { box-shadow: inset 0 0 0 1.5px var(--teal); color: var(--teal-dark); }
.button.white { background: #fff; color: var(--teal-dark); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.35); }
.button.white:hover { background: #f1fbfb; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; padding: 40px 0 64px; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg .grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(17, 151, 154, 0.18) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(80% 70% at 70% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(80% 70% at 70% 40%, #000 30%, transparent 75%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.5; }
.b1 { width: 420px; height: 420px; right: -120px; top: -80px; background: #bfe9ea; animation: drift 16s ease-in-out infinite alternate; }
.b2 { width: 360px; height: 360px; left: -140px; bottom: -120px; background: #cfe9f7; animation: drift 19s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.08); } }

.hero-grid { display: grid; gap: 32px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 18px; padding: 6px 12px; border-radius: 999px;
  background: var(--teal-soft); color: var(--teal-dark);
  font-size: 13px; font-weight: 650; letter-spacing: 0.02em;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(17, 151, 154, 0.5); animation: pulse 2s ease-out infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 9px rgba(17, 151, 154, 0); } }
.hero h1 { margin: 0; font-size: clamp(40px, 9.6vw, 72px); line-height: 1.04; font-weight: 800; letter-spacing: -0.035em; }
.hl {
  background: linear-gradient(90deg, var(--teal) 0%, var(--blue) 50%, var(--teal) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sweep 6s linear infinite;
}
@keyframes sweep { to { background-position: -200% 0; } }
.hero-lead { margin: 20px 0 0; font-size: clamp(17px, 2.2vw, 20px); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-art { position: relative; max-width: 560px; width: 100%; margin: 0 auto; }
.art-ring {
  position: absolute; inset: 6% 10%;
  border-radius: 50%;
  border: 1.5px dashed rgba(17, 151, 154, 0.25);
  animation: spin 60s linear infinite;
}

/* The gears logo, animated */
.gears { width: 100%; height: auto; overflow: visible; display: block; position: relative; }
.gears .gear { fill: var(--teal); fill-rule: evenodd; transform-box: fill-box; transform-origin: center; }
.gears .gear-e, .gears .gear-f { fill: var(--teal-dark); }
.gears .cw { animation: spin 14s linear infinite; }
.gears .ccw { animation: spin-back 14s linear infinite; }
.gears .gear-b, .gears .gear-c { animation-duration: 9.5s; }
.gears .gear-e, .gears .gear-f { animation-duration: 7s; }
.gears .gear-lines line { stroke: var(--teal); stroke-width: 11; stroke-linecap: round; stroke-dasharray: 200; stroke-dashoffset: 0; }
.hero-art:hover .gears .gear { animation-duration: 3s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-back { to { transform: rotate(-360deg); } }

/* Entrance */
.js .up { opacity: 0; transform: translateY(24px); }
.is-ready .up { opacity: 1; transform: none; transition: opacity 0.9s var(--ease), transform 1s var(--ease); }
.is-ready .hero-copy .up:nth-child(2) { transition-delay: 0.08s; }
.is-ready .hero-copy .up:nth-child(3) { transition-delay: 0.16s; }
.is-ready .hero-copy .up:nth-child(4) { transition-delay: 0.24s; }
.is-ready .hero-art.up { transition-delay: 0.2s; }
.js .gears .gear-lines line { stroke-dashoffset: 200; }
.is-ready .gears .gear-lines line { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease) 0.5s; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-head { max-width: 680px; margin-bottom: 40px; }
.kicker { margin: 0 0 10px; color: var(--teal); font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.section h2, .company h2 { margin: 0; font-size: clamp(30px, 6vw, 48px); line-height: 1.1; font-weight: 800; }
.section-lead { margin: 14px 0 0; font-size: 18px; color: var(--muted); }

.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.9s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Ruebex showcase ---------- */
.businesses { background: linear-gradient(180deg, var(--bg-soft), #fff 70%); }
.showcase {
  display: grid; gap: 40px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 28px;
  padding: 28px 22px; box-shadow: var(--shadow);
  overflow: hidden;
}
.product-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px; background: #e8f8ee; color: #1b7a43;
  font-size: 13px; font-weight: 700;
}
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #22a35a; box-shadow: 0 0 0 0 rgba(34, 163, 90, 0.5); animation: pulse-green 2s ease-out infinite; }
@keyframes pulse-green { to { box-shadow: 0 0 0 9px rgba(34, 163, 90, 0); } }
.showcase h3 { margin: 14px 0 0; font-size: clamp(36px, 7vw, 52px); line-height: 1; font-weight: 800; }
.showcase-sub { margin: 8px 0 16px; color: var(--teal-dark); font-weight: 650; font-size: 19px; }
.features { list-style: none; margin: 22px 0; padding: 0; display: grid; gap: 12px; }
.features li { display: flex; gap: 12px; align-items: flex-start; }
.features svg {
  flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 10px;
  background: var(--teal-soft); fill: none; stroke: var(--teal-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.features b { color: var(--ink); }
.features span { padding-top: 5px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 26px; }
.facts div { background: var(--bg-soft); border-radius: 14px; padding: 12px; }
.facts b { display: block; font-family: var(--font-head); font-size: 22px; color: var(--ink); line-height: 1.2; }
.facts span { display: block; font-size: 13px; line-height: 1.35; color: var(--muted); margin-top: 2px; }

.showcase-art { position: relative; display: flex; justify-content: center; padding: 10px 0 20px; }
.showcase-art::before {
  content: ""; position: absolute; width: 82%; aspect-ratio: 1; top: 50%; left: 50%; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(17, 151, 154, 0.22), rgba(38, 158, 216, 0.12) 60%, transparent);
}
.phone {
  position: relative; width: min(270px, 72%);
  border-radius: 38px; padding: 10px; background: #12171c;
  box-shadow: 0 40px 70px -30px rgba(14, 20, 23, 0.55), inset 0 0 0 2px #2a3037;
  animation: bob 6s ease-in-out infinite;
}
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; width: 70px; height: 18px; margin-left: -35px; border-radius: 12px; background: #12171c; z-index: 1; }
.phone img { border-radius: 29px; width: 100%; aspect-ratio: 9 / 19.5; object-fit: cover; object-position: top; }
@keyframes bob { 50% { transform: translateY(-10px); } }

.float-card {
  position: absolute; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; font-size: 13px; color: var(--text); box-shadow: var(--shadow);
  white-space: nowrap;
}
.float-card b { color: var(--ink); }
.fc1 { left: 0; top: 22%; animation: bob 5s ease-in-out infinite 0.6s; }
.fc2 { right: 0; bottom: 18%; animation: bob 5.5s ease-in-out infinite 1.2s; }
.fc-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #ffb36b; color: #3a1d00; font-weight: 800; font-size: 12px; }
.fc2 svg { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: #22a35a; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.next {
  display: flex; align-items: center; gap: 20px; margin-top: 20px;
  border: 1.5px dashed #c9dadb; border-radius: 22px; padding: 22px;
  background: repeating-linear-gradient(135deg, #fbfdfd 0 14px, #f5f9f9 14px 28px);
}
.next-mark { width: 70px; flex: none; opacity: 0.55; filter: grayscale(0.3); }
.next h3 { margin: 0; font-size: 20px; }
.next p { margin: 4px 0 0; color: var(--muted); }

/* ---------- What we do ---------- */
.cards { display: grid; gap: 16px; }
.card {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.35s;
}
.card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: #cfe5e6; box-shadow: 0 20px 40px -20px rgba(17, 151, 154, 0.45); }
.card:hover::after { transform: scaleX(1); }
.card-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  box-shadow: 0 10px 20px -10px rgba(17, 151, 154, 0.9);
}
.card-icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { margin: 18px 0 8px; font-size: 20px; }
.card p { margin: 0; color: var(--muted); }

/* ---------- Process ---------- */
.process { background: var(--bg-soft); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; position: relative; isolation: isolate; counter-reset: step; }
.step {
  position: relative; counter-increment: step;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 22px 84px; box-shadow: var(--shadow);
}
.step b { display: block; font-family: var(--font-head); font-size: 19px; color: var(--ink); }
.step b::before { content: "0" counter(step) "  "; color: var(--teal); font-size: 14px; letter-spacing: 0.06em; }
.step p { margin: 4px 0 0; color: var(--muted); }
.step-gear {
  position: absolute; left: 20px; top: 50%; width: 46px; height: 46px; margin-top: -23px;
  background: url("/assets/gear.svg") center / contain no-repeat;
}
.js .step.in .step-gear { animation: spin 8s linear infinite; }
.step:nth-child(even).in .step-gear { animation-direction: reverse; }

/* ---------- Company ---------- */
.company-grid { display: grid; gap: 32px; align-items: start; }
.company-card {
  margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.company-card div { background: #fff; padding: 18px 20px; }
.company-card .wide { grid-column: 1 / -1; }
.company-card dt { font-size: 13px; color: var(--muted); }
.company-card dd { margin: 4px 0 0; font-weight: 650; color: var(--ink); }

/* ---------- Contact ---------- */
.contact { padding: 40px 0 80px; }
.contact-box {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 28px; padding: 48px 24px;
  background: linear-gradient(135deg, var(--teal) 0%, #0f8a99 45%, var(--blue) 100%);
  color: #fff; text-align: center;
  box-shadow: 0 30px 60px -30px rgba(17, 151, 154, 0.8);
}
.contact-box h2 { margin: 0; color: #fff; font-size: clamp(36px, 8vw, 60px); font-weight: 800; }
.contact-box > p { margin: 10px 0 26px; font-size: 18px; color: rgba(255, 255, 255, 0.9); }
.contact-box .contact-note { margin: 24px auto 0; font-size: 14px; max-width: 40em; color: rgba(255, 255, 255, 0.85); }
.contact-box .contact-note a { color: #fff; }
.contact-gears { position: absolute; z-index: -1; width: 520px; right: -140px; bottom: -110px; opacity: 0.16; }
.contact-gears .gear, .contact-gears .gear-e, .contact-gears .gear-f { fill: #fff; }
.contact-gears .gear-lines line { stroke: #fff; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--muted); }
.footer-grid { display: grid; gap: 18px; }
.footer-legal p { margin: 0 0 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--teal-dark); }

/* ---------- Plain text pages (privacy, 404) ---------- */
.page { padding: 48px 0 40px; max-width: 720px; }
.page h1 { margin: 0; font-size: clamp(36px, 8vw, 56px); line-height: 1.05; font-weight: 800; }
.page h2 { font-size: 20px; margin: 32px 0 8px; }
.page ul { padding-left: 20px; }

/* ---------- Wider screens ---------- */
@media (min-width: 768px) {
  :root { --gutter: 32px; }
  .nav-link { display: inline-block; }
  .hero { padding: 72px 0 96px; }
  .section { padding: 112px 0; }
  .showcase { padding: 48px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .contact-box { padding: 72px 48px; }
  .footer-grid { grid-template-columns: auto 1fr; gap: 40px; align-items: start; }
}
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 48px; }
  .hero { padding: 88px 0 120px; }
  .showcase { grid-template-columns: 1.1fr 1fr; padding: 56px; }
  .cards { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .step { padding: 74px 22px 24px; }
  .step-gear { top: 22px; left: 22px; margin-top: 0; }
  .steps::before {
    content: ""; position: absolute; left: 45px; right: 12%; top: 45px; height: 3px; z-index: -1;
    background: linear-gradient(90deg, var(--teal), var(--blue));
    transform: scaleX(var(--line-p, 0)); transform-origin: left;
  }
  .company-grid { grid-template-columns: 1fr 1.1fr; gap: 56px; }
}
@media (max-width: 380px) {
  .brand span { font-size: 15px; }
  .float-card { font-size: 12px; padding: 8px 10px; }
}

/* ---------- Reduced motion: everything visible and still ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js .up, .js .reveal { opacity: 1; transform: none; }
  .js .gears .gear-lines line { stroke-dashoffset: 0; }
  .steps::before { transform: none; }
}

/* ---------- Interactive machine (driven by app.js) ---------- */
.js .gears .gear { animation: none; }
.hero-art .gears .gear { cursor: grab; }
.hero-art .gears.is-dragging .gear { cursor: grabbing; }
.hero-bg .cogs { position: absolute; inset: 0; width: 100%; height: 100%; }

.drag-hint {
  position: absolute; left: 50%; bottom: -8px; z-index: 2;
  transform: translate(-50%, 8px);
  margin: 0; display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 650; color: var(--teal-dark);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; box-shadow: var(--shadow); white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.6s, transform 0.6s var(--ease);
}
.drag-hint.show { opacity: 1; transform: translate(-50%, 0); }
.hint-icon { width: 15px; height: 15px; background: url("/assets/gear.svg") center / contain no-repeat; animation: spin 3s linear infinite; }

/* Phone turns in 3D as you scroll; the stage does the gentle float */
.phone-stage { position: relative; width: 100%; display: flex; justify-content: center; perspective: 1100px; animation: bob 6s ease-in-out infinite; }
.phone { animation: none; transform-style: preserve-3d; will-change: transform; }
.float-card { will-change: transform; }

/* Spotlight that follows the pointer on the cards */
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, -20%), rgba(17, 151, 154, 0.13), transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.card:hover::before { opacity: 1; }

/* Step gears turn with the scroll, not with a timer */
.js .step.in .step-gear { animation: none; }

/* Cursor companion (mouse only; the normal cursor stays) */
.cursor { display: none; }
.has-cursor .cursor { display: block; }
.cursor-dot, .cursor-ring { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; border-radius: 50%; }
.cursor-dot { width: 7px; height: 7px; background: var(--teal); transform: translate3d(var(--x, -100px), var(--y, -100px), 0) translate(-50%, -50%); }
.cursor-ring {
  width: 34px; height: 34px; border: 1.5px solid rgba(17, 151, 154, 0.45);
  transform: translate3d(var(--rx, -100px), var(--ry, -100px), 0) translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), border-color 0.3s;
}
.cursor-ring::after {
  content: ""; position: absolute; inset: -2px;
  background: url("/assets/gear.svg") center / contain no-repeat;
  opacity: 0; transform: scale(0.6); transition: opacity 0.3s, transform 0.3s var(--ease);
}
.cursor.is-link .cursor-ring { width: 58px; height: 58px; border-color: transparent; }
.cursor.is-link .cursor-ring::after { opacity: 0.35; transform: scale(1); animation: spin 4s linear infinite; }

/* Click burst */
.burst { position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none; background: url("/assets/gear.svg") center / contain no-repeat; }

@media (prefers-reduced-motion: reduce) {
  .hero-bg .cogs, .drag-hint, .cursor { display: none !important; }
}
/* Script-driven gears use their own transform maths. */
.js .gears .gear { transform-box: view-box; transform-origin: 0 0; }
.fx .float-card { animation: none; }
.drag-hint { bottom: -40px; }
.hero-art { margin-bottom: 36px; }

/* ---------- The rendered cosmos (cosmos.js) ----------
   Dark space at the top; diving into Ruebex turns the screen to daylight and the page goes light.
   Without WebGL or with reduced motion, the hero stays light and "worlds" is a plain list. */
canvas.cosmos { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.play-hint, .hud { display: none; }
.worlds { padding: 72px 0 8px; }
.worlds-caps { display: grid; gap: 32px; }
.cap h2, .cap h3 { margin: 0; font-size: clamp(30px, 6vw, 52px); line-height: 1.08; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.cap > p:last-child { margin: 12px 0 0; font-size: 18px; color: var(--muted); max-width: 30em; }

/* hero in space */
.webgl .hero { isolation: auto; min-height: 100vh; min-height: 100svh; padding-top: min(52vh, 440px); }
.webgl .hero-bg, .webgl .hero-art { display: none; }
.webgl .hero-grid { grid-template-columns: minmax(0, 1fr); }
.webgl .hero h1 { color: #fff; }
.webgl .hero .hl { background-image: linear-gradient(90deg, #5fe3e3 0%, #8fb8ff 35%, #c39bff 65%, #5fe3e3 100%); }
.webgl .hero-lead { color: rgba(222, 234, 246, 0.84); }
.webgl .eyebrow { background: rgba(255, 255, 255, 0.07); color: #9feaea; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.webgl .hero .button.outline { background: rgba(255, 255, 255, 0.06); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.32); }
.webgl .play-hint { display: flex; align-items: center; gap: 10px; margin: 26px 0 0; font-size: 13px; font-weight: 650; letter-spacing: 0.02em; color: rgba(222, 234, 246, 0.7); }
.play-dot { width: 9px; height: 9px; border-radius: 50%; background: #5fe3e3; box-shadow: 0 0 0 0 rgba(95, 227, 227, 0.6); animation: pulse 2s ease-out infinite; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .webgl .hero { padding-top: 88px; display: flex; align-items: center; }
  .webgl .hero > .wrap { width: 100%; }
  .webgl .hero-copy { max-width: 50%; }
  .webgl .hero h1 { font-size: clamp(48px, 6vw, 92px); }
}

/* header while over space */
.site-header { transition: background 0.4s, border-color 0.3s, box-shadow 0.3s; }
.on-dark .site-header { background: rgba(3, 7, 18, 0.35); border-bottom-color: rgba(255, 255, 255, 0.06); box-shadow: none; }
.on-dark .brand span { color: #fff; }
.on-dark .nav-link { color: rgba(230, 238, 246, 0.82); }
.on-dark .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* the flight: pinned captions over the render */
.webgl .worlds { height: 360vh; padding: 0; }
.webgl .worlds-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.webgl .worlds-wrap { position: relative; height: 100%; }
.webgl .worlds-caps { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(44px + env(safe-area-inset-bottom)); gap: 0; }
.webgl .worlds-caps::before {
  content: ""; position: absolute; z-index: -1; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter)); top: -60px; bottom: -60px;
  background: linear-gradient(to top, rgba(2, 5, 14, 0.85) 45%, rgba(2, 5, 14, 0));
}
.webgl .cap { grid-area: 1 / 1; align-self: end; opacity: 0; transform: translateY(28px); transition: opacity 0.6s var(--ease), transform 0.9s var(--ease); }
.webgl .cap.on { opacity: 1; transform: none; }
.webgl .cap h2, .webgl .cap h3 { color: #fff; font-size: clamp(30px, min(7.4vw, 6.6vh), 60px); }
.webgl .cap .kicker { color: #6fe6e6; }
.webgl .cap > p:last-child { color: rgba(222, 234, 246, 0.82); font-size: 17px; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .webgl .worlds-caps { right: auto; bottom: auto; top: 50%; transform: translateY(-50%); width: min(460px, 38%); }
  .webgl .worlds-caps::before { display: none; }
  .webgl .cap { align-self: center; }
}

/* HUD labels that sit beside the planets */
.webgl .hud {
  display: flex; align-items: center; gap: 8px; position: absolute; left: 0; top: 0; margin: 0;
  padding: 6px 11px; border-radius: 999px; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: #c9f6f6;
  background: rgba(3, 9, 20, 0.55); box-shadow: inset 0 0 0 1px rgba(111, 230, 230, 0.35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transform: translate3d(var(--hx, -999px), var(--hy, -999px), 0) translateX(-50%);
  opacity: 0; transition: opacity 0.4s;
}
.webgl .hud.on { opacity: 1; }
.hud i { width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 10px #3ddc84; }
.hud b { font-weight: 600; letter-spacing: 0.06em; color: rgba(201, 246, 246, 0.65); }
.hud-b i { background: #b69bff; box-shadow: 0 0 10px #b69bff; }
@media (prefers-reduced-motion: reduce) { canvas.cosmos { display: none; } }
