/* ================================================================
   GreatSage Labs — shared stylesheet
   Dark editorial · Newsreader serif · Geist sans
   Primary: blue #004aad → violet #cb6ce6 gradient · black bg dark,
   off-white bg light · ambient particle field in hero.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* Canvas */
  --bg:        #0a0a0a;
  --bg-2:      #111115;
  --bg-3:      #17171d;
  --bg-elev:   #1c1c24;
  --bg-hover:  #26262f;
  --line:      #23232b;
  --line-2:    #33334a;

  --fg:        #eef2f7;
  --fg-dim:    #a9b0bd;
  --fg-mute:   #6b7180;
  --fg-faint:  #3d4152;

  /* Blue ramp */
  --blue-950: #001f4d;
  --blue-800: #003380;
  --blue-700: #004aad;   /* primary */
  --blue-500: #1a6fd4;
  --blue-300: #5a9de6;
  --blue-100: #c2daf5;

  /* Violet ramp */
  --violet-900: #5c2d73;
  --violet-700: #8a3dab;
  --violet-600: #a34dc4;
  --violet-500: #cb6ce6;  /* accent */
  --violet-300: #d896ee;
  --violet-100: #f0d4f7;

  /* Bridge */
  --bridge-deep:  #3a4a99;
  --bridge-mid:   #6b5bc7;
  --bridge-light: #9864d9;

  /* Gradients */
  --gradient-full: linear-gradient(135deg, #004aad 0%, #cb6ce6 100%);
  --gradient-mid:  linear-gradient(135deg, #004aad 0%, #6b5bc7 50%, #cb6ce6 100%);
  --gradient-soft: linear-gradient(135deg, rgba(0,74,173,0.14), rgba(203,108,230,0.14));

  /* Abstract accent hooks — routed through the new palette.
     --accent  = violet (badges, pips, decoration)
     --accent-2 = blue-light (links in dark, link arrows)
     --accent-dark = deep blue (hovers)
     --contrast-on-accent = text that sits on a solid accent fill */
  --accent:          #cb6ce6;
  --accent-2:        #5a9de6;
  --accent-dark:     #003380;
  --accent-dim:      rgba(203, 108, 230, 0.14);
  --accent-ring:     rgba(203, 108, 230, 0.35);
  --contrast-on-accent: #ffffff;

  /* Legacy aliases — old structural tokens routed to the new palette
     so the rest of the file keeps reading them. */
  --wine-deepest: #050a1c;
  --wine-900:     #001f4d;
  --wine-700:     #004aad;
  --wine-600:     #1a6fd4;
  --wine-500:     #8a3dab;
  --wine-300:     #d896ee;

  --danger:    #ef4444;
  --warn:      #cb6ce6;

  /* Type */
  --serif: 'Newsreader', 'GT Sectra', 'Tiempos Headline', Georgia, serif;
  --sans:  'Geist', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono:  'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --maxw: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

/* ----------------------------------------------------------------
   Typography primitives
   ---------------------------------------------------------------- */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono  { font-family: var(--mono); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--gradient-full);
  display: inline-block;
  opacity: 0.7;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; line-height: 1.04; color: var(--fg); }
h1 { font-size: clamp(44px, 7.2vw, 104px); letter-spacing: -0.035em; line-height: 0.98; font-weight: 450; }
h2 { font-size: clamp(32px, 4.4vw, 60px); letter-spacing: -0.025em; }
h3 { font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.02em; }
p  { margin: 0; color: var(--fg-dim); text-wrap: pretty; }

.lede { font-size: clamp(17px, 1.4vw, 20px); color: var(--fg-dim); max-width: 62ch; line-height: 1.55; }

/* ----------------------------------------------------------------
   Container + rhythm
   ---------------------------------------------------------------- */
.wrap  { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
section { position: relative; }
.section { padding-block: clamp(80px, 10vw, 160px); }
.section--tight { padding-block: clamp(64px, 7vw, 110px); }

.divider {
  height: 1px; background: var(--line);
  max-width: var(--maxw); margin-inline: auto;
}

/* ----------------------------------------------------------------
   Nav
   ---------------------------------------------------------------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .3s ease, backdrop-filter .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10,10,10,0.72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom-color: var(--line);
}
.nav__inner {
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding-inline: var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px;
}
.logo {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--serif); font-size: 20px; font-weight: 500;
  letter-spacing: -0.02em; color: var(--fg);
}
.logo em { font-style: italic; color: var(--fg); font-weight: 400; }
.logo span { font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--fg-mute); letter-spacing: 0.02em; margin-left: 6px; text-transform: lowercase; }

/* Image logo — swaps per theme */
.logo__img {
  display: block;
  height: 36px; width: auto;
  user-select: none; -webkit-user-drag: none;
}
.logo__img--on-light { display: none; }
html[data-theme="light"] .logo__img--on-dark  { display: none; }
html[data-theme="light"] .logo__img--on-light { display: block; }
.footer__brand .logo__img { height: 44px; }
@media (max-width: 560px) {
  .logo__img { height: 30px; }
  .footer__brand .logo__img { height: 34px; }
}

.nav__links { display: flex; gap: 32px; }
.nav__links a {
  font-size: 14px; color: var(--fg-dim); font-weight: 400;
  transition: color .18s ease;
}
.nav__links a:hover { color: var(--fg); }
.nav__links a.is-active { color: var(--fg); }

@media (max-width: 780px) {
  .nav__links { display: none; }
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
  border: 0;
  white-space: nowrap;
}
.btn--primary {
  position: relative;
  background: var(--gradient-full);
  color: #ffffff;
  font-weight: 600;
  box-shadow:
    0 10px 24px -12px rgba(0,74,173,0.45),
    0 0 0 1px rgba(203,108,230,0.25) inset;
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}
.btn--primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.06) saturate(1.05);
  box-shadow:
    0 14px 36px -14px rgba(203,108,230,0.55),
    0 0 0 1px rgba(255,255,255,0.12) inset,
    0 0 40px -8px rgba(203,108,230,0.35);
}
.btn--ghost {
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.btn--ghost:hover {
  background: var(--bg-hover);
  border-color: rgba(203,108,230,0.35);
  color: var(--fg);
}
.btn--link {
  padding: 0; color: var(--fg);
  border-radius: 0;
  font-size: 15px;
  background: transparent;
}
.btn--link .arrow { transition: transform .25s ease; color: var(--accent-2); }
.btn--link:hover .arrow { transform: translateX(4px); color: var(--accent); }
html[data-theme="light"] .btn--link .arrow { color: var(--accent); }

/* ----------------------------------------------------------------
   Badges / tags
   ---------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  color: var(--fg-dim);
}
.badge--live {
  color: var(--violet-100);
  border-color: transparent;
  background: var(--accent-dim);
  position: relative;
}
html[data-theme="light"] .badge--live { color: var(--violet-900); }
.badge--live::after {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-full);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.8;
}
.badge--live::before {
  content:''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 0 3px rgba(203,108,230,0.18),
    0 0 10px rgba(203,108,230,0.55);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
.badge--muted { color: var(--fg-mute); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; color: var(--fg-mute); font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }
.tags span { position: relative; padding-right: 14px; }
.tags span + span::before {
  content: '·'; position: absolute; left: -10px; color: var(--fg-faint);
}

/* ----------------------------------------------------------------
   Scroll reveal
   ---------------------------------------------------------------- */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

/* ----------------------------------------------------------------
   Hero
   ---------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  padding-top: var(--nav-h);
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0;
  z-index: -1;
}
.hero__bg canvas { width: 100%; height: 100%; display: block; }
.hero__bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(1100px 680px at 72% 28%, rgba(0,74,173,0.18), transparent 60%),
    radial-gradient(900px 620px at 18% 82%, rgba(203,108,230,0.10), transparent 62%),
    linear-gradient(180deg, rgba(10,10,10,0) 40%, rgba(10,10,10,0.85) 85%, var(--bg) 100%);
  pointer-events: none;
}
.hero__inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(100px, 14vh, 180px) var(--gutter) clamp(80px, 10vh, 120px);
  position: relative;
}
.hero__eyebrow { margin-bottom: 28px; }
.hero h1 {
  max-width: 16ch;
  margin-bottom: 32px;
}
.hero h1 em {
  font-style: italic;
  color: var(--fg-dim);
  font-weight: 400;
}
.hero__sub {
  max-width: 58ch;
  font-size: clamp(17px, 1.3vw, 19px);
  color: var(--fg-dim);
  line-height: 1.55;
  margin-bottom: 40px;
}
.hero__actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 32px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--fg-mute); text-transform: uppercase;
}
.hero__scroll .line {
  width: 1px; height: 40px;
  background: linear-gradient(180deg, var(--fg-faint) 0%, transparent 100%);
  animation: scroll-hint 2.4s ease-in-out infinite;
  transform-origin: top;
}
@keyframes scroll-hint {
  0%   { transform: scaleY(0.3); opacity: 0.2; }
  50%  { transform: scaleY(1);   opacity: 1; }
  100% { transform: scaleY(0.3); opacity: 0.2; transform-origin: bottom; }
}

/* ----------------------------------------------------------------
   Page-header (for non-home pages)
   ---------------------------------------------------------------- */
.pagehead {
  padding-top: calc(var(--nav-h) + clamp(80px, 12vw, 140px));
  padding-bottom: clamp(60px, 8vw, 100px);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.pagehead h1 { max-width: 18ch; margin: 24px 0 24px; }
.pagehead .lede { max-width: 58ch; }

/* ----------------------------------------------------------------
   Ethos / editorial
   ---------------------------------------------------------------- */
.editorial {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 800px) { .editorial { grid-template-columns: 1fr; } }

.editorial h2 { max-width: 18ch; }
.editorial__body p { font-size: clamp(17px, 1.25vw, 19px); color: var(--fg-dim); margin-bottom: 1.1em; }
.editorial__body p strong { color: var(--fg); font-weight: 500; }

/* ----------------------------------------------------------------
   Product cards (Home)
   ---------------------------------------------------------------- */
.products { display: flex; flex-direction: column; gap: 20px; }

.pcard {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #0f0f0f 0%, #0b0b0b 100%);
  overflow: hidden;
  transition: border-color .3s ease, transform .3s ease;
}
.pcard:hover { border-color: var(--line-2); }

.pcard--hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 520px;
}
.pcard--hero .pcard__text { padding: 48px clamp(32px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.pcard--hero .pcard__visual { position: relative; border-left: 1px solid var(--line); background: #0a0a0a; overflow: hidden; }
@media (max-width: 900px) {
  .pcard--hero { grid-template-columns: 1fr; min-height: 0; }
  .pcard--hero .pcard__visual { border-left: 0; border-top: 1px solid var(--line); min-height: 340px; }
}

.pcard__head { display: flex; flex-direction: column; gap: 16px; }
.pcard__title { font-family: var(--serif); font-size: clamp(28px, 2.6vw, 38px); letter-spacing: -0.02em; line-height: 1.08; font-weight: 500; }
.pcard__title em { font-style: italic; color: var(--fg-dim); font-weight: 400; }
.pcard__desc { color: var(--fg-dim); font-size: 15px; line-height: 1.6; max-width: 54ch; }

.pcard__stats { display: flex; gap: 28px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--line); }
.pcard__stats > div { min-width: 0; }
.pcard__stats strong { display: block; font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--fg); letter-spacing: -0.01em; }
.pcard__stats small { display: block; color: var(--fg-mute); font-size: 12px; font-family: var(--mono); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 4px; }

.pcard__meta { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.pcard--small {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 300px;
}
.pcard--small .pcard__text { padding: 32px; display: flex; flex-direction: column; gap: 20px; justify-content: space-between; height: 100%; }
.pcard--small .pcard__title { font-size: 24px; }
.pcard--placeholder { background: repeating-linear-gradient(45deg, #0c0c0c 0 10px, #0a0a0a 10px 20px); }

.pcards--row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .pcards--row { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------
   Alchemy Lab mock dashboard (inside card + case study)
   ---------------------------------------------------------------- */
.alchemy {
  position: absolute; inset: 24px;
  border-radius: 10px;
  background: #0e0f18;
  border: 1px solid rgba(245,236,215,0.06);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(203,108,230,0.04);
  display: flex; flex-direction: column;
  overflow: hidden;
  font-family: var(--sans);
}
.alchemy__chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
}
.alchemy__chrome .dot { width: 8px; height: 8px; border-radius: 50%; background: #2a2a2a; }
.alchemy__chrome .url { flex: 1; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--fg-mute); letter-spacing: 0.02em; }
.alchemy__body { flex: 1; padding: 16px; display: grid; grid-template-columns: 140px 1fr; gap: 16px; min-height: 0; }
.alchemy__sidebar { display: flex; flex-direction: column; gap: 4px; border-right: 1px solid rgba(255,255,255,0.05); padding-right: 12px; }
.alchemy__sidebar .logo-s { font-family: var(--serif); font-size: 15px; font-weight: 500; padding: 6px 8px; margin-bottom: 12px; }
.alchemy__sidebar .logo-s em { color: var(--accent); font-style: normal; }
.alchemy__nav { display: flex; flex-direction: column; gap: 2px; }
.alchemy__nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px;
  font-size: 11px; color: var(--fg-mute);
  font-family: var(--sans); font-weight: 400;
}
.alchemy__nav a.active { background: rgba(0,74,173,0.25); color: var(--accent); }
.alchemy__nav a .ico { width: 10px; height: 10px; border-radius: 2px; background: currentColor; opacity: 0.7; }

.alchemy__main { display: flex; flex-direction: column; gap: 12px; min-width: 0; overflow: hidden; }
.alchemy__header { display: flex; justify-content: space-between; align-items: baseline; }
.alchemy__header h4 { font-family: var(--serif); font-size: 16px; font-weight: 500; margin: 0; letter-spacing: -0.01em; }
.alchemy__header span { font-family: var(--mono); font-size: 10px; color: var(--fg-mute); text-transform: uppercase; letter-spacing: 0.08em; }

.alchemy__kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.alchemy__kpi { padding: 10px; border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; background: rgba(255,255,255,0.015); }
.alchemy__kpi .lbl { font-family: var(--mono); font-size: 9px; color: var(--fg-mute); text-transform: uppercase; letter-spacing: 0.08em; }
.alchemy__kpi .val { font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--fg); letter-spacing: -0.01em; margin-top: 4px; }
.alchemy__kpi .val em { font-style: normal; color: var(--accent); font-size: 12px; font-family: var(--mono); margin-left: 4px; }
.alchemy__kpi .val.red em { color: #d896ee; }

.alchemy__chart {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.05); border-radius: 8px;
  padding: 10px 12px 8px;
  min-height: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.alchemy__chart .ct { display: flex; justify-content: space-between; align-items: baseline; }
.alchemy__chart .ct b { font-family: var(--serif); font-size: 12px; font-weight: 500; }
.alchemy__chart .ct span { font-family: var(--mono); font-size: 9px; color: var(--fg-mute); }
.alchemy__chart svg { width: 100%; flex: 1; min-height: 60px; }

.alchemy__alerts { display: flex; flex-direction: column; gap: 4px; }
.alchemy__alert {
  display: grid; grid-template-columns: 8px 1fr auto; gap: 8px; align-items: center;
  padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,0.02);
  font-size: 10px;
}
.alchemy__alert .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.alchemy__alert.hi .pip { background: var(--wine-500); }
.alchemy__alert .name { font-weight: 500; color: var(--fg); }
.alchemy__alert .amt { font-family: var(--mono); color: var(--fg-dim); font-size: 10px; }

/* ----------------------------------------------------------------
   Expertise grid
   ---------------------------------------------------------------- */
.expertise {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
@media (max-width: 900px) { .expertise { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .expertise { grid-template-columns: 1fr; } }

.xc {
  padding: 36px 32px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 14px;
  min-height: 220px;
  transition: background .25s ease;
}
.xc:hover { background: #0d0d0d; }
.xc__ico {
  width: 28px; height: 28px;
  color: var(--accent-2);
  filter: drop-shadow(0 0 10px rgba(90,157,230,0.35));
  transition: color .22s ease, filter .22s ease;
}
.xc:hover .xc__ico {
  color: var(--accent);
  filter: drop-shadow(0 0 14px rgba(203,108,230,0.5));
}
html[data-theme="light"] .xc__ico { color: var(--blue-700); filter: none; }
html[data-theme="light"] .xc:hover .xc__ico { color: var(--violet-700); filter: drop-shadow(0 0 8px rgba(203,108,230,0.25)); }
.xc h3 { font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -0.015em; }
.xc p { font-size: 14px; color: var(--fg-dim); line-height: 1.55; }

/* ----------------------------------------------------------------
   Quote section
   ---------------------------------------------------------------- */
.quote {
  background: linear-gradient(180deg, #0b0b0b 0%, #0d0d0d 50%, #0b0b0b 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.quote__inner {
  max-width: 1040px; margin: 0 auto;
  padding: clamp(80px, 10vw, 140px) var(--gutter);
  text-align: left;
}
.quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--fg);
  font-weight: 400;
  text-wrap: balance;
}
.quote blockquote span {
  background: var(--gradient-full);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  font-weight: 500;
  letter-spacing: -0.04em;
  padding-inline: 0.04em;
}
.quote cite { display: block; margin-top: 28px; font-style: normal; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-mute); }

/* ----------------------------------------------------------------
   CTA section
   ---------------------------------------------------------------- */
.cta {
  text-align: center;
  padding-block: clamp(100px, 12vw, 180px);
}
.cta h2 { max-width: 16ch; margin: 0 auto 20px; }
.cta p  { max-width: 48ch; margin: 0 auto 40px; font-size: 18px; }

/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 80px var(--gutter) 40px;
  background: #080808;
}
.footer__grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 60px;
}
@media (max-width: 800px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__brand .logo { font-size: 22px; margin-bottom: 16px; }
.footer__brand p { color: var(--fg-mute); max-width: 36ch; font-size: 14px; }
.footer__col h4 { font-family: var(--mono); font-size: 11px; color: var(--fg-mute); font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 20px; }
.footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer__col a { color: var(--fg-dim); font-size: 14px; transition: color .18s ease; }
.footer__col a:hover { color: var(--fg); }
.footer__bottom {
  max-width: var(--maxw); margin: 0 auto;
  padding-top: 30px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-size: 13px; color: var(--fg-mute);
}

/* ----------------------------------------------------------------
   Case study page (Products)
   ---------------------------------------------------------------- */
.case {
  padding-block: clamp(80px, 10vw, 140px);
  border-bottom: 1px solid var(--line);
}
.case__head {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 80px);
  align-items: end;
  margin-bottom: 64px;
}
@media (max-width: 900px) { .case__head { grid-template-columns: 1fr; align-items: start; gap: 24px; } }
.case__title { font-size: clamp(48px, 6vw, 88px); letter-spacing: -0.035em; font-weight: 450; }
.case__title em { font-style: italic; color: var(--fg-dim); font-weight: 400; }
.case__tagline { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 1.8vw, 26px); color: var(--fg-dim); line-height: 1.3; max-width: 36ch; }

.case__mock {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #0b0b0b;
  aspect-ratio: 16/9;
  overflow: hidden;
  margin-bottom: 80px;
  box-shadow: 0 40px 100px -40px rgba(0,0,0,0.9);
}
.case__mock .alchemy { inset: 32px; }

.case__body {
  display: grid; grid-template-columns: 1fr 2fr; gap: clamp(40px, 6vw, 96px);
  margin-bottom: 80px;
}
@media (max-width: 900px) { .case__body { grid-template-columns: 1fr; } }
.case__body h3 { font-size: clamp(22px, 2vw, 28px); }
.case__body p { font-size: 17px; color: var(--fg-dim); line-height: 1.6; }

.case__features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 80px; }
@media (max-width: 900px) { .case__features { grid-template-columns: 1fr; } }
.feat { padding: 32px; border: 1px solid var(--line); border-radius: 14px; background: #0c0c0c; }
.feat .num {
  font-family: var(--mono); font-size: 11px;
  background: var(--gradient-full);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 20px;
}
.feat h3 { font-size: 22px; margin-bottom: 10px; }
.feat p { font-size: 14px; color: var(--fg-dim); }

.case__result {
  padding: 48px;
  border: 1px solid var(--accent-ring);
  border-radius: 16px;
  background: radial-gradient(600px 300px at 20% 0%, rgba(0,74,173,0.18), transparent 60%), #0e0f1c;
}
.case__result .eyebrow { color: var(--accent); }
.case__result .eyebrow::before { background: var(--accent); }
.case__result blockquote { font-family: var(--serif); font-size: clamp(24px, 2.4vw, 34px); line-height: 1.25; margin: 24px 0 32px; font-weight: 450; letter-spacing: -0.015em; }

/* ----------------------------------------------------------------
   Pipeline
   ---------------------------------------------------------------- */
.pipeline { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .pipeline { grid-template-columns: 1fr; } }
.pipe {
  padding: 32px;
  border-left: 1px solid var(--line);
  position: relative;
}
.pipe::before {
  content: ''; position: absolute; left: -4px; top: 32px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fg-faint);
}
.pipe.is-live::before { background: var(--accent); box-shadow: 0 0 0 3px rgba(203,108,230,0.22); }
.pipe .date { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-mute); margin-bottom: 14px; }
.pipe h3 { font-size: 22px; margin-bottom: 10px; }
.pipe p { font-size: 14px; color: var(--fg-dim); }

