/* singhangad.in — base styles (all pages) */

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: fallback;
  font-weight: 400;
  src: url('./fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: fallback;
  font-weight: 500;
  src: url('./fonts/jetbrains-mono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: fallback;
  font-weight: 600;
  src: url('./fonts/jetbrains-mono-600.woff2') format('woff2');
}

:root[data-theme="light"] {
  --bg: #f4f2ec;
  --fg: #1a1f1c;
  --dim: #7a7f7a;
  --faint: #9ea3a0;
  --accent: #2f7a3e;
  --line: #e3e0d6;
  --line-strong: #d4d0c2;
  --card: #ffffff;
  --selection: #2f7a3e;
  --selection-fg: #f4f2ec;
}
:root[data-theme="dark"] {
  --bg: #0b0f0d;
  --fg: #d8e4dc;
  --dim: #6b7a72;
  --faint: #4d5a53;
  --accent: #8bd17c;
  --line: #1a241f;
  --line-strong: #243029;
  --card: #0f1512;
  --selection: #8bd17c;
  --selection-fg: #0b0f0d;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
html {
  scroll-behavior: smooth;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE / Edge legacy */
}
html::-webkit-scrollbar { display: none; } /* Chrome / Safari / Opera */
body {
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px; line-height: 1.6; letter-spacing: -0.01em;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--selection); color: var(--selection-fg); }
a { color: inherit; text-decoration: none; }
a.underline { border-bottom: 1px dashed var(--line-strong); padding-bottom: 1px; transition: border-color .15s, color .15s; }
a.underline:hover { border-color: var(--accent); color: var(--accent); }

/* Layout */
.wrap { max-width: 880px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 720px; }

/* Header / nav */
.site-header {
  padding: 22px 0; border-bottom: 1px dashed var(--line);
  position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  z-index: 50;
}
.site-header .row { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.site-header .brand { color: var(--accent); font-weight: 600; }
.site-header .spacer { flex: 1; }
.site-header nav a { color: var(--dim); transition: color .15s; padding: 4px 2px; }
.site-header nav a:hover, .site-header nav a.active { color: var(--fg); }
.site-header nav a.active::before { content: "./"; color: var(--accent); }
.site-header nav { display: flex; gap: 18px; }

/* Theme toggle */
.theme-toggle {
  background: transparent; border: 1px solid var(--line-strong); color: var(--dim);
  cursor: pointer; font-family: inherit; font-size: 12px; padding: 4px 10px;
  transition: .15s; display: inline-flex; align-items: center; gap: 6px;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--accent); }

/* Text helpers */
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.acc { color: var(--accent); }
.mono-small { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.prompt::before { content: "$ "; color: var(--accent); }
.comment::before { content: "# "; color: var(--dim); }
.comment { color: var(--dim); }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--accent); vertical-align: -2px; margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Section dividers & headings */
.section { padding: 48px 0; border-top: 1px dashed var(--line); }
.section:first-of-type { border-top: none; }
.section-head { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 28px; }
.section-head .n { color: var(--accent); }
.section-head::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.section-head .more { color: var(--dim); font-size: 11px; border: none; }
.section-head .more:hover { color: var(--accent); }

h1, h2, h3 { font-family: inherit; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h1.display { font-size: 28px; margin-bottom: 6px; }
h1.display-xl { font-size: 36px; letter-spacing: -0.03em; margin-bottom: 10px; }

/* Chips & buttons */
.chip { display: inline-block; padding: 2px 8px; border: 1px solid var(--line-strong); font-size: 11px; color: var(--dim); }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 1px solid var(--line-strong); color: var(--fg); font-family: inherit; font-size: 12px;
  cursor: pointer; background: transparent; transition: .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn .arr { color: var(--accent); }
.kbd { font-size: 10px; padding: 1px 5px; border: 1px solid var(--line-strong); color: var(--dim); border-radius: 2px; }

/* Tables / rows — key-value pairs */
.kv { display: flex; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv .k { width: 130px; flex-shrink: 0; color: var(--dim); }
.kv .v { flex: 1; }
.kv:last-child { border-bottom: none; }

/* List items with year/date prefix */
.entry { padding: 14px 0; border-bottom: 1px dashed var(--line); display: grid; grid-template-columns: 110px 1fr auto; gap: 18px; align-items: baseline; }
.entry:last-child { border-bottom: none; }
.entry .when { color: var(--accent); font-size: 12px; }
.entry .title { font-weight: 500; }
.entry .meta { color: var(--dim); font-size: 12px; margin-top: 3px; }
.entry .trail { color: var(--dim); font-size: 11px; }
.entry:hover .title { color: var(--accent); }
.entry.as-link { cursor: pointer; }

/* Post header (blog posts, talk detail, about) */
.post-header { padding: 48px 0 28px; border-bottom: 1px dashed var(--line); margin-bottom: 32px; }
.post-header .crumbs { color: var(--dim); font-size: 12px; margin-bottom: 18px; }
.post-header .title { font-size: 26px; margin-bottom: 12px; }
.post-header .meta { color: var(--dim); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }

/* Footer */
.site-footer { border-top: 1px dashed var(--line); padding: 22px 0; font-size: 12px; color: var(--dim); }
.site-footer .row { display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* Skip link */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 10px; background: var(--fg); color: var(--bg); padding: 8px 12px; z-index: 100; }

/* Utility / layout helpers */
.page-start { padding-top: 48px; }
.mt-8 { margin-top: 8px; }
.section-sm-top { padding-top: 24px; }
.text-right { text-align: right; }
.page-nav { margin-top: 48px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 720px) {
  body { font-size: 13px; }
  .wrap { padding: 0 18px; }
  .site-header { padding: 14px 0; }
  .site-header .row { flex-wrap: wrap; row-gap: 10px; font-size: 12px; }
  .site-header .spacer { display: none; }
  .site-header nav { order: 3; width: 100%; gap: 14px; padding-top: 4px; border-top: 1px dashed var(--line); }
  .theme-toggle { margin-left: auto; }

  .section { padding: 36px 0; }
  .kv { flex-direction: column; gap: 2px; padding: 8px 0; }
  .kv .k { width: auto; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }

  .entry { grid-template-columns: 1fr; gap: 4px; padding: 14px 0; }
  .entry .when { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
  .entry .trail { font-size: 11px; color: var(--faint); }

  .post-header { padding: 32px 0 20px; margin-bottom: 24px; }
  .post-header .title { font-size: 22px; }

  .site-footer .row { flex-wrap: wrap; gap: 10px; font-size: 11px; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 14px; }
  .btn { padding: 6px 10px; font-size: 11px; }
}
