/* Journey Abundance — classical-modern reading template
   - Elegant serif for headlines, clean sans for body
   - Spacious rhythm, quiet contrast, no imagery required
*/

:root {
  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Garamond, Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Scale */
  --text-0: clamp(0.98rem, 0.25vw + 0.95rem, 1.07rem);
  --text-1: clamp(1.12rem, 0.35vw + 1.05rem, 1.28rem);
  --text-2: clamp(1.35rem, 0.6vw + 1.2rem, 1.65rem);
  --text-3: clamp(1.8rem, 1.2vw + 1.35rem, 2.55rem);
  --text-4: clamp(2.25rem, 2vw + 1.5rem, 3.15rem);

  /* Layout */
  --max: 72ch;              /* ideal measure for essays */
  --gutter: clamp(1.1rem, 3.2vw, 2.4rem);
  --radius: 14px;

  /* Light theme */
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #161515;
  --muted: #5d5a57;
  --quiet: #7b7773;
  --line: rgba(22, 21, 21, 0.10);
  --shadow: 0 10px 30px rgba(22, 21, 21, 0.06);

  --link: #1f3a5f;          /* deep slate-navy */
  --link-hover: #0e2b4d;

  --accent: rgba(31, 58, 95, 0.14); /* used for subtle highlights */
  --selection: rgba(31, 58, 95, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1111;
    --surface: #141717;
    --text: #f1efeb;
    --muted: #c2beb8;
    --quiet: #a6a099;
    --line: rgba(241, 239, 235, 0.12);
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);

    --link: #a9c2ff;
    --link-hover: #d0deff;

    --accent: rgba(169, 194, 255, 0.14);
    --selection: rgba(169, 194, 255, 0.20);
  }
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Stable background glow overlay (prevents awkward bands on short pages) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(31, 58, 95, 0.07), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(31, 58, 95, 0.05), transparent 55%);
}

::selection { background: var(--selection); }

/* Base link styling (used in prose) */
a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--link) 55%, transparent);
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

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

.container {
  max-width: calc(var(--max) + (var(--gutter) * 2));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */
.site-header {
  padding: clamp(1.6rem, 3.4vw, 2.8rem) 0 1.1rem;
}

.brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.brand-title {
  margin: 0;
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
  font-weight: 650;
  font-size: var(--text-3);
  line-height: 1.1;
}

.brand-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: var(--text-0);
  max-width: 55ch;
}

.nav {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

/* Navigation links */
.nav a {
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding: 0.3rem 0.55rem;
  border-radius: 10px;
  color: var(--muted);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav a:hover {
  color: var(--text);
  border-bottom-color: var(--link);
  background: var(--accent);
}

.nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--link);
}

/* Main */
main { padding: 1.5rem 0 2.5rem; }

.card {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 2.2vw, 1.9rem);
}

.prose {
  max-width: var(--max);
}

.prose h1, .prose h2, .prose h3 {
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
  line-height: 1.18;
  margin: 1.2em 0 0.55em;
}
.prose h1 { font-size: var(--text-4); margin-top: 0; }
.prose h2 { font-size: var(--text-2); }
.prose h3 { font-size: var(--text-1); }

.prose p { margin: 0.9em 0; }
.prose p.lede {
  font-size: var(--text-1);
  color: color-mix(in srgb, var(--text) 92%, var(--muted));
  margin-top: 0.6rem;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.6rem 0;
}

.prose blockquote {
  margin: 1.2rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--accent);
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}
.prose blockquote p { margin: 0.7em 0; }

.meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  color: var(--quiet);
  font-size: 0.95em;
  margin: 0.5rem 0 1.2rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

/* Essays list */
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.list li + li {
  border-top: 1px solid var(--line);
  margin-top: 0.9rem;
  padding-top: 0.9rem;
}
/* Essay list links */
.list a {
  font-family: var(--font-serif);
  font-size: var(--text-1);
  color: var(--text);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--text) 40%, transparent);
}
.list a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}
.list .desc {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 62ch;
}

/* Footer base text */
.site-footer {
  padding: 1.8rem 0 2.4rem;
  color: var(--quiet);
}
/* All links inside footer */
.site-footer a {
  color: var(--quiet);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--quiet) 60%, transparent);
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
/* Footer hover */
.site-footer a:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}
.footer-inner {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  display: grid;
  gap: 0.6rem;
}
/* Footer links */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}
.small { font-size: 0.95em; }

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
