/* =============================================================================
   Siddhu — "instrument panel" design system
   Palette: precise slate/graphite ground, one signal-cyan accent.
   Type: IBM Plex Mono for structural labels (the vernacular of registers &
   logs), Inter for reading. Monospace as identity, not decoration.
   ============================================================================= */

:root {
  /* Ground */
  --ink:        #0e1116;   /* near-black graphite  */
  --panel:      #161b22;   /* raised surface       */
  --line:       #232a33;   /* hairline rules       */
  --line-soft:  #1b212a;

  /* Text */
  --fg:         #e6edf3;   /* primary text         */
  --fg-dim:     #8b98a5;   /* secondary text       */
  --fg-faint:   #5b6570;   /* labels, meta         */

  /* Signal — the one accent. Cyan reads as "monitored / live". */
  --signal:     #38d9c4;
  --signal-dim: #1c6b62;

  /* A restrained amber for "flagged" states only */
  --flag:       #e3b341;

  --maxw: 940px;
  --gap: clamp(1.5rem, 4vw, 3rem);

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* faint scanline grid — ambient "panel" texture, extremely subtle */
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px);
  background-size: 100% 3rem;
  background-position: 0 -1px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gap); }

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --- Eyebrow: the signature "register label" -------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(56, 217, 196, 0.15);
}

/* --- Header / masthead ------------------------------------------------------ */
.masthead {
  border-bottom: 1px solid var(--line);
  background: rgba(14, 17, 22, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--fg);
  letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; }
.brand .cursor { color: var(--signal); }
.nav { display: flex; gap: 1.75rem; }
.nav a {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
}
.nav a:hover { color: var(--fg); text-decoration: none; }

/* --- Hero ------------------------------------------------------------------- */
.hero { padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.08;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 1.1rem 0 0;
  max-width: 20ch;
}
.hero .lede {
  color: var(--fg-dim);
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  max-width: 56ch;
  margin-top: 1.25rem;
}

/* --- Section scaffolding ---------------------------------------------------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.section-head h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0.4rem 0 0;
}
.section-head .count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
}

/* --- Repo ledger ------------------------------------------------------------ */
.ledger { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.repo {
  background: var(--panel);
  padding: 1.35rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1.5rem;
  align-items: start;
  transition: background 0.15s ease;
}
.repo:hover { background: #1b212b; }
.repo-name {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.repo-name a { color: inherit; }
.repo-name a:hover { color: var(--signal); text-decoration: none; }
.repo-blurb { grid-column: 1 / -1; color: var(--fg-dim); font-size: 0.95rem; margin: 0.15rem 0 0; }
.repo-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
  display: flex;
  gap: 1.1rem;
  white-space: nowrap;
}
.repo-meta .lang::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal-dim);
  margin-right: 0.4rem;
  vertical-align: 1px;
}
.repo-meta .stat { color: var(--fg-dim); }

/* --- Writing list ----------------------------------------------------------- */
.entries { display: grid; gap: 0; }
.entry {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.5rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.entry:first-child { border-top: 1px solid var(--line); }
.entry time {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
  padding-top: 0.2rem;
}
.entry h3 { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.entry h3 a { color: var(--fg); }
.entry h3 a:hover { color: var(--signal); text-decoration: none; }
.entry p { margin: 0.35rem 0 0; color: var(--fg-dim); font-size: 0.95rem; }
.entry .tags { margin-top: 0.6rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--fg-faint);
  border: 1px solid var(--line);
  padding: 0.1rem 0.5rem;
  border-radius: 2px;
}

/* --- Article (post) --------------------------------------------------------- */
.article { padding: clamp(2.5rem, 7vw, 5rem) 0; max-width: 68ch; margin: 0 auto; }
.article .post-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-faint);
  letter-spacing: 0.05em;
}
.article h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0.8rem 0 0;
}
.article-body { margin-top: 2.5rem; }
.article-body h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; letter-spacing: -0.01em; }
.article-body h3 { font-size: 1.12rem; margin: 2rem 0 0.5rem; }
.article-body p, .article-body li { color: var(--fg); }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote {
  border-left: 2px solid var(--signal-dim);
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  color: var(--fg-dim);
}
.article-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--panel);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--line);
}
.article-body pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.85rem;
}
.article-body pre code { background: none; border: none; padding: 0; }
.article-body img { max-width: 100%; border-radius: 4px; border: 1px solid var(--line); }
.article-body hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.backlink {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-dim);
  display: inline-block;
  margin-bottom: 1.5rem;
}
.backlink:hover { color: var(--signal); text-decoration: none; }

/* --- Footer ----------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3.5rem;
  margin-top: 2rem;
}
.foot .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.foot, .foot a {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}
.foot a:hover { color: var(--signal); text-decoration: none; }
.foot .links { display: flex; gap: 1.5rem; }

/* --- Pagination ------------------------------------------------------------- */
.pager { display: flex; justify-content: space-between; margin-top: 2.5rem; }
.pager a, .pager span {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-dim);
}
.pager .disabled { color: var(--line); }

/* --- Focus / a11y ----------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

/* --- Responsive ------------------------------------------------------------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { gap: 1.1rem; }
  .repo { grid-template-columns: 1fr; }
  .repo-meta { margin-top: 0.3rem; }
  .entry { grid-template-columns: 1fr; gap: 0.35rem; }
  .entry time { padding-top: 0; }
}
