/* ============================================================
   Rumispection — a quiet literary journal for one voice
   Tokens are the contract: change colors here, nowhere else.
   ============================================================ */

:root {
  --paper: #E5D7BB;           /* lamplit paper — dim, warm, night-friendly */
  --ink: #262016;             /* near-black, warm */
  --faint: #6B604C;           /* meta / deks */
  --water: #2B4763;           /* navy — the bridge, the river */
  --rose: #A65D73;            /* pink — the lamp on at 2am */
  --rule: rgba(38, 32, 22, .32);
  --rule-soft: rgba(38, 32, 22, .13);

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --display: 'Young Serif', 'Newsreader', serif;
  --mono: 'Spline Sans Mono', ui-monospace, monospace;
}

html.dusk {
  --paper: #0A0E17;           /* deep blue night, 2am dark */
  --ink: #DCD2BC;             /* warm paper text, dimmed against the dark */
  --faint: #8E8672;
  --water: #8FABCE;
  --rose: #D495A4;
  --rule: rgba(220, 210, 188, .32);
  --rule-soft: rgba(220, 210, 188, .13);
}

/* ——— base ——— */

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s ease, color .5s ease;
}

/* paper grain — restrained */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  opacity: .05;
  mix-blend-mode: multiply;
}
html.dusk body::after { opacity: .055; mix-blend-mode: screen; }
body.no-grain::after { display: none; }

::selection { background: rgba(166, 93, 115, .30); }
html.dusk ::selection { background: rgba(212, 149, 164, .32); }

a {
  color: var(--water);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--water) 45%, transparent);
  transition: color .18s ease, text-decoration-color .18s ease;
}
a:hover { color: var(--rose); text-decoration-color: var(--rose); }

button { font: inherit; cursor: pointer; }
input { font: inherit; }
input::placeholder { color: var(--faint); opacity: .6; }

img { max-width: 100%; height: auto; }

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  flex: 1;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 24px 72px;
  box-sizing: border-box;
}

.label, .kicker {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ——— running head ——— */

.site-head {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 20px 24px 0;
  box-sizing: border-box;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.site-head .brand a {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}
.home-template .site-head .brand { visibility: hidden; }

.dot { color: var(--rose); }

.site-nav {
  display: flex;
  gap: 20px;
  align-items: baseline;
}
.site-nav a, .site-nav .mode {
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .05em;
  color: var(--faint);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  transition: color .18s ease;
}
.site-nav a:hover, .site-nav .mode:hover { color: var(--rose); }

.mode .to-lamp { display: none; }
html.dusk .mode .to-lamp { display: inline; }
html.dusk .mode .to-dusk { display: none; }

/* ——— home ——— */

.masthead {
  text-align: center;
  padding-top: 64px;
}
.masthead h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.7rem, 9vw, 4.3rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.tagline {
  margin: 20px auto 0;
  font-style: italic;
  font-size: min(1rem, calc((100vw - 56px) / 35));
  line-height: 1.6;
  color: var(--faint);
  white-space: nowrap;
}
.double-rule { margin-top: 38px; }
.double-rule span { display: block; border-top: 2px solid var(--ink); }
.double-rule span + span { border-top-width: 1px; margin-top: 3px; opacity: .5; }

.essay-list { margin-top: 22px; }

.entry {
  display: block;
  padding: 30px 2px 34px;
  border-bottom: 1px solid var(--rule-soft);
  text-decoration: none;
  color: inherit;
}
.entry-meta {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
}
.entry-title {
  margin: 12px 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.4rem, 4.4vw, 1.6rem);
  line-height: 1.25;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
  text-decoration-color: transparent;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.entry:hover .entry-title { color: var(--water); text-decoration-color: var(--rose); }
.entry-dek {
  margin: 12px 0 0;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--faint);
}

.forthcoming { margin-top: 48px; }
.forthcoming .empty-slot { height: 46px; border-bottom: 1px solid var(--rule-soft); }

.pagination {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .08em;
  color: var(--faint);
}
.pagination a { color: var(--faint); text-decoration: none; }
.pagination a:hover { color: var(--rose); }
.pagination .page-number { opacity: .7; }

/* ——— essay ——— */

.post-head {
  text-align: center;
  padding-top: 44px;
}
.post-head .kicker { margin-bottom: 0; }
.post-title {
  margin: 18px 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 6.4vw, 2.8rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.post-dek {
  margin: 20px auto 0;
  max-width: 30em;
  font-style: italic;
  font-size: clamp(1.08rem, 3vw, 1.22rem);
  line-height: 1.5;
  color: var(--faint);
}
.byline { margin: 22px 0 0; font-size: .98rem; color: var(--ink); }

.ornament { display: flex; justify-content: center; margin-top: 28px; }
.end-ornament { margin-top: 60px; }

/* ——— essay body (Koenig content) ——— */

.post-content {
  margin-top: 44px;
  font-size: clamp(1.11rem, 1.02rem + .4vw, 1.2rem);
  line-height: 1.74;
}

.post-content p { margin: 0; }
.post-content p + p { text-indent: 1.6em; }

/* drop cap on the opening paragraph */
.post .post-content > p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 3.3em;
  line-height: .82;
  padding: .06em .1em 0 0;
  color: var(--water);
}

/* divider card → bridge ornament */
.post-content hr {
  border: none;
  width: 76px;
  height: 16px;
  margin: 46px auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='16' viewBox='0 0 96 16'%3E%3Cpath d='M6 5 C 30 13.5, 66 13.5, 90 5' stroke='%232B4763' stroke-width='1.6' fill='none'/%3E%3Ccircle cx='6' cy='5' r='2.4' fill='%23A65D73'/%3E%3Ccircle cx='90' cy='5' r='2.4' fill='%23A65D73'/%3E%3C/svg%3E") center / contain no-repeat;
}
html.dusk .post-content hr {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='16' viewBox='0 0 96 16'%3E%3Cpath d='M6 5 C 30 13.5, 66 13.5, 90 5' stroke='%238FABCE' stroke-width='1.6' fill='none'/%3E%3Ccircle cx='6' cy='5' r='2.4' fill='%23D495A4'/%3E%3Ccircle cx='90' cy='5' r='2.4' fill='%23D495A4'/%3E%3C/svg%3E");
}
.post-content hr + p { text-indent: 0; }

/* quote card → lyric / citation */
.post-content blockquote {
  margin: 34px auto;
  max-width: 30em;
  text-align: center;
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink);
  border: none;
  padding: 0;
}
.post-content blockquote + p { text-indent: 0; }

