/* =========================================================================
   IDUX design tokens + base
   Variable names follow shadcn/ui so they copy 1:1 into Next.js globals.css.
   Light values live on :root, dark values on .dark (dark is the default).
   ========================================================================= */

@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/InstrumentSerif-normal-400.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/InstrumentSerif-italic-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("../fonts/Inter-normal-300-800.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("../fonts/JetBrainsMono-normal-400-500.woff2") format("woff2"); }

:root {
  /* --- shadcn core (light) --- */
  --background: #f6f5f1;
  --foreground: #0c0c12;
  --card: #ffffff;
  --card-foreground: #0c0c12;
  --popover: #ffffff;
  --primary: #0c0c12;
  --primary-foreground: #f6f5f1;
  --secondary: #ecebe5;
  --secondary-foreground: #0c0c12;
  --muted: #ecebe5;
  --muted-foreground: #66656f;
  --accent: #6d4aff;
  --accent-foreground: #ffffff;
  --border: rgba(12, 12, 18, 0.1);
  --input: rgba(12, 12, 18, 0.14);
  --ring: #6d4aff;
  --radius: 14px;

  /* --- IDUX extras --- */
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --hairline: rgba(12, 12, 18, 0.07);
  --shadow-lg: 0 30px 80px -30px rgba(20, 16, 50, 0.28);
  --glow-a: #7c5cff;           /* violet */
  --glow-b: #0fb5d4;           /* cyan   */
  --glow-c: #e89a2c;           /* amber  */
  --aurora-opacity: 0.38;
  --grain-opacity: 0.05;

  /* --- connected sources --- */
  --src-dancingj: #c43b6e;
  --src-iabfm: #a8841f;
  --src-wga: #5d6470;
  --src-hkppaa: #2f6fe0;
  --src-idux: #6d4aff;
  --chart-1: #6d4aff;          /* single-series chart hue (validated vs card surface) */

  /* --- type --- */
  --font-display: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --aurora: linear-gradient(100deg, var(--glow-a) 0%, var(--glow-b) 52%, var(--glow-c) 100%);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --container: 1240px;
  --nav-h: 64px;
}

.dark {
  --background: #07070a;
  --foreground: #ededf2;
  --card: #0e0e14;
  --card-foreground: #ededf2;
  --popover: #101017;
  --primary: #f3f3f6;
  --primary-foreground: #07070a;
  --secondary: #16161e;
  --secondary-foreground: #ededf2;
  --muted: #14141b;
  --muted-foreground: #8d8c9a;
  --accent: #9b84ff;
  --accent-foreground: #07070a;
  --border: rgba(255, 255, 255, 0.09);
  --input: rgba(255, 255, 255, 0.12);
  --ring: #9b84ff;

  --glass: rgba(14, 14, 20, 0.6);
  --glass-strong: rgba(16, 16, 23, 0.88);
  --hairline: rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 40px 120px -40px rgba(0, 0, 0, 0.9);
  --glow-a: #8b6cff;
  --glow-b: #22d3ee;
  --glow-c: #f5b54a;
  --aurora-opacity: 0.55;
  --grain-opacity: 0.07;

  --src-dancingj: #ec5f93;
  --src-iabfm: #d4af37;
  --src-wga: #c9ced6;
  --src-hkppaa: #5b9bff;
  --src-idux: #9b84ff;
  --chart-1: #8b6cff;
}

/* ---------------- base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color 0.5s var(--ease-out), color 0.5s var(--ease-out);
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--foreground); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------------- type ---------------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.95;
  text-wrap: balance;
}
.display em, .serif-em { font-style: italic; }
.h1 { font-size: clamp(52px, 8.2vw, 128px); }
.h2 { font-size: clamp(40px, 5.4vw, 80px); }
.h3 { font-size: clamp(28px, 3vw, 42px); }
.lead { font-size: clamp(17px, 1.4vw, 20px); color: var(--muted-foreground); line-height: 1.6; max-width: 60ch; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted-foreground); }
.grad-text {
  background: var(--aurora);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------- layout ---------------- */
.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.section { padding-block: clamp(80px, 11vw, 160px); position: relative; }
.section-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 820px; }
.section-head.center { margin-inline: auto; text-align: center; justify-items: center; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- ambient background ---------------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  opacity: var(--aurora-opacity);
  transition: opacity 0.8s var(--ease-out);
}
.aurora i {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  will-change: transform;
}
.aurora i:nth-child(1) { left: -20vmax; top: -30vmax; background: radial-gradient(closest-side, color-mix(in srgb, var(--glow-a) 70%, transparent), transparent); animation: drift-a 34s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { right: -25vmax; top: -20vmax; background: radial-gradient(closest-side, color-mix(in srgb, var(--glow-b) 55%, transparent), transparent); animation: drift-b 40s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { left: 15vmax; top: 30vh; background: radial-gradient(closest-side, color-mix(in srgb, var(--glow-c) 38%, transparent), transparent); animation: drift-c 46s ease-in-out infinite alternate; }
body:not([data-page="home"]) .aurora { opacity: calc(var(--aurora-opacity) * 0.55); }

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}

@keyframes drift-a { to { transform: translate3d(18vmax, 14vmax, 0) scale(1.15); } }
@keyframes drift-b { to { transform: translate3d(-16vmax, 20vmax, 0) scale(0.9); } }
@keyframes drift-c { to { transform: translate3d(10vmax, -18vmax, 0) scale(1.2); } }
