/* Petrichor — Lore chronicle: four expandable chapters on pages/lore.html */

.lc { margin: 0 0 84px; }

.lc-header { text-align: center; margin-bottom: 44px; }
.lc-header .section-title { margin-top: 6px; }
.lc-intro {
  font-family: 'EB Garamond', serif; font-style: italic;
  font-size: clamp(16px, 1.5vw, 19px); line-height: 1.7;
  color: var(--muted); max-width: 620px; margin: 16px auto 0;
}
.lc-hint {
  margin: 18px 0 0; font: 600 10px/1 'Open Sans', sans-serif;
  letter-spacing: 0.24em; text-transform: uppercase; color: rgba(240,190,200,0.42);
}

/* ── Timeline rail ── */
.lc-list {
  position: relative; list-style: none; margin: 0 auto; padding: 0 0 0 54px;
  max-width: 940px; display: flex; flex-direction: column; gap: 16px;
}
.lc-list::before, .lc-rail-fill {
  content: ''; position: absolute; left: 18px; top: 44px; bottom: 44px; width: 1px;
}
.lc-list::before { background: linear-gradient(to bottom, transparent, rgba(200,16,46,0.26) 8%, rgba(200,16,46,0.26) 92%, transparent); }
.lc-rail-fill {
  bottom: auto; height: 0; width: 1px;
  background: linear-gradient(to bottom, rgba(255,112,128,0), #ff7080 30%, var(--red));
  box-shadow: 0 0 12px 1px rgba(200,16,46,0.75);
  transition: height .8s cubic-bezier(0.22,1,0.36,1);
  pointer-events: none;
}

.lc-chapter { position: relative; scroll-margin-top: 104px; }

/* diamond node on the rail */
.lc-node {
  position: absolute; left: -42px; top: 37px; width: 13px; height: 13px;
  transform: rotate(45deg); background: #12060a;
  border: 1px solid rgba(200,16,46,0.45);
  transition: background .4s, box-shadow .4s, transform .5s cubic-bezier(0.22,1,0.36,1);
}
.lc-chapter.is-open .lc-node,
.lc-chapter.is-read .lc-node { background: var(--red); box-shadow: 0 0 14px 3px rgba(200,16,46,0.65); }
.lc-chapter.is-open .lc-node { transform: rotate(225deg) scale(1.2); }

/* ── Card ── */
.lc-card {
  position: relative; overflow: hidden;
  background: rgba(12,4,6,0.93);
  border: 1px solid rgba(200,16,46,0.18); border-radius: 20px;
  transition: border-color .35s, box-shadow .45s, transform .35s cubic-bezier(0.22,1,0.36,1);
}
.lc-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 260px; pointer-events: none;
  background: radial-gradient(ellipse 70% 100% at 18% 0%, rgba(200,16,46,0.16), transparent 70%);
  opacity: 0; transition: opacity .6s;
}
.lc-chapter:not(.is-open) .lc-card:hover {
  border-color: rgba(200,16,46,0.50); transform: translateX(6px);
  box-shadow: 0 18px 50px rgba(200,16,46,0.11);
}
.lc-chapter.is-open .lc-card {
  border-color: rgba(200,16,46,0.46);
  box-shadow: 0 30px 90px rgba(0,0,0,0.55), 0 0 60px rgba(200,16,46,0.09);
}
.lc-chapter.is-open .lc-card::before { opacity: 1; }

