/* Leverage Library: P1 "Journal" on green. Mobile first. */
:root {
  --forest: #1E3A33;
  --deep: #0F1E1C;
  --ink: #EEE9E0;
  --dim: rgba(238, 233, 224, .64);
  --faint: rgba(238, 233, 224, .15);
  --copper: #C98256;
  --copper-soft: #E7C9B4;
  --f-display: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --f-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--forest); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.page { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 6px; font-size: 12px; color: var(--dim); }
.topbar a, .topbar b { color: var(--ink); font-weight: 600; letter-spacing: .04em; text-decoration: none; }

/* ---------- homepage: six doors ---------- */
.home-hero { padding: 14px 20px 18px; display: grid; gap: 10px; }
.home-word { font-family: var(--f-display); font-weight: 700; font-size: 58px; line-height: .95; margin: 0; }
.home-line { font-family: var(--f-display); font-size: 18px; line-height: 1.35; margin: 0; color: var(--dim); }
.rows { padding: 0 20px 32px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 15px 0; border-top: 1px solid var(--faint); align-items: center; text-decoration: none; }
.row h2, .row h3 { margin: 0; font-family: var(--f-display); font-size: 22px; font-weight: 700; line-height: 1.2; }
.row p { margin: 0; font-size: 12.5px; color: var(--dim); }
.row .arrow { grid-row: 1 / span 2; grid-column: 2; color: var(--copper-soft); font-size: 18px; }
.row.soon { opacity: .45; }
.row.soon .arrow { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- section list ---------- */
.sec-hero { padding: 14px 20px 18px; display: grid; gap: 8px; }
.sec-word { font-family: var(--f-display); font-weight: 700; font-size: 40px; line-height: 1; margin: 0; }
.rows.entries .row h3 { font-size: 19px; }

/* ---------- entry: Journal ---------- */
.e-wrap { flex: 1; padding: 14px 22px 28px; }
.e-in { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.e-in > * { min-width: 0; }
.t { font-family: var(--f-display); font-weight: 700; font-size: 30px; line-height: 1.08; margin: 0; text-wrap: balance; }
.sep { height: 1px; background: rgba(238, 233, 224, .35); margin: -4px 0 0; }
.subh { font-family: var(--f-display); font-size: 18px; line-height: 1.45; margin: 0; }
.capp { display: grid; gap: 10px; font-size: 15px; line-height: 1.6; }
.capp p { margin: 0; }
.capp ul, .capp ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.qn { border: 1px solid var(--faint); border-radius: 10px; padding: 14px 16px; display: grid; gap: 10px; }
.qn h4 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--copper-soft); }
.qn ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.qn li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; font-size: 14.5px; line-height: 1.45; }
.qn li::before { content: ""; height: 1.5px; background: var(--copper); margin-top: 10px; }
.qn li.lead { display: block; font-weight: 600; }
.qn li.lead::before { display: none; }
.qn ol { margin: 0; padding-left: 22px; display: grid; gap: 5px; font-size: 14.5px; line-height: 1.45; }
.qn ol li { display: list-item; }
.qn ol li::before { display: none; }
.qn ol li::marker { color: var(--copper-soft); font-weight: 600; }
.src { font-size: 12px; color: var(--dim); }
.src a { color: var(--copper-soft); }

/* media slot: photo / carousel / video (4:5) */
.media { position: relative; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--deep); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.car-track::-webkit-scrollbar { display: none; }
.car-track > img, .car-track > video { flex: none; width: 100%; scroll-snap-align: start; }
.car-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(15, 30, 28, .7); color: var(--ink); font-size: 20px; line-height: 1; padding: 0 0 2px; cursor: pointer; display: none; }
.car-nav.prev { left: 10px; }
.car-nav.next { right: 10px; }
@media (hover: hover) and (pointer: fine) { .car-nav:not([hidden]) { display: block; } }
.car-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.car-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(238, 233, 224, .45); }
.car-dots i.on { background: var(--ink); }
.badge { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: rgba(15, 30, 28, .7); color: var(--ink); }
.media.empty { display: grid; place-items: center; border: 1.5px dashed rgba(238, 233, 224, .3); background: rgba(15, 30, 28, .35); text-align: center; padding: 20px; }
.media.empty span { font-size: 12.5px; color: var(--dim); line-height: 1.5; }
.media.empty b { display: block; font-family: var(--f-display); font-size: 16px; color: var(--ink); margin-bottom: 2px; }

