/* ---------------------------------------------------------------------------
   robjenkins.me — "warm personal journal"
   A quiet, paper-like site. Warm cream by day, warm dark by night.
   --------------------------------------------------------------------------- */

:root {
  /* Warm light palette */
  --bg: #faf6ef;
  --bg-soft: #f2ebdf;
  --surface: #fffdf8;
  --text: #2c2622;
  --text-soft: #6a6056;
  --border: #e7ddcd;
  --accent: #b2542f;        /* terracotta */
  --accent-soft: #c9744f;
  --shadow: 0 1px 2px rgba(44, 38, 34, 0.05), 0 8px 24px rgba(44, 38, 34, 0.06);

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 38rem;         /* comfortable reading width */
  --wide: 62rem;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1714;
    --bg-soft: #221d19;
    --surface: #241f1a;
    --text: #ece3d6;
    --text-soft: #a99e8f;
    --border: #38302a;
    --accent: #e0916b;
    --accent-soft: #c9744f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layout ------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
.wrap--wide {
  max-width: var(--wide);
}

main {
  padding-block: 2.5rem 4rem;
  min-height: 60vh;
}

/* Typography --------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 2.2rem 0 0.8rem;
}
h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin-top: 0; }
h2 { font-size: clamp(1.45rem, 3.5vw, 1.9rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.2rem; }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-soft); text-decoration: underline; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

blockquote {
  margin: 1.5rem 0;
  padding-left: 1.2rem;
  border-left: 3px solid var(--accent);
  color: var(--text-soft);
  font-style: italic;
}

img { max-width: 100%; height: auto; border-radius: var(--radius); }

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
pre {
  background: var(--bg-soft);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 0.4rem;
}

.muted { color: var(--text-soft); }
.lead { font-size: 1.28rem; line-height: 1.55; color: var(--text); }

/* Header ------------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--accent); text-decoration: none; }
.nav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}
.nav a { color: var(--text-soft); }
.nav a:hover,
.nav a[aria-current="page"] { color: var(--accent); text-decoration: none; }

/* Footer ------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem 3rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-soft);
}
.site-footer a { color: var(--text-soft); }
.site-footer a:hover { color: var(--accent); }
.site-footer__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Home --------------------------------------------------------------------- */
.intro { padding-block: 1rem 0.5rem; }
.intro h1 { margin-bottom: 0.6rem; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 3rem 0 1rem;
}
.section-head h2 { margin: 0; }
.section-head a { font-family: var(--font-sans); font-size: 0.92rem; }

/* Post list ---------------------------------------------------------------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.post-list li:last-child { border-bottom: none; }
.post-list__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 560;
  display: block;
  color: var(--text);
}
.post-list a.post-list__title:hover { color: var(--accent); text-decoration: none; }
.post-list__meta {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 0.15rem;
}
.post-list__desc { color: var(--text-soft); margin: 0.4rem 0 0; }

/* Interest chips ----------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.chip {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  color: var(--text-soft);
  box-shadow: var(--shadow);
}

/* Cards (projects) --------------------------------------------------------- */
.cards { display: grid; gap: 1.2rem; margin-top: 1rem; }
@media (min-width: 40rem) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card h3 { margin-top: 0; }
.card__links { margin-top: auto; padding-top: 0.8rem; font-family: var(--font-sans); font-size: 0.92rem; display: flex; gap: 1rem; }

/* Article ------------------------------------------------------------------ */
.article-header { margin-bottom: 2rem; }
.article-header h1 { margin-bottom: 0.5rem; }
.article-meta { font-family: var(--font-sans); font-size: 0.85rem; color: var(--text-soft); }
.article-hero { margin: 1.5rem 0 2rem; }
.article-hero img { width: 100%; box-shadow: var(--shadow); }
.prose :is(h2, h3) { margin-top: 2.2rem; }
.tag-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.7rem; }
.tag {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-soft);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}

.draft-banner {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.backlink { font-family: var(--font-sans); font-size: 0.92rem; }

/* Gallery ------------------------------------------------------------------ */
.gallery {
  margin: 2rem 0 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.gallery__item { margin: 0; }
.gallery__item img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  box-shadow: var(--shadow);
  display: block;
}
.gallery__item figcaption {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 0.45rem;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 1rem;
  top: 0.5rem;
  background: var(--surface);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  z-index: 100;
}
