/* SynergyWorx. Apple-like restraint: near-white and near-black neutrals, the
   system font (SF on Apple devices, Inter elsewhere), tight tracking on large
   type, one ember accent for the company. Each product keeps its own colours:
   Quorum's spruce and voting-card yellow, Telemetrix's signal blue. */
:root {
  --bg: #FBFBFD;
  --paper: #FFFFFF;
  --tint: #F5F5F7;
  --ink: #1D1D1F;
  --ink-soft: #6E6E73;
  --line: #D2D2D7;
  --ember: #E4511F;
  --q: #1E5A4B;
  --on-q: #FFFFFF;
  --q-card: #E9B526;
  --q-tile: linear-gradient(160deg, #EEF6F2 0%, #DDEDE5 100%);
  --t: #2D6BFF;
  --on-t: #FFFFFF;
  --grad: linear-gradient(95deg, #1E8A6E 0%, #2D6BFF 50%, #E4511F 100%);
  --nav-bg: rgba(251, 251, 253, 0.72);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, "Segoe UI", sans-serif;
  --wrap: 1120px;
  --r: 28px;
  /* Apple's "ease-out-expo"-like curve for entrances: fast start, long soft settle. */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --paper: #161617; --tint: #0E0E10; --ink: #F5F5F7; --ink-soft: #A1A1A6;
    --line: #38383C; --ember: #FF7448; --q: #6CC3A6; --on-q: #06231B; --q-card: #F1C445;
    --q-tile: linear-gradient(160deg, #0F201B 0%, #0A1714 100%);
    --t: #6E9BFF; --on-t: #061537;
    --grad: linear-gradient(95deg, #6CC3A6 0%, #6E9BFF 50%, #FF7448 100%);
    --nav-bg: rgba(0, 0, 0, 0.66);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --paper: #161617; --tint: #0E0E10; --ink: #F5F5F7; --ink-soft: #A1A1A6;
  --line: #38383C; --ember: #FF7448; --q: #6CC3A6; --on-q: #06231B; --q-card: #F1C445;
  --q-tile: linear-gradient(160deg, #0F201B 0%, #0A1714 100%);
  --t: #6E9BFF; --on-t: #061537;
  --grad: linear-gradient(95deg, #6CC3A6 0%, #6E9BFF 50%, #FF7448 100%);
  --nav-bg: rgba(0, 0, 0, 0.66);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 17px; line-height: 1.47; letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased; font-optical-sizing: auto; overflow-x: clip;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--t); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 24px; }
@media (max-width: 520px) { .wrap { padding-inline: 16px; } }
.eyebrow { font-size: 17px; font-weight: 600; color: var(--ember); letter-spacing: -0.01em; margin-bottom: 10px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--paper); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- header: a translucent material, content scrolls under it ---------- */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color .3s ease;
}
header.top.scrolled { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.top .wrap { display: flex; align-items: center; gap: 28px; min-height: 52px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 600 17px var(--font-display); letter-spacing: -0.02em; }
.brand svg { width: 24px; height: 24px; flex: none; }
nav.links { display: flex; gap: 26px; margin-left: auto; }
nav.links a { text-decoration: none; font-size: 13px; color: var(--ink); opacity: .8; transition: opacity .2s ease; }
nav.links a:hover { opacity: 1; }
.langs { display: flex; border-radius: 999px; padding: 2px; gap: 2px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.langs button {
  font: 600 11.5px var(--font); letter-spacing: 0.02em; border: 0; background: transparent; color: var(--ink-soft);
  padding: 4px 9px; border-radius: 999px; cursor: pointer; transition: background-color .2s ease, color .2s ease;
}
.langs button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (max-width: 760px) { nav.links { display: none; } .langs { margin-left: auto; } }
@media (prefers-reduced-transparency: reduce) { header.top { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* ---------- buttons: feedback on press, instantly ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; cursor: pointer;
  font: 500 17px var(--font); padding: 12px 22px; border-radius: 980px; border: 0;
  transition: transform .35s var(--ease), filter .2s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.96); transition-duration: .1s; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-q { background: var(--q); color: var(--on-q); }
.btn-t { background: var(--t); color: var(--on-t); }
.link { color: var(--t); text-decoration: none; font-size: 17px; display: inline-flex; gap: 4px; align-items: center; }
.link:hover { text-decoration: underline; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 96px 0 40px; text-align: center; isolation: isolate; }
.glow {
  position: absolute; inset: -10% 0 auto; height: 720px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 28% 40%, color-mix(in srgb, #1E8A6E 22%, transparent), transparent 70%),
    radial-gradient(40% 50% at 72% 45%, color-mix(in srgb, #2D6BFF 20%, transparent), transparent 70%),
    radial-gradient(30% 40% at 50% 20%, color-mix(in srgb, #E4511F 16%, transparent), transparent 70%);
  filter: blur(40px); opacity: .9;
}
.hero-copy { display: flex; flex-direction: column; align-items: center; }
.hero h1 {
  font-size: clamp(44px, 8vw, 96px); font-weight: 700; line-height: 1.04; letter-spacing: -0.045em;
  max-width: 13ch;
}
.hero h1 em {
  font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { margin-top: 22px; font-size: clamp(19px, 2.2vw, 24px); line-height: 1.38; color: var(--ink-soft); max-width: 40ch; letter-spacing: -0.02em; text-wrap: pretty; }
.ctas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 28px; margin-top: 34px; }

/* the system map */
.map { margin: 56px auto 0; max-width: 860px; }
.map svg { width: 100%; height: auto; display: block; overflow: visible; }
.wire { stroke: var(--line); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 112; stroke-dashoffset: 0; }
.node-bg { fill: var(--paper); stroke: var(--line); stroke-width: 1; }
.core-bg { stroke: none; filter: drop-shadow(0 10px 30px rgba(0,0,0,.12)); }
.node-label { font: 600 15px var(--font); fill: var(--ink-soft); letter-spacing: -0.01em; }
.seat { fill: var(--line); transform-box: fill-box; transform-origin: center; }
.seat.on { fill: var(--q); }
.seat.on.last { fill: var(--q-card); }
.q-dot { fill: var(--q); opacity: .14; }
.signal { fill: none; stroke: var(--t); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 230; }
.live { fill: var(--t); }
.node-in { transform-box: fill-box; transform-origin: center; }
@media (max-width: 520px) { .hero { padding-top: 64px; } .map { margin-top: 40px; padding-inline: 4px; } .node-label { font-size: 26px; } }

/* ---------- statement: words light up as it scrolls through ---------- */
.statement { position: relative; }
.statement-pin { padding: 120px 0; }
.statement-text {
  font: 700 clamp(30px, 4.6vw, 56px)/1.12 var(--font-display); letter-spacing: -0.035em; max-width: 980px;
}
.statement-text .w { transition: opacity .15s linear; }

/* ---------- sections ---------- */
.section { padding: 120px 0; }
.section-tint { background: var(--tint); }
.section-head { text-align: center; display: flex; flex-direction: column; align-items: center; }
.section h2 { font-size: clamp(36px, 5.4vw, 64px); font-weight: 700; line-height: 1.06; letter-spacing: -0.04em; max-width: 18ch; }
.section-lead { margin-top: 18px; font-size: clamp(19px, 2vw, 21px); color: var(--ink-soft); max-width: 46ch; letter-spacing: -0.02em; }
@media (max-width: 520px) { .section { padding: 84px 0; } }

/* ---------- product tiles ---------- */
.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 64px; }
@media (max-width: 860px) { .products { grid-template-columns: 1fr; } }
.tile { perspective: 1400px; }
.tile-inner {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%; --spot: 0;
  position: relative; height: 100%; border-radius: var(--r);
  /* clip-path, not overflow: Chrome drops rounded overflow clipping on 3D-transformed layers. */
  clip-path: inset(0 round var(--r)); backface-visibility: hidden;
  padding: 48px 40px 44px; display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; will-change: transform;
}
.tile-inner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--spot);
  background: radial-gradient(600px circle at var(--mx) var(--my), rgba(255,255,255,.16), transparent 45%);
}
.tile-q .tile-inner { background: var(--q-tile); }
.tile-t .tile-inner {
  background: radial-gradient(120% 80% at 80% 0%, #17306E 0%, #0A1230 45%, #05070F 100%);
  color: #F5F5F7; --ink-soft: #A1A8B8; --line: #2A3352; --t: #6E9BFF; --on-t: #061537;
}
.tile-mark { width: 44px; height: 44px; }
.tile-q .tile-mark { color: var(--q); }
.tile-t .tile-mark { color: var(--t); }
.tag { font-size: 14px; font-weight: 600; color: var(--ink-soft); letter-spacing: -0.01em; }
.tile h3 { font-size: clamp(40px, 5vw, 56px); font-weight: 700; letter-spacing: -0.045em; line-height: 1; margin-top: -8px; }
.tile-lead { font-size: 21px; line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; max-width: 26ch; }
.checks { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 10px; color: var(--ink-soft); font-size: 16px; }
.checks li { padding-left: 26px; position: relative; }
.checks li::before {
  content: ""; position: absolute; left: 1px; top: 0.42em; width: 14px; height: 14px; border-radius: 50%;
  background: currentColor; opacity: .9;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2l2.3 2.3L10.5 4.8' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2l2.3 2.3L10.5 4.8' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.tile-q .checks li::before { color: var(--q); }
.tile-t .checks li::before { color: var(--t); }
.stats { display: flex; gap: 36px; margin: 10px 0 0; }
.stats div { display: grid; }
.stats dt { font: 700 44px/1 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tile-q .stats dt { color: var(--q); }
.stats dd { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
.tile .btn { margin-top: auto; }
.tile .stats + .btn, .tile .checks + .btn { margin-top: 18px; }
@media (max-width: 520px) { .tile-inner { padding: 36px 24px 32px; } }

/* ---------- principles ---------- */
.principles {
  list-style: none; padding: 0; margin: 64px 0 0; counter-reset: p;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
}
.principles li {
  counter-increment: p; background: var(--paper); border-radius: 22px; padding: 34px 32px 36px;
}
.principles li::before {
  content: counter(p, decimal-leading-zero); display: block; font: 700 15px var(--font); color: var(--ember);
  margin-bottom: 18px; font-variant-numeric: tabular-nums;
}
.principles h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.principles p { margin-top: 10px; color: var(--ink-soft); }
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; } }

/* ---------- contact ---------- */
.contact { text-align: center; }
.contact .wrap { display: flex; flex-direction: column; align-items: center; }
.mail {
  margin-top: 36px; font: 700 clamp(26px, 4.4vw, 48px) var(--font-display); letter-spacing: -0.04em;
  text-decoration: none; overflow-wrap: anywhere;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: opacity .2s ease;
}
.mail:hover { opacity: .8; }

/* ---------- footer ---------- */
.foot { background: var(--tint); border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); padding: 22px 0 36px; font-size: 12px; color: var(--ink-soft); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.foot nav { display: flex; gap: 20px; margin-left: auto; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

/* =====================================================================
   Motion. Everything below only applies when scripting is on (site.js
   reveals what it hides) and the visitor hasn't asked for reduced motion.
   ===================================================================== */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  /* hero copy rises in on load, line by line */
  .intro { animation: rise 1.1s var(--ease) both; }
  .intro-2 { animation-delay: .08s; }
  .intro-3 { animation-delay: .18s; }
  .intro-4 { animation-delay: .28s; }
  .glow { animation: fade 2.4s ease both; }

  /* the map assembles itself: core, wires, products, then their content */
  .node-in { animation: pop 1s var(--ease) both; }
  .node-core .node-in { animation-delay: .45s; }
  .node-q .node-in { animation-delay: .8s; }
  .node-t .node-in { animation-delay: .9s; }
  .wire { stroke-dashoffset: 112; animation: draw .9s var(--ease) forwards; }
  .wire-l { animation-delay: .65s; }
  .wire-r { animation-delay: .7s; }
  .seat.on { animation: seat .5s var(--ease) both; animation-delay: calc(1.25s + var(--i, 0) * 70ms); }
  .q-dot { animation: fade .8s ease 1.9s both; }
  .signal { stroke-dashoffset: 230; animation: draw 1.6s cubic-bezier(.65, 0, .35, 1) 1.3s forwards; }
  .live { animation: fade .3s ease 2.8s both, ping 2s ease-out 3.1s infinite; transform-box: fill-box; transform-origin: center; }

  /* scroll reveals: materialize (opacity + rise + un-blur), not just fade */
  .reveal { opacity: 0; transform: translateY(48px) scale(.98); filter: blur(6px); }
  .reveal.in {
    opacity: 1; transform: none; filter: none;
    transition: opacity .9s var(--ease), transform 1.2s var(--ease), filter .9s var(--ease);
  }
  .products .tile:nth-child(2).in { transition-delay: .1s; }
  .stagger { opacity: 1; transform: none; filter: none; }
  .stagger > * { opacity: 0; transform: translateY(40px); }
  .stagger.in > * { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform 1.1s var(--ease); }
  .stagger.in > :nth-child(2) { transition-delay: .08s; }
  .stagger.in > :nth-child(3) { transition-delay: .16s; }
  .stagger.in > :nth-child(4) { transition-delay: .24s; }

  /* statement pins while its words light up */
  .statement.is-live { height: 240vh; }
  .statement.is-live .statement-pin { position: sticky; top: 0; height: 100vh; padding: 0; display: grid; align-items: center; }
  .statement.is-live .w { opacity: clamp(0.16, calc(var(--p, 0) * var(--n, 1) - var(--i, 0)), 1); }
}
/* Reduced motion: a gentle cross-fade instead of movement. */
@media (scripting: enabled) and (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .stagger > * { opacity: 0; }
  .reveal.in, .stagger.in > * { opacity: 1; transition: opacity .4s ease; }
  .btn, .btn:active { transform: none; }
}

@keyframes rise { from { opacity: 0; transform: translateY(28px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes seat { from { fill: var(--line); transform: scale(.4); } }
@keyframes ping { 0% { opacity: 1; transform: scale(1); } 70% { opacity: .25; transform: scale(1.9); } 100% { opacity: 1; transform: scale(1); } }
