/* =================================================================
   rutuldave.com — redesign  ·  shared base
   Warm paper · monochrome ink/grey · clean modern sans
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* warm paper + ink (monochrome, very low chroma) */
  --paper:      oklch(0.985 0.004 85);
  --paper-2:    oklch(0.962 0.005 82);
  --card:       oklch(0.997 0.002 90);
  --ink:        oklch(0.235 0.006 70);
  --ink-soft:   oklch(0.40 0.006 70);
  --muted:      oklch(0.56 0.006 75);
  --faint:      oklch(0.70 0.005 78);
  --line:       oklch(0.90 0.004 80);
  --line-soft:  oklch(0.935 0.003 82);
  --tint:       oklch(0.93 0.004 82);

  /* "accent" mapped to ink so the whole system reads monochrome */
  --accent:       var(--ink);
  --accent-deep:  oklch(0.30 0.006 70);
  --accent-tint:  oklch(0.92 0.004 82);

  /* contribution heat scale — greyscale, dark = more */
  --grid-0: oklch(0.915 0.004 82);
  --grid-1: oklch(0.78 0.005 78);
  --grid-2: oklch(0.60 0.006 75);
  --grid-3: oklch(0.42 0.006 72);
  --grid-4: oklch(0.255 0.006 68);

  --sans:  'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --maxw: 1060px;
  --gutter: clamp(20px, 5vw, 56px);
  --radius: 12px;
  --radius-lg: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: oklch(0.235 0.006 70 / 0.12); }
[id] { scroll-margin-top: 92px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(54px, 8vw, 100px); }
.section + .section { padding-top: 0; }

/* ---- shared type bits ---- */
.kicker {
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 22px;
}
.kicker::before { content: ""; width: 20px; height: 1px; background: var(--ink); display: inline-block; }

.statement {
  font-weight: 700;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  max-width: 22ch;
  text-wrap: balance;
}
.statement em { font-style: normal; color: var(--muted); }
.lede {
  font-size: clamp(16.5px, 1.4vw, 18.5px);
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0;
  line-height: 1.55;
}
.lede a, .about-body a, .hero-bio a {
  color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--faint);
  text-decoration-thickness: 1px; text-underline-offset: 2.5px;
  transition: text-decoration-color .18s;
}
.lede a:hover, .about-body a:hover, .hero-bio a:hover { text-decoration-color: var(--ink); }

/* =================================================================
   NAV
   ================================================================= */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklab, var(--paper) 80%, transparent);
  backdrop-filter: saturate(120%) blur(14px);
  -webkit-backdrop-filter: saturate(120%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 14px var(--gutter); display: flex; align-items: center; gap: 24px; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 11px; white-space: nowrap; }
.brand .mono-mark {
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--ink); border-radius: 8px; color: var(--ink);
}
.nav-links { display: flex; gap: 2px; margin-left: auto; align-items: center; list-style: none; padding: 0; margin-block: 0; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--ink-soft); padding: 8px 12px; border-radius: 8px; transition: color .18s, background .18s; }
.nav-links a:hover { color: var(--ink); background: var(--paper-2); }
.nav-cta { font-weight: 600; font-size: 14px; color: var(--paper) !important; background: var(--ink); padding: 9px 16px; border-radius: 999px; transition: background .2s, transform .2s; }
.nav-cta:hover { background: var(--accent-deep); transform: translateY(-1px); }
.nav-toggle { display: none; }

/* =================================================================
   BUTTONS
   ================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid var(--ink);
  transition: transform .2s, background .2s, color .2s, border-color .2s; cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translate(3px,-3px); }

/* =================================================================
   GENERIC SECTION HEADER
   ================================================================= */
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 38px; flex-wrap: wrap; }
.head-row .lede { margin-top: 6px; }
.viewall {
  font-family: var(--mono); font-size: 13px; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  border-bottom: 1px solid var(--line); padding-bottom: 3px; transition: color .18s, border-color .18s;
}
.viewall:hover { color: var(--ink); border-color: var(--ink); }

/* =================================================================
   TRACKER (GitHub contributions) — shared
   ================================================================= */