/* ----------------------------------------------------------------
   About
   ---------------------------------------------------------------- */
.about-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(40px, 6vw, 96px);
  padding-block: clamp(80px, 10vw, 140px);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 900px) { .about-body { grid-template-columns: 1fr; } }
.about-body h2 { max-width: 14ch; }
.about-body p { font-size: 17px; line-height: 1.65; margin-bottom: 1.2em; color: var(--fg-dim); }
.about-body p strong { color: var(--fg); font-weight: 500; }
.about-body em { color: var(--fg); font-style: italic; }

.principles {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
@media (max-width: 900px) { .principles { grid-template-columns: 1fr; } }
.principle { padding: 40px 32px; background: var(--bg); }
.principle .num {
  font-family: var(--serif); font-style: italic; font-size: 22px;
  background: var(--gradient-full);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.principle h3 { font-size: 22px; margin-bottom: 10px; }
.principle p { font-size: 14px; color: var(--fg-dim); }

.stack-list { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.stack-row { display: grid; grid-template-columns: 200px 1fr; gap: 40px; padding: 24px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 600px) { .stack-row { grid-template-columns: 1fr; gap: 8px; } }
.stack-row dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-mute); }
.stack-row dd { margin: 0; color: var(--fg); font-size: 16px; }
.stack-row dd small { color: var(--fg-mute); display: block; font-size: 14px; margin-top: 4px; }

/* ----------------------------------------------------------------
   Insights list
   ---------------------------------------------------------------- */
.posts { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.post {
  display: grid; grid-template-columns: 180px 1fr auto; gap: 40px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  transition: padding .25s ease;
}
.post:hover { padding-inline: 8px; }
@media (max-width: 780px) { .post { grid-template-columns: 1fr; gap: 10px; } .post__arrow { display: none; } }
.post__date { font-family: var(--mono); font-size: 12px; color: var(--fg-mute); letter-spacing: 0.06em; text-transform: uppercase; }
.post__title { font-family: var(--serif); font-size: clamp(22px, 2vw, 28px); font-weight: 500; letter-spacing: -0.015em; color: var(--fg); line-height: 1.2; }
.post__title em { font-style: italic; color: var(--fg-dim); font-weight: 400; }
.post__excerpt { color: var(--fg-dim); font-size: 14px; margin-top: 8px; max-width: 56ch; }
.post__tag {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--violet-300);
}
html[data-theme="light"] .post__tag { color: var(--violet-700); }
.post__arrow { color: var(--fg-mute); transition: color .2s ease, transform .2s ease; }
.post:hover .post__arrow { color: var(--fg); transform: translateX(4px); }

/* ----------------------------------------------------------------
   Tweaks panel
   ---------------------------------------------------------------- */
.tweaks {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  width: 280px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(14,14,14,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 18px;
  display: none;
  font-size: 13px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.7);
}
.tweaks.is-on { display: block; }
.tweaks h5 { margin: 0 0 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); font-weight: 400; }
.tweak-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.tweak-row label { font-size: 12px; color: var(--fg-dim); font-family: var(--mono); letter-spacing: 0.04em; }
.tweak-swatches { display: flex; gap: 6px; }
.tweak-swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; transition: border-color .2s ease; }
.tweak-swatches button.active { border-color: var(--fg); }
.tweak-select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 6px 8px; border-radius: 8px;
  font-family: var(--mono); font-size: 12px;
}

