/* Inner Monologue: a journal at dusk. No frameworks, no external requests. */

@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url(/assets/fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url(/assets/fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: italic; font-display: swap; src: url(/assets/fonts/cormorant-garamond-latin-600-italic.woff2) format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 400; font-style: normal; font-display: swap; src: url(/assets/fonts/lora-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 400; font-style: italic; font-display: swap; src: url(/assets/fonts/lora-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 600; font-style: normal; font-display: swap; src: url(/assets/fonts/lora-latin-600-normal.woff2) format("woff2"); }

/* ---------- day (parchment) ---------- */
:root {
  --bg: #fbf6ef;
  --bg-2: #f5ece2;
  --surface: #fffaf5;
  --ink: #2b2130;
  --text: #463a4c;
  --muted: #7a6c7e;
  --rose: #a94b62;          /* text-safe on parchment */
  --rose-soft: rgba(169, 75, 98, .12);
  --gold: #a57a32;
  --line: #eadccf;
  --shadow: 0 1px 2px rgba(43, 33, 48, .05), 0 12px 32px rgba(43, 33, 48, .08);
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --narrow: 680px;
  --wide: 1080px;
}
/* ---------- night (plum ink) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1320; --bg-2: #211828; --surface: #251b2d; --ink: #f6ecf0; --text: #e2d5dd; --muted: #a998ab;
    --rose: #eba3b0; --rose-soft: rgba(235, 163, 176, .14); --gold: #e3bf7d; --line: #3a2c43;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 36px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #1a1320; --bg-2: #211828; --surface: #251b2d; --ink: #f6ecf0; --text: #e2d5dd; --muted: #a998ab;
  --rose: #eba3b0; --rose-soft: rgba(235, 163, 176, .14); --gold: #e3bf7d; --line: #3a2c43;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 36px rgba(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: 400 18px/1.8 var(--serif); -webkit-font-smoothing: antialiased; transition: background-color .4s, color .4s; }
img, svg { display: block; }
a { color: var(--rose); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; color: var(--ink); line-height: 1.1; margin: 0 0 .4em; }
p { margin: 0 0 1.15em; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--rose-soft); color: var(--ink); }

.wrap { width: min(100% - 40px, var(--wide)); margin-inline: auto; }
.narrow { width: min(100% - 40px, var(--narrow)); }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--rose); color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { top: 12px; }
.kicker { font: 500 13px/1.4 var(--serif); letter-spacing: .22em; text-transform: uppercase; color: var(--rose); margin-bottom: 18px; }

/* ---------- header ---------- */
.site-header { position: absolute; inset: 0 0 auto 0; z-index: 20; }
.entry-page .site-header, .page-plain .site-header { position: relative; border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: italic 500 23px/1 var(--display); color: var(--ink); }
.home .brand { color: #fbeff2; }
.theme-toggle { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; transition: border-color .2s, color .2s; }
.home .theme-toggle { border-color: rgba(255, 255, 255, .28); color: #fbeff2; }
.theme-toggle:hover { border-color: var(--rose); color: var(--rose); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.theme-toggle .i-moon { fill: currentColor; stroke: none; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
}

/* ---------- dusk sky hero ---------- */
.sky { position: relative; overflow: hidden; isolation: isolate; color: #fbeff2; min-height: min(92vh, 820px); display: flex; align-items: center;
  background: linear-gradient(180deg, #0f0a1c 0%, #1f1433 30%, #3a1f44 55%, #6e3653 76%, #b9686c 92%, #d99a86 100%); }
.sky::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(180deg, transparent, var(--bg)); z-index: -1; }
.stars, .stars::before, .stars::after { position: absolute; inset: 0; z-index: -2; }
.stars { background-image:
    radial-gradient(1.2px 1.2px at 8% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 18% 30%, #ffe9f0 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 27% 8%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 36% 22%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 47% 6%, #ffeacc 50%, transparent 51%), radial-gradient(1px 1px at 55% 28%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 63% 14%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 71% 34%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 84% 9%, #ffe9f0 50%, transparent 51%), radial-gradient(1px 1px at 92% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 12% 46%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 42% 40%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 44%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 4% 58%, #ffeacc 50%, transparent 51%);
  opacity: .9; }
.stars::before { content: ""; background-image:
    radial-gradient(1px 1px at 22% 16%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 52% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 77% 20%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 33% 52%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 96% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 60% 44%, #fff 50%, transparent 51%);
  animation: twinkle 5s ease-in-out infinite alternate; }
.stars::after { content: ""; background: radial-gradient(60% 40% at 50% 105%, rgba(255, 190, 170, .35), transparent 70%); }
@keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }
.moon { position: absolute; z-index: -1; top: 15%; right: 12%; width: 88px; height: 88px; border-radius: 50%; box-shadow: inset -18px 10px 0 0 #fbe9d6; filter: drop-shadow(0 0 22px rgba(251, 233, 214, .55)); transform: rotate(-12deg); }
.sky-inner { padding: 140px 0 120px; text-align: center; }
.sky .kicker { color: #f3c6c9; }
.sky h1 { color: #fff7f3; font-size: clamp(64px, 12vw, 132px); line-height: .9; letter-spacing: -.01em; margin-bottom: 26px; text-shadow: 0 2px 30px rgba(30, 10, 40, .45); }
.sky h1 em { font-style: italic; font-weight: 600; color: #f6c9c4; }
.sky-lead { font: italic 400 clamp(18px, 2vw, 21px)/1.6 var(--serif); color: rgba(255, 240, 238, .86); max-width: 520px; margin: 0 auto 18px; }
.thread { width: min(520px, 90%); height: 92px; margin: 0 auto 30px; overflow: visible; }
.thread path { fill: none; stroke: #f3b8b8; stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 3.6s .4s ease-out forwards; filter: drop-shadow(0 0 6px rgba(243, 184, 184, .6)); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.sky-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.btn { display: inline-flex; align-items: center; padding: 13px 26px; border-radius: 999px; font: 500 16px/1 var(--serif); text-decoration: none; letter-spacing: .02em; transition: background .25s, color .25s, border-color .25s, box-shadow .25s; }
.btn-glow { background: #f6d2cf; color: #2b1631; box-shadow: 0 0 0 0 rgba(246, 210, 207, .5); }
.btn-glow:hover { background: #fff0ec; color: #2b1631; box-shadow: 0 0 28px 4px rgba(246, 210, 207, .35); }
.btn-ghost { border: 1px solid rgba(255, 235, 235, .45); color: #fbeff2; }
.btn-ghost:hover { border-color: #fff; color: #fff; }

/* ---------- prologue quote ---------- */
.prologue { padding: 40px 0 30px; }
.pull { margin: 0; text-align: center; }
.pull p { font: italic 500 clamp(28px, 4vw, 40px)/1.3 var(--display); color: var(--ink); margin-bottom: 18px; }
.pull p::before { content: "“"; color: var(--rose); }
.pull p::after { content: "”"; color: var(--rose); }
.pull footer { font-size: 15px; color: var(--muted); letter-spacing: .04em; }

/* ---------- timeline of letters ---------- */
.letters { padding: 60px 0 110px; }
.section-title { font-style: italic; font-size: clamp(40px, 5vw, 54px); text-align: center; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--muted); font-size: 16px; margin-bottom: 56px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 92px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--line), var(--rose) 50%, var(--line)); }
.timeline li { display: grid; grid-template-columns: 78px 1fr; gap: 30px; margin-bottom: 26px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 88px; top: 22px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--rose); }
.t-date { text-align: right; padding-top: 12px; line-height: 1.3; }
.t-day { display: block; font: italic 500 21px/1.2 var(--display); color: var(--ink); }
.t-time { display: block; font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.letter { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px 26px 20px; box-shadow: var(--shadow); color: var(--text); position: relative; transition: transform .3s, border-color .3s, box-shadow .3s; }
.letter::after { content: ""; position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(135deg, var(--rose-soft), transparent 55%); opacity: 0; transition: opacity .3s; }
.letter:hover { transform: translateY(-3px); border-color: var(--rose); color: var(--text); }
.letter:hover::after { opacity: 1; }
.letter-no { display: block; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--rose); margin-bottom: 6px; }
.letter-title { display: block; font: italic 500 30px/1.15 var(--display); color: var(--ink); margin-bottom: 8px; }
.letter-line { display: block; font-size: 16.5px; line-height: 1.65; }
.letter-meta { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); }
.to-be-continued { text-align: center; font: italic 500 26px/1.3 var(--display); color: var(--muted); margin: 50px 0 0; }
@media (max-width: 560px) {
  .timeline::before { left: 6px; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; padding-left: 28px; }
  .timeline li::before { left: 2px; top: 8px; }
  .t-date { text-align: left; padding-top: 0; display: flex; gap: 10px; align-items: baseline; }
  .letter { padding: 18px 20px; }
  .letter-title { font-size: 27px; }
}

/* ---------- entry page ---------- */
.entry-head { padding: clamp(56px, 9vw, 104px) 0 20px; text-align: center; background: radial-gradient(70% 90% at 50% 0%, var(--rose-soft), transparent 70%); }
.entry-head h1 { font-style: italic; font-size: clamp(44px, 7vw, 76px); text-wrap: balance; margin-bottom: 18px; }
.entry-meta { color: var(--muted); font-size: 15px; letter-spacing: .03em; }
.entry-body { padding: 22px 0 10px; font-size: 19.5px; line-height: 1.9; }
.entry-body > p:first-of-type::first-letter { float: left; font: italic 600 4.6em/.8 var(--display); color: var(--rose); padding: .08em .1em 0 0; }
.ornament { margin: 48px auto 20px; width: 220px; height: 24px; }
.ornament path, .ornament circle { fill: none; stroke: var(--rose); stroke-width: 1.2; stroke-linecap: round; }
.ornament circle { fill: var(--rose); stroke: none; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; margin-bottom: 18px; }
.pager-link { display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; transition: border-color .25s, transform .25s; }
.pager-link:hover { border-color: var(--rose); transform: translateY(-2px); }
.pager-link.next { text-align: right; }
.pager-link.is-end { opacity: .7; }
.pager-link.is-end:hover { transform: none; border-color: var(--line); }
.pager-dir { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--rose); }
.pager-title { font: italic 500 23px/1.2 var(--display); color: var(--ink); }
.back-all { text-align: center; margin: 26px 0 80px; font-size: 16px; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .entry-body { font-size: 18.5px; } }

/* ---------- simple pages ---------- */
.page { padding: 70px 0 90px; }
.page h1 { font-style: italic; font-size: clamp(42px, 6vw, 60px); }
.notfound { text-align: center; }
.notfound .ornament { margin-top: 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); text-align: center; padding: 46px 0 40px; }
.site-footer .ornament { margin: 0 auto 14px; }
.footer-name { font: italic 500 28px/1.2 var(--display); color: var(--ink); margin-bottom: 4px; }
.footer-line { color: var(--muted); font-style: italic; font-size: 16px; }
.footer-small { font-size: 13.5px; color: var(--muted); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .thread path { stroke-dashoffset: 0; }
}
@media (max-width: 640px) {
  .moon { top: 84px; right: 8%; width: 54px; height: 54px; box-shadow: inset -11px 6px 0 0 #fbe9d6; }
  .sky-inner { padding: 150px 0 110px; }
  .sky .kicker { font-size: 12px; letter-spacing: .16em; }
}
