/* xydinesh.com — style C: calm minimal, IBM Plex, one vermilion accent. */
:root {
  --bg: #fff;
  --fg: #161616;
  --muted: #5f5f5f;      /* 6.4:1 on white */
  --rule: #e8e8e8;
  --accent: #d6452f;     /* rules, borders, hover */
  --accent-text: #c93f29; /* small accent text, 4.97:1 on white */
  --tint: #fbeae6;
  --tile: #f6f4f2;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --measure: 65ch;
  --wide: 960px;
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 1rem;
  --s4: 2rem;
  --s5: 4rem;
  --cover-ratio: 2 / 3;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Layout */
.wrap { max-width: var(--wide); margin: 0 auto; padding-left: var(--s3); padding-right: var(--s3); }
@media (min-width: 640px) {
  .wrap { padding-left: var(--s4); padding-right: var(--s4); }
}
.site-header { border-bottom: 1px solid var(--rule); }
.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s2) var(--s3);
  padding-top: var(--s3);
  padding-bottom: var(--s3);
}
.site-name { font-weight: 600; color: var(--fg); text-decoration: none; }
.nav nav { display: flex; gap: var(--s3); }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.nav nav a:hover, .nav nav a[aria-current] { color: var(--accent-text); }
main.wrap { padding-top: var(--s4); padding-bottom: var(--s5); }
.site-footer { border-top: 1px solid var(--rule); padding-top: var(--s3); padding-bottom: var(--s4); }

/* Type */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; margin: var(--s4) 0 var(--s2); }
h1 { font-size: 2rem; margin-top: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
.meta { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }
.muted { color: var(--muted); }
.tag { margin-right: var(--s2); }
.tag::before { content: "#"; color: var(--accent-text); }

/* Long-form text */
.prose { max-width: var(--measure); }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table { margin: 0 0 var(--s3); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: var(--s1); }
.prose li > ul, .prose li > ol { margin: var(--s1) 0 0; }
.prose blockquote { margin-left: 0; padding-left: var(--s3); border-left: 2px solid var(--accent); color: #3d3d3d; }
.prose mark { background: var(--tint); color: inherit; padding: 0 0.15em; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s4) 0; }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: var(--s1) var(--s2); text-align: left; }
.page-intro { max-width: var(--measure); color: var(--muted); margin: 0 0 var(--s4); }
.home-intro p { font-size: 1.125rem; }
.article-header { margin-bottom: var(--s4); }
.article-header h1 { margin-bottom: var(--s1); }
.article-header .meta { margin: 0; }

/* Dated row lists (home, writing, now) */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin: var(--s4) 0 var(--s2); max-width: var(--measure); }
.section-head h2 { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 400; color: var(--muted); margin: 0; }
.section-head a { font-family: var(--font-mono); font-size: 0.8125rem; text-decoration: none; }
.rows { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.rows li { display: grid; grid-template-columns: 6.5rem 1fr; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px dashed var(--rule); }
.row-date { padding-top: 0.15rem; }
.row-main a { color: var(--fg); text-decoration: none; font-weight: 500; }
.row-main a:hover { color: var(--accent-text); }
.row-desc { display: block; color: var(--muted); font-size: 0.9375rem; }
@media (max-width: 480px) {
  .rows li { grid-template-columns: 1fr; gap: 0; }
}

/* Covers */
.cover { display: block; width: 100%; aspect-ratio: var(--cover-ratio); object-fit: cover; background: var(--tile); border: 1px solid var(--rule); }
.cover.tile {
  display: flex;
  align-items: flex-end;
  padding: var(--s3);
  border-top: 3px solid var(--accent);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.25;
  color: var(--fg);
  overflow: hidden;
}

/* Notes index */
.notes-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s2) var(--s3); margin-bottom: var(--s4); }
.notes-head h1 { margin: 0; }
.sort { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: baseline; }
.sort button {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
}
.sort button:hover { color: var(--accent-text); }
.sort button[aria-pressed="true"] { color: var(--accent-text); border-color: var(--accent); }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s4); }
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s3); }
}
.card a { display: block; color: inherit; text-decoration: none; }
.card a:hover .card-title { color: var(--accent-text); }
.card-title { font-size: 1rem; margin: var(--s2) 0 0; }
.card-author { margin: 0 0 var(--s1); }
.card .tags { margin: 0 0 var(--s1); }
.card-summary { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: #3d3d3d; }

/* Note page header */
.note-header { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: var(--s4); align-items: start; margin-bottom: var(--s4); padding-bottom: var(--s4); border-bottom: 1px solid var(--rule); max-width: var(--measure); }
.note-header h1 { margin-bottom: var(--s2); }
.note-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 var(--s2); margin: 0; line-height: 1.9; }
.note-meta dt { color: var(--accent-text); }
.note-meta dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .note-header { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .note-header .cover { width: 7rem; }
  .note-header h1 { font-size: 1.5rem; }
}

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