/* ============================================================
   base.css — design tokens, reset, typography, utilities
   bikashsharma.in
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #07070d;
  --bg-soft: #0d0d17;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* Text */
  --text: #eef0f6;
  --text-muted: #a3abc0;
  --text-faint: #6d748a;

  /* Accent */
  --accent-1: #8b7cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 124, 255, 0.14);
  --ok: #34d399;
  --warn: #fbbf24;

  /* Gradient + glow */
  --grad: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  --glow: 0 0 90px rgba(139, 124, 255, 0.20);

  /* Type */
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Motion / shape / layout */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1100px;
  --nav-h: 68px;
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 20px 60px rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] {
  color-scheme: light;

  --bg: #f5f6fb;
  --bg-soft: #eef0f8;
  --surface: rgba(16, 20, 45, 0.03);
  --surface-strong: rgba(16, 20, 45, 0.05);
  --border: rgba(16, 20, 45, 0.10);
  --border-strong: rgba(16, 20, 45, 0.20);

  --text: #14151f;
  --text-muted: #4b5164;
  --text-faint: #7a8094;

  --accent-1: #5b4bff;
  --accent-2: #0891b2;
  --accent-soft: rgba(91, 75, 255, 0.10);

  --glow: 0 0 90px rgba(91, 75, 255, 0.10);
  --shadow-card: 0 10px 30px rgba(20, 25, 60, 0.08);
  --shadow-card-hover: 0 18px 44px rgba(20, 25, 60, 0.14);
}

/* ---------- 2. Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: var(--accent-1);
  text-underline-offset: 3px;
}

ul,
ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  color: var(--text-muted);
  text-wrap: pretty;
}

/* ---------- 3. Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-1);
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.6rem 1.1rem;
  background: var(--accent-1);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus-visible {
  top: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 4. Scrollbar (WebKit) ---------- */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-faint) 40%, transparent);
  border-radius: 8px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-1);
}

/* ---------- 5. Base utilities ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.accent {
  color: var(--accent-2);
}

/* Section scaffolding */
.section {
  padding-block: clamp(4rem, 9vh, 6.5rem);
  scroll-margin-top: calc(var(--nav-h) + 0.5rem);
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-1);
}

.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

.section-head {
  margin-bottom: clamp(2rem, 5vh, 3rem);
}

.section-title {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  margin-top: 0.4rem;
}

.section-sub {
  max-width: 56ch;
  margin-top: 0.6rem;
  color: var(--text-muted);
}