/* Utility */
.icon { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Print */
@media print {
  .nav, .tweaks, .hero__scroll { display: none; }
}


/* ----------------------------------------------------------------
   Light theme (data-theme="light" on <html>)
   ---------------------------------------------------------------- */
html[data-theme="light"] {
  /* Off-white canvas — neutral, slightly warm, pairs with blue/violet */
  --bg:        #f5f3ec;
  --bg-2:      #edeae0;
  --bg-3:      #e1ddd0;
  --bg-elev:   #f5f3ec;
  --bg-hover:  #d9d3c4;

  --line:      #d6d0be;
  --line-2:    #8a3dab;     /* violet hairline for hover/active */

  --fg:        #0a0c1c;
  --fg-dim:    #353849;
  --fg-mute:   #6b7080;
  --fg-faint:  #a8abb8;

  /* Violet-forward accents; text-on-accent flips to cream */
  --accent:          #8a3dab;
  --accent-2:        #004aad;
  --accent-dark:     #5c2d73;
  --accent-dim:      rgba(138, 61, 171, 0.10);
  --accent-ring:     rgba(138, 61, 171, 0.35);
  --contrast-on-accent: #f5f3ec;

  /* Legacy aliases remapped for structural borrows */
  --wine-deepest: #f5f3ec;
  --wine-900:     #001f4d;
  --wine-700:     #004aad;
  --wine-600:     #1a6fd4;
  --wine-500:     #a34dc4;
  --wine-300:     #cb6ce6;
}

/* Nav surface in light mode */
html[data-theme="light"] .nav.is-scrolled {
  background: rgba(245,236,215,0.85);
  border-bottom-color: var(--line);
}

/* Primary button in light: wine fill, cream text */
html[data-theme="light"] .btn--primary {
  color: var(--accent-2, #f5f3ec);
  color: #f5f3ec;
  background: var(--accent);
  box-shadow: 0 10px 24px -12px rgba(0,74,173,0.5);
}
html[data-theme="light"] .btn--primary:hover { background: var(--accent-dark); }
html[data-theme="light"] .btn--ghost { background: #e1ddd0; color: var(--fg); }
html[data-theme="light"] .btn--ghost:hover { background: #E2CFA0; }
html[data-theme="light"] .btn--link .arrow { color: var(--accent); }

/* Hero background tint */
html[data-theme="light"] .hero__bg::after {
  background:
    radial-gradient(1200px 700px at 70% 30%, rgba(0,74,173,0.14), transparent 60%),
    radial-gradient(900px 600px at 15% 85%, rgba(203,108,230,0.15), transparent 60%),
    linear-gradient(180deg, rgba(245,236,215,0) 40%, rgba(245,236,215,0.88) 85%, var(--bg) 100%);
}

/* Product / feat cards tint slightly */
html[data-theme="light"] .pcard,
html[data-theme="light"] .feat,
html[data-theme="light"] .case__mock {
  background: #edeae0;
}
html[data-theme="light"] .pcard--hero .pcard__visual { background: #dcd6c2; }
html[data-theme="light"] .pcard--placeholder {
  background: repeating-linear-gradient(45deg, #edeae0 0 10px, #EADFBF 10px 20px);
}

/* Alchemy Lab mock against light */
html[data-theme="light"] .alchemy {
  background: #ffffff;
  border-color: rgba(45,10,10,0.08);
  color: var(--fg);
}
html[data-theme="light"] .alchemy__chrome { background: rgba(45,10,10,0.03); border-bottom-color: rgba(45,10,10,0.08); }
html[data-theme="light"] .alchemy__chrome .url { color: var(--fg-mute); }
html[data-theme="light"] .alchemy__chrome .dot { background: #d6d0be; }
html[data-theme="light"] .alchemy__sidebar { border-right-color: rgba(45,10,10,0.08); }
html[data-theme="light"] .alchemy__nav a { color: var(--fg-mute); }
html[data-theme="light"] .alchemy__nav a.active { background: rgba(0,74,173,0.10); color: var(--accent); }
html[data-theme="light"] .alchemy__kpi { border-color: rgba(45,10,10,0.08); background: rgba(45,10,10,0.02); }
html[data-theme="light"] .alchemy__chart { border-color: rgba(45,10,10,0.08); }
html[data-theme="light"] .alchemy__alert { background: rgba(45,10,10,0.03); }
html[data-theme="light"] .alchemy__alert .name { color: var(--fg); }
html[data-theme="light"] .alchemy__alert .amt { color: var(--fg-dim); }

/* Expertise / principles grid */
html[data-theme="light"] .expertise,
html[data-theme="light"] .principles {
  background: var(--line);
  border-color: var(--line);
}
html[data-theme="light"] .xc,
html[data-theme="light"] .principle { background: var(--bg); }
html[data-theme="light"] .xc:hover { background: #edeae0; }

/* Footer / quote */
html[data-theme="light"] .footer { background: #edeae0; }
html[data-theme="light"] .quote {
  background: linear-gradient(180deg, #edeae0 0%, #e1ddd0 50%, #edeae0 100%);
}
html[data-theme="light"] .case__result {
  background: radial-gradient(600px 300px at 20% 0%, rgba(0,74,173,0.12), transparent 60%), #edeae0;
}

/* Tweaks panel surface */
html[data-theme="light"] .tweaks {
  background: rgba(245,236,215,0.94);
  border-color: var(--line-2);
}
html[data-theme="light"] .tweak-select {
  background: rgba(45,10,10,0.04);
  border-color: var(--line);
  color: var(--fg);
}

/* Theme toggle button — tucked into nav */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 999px;
  color: var(--fg-dim);
  background: transparent;
  transition: color .18s ease, background .18s ease;
  margin-right: 4px;
}
.theme-toggle:hover { color: var(--fg); background: var(--bg-elev); }
.theme-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .ic-sun  { display: none; }
.theme-toggle .ic-moon { display: block; }
html[data-theme="light"] .theme-toggle .ic-sun  { display: block; }
html[data-theme="light"] .theme-toggle .ic-moon { display: none; }

/* ----------------------------------------------------------------
   Demo request form (products.html #demo)
   ---------------------------------------------------------------- */
.demo {
  padding-block: clamp(80px, 10vw, 140px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(900px 500px at 80% 0%, rgba(0,74,173,0.10), transparent 60%);
}
.demo__head { max-width: 56ch; margin-bottom: clamp(48px, 6vw, 80px); }
.demo__head h2 { max-width: 16ch; }
.demo__head em { font-style: italic; color: var(--fg-dim); font-weight: 400; }
.demo__head .lede { max-width: 56ch; }

.demo__form {
  max-width: 820px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #0b0b11 0%, #0a0a10 100%);
  padding: clamp(28px, 4vw, 48px);
  position: relative;
}

.demo__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 24px;
}
@media (max-width: 680px) { .demo__grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field--full { grid-column: 1 / -1; }

.field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
  font-weight: 400;
}
.field label .req { color: var(--accent); margin-left: 2px; }
.field label .opt {
  color: var(--fg-faint);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 10px;
  margin-left: 4px;
}

.field input,
.field textarea {
  font: inherit;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--fg);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  outline: 0;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.field input::placeholder,
.field textarea::placeholder { color: var(--fg-faint); }

.field input:hover,
.field textarea:hover { border-color: var(--line-2); }

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.03);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.field.is-invalid input,
.field.is-invalid textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.14);
}

.field .err {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--danger);
  letter-spacing: 0.04em;
  min-height: 13px;
  display: block;
}

.demo__honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none;
}

.demo__actions {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 28px;
}
.demo__hint { font-size: 13px; color: var(--fg-mute); margin: 0; }

.demo__err-global {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--danger);
  letter-spacing: 0.04em;
}
.demo__err-global:empty { display: none; }

/* Submit button loading state */
#demo-submit { min-width: 180px; justify-content: center; }
#demo-submit .demo__spinner {
  display: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: demo-spin .7s linear infinite;
}
#demo-submit[data-loading="true"] { pointer-events: none; opacity: .75; }
#demo-submit[data-loading="true"] .demo__btn-label { opacity: 0.55; }
#demo-submit[data-loading="true"] .demo__btn-arrow { display: none; }
#demo-submit[data-loading="true"] .demo__spinner { display: inline-block; }
@keyframes demo-spin { to { transform: rotate(360deg); } }

/* Success state */
.demo__success {
  max-width: 820px;
  border: 1px solid var(--accent-ring);
  border-radius: 18px;
  padding: clamp(32px, 5vw, 56px);
  background:
    radial-gradient(500px 240px at 20% 0%, rgba(0,74,173,0.18), transparent 60%),
    #0e0f18;
}
.demo__success-check {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: var(--wine-deepest);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.demo__success-check svg {
  width: 20px; height: 20px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.demo__success h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.demo__success p {
  color: var(--fg-dim); font-size: 16px; max-width: 44ch;
}

/* Light mode overrides */
html[data-theme="light"] .demo {
  background: radial-gradient(900px 500px at 80% 0%, rgba(0,74,173,0.08), transparent 60%);
}
html[data-theme="light"] .demo__form {
  background: #edeae0;
  border-color: var(--line);
}
html[data-theme="light"] .field input,
html[data-theme="light"] .field textarea {
  background: rgba(251,246,230,0.75);
  border-color: var(--line);
  color: var(--fg);
}
html[data-theme="light"] .field input:focus,
html[data-theme="light"] .field textarea:focus {
  background: #ffffff;
  border-color: var(--accent);
}
html[data-theme="light"] .field input::placeholder,
html[data-theme="light"] .field textarea::placeholder { color: var(--fg-faint); }
html[data-theme="light"] .demo__success {
  background:
    radial-gradient(500px 240px at 20% 0%, rgba(0,74,173,0.10), transparent 60%),
    #edeae0;
}
html[data-theme="light"] .demo__success-check { background: var(--accent); color: #f5f3ec; }

/* ================================================================
   Gradient border hover on product cards
   ================================================================ */
.pcard { transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease; }
.pcard::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-full);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
  z-index: 1;
}
.pcard:hover::before { opacity: 0.9; }
.pcard:hover { border-color: transparent; box-shadow: 0 24px 60px -30px rgba(203,108,230,0.35); }
.pcard--placeholder::before { opacity: 0 !important; }
.pcard--placeholder:hover { border-color: var(--line-2); box-shadow: none; }

/* ================================================================
   Link (in-body) — blue in dark, deep violet in light
   ================================================================ */
a.link, .prose a, .post__title em, .editorial__body a {
  color: var(--accent-2);
  transition: color .18s ease;
}
a.link:hover { color: var(--accent); }
html[data-theme="light"] a.link { color: var(--blue-700); }
html[data-theme="light"] a.link:hover { color: var(--violet-700); }

/* ================================================================
   Focus ring — blue primary, violet in light theme
   ================================================================ */
a:focus-visible, button:focus-visible, .btn:focus-visible,
.field input:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 6px;
}
html[data-theme="light"] a:focus-visible,
html[data-theme="light"] button:focus-visible,
html[data-theme="light"] .btn:focus-visible {
  outline-color: var(--blue-700);
}

/* ================================================================
   Accessibility: reduced motion
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .badge--live::before { animation: none; }
  .hero__scroll .line { animation: none; }
  .reveal { transition: none; transform: none; opacity: 1; }
  .faq__item[open] .faq__chev svg { transition: none; }
}

/* ================================================================
   Nav tools cluster: language selector + theme + CTA
   ================================================================ */
.nav__tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav__tools .nav__cta { margin-inline-start: 4px; }
@media (max-width: 640px) {
  .nav__tools .nav__cta { display: none; }
}

/* Language pills */
.lang {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: transparent;
  gap: 2px;
}
.lang button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute);
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .18s ease, background .22s ease;
  line-height: 1;
}
.lang button:hover { color: var(--fg-dim); }
.lang button.is-active {
  color: var(--fg);
  background: var(--bg-elev);
  position: relative;
}
.lang button.is-active::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-full);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.8;
  pointer-events: none;
}
html[data-theme="light"] .lang button.is-active { background: #ece7d7; }
@media (max-width: 520px) { .lang button { padding: 4px 7px; font-size: 10.5px; } }

/* ================================================================
   About — "Why eHealth" sub-card
   ================================================================ */
.why-card {
  margin-top: 36px;
  padding: 28px 30px;
  border-radius: 16px;
  position: relative;
  background:
    linear-gradient(180deg, rgba(0,74,173,0.05) 0%, rgba(203,108,230,0.04) 100%),
    var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.why-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-full);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.35;
  pointer-events: none;
}
.why-card .eyebrow { color: var(--fg-dim); }
.why-card__body {
  margin-top: 14px;
  font-size: clamp(16px, 1.2vw, 18px);
  color: var(--fg);
  line-height: 1.55;
}
html[data-theme="light"] .why-card {
  background:
    linear-gradient(180deg, rgba(0,74,173,0.06) 0%, rgba(203,108,230,0.05) 100%),
    var(--bg-2);
}

