/* ============================================================
   Sadeep OS — base tokens, themes, cursor
   ============================================================ */
:root {
  /* dark workspace (default) */
  --bg:        #0d0b09;
  --bg-2:      #14100d;
  --surface:   #1b1612;
  --surface-2: #241d18;
  --line:      rgba(255, 240, 230, 0.08);
  --line-2:    rgba(255, 240, 230, 0.15);
  --ink:       #f6f0ea;
  --ink-soft:  #c6bab0;
  --ink-mute:  #8a7e75;

  /* accents */
  --c-coral:   #e08763;
  --c-coral-d: #c8623f;
  --c-cyan:    #5fd9d0;
  --c-violet:  #b08cf0;
  --c-amber:   #e7b15e;

  --glow-coral:  0 0 50px -8px rgba(224, 135, 99, 0.55);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Manrope', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
  --font-serif:   'Instrument Serif', Georgia, serif;

  --radius:    20px;
  --radius-sm: 13px;
  --maxw:      1220px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
}

/* LIGHT workspace theme (scoped to .theme-light sections) */
.theme-light {
  --bg:        #f1eadf;
  --bg-2:      #efe7dc;
  --surface:   rgba(255, 252, 247, 0.86);
  --surface-2: #f6efe6;
  --line:      rgba(40, 28, 20, 0.10);
  --line-2:    rgba(40, 28, 20, 0.18);
  --ink:       #241a13;
  --ink-soft:  #5c4f44;
  --ink-mute:  #8c7d6f;
  --c-coral:   #c8623f;
  --glow-coral: 0 18px 50px -22px rgba(120, 70, 40, 0.5);
  color: var(--ink);
}
/* re-establish inherited color at each theme scope so headings
   resolve --ink from their OWN section, not the :root default */
.theme-dark { color: var(--ink); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
body.booting { overflow: hidden; }

/* hide native cursor on fine pointers */
@media (pointer: fine) {
  body.has-cursor, body.has-cursor * { cursor: none !important; }
}

/* background layers ----------------------------------------- */
#bg-base {
  position: fixed; inset: 0; z-index: 0;
  background-color: var(--bg);
  transition: background-color 0.9s var(--ease);
}
#bg-canvas { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
#three-canvas { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 1; transition: opacity 0.8s ease; }
.grain {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main { position: relative; z-index: 5; }

/* custom cursor --------------------------------------------- */
#cur-dot, #cur-ring { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; border-radius: 50%; mix-blend-mode: difference; will-change: transform; }
#cur-dot { width: 7px; height: 7px; background: #fff; transform: translate(-50%, -50%); }
#cur-ring { width: 34px; height: 34px; border: 1.5px solid rgba(255,255,255,0.7); transform: translate(-50%, -50%); transition: width 0.25s var(--ease), height 0.25s var(--ease), background 0.25s, border-color 0.25s; }
#cur-ring.hot { width: 54px; height: 54px; background: rgba(224,135,99,0.18); border-color: var(--c-coral); }
@media (pointer: coarse) { #cur-dot, #cur-ring { display: none; } }

/* layout ---------------------------------------------------- */
.wrap { width: min(92%, var(--maxw)); margin-inline: auto; }

/* type ------------------------------------------------------ */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.02; letter-spacing: -0.02em; }

.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--c-coral);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; opacity: 0.6; }

.section-head { margin-bottom: clamp(40px, 6vh, 70px); max-width: 760px; }
.section-head h2 { font-size: clamp(34px, 5.4vw, 60px); margin-top: 20px; text-wrap: balance; }
.section-head p { color: var(--ink-soft); font-size: clamp(16px, 2vw, 19px); margin-top: 18px; max-width: 56ch; text-wrap: pretty; }
.section-head code, p code { font-family: var(--font-mono); font-size: 0.85em; background: rgba(224,135,99,0.14); color: var(--c-coral); padding: 2px 8px; border-radius: 6px; }

/* cards ----------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}
.theme-dark .card { background: linear-gradient(165deg, rgba(27,22,18,0.82), rgba(20,16,13,0.9)); }

/* buttons --------------------------------------------------- */
.btn {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em;
  padding: 13px 24px; border-radius: 100px; border: 1px solid var(--line-2);
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.03); transition: transform 0.3s var(--ease), background 0.3s, border-color 0.3s, box-shadow 0.4s, color 0.3s;
}
.theme-light .btn { background: rgba(40,28,20,0.04); }
.btn:hover { border-color: var(--c-coral); box-shadow: var(--glow-coral); }
.btn-primary { background: linear-gradient(120deg, var(--c-coral), var(--c-coral-d)); border-color: transparent; color: #fff7f2; font-weight: 700; }
.theme-light .btn-primary { color: #fff7f2; }

/* reveal ---------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.85s var(--ease), transform 0.85s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; } .reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; } .reveal.d4 { transition-delay: 0.32s; }

/* chips ----------------------------------------------------- */
.chip {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 7px 13px; border-radius: 100px; border: 1px solid var(--line-2);
  color: var(--ink-soft); background: rgba(127,127,127,0.06); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  #three-canvas, #bg-canvas { display: none; }
}
