/* =========================================================
   Desolate Oath — Minimal Authorial Dark Theme
   ========================================================= */


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

  --bg: #060503;
  --bg-2: #151412;
  --panel: #1b1916;
  --panel-2: #12110f;
  --text: #e6e3dc;
  --muted:   #b9b4aa;
  --muted-2: #8f8a81;
  --line: rgba(200, 180, 130, 0.18);
  --shadow: rgba(0, 0, 0, 0.35);
  --text-2: #f0ede6;

  --accent:   #c8b37a;
  --accent-2: #9aa3b2;
  --danger: #b35a4f;

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

  --bg: #13110e;
  --bg-2: #151412;
  --panel: #1c1914;
  --panel-2: #12110f;
  --text: #b1a48a;
  --text-2: #908267;
  --muted:   #7a705e;
  --muted-2: #3f3a32;
  --line: rgba(177, 164, 138, 0.16);
  --shadow: rgba(0, 0, 0, 0.35);

  --accent:   #b59b62;
  --accent-2: #8b8271;
  --danger: #b35a4f;
  ---- */

  /* RGB helpers for rgba() usage */
  --accent-rgb: 200, 179, 122;  /* #c8b37a */
  --steel-rgb: 154, 163, 178;   /* #9aa3b2 */
  
  --ink: 18, 18, 18;        /* neutral near-black (rgb) */
  --ink-2: 28, 28, 28;      /* slightly lifted neutral (rgb) */

  /* Layout */
  --max: 75ch;            /* reading column */
  --max-wide: 1100px;
  --radius: 14px;
  --radius-sm: 20px;

  /* Type scale */
  --base: 17px;
  --lh: 1.75;
  --lh-tight: 1.25;

  /* Spacing */
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
}

/* ---- Reset-ish ---- */
* { box-sizing: border-box; }
html { font-size: var(--base); }
body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), #0b0a08);
  font-family: var(--font-serif);
  line-height: var(--lh);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block;}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- Page chrome ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(var(--ink), 0.82);
  border-bottom: 1px solid var(--line);
}

.wrap {
  width: min(var(--max-wide), calc(100% - 2 * var(--space-4)));
  margin: 0 auto;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
}
.brand a { color: var(--text); text-decoration: none; }
.brand .title {
  font-family: var(--font-serif);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.95rem;
}
.brand .tagline {
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-family: var(--font-sans);
  font-size: 0.92rem;
}
.nav a {
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
}
.nav a:hover {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.08);
  text-decoration: none;
}

/* ---- Subtle notice banner (quiet craft intermission) ---- */
.notice {
  background: rgba(var(--ink-2), 0.72);
  border-bottom: 1px solid var(--line);
}
.notice .wrap {
  padding: 10px 0;
  text-align: center;
  font-family: var(--font-sans);
  color: var(--muted);
  letter-spacing: 0.02em;
  font-size: 0.95rem;
}
.notice strong { color: var(--text); font-weight: 600; }

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

main { padding-top: var(--space-2); padding-bottom: var(--space-4); }

.stack { display: grid; gap: var(--space-5); }

.meta-label{
  margin: 0;
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
  margin-bottom: 6px;
}

/* ---- Hero (home) ---- */
.hero {
  position: relative;
  padding-top: 0;
  padding-bottom: 0;
}

.hero h1, .hero p { margin-top: 0; }

.hero h1 {
  margin: 0 0 0.25em;   /* tighter than space-2 */
  font-size: clamp(3rem, 3.6vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  font-family: "Crimson Pro", serif;
  margin-bottom: 0.0em;
}

.hero .sub {
  margin-top: 0;
  font-size: 1rem;
  color: var(--muted);
  max-width: 55ch;
}

.hero .meta {
  display: flex;
  flex-wrap: wrap;
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  gap: 10px;                       /* tighter */
  margin-top: var(--space-2);
  margin-bottom: 8px;
}

.hero-banner {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;             /* crops instead of shrinking */
  object-position: 50% 35%;      /* move crop up/down (try 25–45%) */
  display: block;
}

.meta { margin-bottom: 1rem; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;               /* smaller */
  border-radius: 999px;
  font-size: 0.85rem;              /* smaller */
  letter-spacing: 0.02em;
  color: var(--muted);
  background: rgba(255,255,255,0.03);   /* neutral, not gold */
  border: 1px solid rgba(255,255,255,0.06);
}

.image-container {
  display: flex;
  justify-content: center;  /* horizontal center */
}

/* ---- Cards / panels ---- */
.card {
  background: linear-gradient(180deg, rgba(var(--ink-2), 0.92), rgba(var(--ink), 0.88));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px var(--shadow);
}
.card .card-inner { padding: var(--space-5); }
.card h2 {
  margin: 0 0 var(--space-3);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}
.card p { margin: 0 0 var(--space-3); color: var(--muted); }
.card p:last-child { margin-bottom: 0; }

/* ---- Buttons ---- */
.actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.20);
  background: rgba(var(--accent-rgb), 0.10);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: rgba(var(--accent-rgb), 0.16); text-decoration: none; }
