/* =====================================================================
   The Cornerstones hub (/cornerstones). A dark hero with the eleven
   articles as the stones of an arch (the Resurrection is the keystone),
   then a reading path in three parts. Cards are generated into the page
   by scripts/build-cornerstones-page.mjs; cornerstones-hub.js adds the
   reader's progress and the scroll reveals.
   ===================================================================== */
.csx { --ink: #2f2a24; --muted: #5f5547; --gold: #b8914b; --gold-d: #8a6c2b; --gold-l: #e2c47e; --line: #dccb9e; --card: #fbf7ee;
  max-width: 1120px; margin: 0 auto; padding: 5.5rem 16px 40px; color: var(--ink); }
/* style.css colours every heading with var(--theme-heading) !important */
.csx-hero { --theme-heading: #fbf3df; }

/* ---- hero ---- */
.csx-hero { position: relative; overflow: hidden; margin: 18px 0 0; border-radius: 22px; color: #f1e8d4;
  background:
    radial-gradient(120% 90% at 78% 18%, rgba(226, 196, 126, .16), transparent 60%),
    radial-gradient(80% 70% at 10% 100%, rgba(140, 100, 40, .25), transparent 60%),
    linear-gradient(160deg, #1d1813 0%, #120f0c 55%, #0d0b09 100%);
  box-shadow: 0 30px 60px -30px rgba(30, 20, 8, .55); }
.csx-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: url("/assets/parchment-bg.webp"); background-size: 600px; mix-blend-mode: screen; }
.csx-hgrid { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 12px 30px; align-items: center; padding: 54px 48px 46px; }
.csx-eyebrow { margin: 0 0 14px; font: 600 12px/1 system-ui, sans-serif; letter-spacing: .28em; color: var(--gold-l); }
.csx .csx-title { margin: 0; font-family: 'Cinzel', serif; font-weight: 600; font-size: clamp(30px, 4.2vw, 50px); line-height: 1.08; letter-spacing: .01em; color: #fbf3df;
  text-wrap: balance; }
.csx-title em { font-style: normal; color: var(--gold-l); }
.csx-sub { margin: 18px 0 0; max-width: 34rem; font-size: 18px; line-height: 1.6; color: rgba(241, 232, 212, .82); }
.csx-stats { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 24px 0 0; padding: 0; list-style: none; }
.csx-stats li { display: grid; gap: 2px; }
.csx-stats b { font-family: 'Cinzel', serif; font-size: 24px; font-weight: 600; color: #fbf3df; line-height: 1; }
.csx-stats span { font: 12px/1.3 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: rgba(241, 232, 212, .6); }
.csx-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 28px 0 0; }
.csx-btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 999px; font: 700 15px 'Cinzel', serif; letter-spacing: .03em; text-decoration: none;
  color: #1a140c; background: linear-gradient(180deg, #f0d48c, #c79a45 55%, #a87c32); box-shadow: 0 10px 24px -10px rgba(226, 196, 126, .7), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform .15s ease, box-shadow .15s ease; }
.csx-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(226, 196, 126, .85), inset 0 1px 0 rgba(255, 255, 255, .5); }
.csx-btn:focus-visible, .csx-ghost:focus-visible, .csx-link:focus-visible, .csx-st:focus-visible { outline: 2px solid var(--gold-l); outline-offset: 3px; }
.csx-ghost { color: rgba(241, 232, 212, .85); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(226, 196, 126, .5); }
.csx-ghost:hover { color: #fff; }
.csx-progress { margin: 18px 0 0; font: 13px/1.4 system-ui, sans-serif; color: rgba(241, 232, 212, .7); }
.csx-progress[hidden] { display: none; }
.csx-bar { display: block; width: 220px; max-width: 100%; height: 4px; margin-top: 7px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.csx-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c79a45, #f0d48c); transition: width .6s ease; }

/* the arch */
.csx-archwrap { position: relative; }
.csx-arch { display: block; width: 100%; height: auto; overflow: visible; }
.csx-stone { stroke: rgba(0, 0, 0, .55); stroke-width: 1.2; transition: filter .2s ease, transform .2s ease; }
.csx-g0 { fill: #b08a45; } .csx-g1 { fill: #d9bf82; } .csx-g2 { fill: #7d6a52; }
.csx-stone.is-key { fill: #f0d48c; }
.csx-st { cursor: pointer; }
.csx-st .csx-stone { filter: brightness(.82) saturate(.9); }
.csx-st:hover .csx-stone, .csx-st:focus-visible .csx-stone, .csx-st.is-hot .csx-stone { filter: brightness(1.15) drop-shadow(0 0 10px rgba(240, 212, 140, .6)); }
.csx-st.is-read .csx-stone { filter: brightness(1.08) drop-shadow(0 0 6px rgba(240, 212, 140, .45)); }
.csx-sn { font: 700 17px 'Cinzel', serif; fill: #1a140c; text-anchor: middle; pointer-events: none; }
.csx-pillar { fill: #3a3128; stroke: rgba(0, 0, 0, .5); }
.csx-ground { stroke: rgba(226, 196, 126, .35); stroke-width: 1.5; }
.csx-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 6px 0 0; padding: 0; list-style: none; font: 12px system-ui, sans-serif; color: rgba(241, 232, 212, .7); }
.csx-legend li { display: inline-flex; align-items: center; gap: 6px; }
.csx-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.csx-legend a { color: inherit; text-decoration: none; }
.csx-legend a:hover { color: #fff; }
.csx-archtip { margin: 4px auto 2px; max-width: 92%; text-align: center; font: 600 14px/1.3 'Cinzel', serif; color: #fbf3df; min-height: 1.3em; }

/* verse strip */
.csx-verse { margin: 34px auto 0; max-width: 46rem; text-align: center; }
.csx-verse blockquote { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: clamp(21px, 2.4vw, 26px); line-height: 1.45; color: #3b3227; }
.csx-verse cite { display: block; margin-top: 8px; font: 600 12px system-ui, sans-serif; letter-spacing: .2em; text-transform: uppercase; font-style: normal; color: var(--gold-d); }
.csx-orn { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 0 0 14px; color: var(--gold); }
.csx-orn::before, .csx-orn::after { content: ""; height: 1px; width: 70px; background: linear-gradient(90deg, transparent, var(--gold)); }
.csx-orn::after { transform: scaleX(-1); }

/* ---- movements ---- */
.csx-move { margin: 64px 0 0; scroll-margin-top: 80px; }
.csx-mhead { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center; margin: 0 0 26px; }
.csx-roman { font: 600 64px/1 'Cinzel', serif; color: transparent; -webkit-text-stroke: 1.5px var(--gold); min-width: 1.4em; text-align: center; }
.csx-mkick { margin: 0; font: 600 12px system-ui, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-d); }
.csx .csx-mhead h2 { margin: 4px 0 4px; font-family: 'Cinzel', serif; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; color: var(--ink); }
.csx-mhead p:last-child { margin: 0; max-width: 40rem; font-size: 17px; line-height: 1.55; color: var(--muted); }

.csx-path { position: relative; list-style: none; margin: 0; padding: 0 0 0 64px; }
.csx-path::before { content: ""; position: absolute; left: 21px; top: 18px; bottom: 18px; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), rgba(184, 145, 75, .25)); }
.csx-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 26px; align-items: center;
  margin: 0 0 22px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, #fffdf8, var(--card));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 18px 36px -28px rgba(60, 40, 10, .45); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.csx-row:nth-child(even) { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.csx-row:nth-child(even) .csx-art { order: 2; }
.csx-row:hover, .csx-row.is-hot { border-color: #c4a35e; transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 24px 40px -26px rgba(60, 40, 10, .55); }
.csx-node { position: absolute; left: -64px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font: 700 17px 'Cinzel', serif; color: #fbf3df; background: radial-gradient(circle at 35% 30%, #d9b264, #8a6c2b); box-shadow: 0 0 0 5px #f6f1e6, 0 6px 14px -6px rgba(60, 40, 10, .6); }
.csx-row.is-read .csx-node { background: radial-gradient(circle at 35% 30%, #f0d48c, #b8914b); color: #1a140c; }
.csx-art { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #1a1612; }
.csx-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.csx-row:hover .csx-art img { transform: scale(1.04); }
.csx-copy { min-width: 0; }
.csx-num { margin: 0 0 6px; font: 600 12px system-ui, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-d); }
.csx-done { color: #3f7a4a; letter-spacing: .1em; }
.csx .csx-copy h3 { margin: 0 0 8px; font-family: 'Cinzel', serif; font-weight: 700; font-size: clamp(19px, 2vw, 23px); line-height: 1.25; color: var(--ink); }
.csx-link { color: inherit; text-decoration: none; }
.csx-link::after { content: ""; position: absolute; inset: 0; border-radius: 18px; z-index: 1; }
.csx-copy > p:not([class]) { margin: 0; font-size: 17px; line-height: 1.55; color: #4a4335; }
.csx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 0; font: 13px system-ui, sans-serif; color: var(--muted); }
.csx-meta > span:first-child::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--gold); vertical-align: 2px; }
.csx-guide { position: relative; z-index: 2; color: #6b4f1e; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(107, 79, 30, .35); }
.csx-guide:hover { text-decoration-color: currentColor; }
.csx-row.is-soon { opacity: .75; }
.csx .cs-soon { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }

/* ---- close ---- */
.csx-close { margin: 70px 0 0; padding: 36px 32px; border-radius: 20px; text-align: center; border: 1px solid var(--line);
  background: radial-gradient(90% 120% at 50% 0%, rgba(226, 196, 126, .22), transparent 60%), #fbf6ea; }
.csx .csx-close h2 { margin: 0 0 10px; font-family: 'Cinzel', serif; font-size: 26px; color: var(--ink); }
.csx-close p { max-width: 40rem; margin: 0 auto 10px; font-size: 17px; line-height: 1.6; color: #4a4335; }
.csx-close a:not(.csx-btn) { color: #6b4f1e; font-weight: 600; }
.csx-close .csx-btn { margin-top: 12px; }

/* ---- reveal on scroll (only when the script runs and motion is welcome) ---- */
@media (prefers-reduced-motion: no-preference) {
  .csx-js .csx-reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
  .csx-js .csx-reveal.is-in { opacity: 1; transform: none; }
  .csx-js .csx-st { animation: csx-rise .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms + 150ms); }
}
@keyframes csx-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- smaller screens ---- */
@media (max-width: 900px) {
  .csx-hgrid { grid-template-columns: 1fr; padding: 40px 26px 30px; }
  .csx-archwrap { max-width: 460px; margin: 6px auto 0; width: 100%; }
  .csx-row, .csx-row:nth-child(even) { grid-template-columns: 1fr; gap: 14px; }
  .csx-row:nth-child(even) .csx-art { order: 0; }
}
@media (max-width: 560px) {
  .csx { padding: 4.75rem 12px 30px; }
  .csx-hero { border-radius: 16px; margin-top: 10px; }
  .csx-hgrid { padding: 30px 18px 22px; }
  .csx-sub { font-size: 16.5px; }
  .csx-stats b { font-size: 20px; }
  .csx-roman { font-size: 44px; }
  .csx-mhead { gap: 4px 14px; }
  .csx-path { padding-left: 0; }
  .csx-path::before { display: none; }
  .csx-node { left: 12px; top: 12px; transform: none; width: 36px; height: 36px; font-size: 15px; z-index: 2; box-shadow: 0 0 0 3px rgba(251, 246, 234, .9); }
  .csx-row { padding: 12px; border-radius: 16px; }
  .csx-close { padding: 28px 18px; }
}
