/* ==========================================================================
   SyncTide — base styles: tokens, reset, typography
   ========================================================================== */

:root {
  /* Color system */
  --bg-0: #05070d;
  --bg-1: #0a0e1a;
  --bg-2: #0f1525;
  --surface: #111a2e;
  --surface-hi: #172341;
  --border: #1d2944;
  --border-hi: #2a3a60;

  --text: #e9eefb;
  --text-dim: #b1bdd5;
  --text-muted: #7d8aa8;

  --accent: #5eb0ff;
  --accent-2: #7c5cff;
  --accent-3: #3ddc97;
  --danger: #ff5d73;
  --warn: #f2c14e;

  /* Gradients */
  --grad-hero: linear-gradient(135deg, #5eb0ff 0%, #7c5cff 60%, #3ddc97 120%);
  --grad-text: linear-gradient(180deg, #ffffff 0%, #a9c3ea 100%);
  --grad-card: linear-gradient(160deg, rgba(94,176,255,0.08), rgba(124,92,255,0.02));

  /* Shadows / glows */
  --glow-blue: 0 20px 60px -20px rgba(94,176,255,0.55);
  --glow-purple: 0 20px 60px -20px rgba(124,92,255,0.55);
  --glow-soft: 0 10px 40px -10px rgba(0,0,0,0.55);

  /* Spacing + radii */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --container: 1200px;
  --nav-h: 68px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dynamic mesh background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60vw 60vw at 10% 0%, rgba(94,176,255,0.18), transparent 60%),
    radial-gradient(55vw 55vw at 90% 10%, rgba(124,92,255,0.14), transparent 60%),
    radial-gradient(70vw 50vw at 50% 100%, rgba(61,220,151,0.08), transparent 60%);
  pointer-events: none;
  z-index: -2;
  animation: meshShift 22s var(--ease-in-out) infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 75%);
  pointer-events: none;
  z-index: -1;
}

@keyframes meshShift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-2%, 2%, 0) scale(1.05); }
  100% { transform: translate3d(2%, -1%, 0) scale(1.02); }
}

/* Typography */
h1, h2, h3, h4 { font-family: "Instrument Serif", "Inter", serif; letter-spacing: -0.02em; font-weight: 400; margin: 0; }
h1 { font-size: clamp(44px, 7.5vw, 96px); line-height: 1; }
h2 { font-size: clamp(32px, 4.5vw, 52px); line-height: 1.05; }
h3 { font-size: clamp(20px, 2vw, 24px); line-height: 1.25; font-family: "Inter", sans-serif; font-weight: 600; letter-spacing: -0.01em; }

.serif { font-family: "Instrument Serif", serif; font-style: italic; font-weight: 400; }

p { margin: 0; }

a { color: inherit; text-decoration: none; transition: color .2s var(--ease-out); }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

code, pre {
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
}
code {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 6px;
  color: var(--text-dim);
}

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 700px) { .container { padding: 0 20px; } }

.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }

.reveal { opacity: 0; transform: translateY(24px); }

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body::before { animation: none; }
}
