/* Avinash Negi blog — Notion-inspired system (tokens from DESIGN.md). */
:root {
  --primary: #0075de;
  --primary-active: #005bab;
  --night: #213183;
  --canvas: #f6f5f4;
  --surface: #fff;
  --ink: #000;
  --ink-2: #31302e;
  --ink-muted: #615d59;
  --ink-faint: #a39e98;
  --hairline: #e6e6e6;
  --sky: #62aef0; --pink: #ff64c8; --orange: #dd5b00; --green: #1aae39;
  --r-md: 8px; --r-lg: 12px;
  --shadow-1: rgba(0,0,0,.01) 0 .175px 1px, rgba(0,0,0,.02) 0 .8px 3px, rgba(0,0,0,.027) 0 2px 8px, rgba(0,0,0,.04) 0 4px 18px;
  --font: Inter, -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 16px/1.5 var(--font);
  font-feature-settings: "lnum";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
::selection { background: #cfe5fb; }

.skip-link { position: fixed; left: -999px; top: 12px; z-index: 10; padding: 8px 14px; background: var(--primary); color: #fff; border-radius: 9999px; }
.skip-link:focus { left: 12px; }

.hero-inner, .index, footer > * { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }

/* nav — white utility bar, 8px utility CTA */
.nav { position: sticky; top: 0; z-index: 5; min-height: 60px; display: flex; align-items: center; gap: 24px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--hairline); }
.brand { font-weight: 600; letter-spacing: -.125px; }
.nav-links { display: flex; align-items: center; gap: 24px; margin-left: auto; font-size: 15px; }
.nav-links a:hover { color: var(--primary); }
.nav [aria-current="page"] { color: var(--primary); }
.nav .cta { padding: 4px 14px; border: 1px solid var(--hairline); border-radius: var(--r-md); font-weight: 500; color: var(--ink); }
.nav .cta:hover { background: var(--canvas); color: var(--ink); }
.nav .cta:active { transform: scale(.96); }

/* hero — the single indigo "night" band */
.hero { background: var(--night); color: #fff; overflow: hidden; }
.hero-inner { position: relative; padding: clamp(72px, 11vw, 140px) 0 clamp(64px, 9vw, 112px); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 9999px; background: var(--surface); color: var(--primary); font-size: 12px; font-weight: 600; line-height: 1.33; letter-spacing: .125px; box-shadow: var(--shadow-1); }
h1 { max-width: 14ch; margin: 24px 0 0; font-size: clamp(44px, 7vw, 84px); line-height: 1; letter-spacing: -.033em; font-weight: 700; }
.intro { max-width: 34ch; margin: 24px 0 0; font-size: clamp(18px, 2vw, 22px); line-height: 1.4; color: rgba(255,255,255,.72); }
/* sticker constellation — decoration only, never structure */
.sticker { position: absolute; border-radius: var(--r-lg); box-shadow: 0 0 40px rgba(255,255,255,.18); pointer-events: none; }
.s1 { width: 72px; height: 72px; right: 6%; top: 18%; background: var(--pink); transform: rotate(-8deg); }
.s2 { width: 56px; height: 56px; right: 18%; top: 44%; background: var(--sky); border-radius: 9999px; }
.s3 { width: 88px; height: 88px; right: 10%; bottom: 14%; background: var(--orange); transform: rotate(12deg); }
.s4 { width: 44px; height: 44px; right: 26%; bottom: 26%; background: var(--green); transform: rotate(-16deg); }

/* index */
.index { padding: 64px 0 96px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-heading h2 { margin: 0; font-size: 26px; line-height: 1.23; letter-spacing: -.625px; font-weight: 700; }
.section-heading p { margin: 0; color: var(--ink-faint); font-size: 14px; }
.sort-btn { all: unset; cursor: pointer; color: var(--ink-muted); font-size: 14px; font-family: var(--font); padding: 4px 12px; border: 1px solid var(--hairline); border-radius: 9999px; transition: background .15s, color .15s; user-select: none; }
.sort-btn:hover { background: var(--surface); color: var(--primary); }
.sort-btn:active { transform: scale(.96); }
/* Medium-style feed: one row per post, copy left, thumb right, hairline between */
.index { max-width: 760px; }
.articles { display: flex; flex-direction: column; }
.article { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 32px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--hairline); }
.article:first-child { border-top: 1px solid var(--hairline); }
.article > :first-child { order: 2; }
.article-copy { order: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.article img { display: block; width: 100%; height: 120px; object-fit: cover; border-radius: var(--r-md); background: var(--canvas); }
/* a square logo must not be cropped to the 4:3 card box */
.article img.logo { object-fit: contain; background: #fff; }
.article-copy p { margin: 0; align-self: flex-start; padding: 4px 8px; border: 1px solid var(--hairline); border-radius: 9999px; background: var(--surface); color: var(--primary); font-size: 12px; font-weight: 600; line-height: 1.33; letter-spacing: .125px; }
.article-copy h3 { margin: 4px 0 0; font-size: 22px; line-height: 1.27; letter-spacing: -.25px; font-weight: 700; }
.article:hover h3 { color: var(--primary); }
.article-copy span { color: var(--ink-muted); font-size: 14px; }
.article-copy span::after { content: " →"; color: var(--primary); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; font-size: 14px; color: var(--ink-faint); }
.pager button:disabled { opacity: .35; cursor: default; }
.pager button:disabled:hover { background: none; color: var(--ink-muted); }

/* footer — warm band */
footer { padding: 32px 0; border-top: 1px solid var(--hairline); color: var(--ink-2); font-size: 14px; }
footer p { margin: 0 auto 12px; }
footer div { display: flex; gap: 24px; }
footer a:hover { color: var(--primary); }

@media (max-width: 760px) {
  .sticker { display: none; }
}
@media (max-width: 520px) {
  .article { grid-template-columns: minmax(0, 1fr) 96px; gap: 16px; padding: 20px 0; }
  .article-copy h3 { font-size: 18px; }
}
@media (max-width: 600px) {
  .nav { padding: 0 16px; }
  .hero-inner, .index, footer > * { width: calc(100% - 32px); }
  .nav-links { gap: 16px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
