/* =================================================================
   Jonathan Kosar — homepage
   Editorial: warm paper, serif display, sage accent.
   ================================================================= */

:root {
  --paper:       #f0eadc;
  --paper-deep:  #e6dfcd;
  --rule:        #d6cfbc;
  --ink:         #1c1a14;
  --ink-soft:    #3e3a2e;
  --ink-dim:     #7a7261;
  --ink-faint:   #b3aa97;
  --accent:      oklch(0.42 0.08 150);
  --accent-soft: oklch(0.42 0.08 150 / 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.55;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* paper texture — very subtle */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(120,100,60,0.04), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(60,80,60,0.04), transparent 50%);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 32px 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ───────────────────── topbar ───────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 64px;
  gap: 24px;
  flex-wrap: wrap;
}

.mark {
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.mark-initials {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  background: var(--ink);
  color: var(--paper);
  padding: 5px 8px 4px;
  line-height: 1;
}
.mark-name {
  font-family: "Newsreader", serif;
  font-style: italic;
  font-size: 17px;
  color: var(--ink-soft);
}

.nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: color 0.15s;
  position: relative;
  padding-bottom: 4px;
  cursor: pointer;
}
.nav a:hover { color: var(--accent); }
.nav a.active {
  color: var(--ink);
}
.nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
}
.resume-link .arrow {
  display: inline-block;
  margin-left: 2px;
  font-size: 10px;
  transform: translateY(-1px);
}

/* ───────────────────── main + swap transition ───────────────────── */

#main {
  transition: opacity 0.15s ease;
  flex: 1;
}

/* ───────────────────── hero ───────────────────── */

.hero {
  margin-bottom: 72px;
}
.hero-kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero-name {
  font-family: "Newsreader", serif;
  font-weight: 300;
  font-size: clamp(48px, 9vw, 92px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
  text-wrap: balance;
}
.hero-name em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}
.hero-lead {
  font-size: 21px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 36ch;
  margin: 0;
  text-wrap: pretty;
}
.hero-lead em { font-style: italic; }
.hero-lead a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* ───────────────────── section title ───────────────────── */

.section-title {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
}
.section-title .count {
  color: var(--ink-faint);
  font-weight: 400;
}

.page-intro {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 40ch;
  margin: 0 0 40px;
  text-wrap: pretty;
}
.page-intro em { font-style: italic; }

/* ───────────────────── post list ───────────────────── */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.post-row:hover { background: linear-gradient(90deg, var(--accent-soft), transparent 80%); }
.post-row a {
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-wrap: pretty;
}
.post-row a:hover { color: var(--accent); }
.post-row .date {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.post-row .excerpt {
  grid-column: 1 / -1;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 4px;
  text-wrap: pretty;
}

/* ───────────────────── article ───────────────────── */

.article-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.article-meta .sep { color: var(--ink-faint); }
.article-title {
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-size: clamp(34px, 5.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.022em;
  margin: 0 0 36px;
  text-wrap: balance;
}
.article-body {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 60ch;
}
.article-body > p:first-of-type::first-line {
  font-variant-caps: small-caps;
  letter-spacing: 0.05em;
}
.article-body p { margin: 0 0 1.2em; text-wrap: pretty; }
.article-body em { font-style: italic; }
.article-body strong { font-weight: 500; color: var(--ink); }
.article-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: background 0.15s;
}
.article-body a:hover { background: var(--accent-soft); }
.article-body blockquote {
  margin: 1.8em 0;
  padding-left: 24px;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--ink);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  color: var(--ink-dim);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.back-link:hover { color: var(--accent); }

/* ───────────────────── projects ───────────────────── */

.project-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.project {
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.project h3 {
  font-family: "Newsreader", serif;
  font-weight: 400;
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.005em;
}
.project h3 a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.project h3 a:hover { color: var(--accent); border-color: var(--accent); }
.project p {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 4px 0 0;
  line-height: 1.5;
  text-wrap: pretty;
}
.project-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}

/* ───────────────────── now page ───────────────────── */

.now-section {
  margin-bottom: 36px;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.now-section:last-child { border-bottom: none; }
.now-section h3 {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 4px 0 0;
}
.now-section .now-body p {
  font-size: 18px;
  line-height: 1.5;
  margin: 0 0 0.5em;
  text-wrap: pretty;
}
.now-section .now-body p:last-child { margin-bottom: 0; }
.now-section .now-body em { font-style: italic; }

@media (max-width: 540px) {
  .now-section { grid-template-columns: 1fr; gap: 6px; }
  .now-section h3 { margin: 0; }
}

/* ───────────────────── footer ───────────────────── */

.footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  flex-wrap: wrap;
}
.footer a {
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.footer a:hover { color: var(--accent); }
.footer-dot { color: var(--ink-faint); }
.footer-cr { letter-spacing: 0.04em; }
