/* ============================================================
   SYNTHETIX — global styles & design tokens
   ============================================================ */

:root {
  /* ---- canvas (off-white light) ---- */
  --bg:        #f9fafb;
  --bg-1:      #f3f4f6;
  --bg-2:      #ebedf0;
  --bg-3:      #e2e5e9;
  --line:      rgba(0,0,0,0.08);
  --line-2:    rgba(0,0,0,0.13);

  /* ---- ink ---- */
  --ink:       #0d1117;
  --ink-soft:  #374151;
  --ink-mute:  #6b7280;
  --ink-faint: #9ca3af;

  /* ---- accents (darkened for light background contrast) ---- */
  --cyan:      oklch(0.52 0.16 196);
  --cyan-dim:  oklch(0.52 0.16 196 / 0.14);
  --amber:     oklch(0.55 0.16 72);
  --amber-dim: oklch(0.55 0.16 72 / 0.14);
  --accent:    var(--cyan);          /* primary signal, overridable by tweak */
  --accent-2:  var(--amber);

  /* ---- type ---- */
  --display: "Bricolage Grotesque", Georgia, serif;
  --body:    "Hanken Grotesk", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  --maxw: 1240px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* hide native cursor only on devices with a precise pointer */
@media (hover: hover) and (pointer: fine) {
  body.custom-cursor, body.custom-cursor * { cursor: none; }
}

::selection { background: color-mix(in oklch, var(--accent) 35%, transparent); color: #fff; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

h1,h2,h3,h4 { font-family: var(--display); font-weight: 700; line-height: 1.02; letter-spacing: -0.02em; }

.mono { font-family: var(--mono); }

/* ---- layout helpers ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 64px); }
.section { position: relative; }

/* eyebrow / kicker label */
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  display: inline-block;
}
.kicker.muted { color: var(--ink-mute); }
.kicker.muted::before { background: var(--ink-mute); }

/* ============================================================
   GRAIN OVERLAY (hero only)
   ============================================================ */
.grain {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.05;
  z-index: 3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' 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
   ============================================================ */
.cur-dot, .cur-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  will-change: transform;
}
.cur-dot {
  width: 7px; height: 7px;
  background: #111;
  transform: translate(-50%, -50%);
}
.cur-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(0,0,0,0.35);
  transform: translate(-50%, -50%);
  mix-blend-mode: normal;
  transition: width .22s ease, height .22s ease, border-color .22s ease, background .22s ease;
}
.cur-ring.hot {
  width: 58px; height: 58px;
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 12%, transparent);
}
.cur-ring.down { width: 26px; height: 26px; }
@media (hover: none), (pointer: coarse) { .cur-dot, .cur-ring { display: none; } }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 64px);
  transition: background .4s ease, border-color .4s ease, padding .4s ease;
  border-bottom: 1px solid transparent;
}
.nav.stuck {
  background: color-mix(in oklch, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  padding-top: 13px; padding-bottom: 13px;
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand .glyph {
  width: 22px; height: 22px; position: relative; flex: none;
}
.brand .glyph span { position: absolute; inset: 0; border: 1.5px solid var(--accent); }
.brand .glyph span:nth-child(2) { transform: translate(5px,5px); border-color: var(--accent-2); opacity: .55; }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { font-size: 14.5px; color: var(--ink-soft); transition: color .25s ease; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); }
/* Active section indicator — subtle dot below the link */
.nav-links a:not(.nav-cta) { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.nav-links a.active:not(.nav-cta) { color: var(--ink); }
.nav-links a:not(.nav-cta)::after {
  content: "";
  display: block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 4px;
  opacity: 0;
  transform: scale(0);
  transition: opacity .25s ease, transform .25s cubic-bezier(.16,1,.3,1);
}
.nav-links a.active:not(.nav-cta)::after { opacity: 1; transform: scale(1); }
.nav-cta {
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em; white-space: nowrap;
  padding: 9px 18px; border: 1px solid var(--line-2); border-radius: 4px;
  color: var(--ink); transition: border-color .2s, background .2s, color .2s;
}
.nav-cta:hover { border-color: var(--accent); background: var(--accent); color: #06292b; }
@media (max-width: 760px){ .nav-links a:not(.nav-cta){ display:none; } }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  font-family: var(--mono); font-size: 14px; letter-spacing: .03em;
  padding: 15px 26px; border-radius: 5px;
  border: 1px solid transparent;
  transition: transform .25s cubic-bezier(.16,1,.3,1), background .25s, border-color .25s, color .25s;
  position: relative; overflow: hidden;
}
.btn .arrow { transition: transform .3s cubic-bezier(.16,1,.3,1); }
.btn:hover .arrow { transform: translateX(5px); }
.btn-primary { background: var(--accent); color: #06292b; font-weight: 600; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line); padding: 60px 0 40px; }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; }
.footer .muted { color: var(--ink-mute); font-size: 14px; }
