/* QuantaLynk shared shell — chrome tokens + nav + footer + grain + cursor.
   Authoritative tokens. Per-page :root MUST NOT redefine these names. */

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

:root {
  --bg: #100D0A !important;
  --bg-2: #1A1612 !important;
  --bg-3: #221C16 !important;
  --ink: #F5EFE6 !important;
  --ink-2: rgba(245,239,230,0.82) !important;
  --ink-3: rgba(245,239,230,0.56) !important;
  --ink-4: rgba(245,239,230,0.32) !important;
  --line: rgba(245,239,230,0.08) !important;
  --line-2: rgba(245,239,230,0.16) !important;
  --accent: #D14E2C !important;
  --accent-glow: rgba(209,78,44,0.18) !important;
  --accent-soft: rgba(209,78,44,0.08) !important;
  --highlight: #F0C8B3 !important;
  --display: 'Fraunces', Georgia, serif !important;
  --body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace !important;
  --pad: clamp(20px, 4vw, 56px) !important;
  --max: 1320px !important;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: none;
}

@media (hover: none) {
  body { cursor: auto; }
  #cursor, #cursor-dot { display: none !important; }
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--bg); }

/* Grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* Custom cursor */
#cursor {
  position: fixed; pointer-events: none; z-index: 1000;
  width: 32px; height: 32px;
  border: 1px solid var(--ink-3); border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 200ms cubic-bezier(0.2,0.8,0.2,1), height 200ms cubic-bezier(0.2,0.8,0.2,1), border-color 200ms;
  mix-blend-mode: difference;
}
#cursor-dot {
  position: fixed; pointer-events: none; z-index: 1001;
  width: 4px; height: 4px;
  background: var(--ink); border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 200ms;
}
#cursor.active { width: 64px; height: 64px; border-color: var(--accent); background: var(--accent-soft); }
#cursor.active ~ #cursor-dot { opacity: 0; }

.qlk-wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* Nav */
.qlk-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 22px 0;
  background: rgba(16,13,10,0.6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  transition: padding 250ms;
}
.qlk-nav.scrolled { padding: 14px 0; }
.qlk-nav-inner { display: flex; align-items: center; justify-content: space-between; }
.qlk-brand {
  font-family: var(--display);
  font-weight: 500; font-size: 20px;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 30;
  color: var(--ink);
}
.qlk-brand .accent { color: var(--accent); font-style: italic; font-weight: 500; }
.qlk-nav-links {
  display: flex; gap: 32px; list-style: none;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
}
.qlk-nav-links a { color: var(--ink-3); transition: color 200ms; padding: 4px 0; position: relative; }
.qlk-nav-links a::after {
  content: ""; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--accent);
  transition: width 250ms;
}
.qlk-nav-links a:hover { color: var(--ink); }
.qlk-nav-links a:hover::after { width: 100%; }
.qlk-nav-cta {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 10px 18px;
  background: var(--ink); color: var(--bg);
  border-radius: 999px; border: none;
  letter-spacing: 0.04em;
  transition: all 250ms;
  display: inline-block;
}
.qlk-nav-cta:hover { background: var(--accent); color: var(--ink); transform: translateY(-1px); }
@media (max-width: 820px) { .qlk-nav-links { display: none; } }

/* Footer */
.qlk-footer {
  padding: 36px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  letter-spacing: 0.04em;
}
.qlk-footer-inner {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
}
.qlk-footer a { color: var(--ink-2); transition: color 200ms; border-bottom: 1px solid var(--line-2); }
.qlk-footer a:hover { color: var(--accent); border-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body::before { display: none; }
}