/* ── Toggle (chapter heading) ── */
.lc-heading { margin: 0; font: inherit; }
.lc-toggle {
  position: relative; z-index: 1; width: 100%;
  display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 22px;
  padding: 22px 26px; background: none; border: 0; color: inherit;
  text-align: left; cursor: pointer; font: inherit;
}
.lc-num {
  font-family: 'Cinzel', serif; font-weight: 900; font-size: 58px; line-height: 1;
  text-align: center; color: transparent;
  -webkit-text-stroke: 1px rgba(200,16,46,0.50);
  transition: color .5s, -webkit-text-stroke-color .5s, text-shadow .5s;
}
.lc-toggle:hover .lc-num { -webkit-text-stroke-color: rgba(255,112,128,0.85); }
.lc-chapter.is-open .lc-num {
  color: var(--red); -webkit-text-stroke-color: var(--red);
  text-shadow: 0 0 28px rgba(200,16,46,0.60);
}
.lc-head { min-width: 0; display: block; }
.lc-years {
  display: block; font: 700 10px/1 'Open Sans', sans-serif;
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--red); margin-bottom: 9px;
}
.lc-title {
  display: block; font-family: 'Cinzel', serif; font-weight: 700;
  font-size: clamp(19px, 2.1vw, 27px); line-height: 1.18; letter-spacing: 0.01em; color: #fff;
}
.lc-sub {
  display: block; margin-top: 6px; font-family: 'EB Garamond', serif; font-style: italic;
  font-size: clamp(15px, 1.4vw, 18px); line-height: 1.4; color: var(--muted);
}
.lc-icon {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(200,16,46,0.26); background: rgba(200,16,46,0.06);
  transition: background .25s, border-color .25s, transform .55s cubic-bezier(0.22,1,0.36,1);
}
.lc-icon::before, .lc-icon::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px;
  margin: -0.75px 0 0 -7px; background: var(--red); border-radius: 1px;
  transition: transform .55s cubic-bezier(0.22,1,0.36,1), background .25s;
}
.lc-icon::after { transform: rotate(90deg); }
.lc-toggle:hover .lc-icon { background: rgba(200,16,46,0.18); border-color: rgba(200,16,46,0.55); }
.lc-chapter.is-open .lc-icon { transform: rotate(180deg); background: rgba(200,16,46,0.16); }
.lc-chapter.is-open .lc-icon::after { transform: rotate(0deg); }
.lc-chapter.is-open .lc-icon::before,
.lc-chapter.is-open .lc-icon::after { background: #ff7080; }

/* ── Expanding panel ── */
.lc-panel {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows .75s cubic-bezier(0.22,1,0.36,1), visibility 0s linear .75s;
}
.lc-chapter.is-open .lc-panel { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.lc-panel-inner { overflow: hidden; min-height: 0; }
.lc-body { position: relative; padding: 0 44px 40px; }
.lc-body::before {
  content: ''; display: block; height: 1px; margin-bottom: 30px;
  background: linear-gradient(to right, var(--red), rgba(200,16,46,0.20) 45%, transparent);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 1s cubic-bezier(0.22,1,0.36,1) .12s;
}
.lc-chapter.is-open .lc-body::before { transform: scaleX(1); }

/* ── At a glance ── */
.lc-brief {
  background: rgba(200,16,46,0.045); border: 1px solid rgba(200,16,46,0.14);
  border-radius: 14px; padding: 20px 22px 22px; margin: 0 0 34px;
}
.lc-label {
  margin: 0 0 14px; font-family: 'Cinzel', serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--red);
}
.lc-brief ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.lc-brief li {
  position: relative; padding-left: 20px;
  font-family: 'EB Garamond', serif; font-size: 17px; line-height: 1.55; color: var(--text);
}
.lc-brief li::before {
  content: ''; position: absolute; left: 0; top: 0.58em; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 6px rgba(200,16,46,0.6);
}
.lc-prose p.lc-meta {
  margin: 0 0 18px; font: 600 10px/1 'Open Sans', sans-serif;
  letter-spacing: 0.22em; text-transform: uppercase; color: rgba(240,190,200,0.40);
}

/* ── Prose ── */
.lc-prose { max-width: 720px; margin: 0 auto; }
.lc-prose p {
  margin: 0 0 20px; font-family: 'EB Garamond', serif;
  font-size: clamp(17px, 1.35vw, 19.5px); line-height: 1.85; color: var(--muted);
}
.lc-prose > .lc-meta + p::first-letter {
  float: left; font-family: 'Cinzel', serif; font-weight: 900;
  font-size: 3.5em; line-height: 0.84; padding: 0.07em 0.12em 0 0;
  color: var(--red); text-shadow: 0 0 22px rgba(200,16,46,0.50);
}
.lc-prose strong {
  font-weight: 600; color: #fff;
  border-bottom: 1px solid rgba(200,16,46,0.55); padding-bottom: 1px;
}
.lc-prose p.lc-beat {
  position: relative; margin: 34px auto; padding: 0 12px; max-width: 30ch;
  text-align: center; text-wrap: balance;
  font-family: 'Cinzel', serif; font-weight: 600;
  font-size: clamp(17px, 1.7vw, 22px); line-height: 1.45; letter-spacing: 0.02em; color: #fff;
}
.lc-prose p.lc-beat::before, .lc-prose p.lc-beat::after {
  content: '◆'; display: block; font-size: 7px; line-height: 1; color: rgba(200,16,46,0.60);
}
.lc-prose p.lc-beat::before { margin-bottom: 14px; }
.lc-prose p.lc-beat::after  { margin-top: 14px; }
.lc-prose p.lc-beat.lc-beat-final {
  color: transparent; font-size: clamp(20px, 2.2vw, 28px);
  background: linear-gradient(110deg, var(--red) 0%, #ff7080 100%);
  -webkit-background-clip: text; background-clip: text;
}

/* scroll-reveal inside an open chapter (only when JS is running) */
.lc-js .lc-reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .75s ease, transform .75s cubic-bezier(0.22,1,0.36,1);
}
.lc-js .lc-reveal.is-in { opacity: 1; transform: none; }

/* ── Chapter footer ── */
.lc-foot {
  max-width: 720px; margin: 36px auto 0; padding-top: 24px;
  border-top: 1px solid rgba(200,16,46,0.12);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.lc-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 20px;
  background: rgba(200,16,46,0.07); border: 1px solid rgba(200,16,46,0.24); border-radius: 10px;
  color: var(--red); font: 700 10.5px/1.3 'Open Sans', sans-serif;
  letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.lc-btn:hover { background: rgba(200,16,46,0.18); border-color: rgba(200,16,46,0.52); color: #ff7080; transform: translateY(-2px); }
.lc-btn-ghost { background: none; border-color: transparent; color: rgba(240,190,200,0.50); padding: 0 8px; }
.lc-btn-ghost:hover { background: none; border-color: transparent; color: var(--text); }
.lc-btn-next { margin-left: auto; text-align: right; }
.lc-btn-next span { transition: transform .25s; }
.lc-btn-next:hover span { transform: translateX(4px); }

/* entrance of the cards on page load */
@keyframes lcRise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.lc-js .lc-chapter { animation: lcRise .8s cubic-bezier(0.22,1,0.36,1) both; }
.lc-js .lc-chapter:nth-child(2) { animation-delay: .08s; }
.lc-js .lc-chapter:nth-child(3) { animation-delay: .16s; }
.lc-js .lc-chapter:nth-child(4) { animation-delay: .24s; }
.lc-js .lc-chapter:nth-child(5) { animation-delay: .32s; }

/* No JS: everything is simply readable */
html:not(.lc-js) .lc-panel { grid-template-rows: 1fr; visibility: visible; }
html:not(.lc-js) .lc-icon, html:not(.lc-js) .lc-foot, html:not(.lc-js) .lc-hint { display: none; }

@media (max-width: 900px) {
  .lc { margin-bottom: 56px; }
  .lc-chapter { scroll-margin-top: 76px; }
  .lc-list { padding-left: 30px; gap: 14px; }
  .lc-list::before, .lc-rail-fill { left: 8px; }
  .lc-node { left: -27px; top: 34px; width: 11px; height: 11px; }
  .lc-card { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(12,4,6,0.95); }
  .lc-chapter:not(.is-open) .lc-card:hover { transform: none; }
  .lc-toggle { grid-template-columns: 58px 1fr 40px; gap: 14px; padding: 18px 16px; }
  .lc-num { font-size: 38px; }
  .lc-icon { width: 40px; height: 40px; }
  .lc-body { padding: 0 20px 28px; }
  .lc-brief { padding: 16px 16px 18px; }
}
@media (max-width: 520px) {
  .lc-list { padding-left: 0; }
  .lc-list::before, .lc-rail-fill, .lc-node { display: none; }
  .lc-toggle { grid-template-columns: 1fr 40px; }
  .lc-num { display: none; }
  .lc-years { letter-spacing: 0.18em; }
  .lc-body { padding: 0 16px 24px; }
  .lc-foot { flex-direction: column-reverse; align-items: stretch; }
  .lc-btn { justify-content: center; }
  .lc-btn-next { margin-left: 0; }
}