/* sticky next bar */
.nextbar { position: sticky; bottom: 0; background: var(--forest); border-top: 1px solid var(--faint); padding: 12px 22px calc(16px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; }
.nextbar small { display: block; font-size: 11.5px; color: var(--dim); }
.nextbar b { font-family: var(--f-display); font-size: 15px; font-weight: 700; line-height: 1.2; }
.nextbtn { flex: none; background: var(--ink); color: var(--deep); border-radius: 99px; padding: 9px 15px; font-weight: 600; font-size: 13px; }

.foot { padding: 20px; font-size: 12px; color: var(--dim); border-top: 1px solid var(--faint); }
.foot a { color: var(--copper-soft); }

/* ---------- homepage: email signup + about ---------- */
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tb-link { font-weight: 500 !important; color: var(--dim) !important; letter-spacing: 0 !important; }
.signup { margin: 0 20px 26px; padding: 16px; border: 1px solid var(--faint); border-radius: 10px; background: rgba(15, 30, 28, .35); display: grid; gap: 8px; }
.signup h2 { margin: 0; font-family: var(--f-display); font-size: 20px; font-weight: 700; line-height: 1.2; }
.signup > p { margin: 0; font-size: 13px; color: var(--dim); }
.su-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 4px; }
.su-row input { min-width: 0; font: inherit; font-size: 16px; color: var(--ink); background: var(--deep); border: 1px solid var(--faint); border-radius: 99px; padding: 10px 14px; }
.su-row input::placeholder { color: rgba(238, 233, 224, .4); }
.su-row input:focus { outline: none; border-color: var(--copper-soft); }
.su-row button { font: inherit; font-size: 14px; font-weight: 600; border: 0; border-radius: 99px; padding: 10px 18px; background: var(--ink); color: var(--deep); cursor: pointer; }
.su-row button:disabled { opacity: .6; }
.su-msg { margin: 0; font-size: 12.5px; color: var(--copper-soft); min-height: 0; }
.su-msg:empty { display: none; }
.signup.done .su-row { display: none; }
.about { padding: 24px 20px 26px; border-top: 1px solid var(--faint); display: grid; gap: 10px; }
.about-ph { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; background: var(--deep); margin-bottom: 6px; }
.about h2 { margin: 0; font-family: var(--f-display); font-size: 26px; font-weight: 700; }
.about p { margin: 0; font-size: 15px; line-height: 1.6; }
.about-links a { color: var(--copper-soft); font-size: 13px; }
.rows[aria-label="Sections"] { padding-bottom: 8px; }

/* ---------- homepage: photo line, newest strip, counts ---------- */
.by { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--dim); margin-top: 4px; }
.by img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--faint); flex: none; }
.by b { color: var(--ink); font-weight: 600; }
.latest { margin: 0 0 22px; display: grid; gap: 10px; }
.latest .lbl { margin: 0; padding: 0 20px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--copper-soft); }
.strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0 20px; scroll-padding: 0 20px; }
.strip::-webkit-scrollbar { display: none; }
.card { flex: none; width: 156px; scroll-snap-align: start; border: 1px solid var(--faint); border-radius: 8px; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; }
.card .ph { aspect-ratio: 4 / 5; background: var(--deep); }
.card .ph img, .card .ph video { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .ph.empty { background: linear-gradient(160deg, #2C4A40, var(--deep)); padding: 12px; display: flex; align-items: flex-end; }
.card .ph.empty p { margin: 0; font-family: var(--f-display); font-size: 13px; line-height: 1.35; color: var(--dim); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.card b { display: block; padding: 9px 10px 2px; font-family: var(--f-display); font-size: 14.5px; line-height: 1.25; }
.card small { display: block; padding: 0 10px 10px; font-size: 11px; color: var(--dim); }
.row .arrow small { display: block; font-size: 10.5px; color: var(--dim); text-align: right; margin-top: 1px; }
.row .arrow { text-align: right; }
.new { display: inline-block; font-family: var(--f-body); font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--copper); color: var(--deep); border-radius: 4px; padding: 1px 5px; margin-left: 8px; vertical-align: 4px; }

/* ---------- homepage structure: mobile = one column, desktop = Layout A split ---------- */
.home, .h-left, .h-right { display: contents; }
.h-left .topbar { order: 1; }
.home-hero { order: 2; }
.latest { order: 3; }
.signup[data-source="library-home"] { order: 4; }
.home .rows { order: 5; }
.home .about { order: 6; }
.signup[data-source="library-footer"] { order: 7; }
.home .foot { order: 8; }
.ents { display: none; }
.sec.soon .row.soon { opacity: 1; }
.sec.soon { opacity: .45; }

@media (min-width: 960px) {
  .page:has(> .home) { max-width: 1240px; }
  .home { display: grid; grid-template-columns: 400px minmax(0, 1fr); align-items: start; }
  .h-left { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; padding: 28px 36px 26px; border-right: 1px solid var(--faint); }
  .h-left .topbar, .h-left .home-hero { padding: 0; }
  .h-left .home-hero { gap: 14px; }
  .h-left .home-word { font-size: 72px; }
  .h-left .home-line { font-size: 19px; }
  .h-left .signup { margin: 0; }
  .h-left .foot { margin-top: auto; padding: 0; border: 0; }
  .h-right { display: block; padding: 30px 44px 56px; min-width: 0; }
  .h-right .latest { margin: 0 0 34px; gap: 12px; }
  .h-right .latest .lbl { padding: 0; }
  .h-right .strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0; overflow: visible; }
  .h-right .card { width: auto; }
  .h-right .card b { font-size: 16px; }
  .home .rows { padding: 0; }
  .sec { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 20px 0; border-top: 1px solid var(--faint); }
  .sec .row { display: block; padding: 0; border: 0; }
  .sec .row h2 { font-size: 23px; }
  .sec .row p { margin-top: 3px; }
  .sec .row .arrow { display: none; }
  .ents { display: grid; gap: 10px; align-content: start; }
  .ent { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; text-decoration: none; }
  .ent b { font-family: var(--f-display); font-size: 17px; line-height: 1.25; }
  .ent > span:last-child { color: var(--copper-soft); }
  .ent:hover b, .sec .row:hover h2 { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
  .th { width: 44px; height: 55px; border-radius: 4px; overflow: hidden; background: var(--deep); display: block; }
  .th img, .th video { width: 100%; height: 100%; object-fit: cover; display: block; }
  .th.empty { background: linear-gradient(160deg, #2C4A40, var(--deep)); border: 1px solid var(--faint); }
  .ents-soon { font-size: 13px; color: var(--dim); }
  .home .about { padding: 28px 0 0; }
  .about-ph { max-width: 300px; }
  .signup[data-source="library-footer"] { display: none; }
}