.btn.secondary {
  background: rgba(200, 179, 122, 0.08);
  border-color: rgba(200, 179, 122, 0.16);
}
.btn.secondary:hover { background: rgba(200, 179, 122, 0.12); }

/* ---- Lists (home) ---- */
.grid-2 {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

.chapter-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chapter-list a {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(var(--ink), 0.40);
  color: var(--text);
  text-decoration: none;
}
.chapter-list a:hover {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.18);
}
.chapter-list .num {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.92rem;
}
.chapter-list .label {
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  white-space: nowrap;
}

/* ----------------------------------------------------------
   hr
---------------------------------------------------------- */

hr{
  border: none;
  height: 2px;
  margin: var(--space-5) 0;
  background: linear-gradient(
    to right,
    transparent,
    rgba(var(--accent-rgb), 0.5),
    transparent
  );
}


/* ----------------------------------------------------------
   Icon Grid
---------------------------------------------------------- */

.follow{
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: var(--space-3);
}

.icon-link span {
  margin-top: .2rem;
}

.icon-link{
  padding: 10px 12px;  /* slightly tighter */
}

/* Smaller, cleaner icons */
.icon-link img {
  width: 28px;
  height: 28px;
}

.icon-grid{
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
  width: fit-content;        /* KEY: shrink to content */
  max-width: 100%;           /* prevents overflow on mobile */
}

.icon-grid .icon-link{
  width: 130px;           /* your card width */
  flex: 0 0 130px;        /* prevents stretching */
  padding: 12px 10px;    /* less height */
  text-align: center;
  flex-direction: column;
}

/* ---- Chapter page reading column ---- */
.reader {
  width: min(var(--max), calc(100% - 2 * var(--space-4)));
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 3rem) clamp(1rem, 3.2vw, 2.5rem);
  position: relative;
  background: #161513; /* soft charcoal-gold */
  padding: 3rem 2.5rem;
  border-radius: 8px;
  box-shadow: 
    0 0 0 1px rgba(160,170,190,0.08),
    0 30px 60px rgba(0,0,0,0.45);
}