/* ================================================================
   FAQ accordion
   ================================================================ */
.faq {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line);
}
.faq__item {
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.faq__item summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 4px;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(18px, 1.8vw, 22px);
  letter-spacing: -0.01em;
  color: var(--fg);
  transition: color .2s ease;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--accent); }
html[data-theme="light"] .faq__item summary:hover { color: var(--violet-700); }
.faq__q { flex: 1; min-width: 0; }
.faq__chev {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .25s ease, color .25s ease;
}
.faq__chev svg { width: 14px; height: 14px; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.faq__item[open] .faq__chev {
  border-color: transparent;
  background: var(--gradient-full);
  color: #ffffff;
}
.faq__item[open] .faq__chev svg { transform: rotate(-180deg); }
.faq__a {
  padding: 0 4px 28px;
  max-width: 82ch;
}
.faq__a p {
  color: var(--fg-dim);
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.65;
}

/* ================================================================
   Alchemy Lab mockup — keep the product's own emerald identity
   (scoped overrides so the studio's blue/violet does not bleed in)
   ================================================================ */
.alchemy {
  --s-emerald:     #059669;
  --s-emerald-2:   #34d399;
  --s-emerald-dim: rgba(5,150,105,0.18);
  --s-emerald-sft: rgba(5,150,105,0.10);
  --s-danger:      #dc2626;
}
.alchemy__sidebar .logo-s em { color: var(--s-emerald); }
.alchemy__nav a.active {
  background: var(--s-emerald-dim);
  color: var(--s-emerald);
}
.alchemy__kpi .val em { color: var(--s-emerald); font-size: 12px; font-family: var(--mono); font-style: normal; margin-left: 4px; }
.alchemy__kpi .val.red em { color: #fca5a5; }
.alchemy__alert .pip { background: var(--s-emerald); }
.alchemy__alert.hi .pip { background: var(--s-danger); }
html[data-theme="light"] .alchemy__nav a.active {
  background: var(--s-emerald-sft);
  color: #047857;
}
html[data-theme="light"] .alchemy__kpi .val em { color: #047857; }
html[data-theme="light"] .alchemy__kpi .val.red em { color: #b91c1c; }

/* ================================================================
   RTL overrides
   ================================================================ */
html[dir="rtl"] body { font-family: 'Noto Naskh Arabic', 'IBM Plex Sans Arabic', 'Geist', ui-sans-serif, system-ui, sans-serif; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4,
html[dir="rtl"] .pcard__title, html[dir="rtl"] .faq__item summary {
  font-family: 'Noto Naskh Arabic', 'IBM Plex Sans Arabic', var(--serif);
  letter-spacing: 0;
  font-weight: 600;
}
html[dir="rtl"] em { font-style: normal; color: var(--accent); }
html[dir="rtl"] .hero h1 em { color: var(--accent); }
html[dir="rtl"] .pcard__title em { color: var(--accent); }
html[dir="rtl"] h1, html[dir="rtl"] h2 { line-height: 1.2; }

/* Flip arrow icons in RTL */
html[dir="rtl"] .arrow-ic,
html[dir="rtl"] .btn--link .arrow { transform: scaleX(-1); }

/* Alchemy mock — border side flips */
html[dir="rtl"] .pcard--hero .pcard__visual {
  border-left: 0;
  border-right: 1px solid var(--line);
}
@media (max-width: 900px) {
  html[dir="rtl"] .pcard--hero .pcard__visual {
    border-right: 0;
    border-top: 1px solid var(--line);
  }
}
html[dir="rtl"] .alchemy__sidebar {
  border-right: 0;
  border-left: 1px solid rgba(255,255,255,0.05);
  padding-right: 0;
  padding-left: 12px;
}
html[data-theme="light"][dir="rtl"] .alchemy__sidebar {
  border-left-color: rgba(10,12,28,0.08);
}
html[dir="rtl"] .alchemy__alert { grid-template-columns: auto 1fr 8px; }

/* Pipe (pipeline) — left border flips (only present on former products page, but safe) */
html[dir="rtl"] .pipe {
  border-left: 0;
  border-right: 1px solid var(--line);
}
html[dir="rtl"] .pipe::before { left: auto; right: -4px; }

/* Stack list: cue column gap reads correctly in RTL */
html[dir="rtl"] .stack-row { direction: rtl; }

/* FAQ chev faces the expected direction in RTL (chevron-down stays down) */
html[dir="rtl"] .faq__item summary { text-align: right; }

/* Nav __tools: the language pill + CTA naturally flow via flex reverse */
html[dir="rtl"] .nav__tools { flex-direction: row-reverse; }
html[dir="rtl"] .lang { flex-direction: row-reverse; }

/* Theme-color meta doesn't need flipping, but scroll hint does */
html[dir="rtl"] .hero__scroll { left: auto; right: 50%; transform: translateX(50%); }

/* ================================================================
   Solutions — pcard__cta variant (primary gradient inside card)
   ================================================================ */
.pcard__cta { padding: 11px 20px; }

/* Keep the solutions lede constrained */
#solutions .lede { color: var(--fg-dim); max-width: 56ch; }

/* Tags — stay violet-scoped for studio cards, unless inside .alchemy */
.tags:not(.alchemy *) { color: var(--violet-300); }
html[data-theme="light"] .tags:not(.alchemy *) { color: var(--violet-700); }