.tracker { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 32px); }
.tracker-top { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.tracker-total { display: flex; align-items: baseline; gap: 12px; }
.tracker-total b { font-weight: 800; font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.03em; }
.tracker-total span { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.03em; }
.tracker-handle {
  font-family: var(--mono); font-size: 13px; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; transition: border-color .18s, color .18s;
}
.tracker-handle:hover { border-color: var(--ink); color: var(--ink); }
.cal-scroll { overflow-x: auto; padding-bottom: 6px; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; min-width: 640px; }
.cal-cell { width: 100%; aspect-ratio: 1; border-radius: 2.5px; background: var(--grid-0); outline: 1px solid oklch(0.4 0 0 / 0.04); outline-offset: -1px; }
.cal-cell[data-lvl="1"] { background: var(--grid-1); }
.cal-cell[data-lvl="2"] { background: var(--grid-2); }
.cal-cell[data-lvl="3"] { background: var(--grid-3); }
.cal-cell[data-lvl="4"] { background: var(--grid-4); }
.cal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; flex-wrap: wrap; gap: 12px; }
.cal-legend { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.cal-legend .cal-cell { width: 11px; height: 11px; aspect-ratio: auto; }
.cal-note { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.cal-fallback { width: 100%; border-radius: 8px; }

/* =================================================================
   FOOTER + CONTACT — shared
   ================================================================= */
.contact { padding-block: clamp(58px, 9vw, 116px); }
.contact-card { background: var(--ink); color: var(--paper); border-radius: var(--radius-lg); padding: clamp(34px, 6vw, 68px); position: relative; overflow: hidden; }
.contact-card .kicker { color: oklch(0.78 0.005 80); }
.contact-card .kicker::before { background: oklch(0.78 0.005 80); }
.contact h2 { font-weight: 700; font-size: clamp(30px, 5vw, 52px); line-height: 1.04; letter-spacing: -0.03em; margin: 0 0 16px; max-width: 18ch; }
.contact h2 em { font-style: normal; color: oklch(0.7 0.005 80); }
.contact p { color: oklch(0.82 0.006 78); max-width: 48ch; font-size: 18px; margin: 0 0 30px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-light:hover { background: oklch(0.9 0.004 82); border-color: oklch(0.9 0.004 82); transform: translateY(-2px); }
.btn-outline-light { background: transparent; color: var(--paper); border-color: oklch(0.55 0.006 75); }
.btn-outline-light:hover { border-color: var(--paper); transform: translateY(-2px); }

.footer { border-top: 1px solid var(--line); padding-block: 42px; }
.footer-grid { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand { font-weight: 700; font-size: 18px; }
.footer-links { display: flex; gap: 10px; list-style: none; padding: 0; margin: 0; }
.footer-links a { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-soft); transition: all .2s; }
.footer-links a:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }
.footer-links svg { width: 17px; height: 17px; }
.footer-copy { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* =================================================================
   ARTICLE PAGES — shared
   ================================================================= */
.article { padding-top: clamp(36px, 6vw, 64px); padding-bottom: clamp(54px, 8vw, 92px); }
.article-wrap { max-width: 700px; margin: 0 auto; padding-inline: var(--gutter); }
.crumb { font-family: var(--mono); font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 32px; transition: color .18s; }
.crumb:hover { color: var(--ink); }
.article-tag { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.article h1 { font-weight: 800; font-size: clamp(36px, 6vw, 58px); line-height: 1.0; letter-spacing: -0.035em; margin: 0 0 18px; }
.article-dek { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.45; color: var(--ink-soft); margin: 0 0 8px; max-width: 60ch; font-weight: 500; }
.article-rule { height: 1px; background: var(--line); border: 0; margin: 34px 0; }
.prose { font-size: 18px; line-height: 1.72; color: var(--ink-soft); }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 24px; max-width: 68ch; }
.prose strong, .prose b { font-weight: 700; color: var(--ink); }
.prose h3 { font-weight: 700; font-size: 23px; letter-spacing: -0.02em; color: var(--ink); margin: 44px 0 14px; }
.prose h4 { font-weight: 700; font-size: 16px; color: var(--ink); margin: 34px 0 14px; }
.prose ul { margin: 0 0 24px; padding-left: 0; list-style: none; }
.prose ul li { position: relative; padding-left: 24px; margin-bottom: 10px; max-width: 66ch; }
.prose ul li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 6px; height: 6px; border-radius: 999px; background: var(--ink); }
.prose ul ul { margin: 10px 0 0; }
.prose ul ul li::before { background: var(--faint); width: 5px; height: 5px; top: 12px; }
.prose blockquote {
  margin: 0 0 22px; padding: 2px 0 2px 24px; border-left: 2.5px solid var(--ink);
  font-size: 21px; font-weight: 500; line-height: 1.45; color: var(--ink);
}
.prose blockquote .text-muted, .prose .text-muted { display: block; font-family: var(--mono); font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 10px; letter-spacing: 0.02em; }
.prose blockquote a { font-weight: 500; }
.prose mark { background: var(--tint); color: var(--ink); padding: 2px 5px; border-radius: 4px; font-weight: 500; }
.prose .lead { font-size: 22px; font-weight: 600; color: var(--ink); }
.article-nav { margin-top: 54px; padding-top: 26px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.article-nav a { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); display: inline-flex; gap: 8px; align-items: center; transition: color .18s; }
.article-nav a:hover { color: var(--ink); }

/* =================================================================
   REVEAL
   ================================================================= */
.reveal { transform: translateY(14px); transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { transform: none; transition: none; } html { scroll-behavior: auto; } }

/* =================================================================
   SHARED RESPONSIVE NAV
   ================================================================= */
@media (max-width: 620px) {
  body { font-size: 17px; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 18px; gap: 2px; }
  .nav-links.open a { padding: 12px 8px; }
  .nav-links.open .nav-cta { text-align: center; margin-top: 6px; }
  .nav-toggle { display: grid; place-items: center; margin-left: auto; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: transparent; cursor: pointer; }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content: ""; display: block; width: 17px; height: 1.5px; background: var(--ink); position: relative; }
  .nav-toggle span::before { position: absolute; top: -5px; }
  .nav-toggle span::after { position: absolute; top: 5px; }
}
