/* ── The Maneesh Sagar Gazette — old newspaper, modern motion ── */

:root {
  --paper: #f7f4ec;
  --ink: #1a1712;
  --ink-soft: #555046;
  --ink-faint: #97907f;
  --rule: #c9c2b2;
  --rule-dark: #1a1712;
  --accent: #8a2b1d; /* aged red ink */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  background-image: radial-gradient(ellipse at top, rgba(0,0,0,0.025), transparent 60%);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 44px 22px 90px;
}

::selection { background: var(--ink); color: var(--paper); }

a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 100%;
  transition: color 0.25s ease, background-size 0.25s ease;
}

a:hover {
  color: var(--accent);
  background-size: 100% 2px;
}

/* ── Masthead ── */

.masthead {
  text-align: center;
  margin-bottom: 8px;
  animation: settle 0.7s ease both;
}

.masthead .site-name {
  font-size: clamp(34px, 7vw, 46px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin: 10px 0 6px;
}

.masthead .site-name a {
  background: none;
  color: var(--ink);
}

.masthead .site-name a:hover { color: var(--accent); }

.masthead .tagline {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 14px;
}

.dateline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.dateline::before,
.dateline::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}

/* double rule under masthead */
.masthead-rule {
  border: none;
  border-top: 3px double var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
  height: 3px;
  margin: 0 0 14px;
}

/* ── Nav ── */

.nav {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 44px;
  animation: settle 0.7s ease 0.1s both;
}

.nav a {
  margin: 0 12px;
  background-size: 0% 1px;
  background-position: 50% 100%;
}

.nav a:hover { background-size: 100% 1px; }

/* ── Section label ── */

.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--ink-faint);
  text-align: center;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.label::before,
.label::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}

/* ── Essay list ── */

.essay-list {
  list-style: none;
  padding: 0;
  margin: 0 0 48px;
}

.essay-list li {
  padding: 14px 2px;
  border-bottom: 1px dotted var(--rule);
  display: flex;
  align-items: baseline;
  gap: 16px;
  transition: transform 0.25s ease;
}

.essay-list li:hover { transform: translateX(6px); }

.essay-list .date {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  flex-shrink: 0;
  width: 74px;
}

.essay-list a {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  background: none;
}

.essay-list a:hover { color: var(--accent); }

/* ── Project list ── */

.project-list {
  list-style: none;
  padding: 0;
  margin: 0 0 48px;
}

.project-list li {
  margin-bottom: 26px;
  padding-left: 18px;
  border-left: 2px solid var(--rule);
  transition: border-color 0.3s ease;
}

.project-list li:hover { border-left-color: var(--accent); }

.project-list .proj-title {
  font-weight: 700;
  font-size: 18px;
}

.project-list .proj-note {
  font-weight: 400;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-faint);
}

.project-list .proj-desc {
  color: var(--ink-soft);
  font-size: 15px;
  margin-top: 3px;
}

/* ── Post page ── */

.post-title {
  margin: 0;
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  margin-bottom: 10px;
  text-wrap: balance;
}

.post-date {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.post-date::before,
.post-date::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}

.post-body p { margin: 0 0 1.15em; }

.post-body > p:first-of-type::first-letter {
  font-size: 3.4em;
  font-weight: 700;
  float: left;
  line-height: 0.82;
  padding: 4px 8px 0 0;
  color: var(--accent);
}

.post-body h2 {
  font-size: 20px;
  text-align: center;
  margin: 2em 0 0.7em;
}

.post-body h2::after {
  content: "❧";
  display: block;
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 4px;
  font-weight: 400;
}

.post-body ul,
.post-body ol {
  padding-left: 1.5em;
  margin-bottom: 1.15em;
}

.post-body li { margin-bottom: 0.35em; }

.post-body code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: rgba(26, 23, 18, 0.06);
  padding: 1px 5px;
  border-radius: 2px;
}

.post-body pre {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  background: rgba(26, 23, 18, 0.05);
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 1.15em;
  border-left: 2px solid var(--rule-dark);
}

.post-body pre code { background: none; padding: 0; }

.post-body blockquote {
  border-left: 3px solid var(--rule);
  padding-left: 16px;
  margin: 1.2em 0;
  font-style: italic;
  color: var(--ink-soft);
}

.back {
  display: inline-block;
  margin-top: 40px;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: none;
}

.back:hover { color: var(--accent); }

/* ── Footer ── */

footer {
  margin-top: 60px;
  padding-top: 16px;
  border-top: 3px double var(--rule);
  text-align: center;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-faint);
}

footer a { color: var(--ink-faint); }

/* ── Front page ── */

.front .wrap { max-width: 780px; }

.kicker {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.lead {
  text-align: center;
  padding: 6px 0 30px;
  border-bottom: 1px solid var(--rule-dark);
  margin-bottom: 30px;
}

.lead .headline {
  font-size: clamp(30px, 6.5vw, 44px);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 auto 14px;
  max-width: 620px;
  text-wrap: balance;
}

.lead .headline a { background: none; color: var(--ink); }
.lead .headline a:hover { color: var(--accent); }

.lead .deck {
  font-style: italic;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 auto 16px;
}

.lead .byline {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.continue {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 9px 20px;
  background: none;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.continue:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
}

/* two columns with a vertical rule, like a broadsheet */
.columns {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 28px;
  margin-bottom: 40px;
}

.columns .col-rule { background: var(--rule); }

.columns .label { margin-bottom: 18px; }

.columns .essay-list a { font-size: 17px; }
.columns .essay-list li { padding: 12px 0; }
.columns .essay-list .date { width: auto; }

@media (max-width: 640px) {
  .columns { grid-template-columns: 1fr; }
  .columns .col-rule { display: none; }
  .columns > section { margin-bottom: 8px; }
}

/* notices box */
.notice {
  border: 1px solid var(--rule-dark);
  padding: 18px 22px;
  text-align: center;
  margin-bottom: 8px;
  position: relative;
}

.notice::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid var(--rule);
  pointer-events: none;
}

.notice .notice-title {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.notice p {
  margin: 0;
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ── Motion ── */

.reveal { animation: settle 0.7s ease both; }
.reveal-1 { animation-delay: 0.15s; }
.reveal-2 { animation-delay: 0.28s; }
.reveal-3 { animation-delay: 0.4s; }

@keyframes settle {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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