/* =================================================================
   Mayank Agarwal — personal site
   Minimal, typographic theme. Plain CSS (no build step needed).
   ================================================================= */

:root {
  --bg:        #fafaf8;   /* warm off-white */
  --surface:   #ffffff;
  --ink:       #16150f;   /* near-black, slightly warm */
  --muted:     #6b6a63;   /* secondary text */
  --line:      #e6e4dc;   /* hairline borders */
  --accent:    #b4502d;   /* terracotta link/hover */
  --maxw:      720px;     /* reading column */
  --maxw-wide: 960px;     /* home/landing */

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ---- reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color .15s ease, border-color .15s ease;
}
a:hover { color: var(--accent); border-color: var(--accent); }

/* shared layout container */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.site-main { flex: 1 0 auto; }

/* ---- header / nav ---- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner {
  max-width: var(--maxw-wide);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
}
.site-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-bottom: none;
}
.site-name:hover { color: var(--accent); }

.site-nav { display: flex; gap: 28px; }
.site-nav a {
  font-size: 0.95rem;
  color: var(--muted);
  border-bottom: none;
}
.site-nav a:hover,
.site-nav a.is-active { color: var(--ink); }

/* mobile burger (hidden on desktop) */
.nav-toggle, .nav-burger { display: none; }

/* ---- hero / home ---- */
.hero { padding: 96px 24px 64px; max-width: var(--maxw-wide); }
.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.hero-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: var(--muted);
  margin: 0 0 28px;
}
.hero-body { max-width: var(--maxw); font-size: 1.12rem; color: #3a3833; }
.hero-body p { margin: 0 0 1em; }

/* section header (home) */
.home-writing { max-width: var(--maxw-wide); padding-bottom: 80px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 28px;
  margin-top: 8px;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  margin: 0;
}
.more-link { font-size: 0.95rem; color: var(--muted); border-bottom: none; }
.more-link:hover { color: var(--accent); }

/* ---- post list ---- */
.post-list { list-style: none; margin: 24px 0 0; padding: 0; }
.post-row {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.post-row time {
  flex: 0 0 120px;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.post-row-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  border-bottom: none;
}

/* ---- generic page ---- */
.page { padding: 72px 24px 96px; }
.page-head { margin-bottom: 36px; }
.page-head h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 10px;
}
.page-subtitle, .post-subtitle { color: var(--muted); font-size: 1.15rem; margin: 0; }

/* ---- post ---- */
.post { padding: 64px 24px 96px; }
.post-head { margin-bottom: 40px; }
.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 14px;
}
.post-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
}
.post-tags { display: inline-flex; gap: 8px; }
.tag {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
}
.post-foot {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

/* ---- prose (long-form body) ---- */
.prose { font-size: 1.12rem; }
.prose > * + * { margin-top: 1.4em; }
.prose h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  margin-top: 1.8em;
}
.prose h3 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; margin-top: 1.6em; }
.prose a { border-bottom-color: var(--accent); }
.prose blockquote {
  margin: 1.6em 0;
  padding-left: 20px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #f0efe9;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.prose pre {
  background: #1c1b16;
  color: #f4f2ea;
  padding: 18px 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose img { border-radius: 8px; }

/* ---- projects grid ---- */
.project-grid {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.project-item {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.project-item h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 6px;
}
.project-item h3 a { border-bottom: none; }
.project-meta { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; }
.project-item p { margin: 0; color: #3a3833; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner {
  max-width: var(--maxw-wide);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
  padding-bottom: 40px;
  font-size: 0.88rem;
  color: var(--muted);
}
.footer-social { display: flex; gap: 20px; }
.footer-social a { color: var(--muted); border-bottom: none; }
.footer-social a:hover { color: var(--accent); }

/* ---- responsive ---- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .nav-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px; height: 24px;
    cursor: pointer;
  }
  .nav-burger span { display: block; height: 2px; background: var(--ink); transition: .2s; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px;
  }
  .header-inner { position: relative; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .site-nav a { padding: 10px 0; font-size: 1.05rem; }

  .hero { padding: 64px 24px 48px; }
  .post-row { flex-direction: column; gap: 4px; }
  .post-row time { flex-basis: auto; }
}
