/* ============================================================
   BASE — Design tokens, reset, typography
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400&family=Hanken+Grotesk:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Palette — warm light */
  --bg:          #F8F7F4;
  --surface:     #FFFFFF;
  --surface-2:   #F3F2EE;
  --surface-3:   #EBEAE6;
  --border:      #DEDCD6;
  --border-dim:  #E8E6E1;

  /* Text */
  --text:        #3A3A48;
  --text-dim:    #6B6B7A;
  --text-bright: #1A1A28;
  --text-muted:  #9C9CA8;

  /* Accent — deep indigo */
  --accent:      #3B5BDB;
  --accent-hover:#364FC7;
  --accent-dim:  #5C7CFA;
  --accent-bg:   rgba(59, 91, 219, 0.06);
  --accent-bg-strong: rgba(59, 91, 219, 0.12);

  /* Semantic */
  --green:   #099268;
  --red:     #C92A2A;
  --gold:    #E67700;
  --cyan:    #0C8599;
  --pink:    #A61E4D;
  --orange:  #D9480F;
  --violet:  #6741D9;

  /* Typography */
  --font-display: 'Newsreader', Georgia, serif;
  --font-body:    'Hanken Grotesk', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Radius */
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Motion */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:  150ms;
  --dur-normal:250ms;
  --dur-slow:  400ms;

  /* Layout */
  --max-w: 1080px;
}


/* ---- Reset ---- */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Top accent line */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  z-index: 1000;
}


/* ---- Selection & Scrollbar ---- */

::selection {
  background: rgba(59, 91, 219, 0.15);
  color: var(--text-bright);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* ---- Typography ---- */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-bright);
  line-height: 1.2;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
}

p { max-width: 66ch; }

strong { color: var(--text-bright); font-weight: 600; }
em { font-style: italic; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}


/* ---- Code ---- */

code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: 0.12em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  color: var(--violet);
}

pre {
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: var(--space-md) 0;
}
pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
}
