/* ===== Kshitij — personal site ===== */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6862;
  --border: #e7e3da;
  --accent: #b5562b;
  --accent-soft: #f3e3d8;
  --maxw: 720px;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #14130f;
  --surface: #1c1b17;
  --text: #ece8df;
  --muted: #9a958a;
  --border: #2c2a24;
  --accent: #e08a5f;
  --accent-soft: #2a211a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

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

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(160%) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; gap: 4px;
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  font-family: var(--sans); font-size: 15px;
}
.nav .brand {
  font-weight: 700; font-size: 17px; letter-spacing: -.01em;
  margin-right: auto; text-decoration: none; color: var(--text);
}
.nav a.link {
  color: var(--muted); text-decoration: none;
  padding: 6px 10px; border-radius: 8px; transition: all .15s ease;
}
.nav a.link:hover { color: var(--text); background: var(--accent-soft); }
.nav a.link.active { color: var(--accent); font-weight: 600; }
.theme-toggle {
  margin-left: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); width: 34px; height: 34px; border-radius: 9px;
  cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center;
}
.theme-toggle:hover { border-color: var(--accent); }

/* ---- Layout blocks ---- */
main { padding: 56px 0 96px; }
.hero h1 { font-size: 46px; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 12px; }
.hero .lead { font-size: 21px; color: var(--muted); margin: 0 0 28px; }
.eyebrow {
  font-family: var(--sans); font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0 0 10px;
}
h2 { font-size: 30px; letter-spacing: -.01em; margin: 48px 0 14px; }
h3 { font-size: 22px; margin: 28px 0 8px; }
p { margin: 0 0 18px; }
a { color: var(--accent); text-underline-offset: 3px; }
hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ---- Section cards on home ---- */
.cards { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-top: 8px; }
.card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 14px; padding: 20px 22px; transition: all .18s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .ico { font-size: 24px; }
.card h3 { margin: 10px 0 4px; font-size: 19px; }
.card p { font-size: 15px; color: var(--muted); margin: 0; font-family: var(--sans); }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* ---- Post / entry lists ---- */
.entry-list { list-style: none; padding: 0; margin: 24px 0 0; }
.entry-list li { border-bottom: 1px solid var(--border); padding: 18px 0; }
.entry-list a.entry-title {
  text-decoration: none; color: var(--text); font-size: 22px; font-weight: 600;
  display: inline-block; transition: color .15s ease;
}
.entry-list a.entry-title:hover { color: var(--accent); }
.meta { font-family: var(--sans); font-size: 13.5px; color: var(--muted); }
.entry-list p { font-size: 16px; color: var(--muted); margin: 6px 0 0; }

/* ---- Article ---- */
.article-meta { font-family: var(--sans); color: var(--muted); font-size: 15px; margin-bottom: 4px; }
.article h1 { font-size: 38px; line-height: 1.15; margin: 6px 0 30px; }
.article blockquote {
  border-left: 3px solid var(--accent); margin: 24px 0; padding: 4px 0 4px 20px;
  color: var(--muted); font-style: italic;
}

/* ---- Gallery ---- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.gallery .tile {
  aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
  background: var(--accent-soft); display: grid; place-items: center;
  font-family: var(--sans); color: var(--muted); font-size: 13px; text-align: center; padding: 10px;
}
.gallery .tile img, .gallery .tile video { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 560px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* ---- Tags / badges ---- */
.badge {
  display: inline-block; font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 10px; border-radius: 999px; margin-right: 6px;
}

/* ---- Back link ---- */
.back { font-family: var(--sans); font-size: 14px; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--accent); }

/* ---- Socials / footer ---- */
.socials { display: flex; flex-wrap: wrap; gap: 10px; font-family: var(--sans); font-size: 15px; }
.socials a {
  text-decoration: none; color: var(--text); border: 1px solid var(--border);
  background: var(--surface); padding: 8px 14px; border-radius: 10px; transition: all .15s ease;
}
.socials a:hover { border-color: var(--accent); color: var(--accent); }
.site-footer {
  border-top: 1px solid var(--border); padding: 28px 0;
  font-family: var(--sans); font-size: 14px; color: var(--muted);
}
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---- Writing filters ---- */
.filters { margin: 26px 0 6px; display: flex; flex-direction: column; gap: 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-tag, .filter-len {
  font-family: var(--sans); font-size: 13px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  padding: 5px 12px; border-radius: 999px; transition: all .15s ease;
}
.filter-tag:hover, .filter-len:hover { border-color: var(--accent); color: var(--text); }
.filter-tag.active, .filter-len.active {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.entry-list .badge { margin-top: 6px; }

/* ---- Work / timeline ---- */
.timeline { list-style: none; padding: 0; margin: 24px 0 0; }
.timeline li { padding: 0 0 26px 22px; border-left: 2px solid var(--border); position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--bg);
}
.timeline .role { font-weight: 600; font-size: 19px; }
.timeline .when { font-family: var(--sans); font-size: 13.5px; color: var(--muted); }