/* quote card, alt style (click quote twice) → pull quote */
.post-content blockquote.kg-blockquote-alt {
  margin: 48px 0;
  max-width: none;
  padding: 30px 8px;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  font-weight: 500;
  font-size: clamp(1.3rem, 3.6vw, 1.5rem);
  line-height: 1.42;
  color: var(--water);
}

/* lyric HTML card (figure.lyric) */
.post-content .lyric {
  margin: 34px auto;
  max-width: 30em;
  text-align: center;
}
.post-content .lyric blockquote { margin: 0; }
.post-content .lyric figcaption,
.post-content figcaption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
}
.post-content .lyric + p, .post-content figure + p { text-indent: 0; }

/* images (Koenig image card) */
.post-content .kg-image-card { margin: 40px 0; }
.post-content .kg-image { margin: 0 auto; display: block; }

/* wide / full-bleed image cards (required by the Koenig editor) */
.kg-width-wide {
  position: relative;
  width: min(64rem, calc(100vw - 48px));
  margin-left: 50%;
  transform: translateX(-50%);
}
.kg-width-full {
  position: relative;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}
.kg-width-wide .kg-image,
.kg-width-full .kg-image { width: 100%; }

/* footnotes HTML card */
.footnotes { margin-top: 64px; }
.footnotes-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footnotes-head span:first-child {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
}
.footnotes-head span:last-child { flex: 1; border-top: 1px solid var(--rule-soft); }
.footnotes p {
  margin: 12px 0 0 !important;
  display: flex;
  gap: 12px;
  font-size: .93rem;
  line-height: 1.6;
  color: var(--faint);
  text-indent: 0 !important;
}
.footnotes .fn-num {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--water);
  padding-top: .2em;
}

/* ——— subscribe ——— */

.subscribe { margin-top: 26px; text-align: center; }
.subscribe-line {
  margin: 0;
  font-style: italic;
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--ink);
}
.subscribe form { margin: 0; }
.subscribe-row {
  margin: 20px auto 0;
  max-width: 26rem;
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.subscribe input[type="email"] {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 8px 2px;
  color: var(--ink);
  font-size: 1rem;
  outline: none;
  transition: border-color .2s ease;
}
.subscribe input[type="email"]:focus { border-bottom-color: var(--water); }
.subscribe button[type="submit"] {
  background: transparent;
  border: 1px solid var(--water);
  border-radius: 0;
  color: var(--water);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 10px 18px;
  transition: background-color .2s ease, color .2s ease;
}
.subscribe button[type="submit"]:hover { background: var(--water); color: var(--paper); }

.subscribe-success { display: none; margin: 20px 0 0; font-style: italic; font-size: 1.02rem; color: var(--water); }
.subscribe-error { display: none; margin: 12px 0 0; font-size: .9rem; color: var(--rose); }

.subscribe form.success .subscribe-row { display: none; }
.subscribe form.success .subscribe-success { display: block; }
.subscribe form.error .subscribe-error { display: block; }
.subscribe form.loading button[type="submit"] { opacity: .5; pointer-events: none; }

.back { margin: 36px 0 0; text-align: center; }
.back a {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .08em;
  color: var(--faint);
  text-decoration: none;
  transition: color .18s ease;
}
.back a:hover { color: var(--rose); }

/* ——— pages (About) ——— */

.page-head { padding-top: 52px; }
.page-content { margin-top: 28px; font-size: clamp(1.08rem, 1rem + .35vw, 1.16rem); line-height: 1.72; }
.page-content h1, .page-content h2 {
  margin: 0 0 20px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 5vw, 1.9rem);
  line-height: 1.2;
  color: var(--ink);
}
.page .post-content > p:first-of-type::first-letter { all: unset; }

/* ——— footer ——— */

.site-foot {
  margin-top: auto;
  padding: 56px 24px 44px;
  text-align: center;
}
.site-foot svg { opacity: .85; }
.site-foot p {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--faint);
}
