/* ==========================================================================
   Notes — a quiet corner of the internet
   Editorial layout, system fonts, light/dark aware, no dependencies.
   ========================================================================== */

:root {
  --ink:        #14161a;
  --ink-soft:   #3d434d;
  --ink-mute:   #767d88;
  --ink-faint:  #a2a8b2;
  --paper:      #fbfaf8;
  --paper-raise:#ffffff;
  --rule:       #e7e4df;
  --rule-soft:  #f0ede8;
  --accent:     #8a5a2b;
  --accent-soft:#c9a227;
  --code-bg:    #f4f2ee;

  --measure: 40rem;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --sans:  ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
           Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
           "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #eceae6;
    --ink-soft:   #c3c0ba;
    --ink-mute:   #8f8b84;
    --ink-faint:  #6b6862;
    --paper:      #121316;
    --paper-raise:#181a1e;
    --rule:       #2a2c31;
    --rule-soft:  #212327;
    --accent:     #d9a566;
    --accent-soft:#e8c37a;
    --code-bg:    #1c1e22;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.75;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- masthead ---------- */

.masthead {
  padding: 3.5rem 0 0;
  text-align: center;
}

.masthead__brand {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color .18s ease, color .18s ease;
}

.masthead__brand:hover { border-bottom-color: var(--accent); color: var(--accent); }

.masthead__tagline {
  margin: 1.35rem auto 0;
  max-width: 27rem;
  color: var(--ink-mute);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.62;
}

/* ---------- nav ---------- */

.nav {
  margin-top: 2.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.nav a {
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-mute);
  transition: color .18s ease;
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--ink); }

/* ---------- main ---------- */

main { padding: 3.75rem 0 5rem; }

/* ---------- post list ---------- */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li + li { margin-top: 2.6rem; }

.post-list a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.post-list__title {
  font-family: var(--sans);
  font-size: 1.24rem;
  font-weight: 620;
  line-height: 1.38;
  letter-spacing: -0.011em;
  color: var(--ink);
  margin: 0 0 0.4rem;
  transition: color .16s ease;
}

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

.post-list__meta {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.55rem;
}

.post-list__excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.7;
}

/* ---------- article ---------- */

.article__header {
  text-align: center;
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.article__kicker {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.article__title {
  font-family: var(--sans);
  font-size: clamp(1.7rem, 1.15rem + 2.1vw, 2.3rem);
  font-weight: 680;
  line-height: 1.2;
  letter-spacing: -0.022em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.article__meta {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

.article__body > p:first-of-type::first-letter {
  float: left;
  font-size: 3.35rem;
  line-height: 0.82;
  font-weight: 500;
  padding: 0.14em 0.09em 0 0;
  color: var(--accent);
}

.article__body p { margin: 0 0 1.5rem; }

.article__body h2 {
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 640;
  letter-spacing: -0.012em;
  margin: 2.75rem 0 1rem;
  line-height: 1.35;
}

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

.article__body a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.article__body strong { font-weight: 640; }

.article__body ul,
.article__body ol { margin: 0 0 1.5rem; padding-left: 1.35rem; }

.article__body li { margin-bottom: 0.45rem; }

.article__body blockquote {
  margin: 2rem 0;
  padding: 0.2rem 0 0.2rem 1.5rem;
  border-left: 2px solid var(--accent-soft);
  color: var(--ink-soft);
  font-style: italic;
}

.article__body blockquote p:last-child { margin-bottom: 0; }

/* ---------- code ---------- */

code {
  font-family: var(--mono);
  font-size: 0.845em;
  background: var(--code-bg);
  padding: 0.13em 0.42em;
  border-radius: 3px;
  word-break: break-word;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.15rem 1.3rem;
  margin: 0 0 1.75rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.68;
  tab-size: 4;
}

pre code {
  background: none;
  padding: 0;
  border: 0;
  font-size: inherit;
  word-break: normal;
}

/* ---------- divider ---------- */

.rule {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 3rem 0;
}

.rule--ornament {
  background: none;
  height: auto;
  text-align: center;
  color: var(--ink-faint);
  letter-spacing: 0.7em;
  font-size: 0.8rem;
  margin: 3.25rem 0;
}

.rule--ornament::before { content: "\2022\2003\2022\2003\2022"; }

/* ---------- article footer ---------- */

.article__footer {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-mute);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.article__footer a {
  color: var(--ink-mute);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color .16s ease, border-color .16s ease;
}

.article__footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- prose pages (about / 404) ---------- */

.page__title {
  font-family: var(--sans);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2rem);
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.24;
  margin: 0 0 1.75rem;
  text-wrap: balance;
}

.page__body { font-size: 1.0625rem; }

.page__body p { margin: 0 0 1.5rem; }

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

.page__body a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- notfound ---------- */

.notfound {
  text-align: center;
  padding: 3rem 0 1rem;
}

.notfound__code {
  font-family: var(--sans);
  font-size: clamp(3.4rem, 2rem + 7vw, 5.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 1.25rem;
  color: var(--ink);
  opacity: 0.14;
}

.notfound__title {
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 640;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
}

.notfound__text {
  color: var(--ink-mute);
  max-width: 26rem;
  margin: 0 auto 2rem;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.25rem 0 3rem;
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer__mark {
  font-style: italic;
  font-family: var(--serif);
  font-size: 0.82rem;
  letter-spacing: 0;
  color: var(--ink-mute);
}

/* ---------- selection ---------- */

::selection { background: var(--accent-soft); color: #14161a; }

/* ---------- focus ---------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- small screens ---------- */

@media (max-width: 34rem) {
  body { font-size: 1rem; }
  .masthead { padding-top: 2.5rem; }
  .nav { gap: 1.4rem; }
  main { padding: 2.75rem 0 3.5rem; }
  .article__body > p:first-of-type::first-letter {
    font-size: 2.9rem;
    padding-right: 0.07em;
  }
  .site-footer .wrap { justify-content: flex-start; }
}