.chapter-header {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.chapter-header .kicker {
  font-family: var(--font-mono);
  color: var(--muted-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
}
.chapter-header h1 {
  margin: var(--space-2) 0 var(--space-2);
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  line-height: var(--lh-tight);
}
.chapter-header .submeta {
  color: var(--muted);
  font-family: var(--font-sans);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.chapter-header .center {
  text-align: center;
}

/* Subtle vertical manuscript rules */
.reader::before,
.reader::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(180, 175, 165, 0.14); /* pale grey yellow */
}

.reader::before {
  left: -20px;
}

.reader::after {
  right: -20px;
}

/* =========================================================
   Chapter Index
   ========================================================= */

.chpt-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.chpt-sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.act-title {
  margin: 1.5rem 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.chpt .chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.chpt .chapter-link {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  align-items: baseline;
  gap: 0.75rem;

  padding: 12px 14px;
  border-radius: 14px;

  background: rgba(var(--ink), 0.35);
  border: 1px solid rgba(255,255,255,0.08);

  color: var(--text);
  text-decoration: none;
}

.chpt .chapter-link:hover {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.18);
  text-decoration: none;
}

.chpt .ch-num {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.chpt .ch-name {
  font-family: var(--font-serif);
  color: var(--text);
}


/* ----------------------------------------------------------
   Chapter Header Block
---------------------------------------------------------- */

.chpt-header {
  text-align: center;
  margin: 2.5rem 0 2rem 0; /* Additional breathing room */
  padding: 0 1rem;         /* Prevent edge crowding */
}

.chpt-header .chapter-number {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: .5rem;
}

.chpt-header .chapter-number::before,
.chpt-header .chapter-number::after {  
  content: "";
  flex: 1;
  height: 1px;
  margin: 0 .75rem;
  opacity: 0.8;
}

.chpt-header .chapter-number::before {
  background: linear-gradient(
    to left,
    rgba(var(--accent-rgb), 0.8),
    rgba(var(--accent-rgb), 0)
  );
}

.chpt-header .chapter-number::after {
  background: linear-gradient(
    to right,
    rgba(var(--accent-rgb), 0.8),
    rgba(var(--accent-rgb), 0)
  );
}

.chpt-header .chapter-title {
  font-size: 2rem;
  letter-spacing: 1px;
  font-weight: bold;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
}

/* ---- Content note box ---- */
.content-note {
  margin: var(--space-4) 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.content-note .label {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 6px;
}
.content-note .items {
  color: var(--muted);
  font-family: var(--font-sans);
  font-style: italic;
}

/* ---- Prose styling ---- */
.prose .emphasis {
  margin: 2.5em 0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.reader .prose {
  max-width: var(--max);
  margin: 0 auto;
}

.prose { font-size: 1.08rem; }
.prose p { margin: 0 0 1.05em; }
.prose p:last-child { margin-bottom: 0; }
.prose em,
.prose strong { color: var(--text-2); }
.prose blockquote {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid rgba(var(--accent-rgb), 0.30);
  background: rgba(var(--ink), 0.35);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
}

  /* Clean, editorial-style lists */
.prose ul, ol {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.prose ul li, ol li {
  padding-left: 1.2rem;
  margin-bottom: 0.6rem;
  position: relative;
  line-height: 1.8;
}

.prose ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent); /* matches your gold accent */
  opacity: 0.8;
}

/* ---- Chapter nav (prev/next) ---- */
.chapter-nav {
  margin-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
}
.chapter-nav a {
  font-family: var(--font-sans);
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(var(--ink), 0.40);
}
.chapter-nav a:hover {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.18);
  background: rgba(var(--accent-rgb), 0.08);
  text-decoration: none;
}

/* ----------------------------------------------------------
   Journal Entry Formatting
---------------------------------------------------------- */

.data-entry-title {
  font-family: "Garamond", "Georgia", serif;
  font-size: 1.6rem;
  font-weight: none;
  letter-spacing: 0.08em;
  margin-bottom: 1.2rem;
}

.data-entry-body {
  max-width: 68ch;
  font-family: "Georgia", serif;
  font-size: 1.05rem;
  line-height: 1.7;
}

.data-entry-body p {
  margin-bottom: 1.4em;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-5) 0;
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 0.92rem;
}
.site-footer .row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.smallcaps {
  font-variant: all-small-caps;
  letter-spacing: 0.08em;
}

/* =========================================================
   Mobile tuning — reduce “ceremony”, keep the vibe
   ========================================================= */
@media (max-width: 700px) {

  /* Make the sticky header less dominant */
  .header-row {
    padding: 10px 0;
    gap: 10px;
  }
  
  body {
  background: var(--bg);
}

  .brand { min-width: 0; }
  .brand .title {
    font-size: 0.82rem;
    letter-spacing: 0.10em;
  }
  .brand .tagline {
    font-size: 0.78rem;
    opacity: 0.85;
  }

  .nav {
    gap: 8px;
    font-size: 0.88rem;
  }
  .nav a {
    padding: 6px 8px;
    border-radius: 10px;
  }

  /* Reader card: less padding + less shadow = less “messy” */
  .reader {
    width: calc(100% - 2 * var(--space-3));
    padding: 1.25rem 1rem;
    border-radius: 12px;
    box-shadow:
      0 0 0 1px rgba(180, 175, 165, 0.10),
      0 18px 30px rgba(0,0,0,0.35);
  }

  /* Turn off the vertical manuscript rules on mobile */
  .reader::before,
  .reader::after {
    display: none;
  }

  /* Chapter header: tighten vertical whitespace */
  .chpt-header {
    margin: 1.5rem 0 1.25rem;
    padding: 0;
  }

  .chpt-header .chapter-number {
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
  }

  /* Make the big title scale better on phones */
  .chpt-header .chapter-title {
    font-size: clamp(1.35rem, 7vw, 2rem);
    letter-spacing: 0.06em;
    line-height: 1.1;
    text-shadow: none; /* reduces fuzziness on small screens */
  }

  /* Prose: slightly smaller, more comfortable on narrow screens */
  .prose {
    font-size: 1rem;
  }
  .prose p {
    margin: 0 0 1.1em;
  }

  /* Softer hr on mobile so it doesn’t scream “section break” */
  hr {
    margin: 1.5rem 0;
    height: 1px;
  }

  /* Content warning box: tighter */
  .content-note {
    padding: 0.9rem 1rem;
    margin: 1rem 0 1.25rem;
  }
}

/* If user’s OS is light mode, we still keep our dark palette */
@media (prefers-color-scheme: light) {
  :root { color-scheme: dark; }
}

/* Desktop layout enhancements */
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1.25fr 0.75fr; }
  .icon-grid { flex-wrap: nowrap; }
}

/* Mobile tuning (iPhone 13 lives here comfortably) */
@media (max-width: 700px) {
  /* (paste the whole mobile patch I gave you here) */
}

@supports (height: 100dvh) {
  body { min-height: 100dvh; }
}

@media (max-width: 700px) {
  .chpt .chapter-link {
    grid-template-columns: 3.1rem 1fr;
    padding: 10px 12px;
  }
}