/* =========================================================
   base.css — Python Power User
   Design tokens, reset, typography primitives
   Dark-mode first. Single, considered palette.
   ========================================================= */

:root {
  /* Surfaces (dark) */
  --bg-0:   #0c0c0d;   /* deepest — page */
  --bg-1:   #141416;   /* elevated surfaces (cards) */
  --bg-2:   #1c1c1f;   /* hovered / inset */
  --bg-3:   #26262a;   /* deeper inset — code */

  /* Ink */
  --ink-0:  #f4f2ee;   /* primary text */
  --ink-1:  #d6d3cd;   /* body */
  --ink-2:  #a09b92;   /* muted */
  --ink-3:  #6a655d;   /* subtle, dividers-as-text */

  /* Lines */
  --line-1: rgba(255,255,255,0.06);
  --line-2: rgba(255,255,255,0.10);
  --line-focus: rgba(232,161,59,0.45);

  /* Accent — warm amber (Python-yellow's calmer cousin) */
  --amber:      #e8a13b;
  --amber-soft: #f1b55a;
  --amber-deep: #b87a22;
  --amber-wash: rgba(232,161,59,0.10);

  /* Secondary accents (used sparingly) */
  --leaf:   #7aa36b;   /* for "ok", #? prompts */
  --rust:   #c46e4e;   /* for warnings in code annotations */

  /* Code-token palette (restrained, not rainbow) */
  --t-kw:      #d49a4b;   /* keywords: def, return, if */
  --t-builtin: #c8b88a;   /* builtins: print, len */
  --t-str:     #9ab88d;   /* strings */
  --t-num:     #d98f6c;   /* numbers */
  --t-com:     #6a655d;   /* comments */
  --t-fn:      #e8d9a1;   /* function call names */
  --t-op:      #a09b92;   /* operators */
  --t-punc:    #8a857c;   /* punctuation */

  /* Type scale */
  --font-sans: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --text-xs:    0.75rem;   /* 12 */
  --text-sm:    0.875rem;  /* 14 */
  --text-base:  1rem;      /* 16 */
  --text-md:    1.0625rem; /* 17 — body on desktop */
  --text-lg:    1.1875rem; /* 19 */
  --text-xl:    1.4375rem; /* 23 */
  --text-2xl:   1.75rem;   /* 28 */
  --text-3xl:   2.25rem;   /* 36 */
  --text-4xl:   3rem;      /* 48 */
  --text-hero:  clamp(2.25rem, 6.2vw, 4.25rem);

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-7: 2rem;
  --sp-8: 2.5rem;
  --sp-9: 3rem;
  --sp-10: 4rem;
  --sp-12: 6rem;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-pop: 0 10px 30px rgba(0,0,0,0.35);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.02) inset, 0 12px 24px -18px rgba(0,0,0,0.6);

  /* Layout */
  --page-max: 1200px;
  --prose-max: 68ch;
  --radius-card: 14px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-1: 140ms;
  --dur-2: 240ms;
  --dur-3: 420ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--line-focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- Base ---------- */
html, body {
  background: var(--bg-0);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02", "cv11";
}

/* Subtle noise/grain on body, barely visible, prevents flat feel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% -10%, rgba(232,161,59,0.04), transparent 50%),
                    radial-gradient(circle at 120% 110%, rgba(232,161,59,0.025), transparent 45%);
  z-index: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--ink-0);
  letter-spacing: -0.015em;
  line-height: 1.1;
  font-weight: 700;
}
h1 { font-weight: 900; letter-spacing: -0.025em; }

p { color: var(--ink-1); }
strong { color: var(--ink-0); font-weight: 700; }
em { color: var(--ink-0); font-style: italic; }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.93em;
  font-variant-ligatures: none;
}

/* Inline code (inside prose) */
p > code, li > code, .prose code:not(pre code), .inline-code {
  background: var(--bg-2);
  color: var(--amber-soft);
  border: 1px solid var(--line-1);
  padding: 0.10em 0.38em;
  border-radius: 5px;
  font-size: 0.88em;
  white-space: nowrap;
}
/* Long inline code must wrap on small screens instead of overflowing */
@media (max-width: 759px) {
  p > code, li > code, .prose code:not(pre code), .inline-code {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

a { color: var(--ink-0); border-bottom: 1px solid var(--line-2); transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease); }
a:hover { color: var(--amber); border-bottom-color: var(--amber); }

/* Utility */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 500;
}

.amber { color: var(--amber); }

/* Scrollbar — subtle */
* { scrollbar-width: thin; scrollbar-color: var(--bg-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: padding-box; border: 2px solid transparent; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
