/* The Inner Curriculum. Two looks on purpose:
   - the lesson text (.story) keeps the reading format exactly: cream page, Literata, DM Serif Display, red drop cap;
   - everything around it is the night sky: indigo, gold, Cinzel and Cormorant Garamond. */

:root {
  --night: #0d0a18; --panel: #15112a; --panel-2: rgba(28, 22, 52, .6);
  --gold: #d4b56a; --gold-hi: #f0d99a; --ink: #ece6f6; --bright: #f5efe0; --muted: #b3a9c9;
  --line: rgba(212, 181, 106, .28); --line-strong: rgba(212, 181, 106, .55);
  --display: 'Cormorant Garamond', Georgia, serif; --caps: Cinzel, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 19px/1.55 var(--display);
  background-color: var(--night);
  background-image:
    radial-gradient(1px 1px at 12% 8%, #e9dcb5 50%, transparent 51%), radial-gradient(1px 1px at 78% 4%, #cfc4e8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 42% 14%, #f0d99a 50%, transparent 51%), radial-gradient(1px 1px at 88% 22%, #e9dcb5 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 30%, #cfc4e8 50%, transparent 51%), radial-gradient(1px 1px at 63% 27%, #e9dcb5 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 24% 46%, #cfc4e8 50%, transparent 51%), radial-gradient(1px 1px at 95% 52%, #f0d99a 50%, transparent 51%),
    radial-gradient(1px 1px at 50% 66%, #e9dcb5 50%, transparent 51%), radial-gradient(1px 1px at 3% 78%, #f0d99a 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 88%, #cfc4e8 50%, transparent 51%), radial-gradient(1.5px 1.5px at 30% 96%, #e9dcb5 50%, transparent 51%);
  background-attachment: fixed;
}
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.caps { font: 500 12px var(--caps); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.muted { color: var(--muted); }
.italic { font-style: italic; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header and footer */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--gold); text-decoration: none; font: 500 19px/1 var(--caps); letter-spacing: .12em; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 26px; }
.nav a { color: var(--ink); text-decoration: none; font: 500 12px var(--caps); letter-spacing: .16em; }
.nav a:hover { color: var(--gold-hi); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid rgba(212, 181, 106, .5); border-radius: 999px; color: var(--gold); font: 500 12px var(--caps); letter-spacing: .14em; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.on .dot { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.site-foot { border-top: 1px solid var(--line); margin-top: 40px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 28px; padding-bottom: 28px; }

/* buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border-radius: 2px; border: 1px solid rgba(212, 181, 106, .6);
  background: transparent; color: var(--gold); font: 500 13px var(--caps); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--gold-hi); border-color: var(--gold-hi); }
.btn.solid { background: var(--gold); color: var(--night); border-color: var(--gold); font-weight: 600; }
.btn.solid:hover { background: var(--gold-hi); color: var(--night); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 11px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.linkish { background: none; border: 0; min-height: 44px; padding: 0 8px; color: var(--muted); font: italic 17px var(--display); text-decoration: underline; cursor: pointer; }
label.field { display: block; margin: 0 0 18px; }
label.field > span { display: block; margin-bottom: 8px; }
input[type=text], textarea, select {
  width: 100%; padding: 12px 14px; border: 1px solid rgba(212, 181, 106, .4); border-radius: 2px; background: var(--night);
  color: var(--ink); font: 19px/1.5 var(--display); }
textarea { resize: vertical; }
textarea.mono { font: 15px/1.6 ui-monospace, 'SFMono-Regular', Menlo, monospace; }
select { min-height: 48px; }
::placeholder { color: #8f86a8; font-style: italic; }
.row { display: flex; flex-wrap: wrap; gap: 18px; }
.row > * { flex: 1 1 200px; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 8px; }
.error { color: #ffb4a6; min-height: 1.2em; margin: 8px 0 0; }
.hint { font-size: 17px; color: var(--muted); margin: 6px 0 18px; }
code.url { display: block; padding: 12px 14px; border: 1px dashed var(--line-strong); background: var(--night); color: var(--gold-hi); font: 14px/1.5 ui-monospace, Menlo, monospace; word-break: break-all; }

/* hero */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding-top: 64px; padding-bottom: 56px; }
.hero-text { flex: 1 1 520px; min-width: 0; }
.hero h1 { font: 400 clamp(44px, 6.4vw, 78px)/1 var(--display); letter-spacing: -.01em; margin: 18px 0 22px; color: var(--bright); }
.hero h1 em { color: var(--gold); }
.lede { margin: 0; max-width: 560px; font-size: 21px; color: #c3b9d8; }
.hero .actions { margin-top: 34px; }
.hero-art { flex: 0 1 300px; display: flex; justify-content: center; }
.hero-art svg { width: 280px; max-width: 100%; height: auto; }

/* section titles with rules on both sides */
.ruled { display: flex; align-items: center; gap: 16px; margin: 0 0 30px; }
.ruled::before, .ruled::after { content: ''; flex: 1; height: 1px; background: rgba(212, 181, 106, .35); }

/* four stages */
.stages { padding-bottom: 72px; }
.cards { display: flex; flex-wrap: wrap; gap: 20px; }
.card { flex: 1 1 230px; padding: 26px 24px; border: 1px solid rgba(212, 181, 106, .25); background: var(--panel-2); border-radius: 2px; }
.numeral { width: 46px; height: 46px; border: 1px solid var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 500 16px var(--caps); color: var(--gold); }
.card h3 { font: 600 23px/1.2 var(--display); margin: 16px 0 6px; color: var(--bright); }
.card p { margin: 0; font-size: 18px; color: #c3b9d8; }

/* panels */
.panel { border: 1px solid var(--line-strong); background: var(--panel); border-radius: 2px; padding: 30px 28px; }
.panel h2 { font: 500 34px/1.1 var(--display); color: var(--bright); margin: 8px 0 14px; }
.section { padding-bottom: 72px; }

/* tradition chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 14px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid rgba(212, 181, 106, .4); border-radius: 999px; color: var(--ink); font: 500 12px var(--caps); letter-spacing: .14em; cursor: pointer; }
.chip span::before { content: '◇'; color: var(--gold); }
.chip input:checked + span { border-color: var(--gold); background: rgba(212, 181, 106, .14); color: var(--gold-hi); }
.chip input:checked + span::before { content: '◆'; }
.chip input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

/* saved paths */
.path-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.path-list a { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border: 1px solid var(--line); background: var(--panel-2); color: var(--bright); text-decoration: none; font-size: 21px; }
.path-list a:hover { border-color: var(--gold); }

/* path page */
.path-head { padding-top: 48px; padding-bottom: 32px; }
.path-head h1 { font: 400 clamp(36px, 5vw, 56px)/1.05 var(--display); color: var(--bright); margin: 10px 0 12px; }
.bar { height: 4px; background: rgba(212, 181, 106, .18); border-radius: 2px; overflow: hidden; max-width: 560px; margin-top: 18px; }
.bar > div { height: 4px; width: 0; background: var(--gold); box-shadow: 0 0 8px var(--gold); transition: width .4s; }
.offline { color: var(--gold-hi); font-style: italic; }
.connect { margin-bottom: 40px; }
.connect summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; }
.connect summary::-webkit-details-marker { display: none; }
.connect summary::after { content: '＋'; color: var(--gold); }
.connect[open] summary::after { content: '−'; }
.connect ol { padding-left: 1.3em; margin: 16px 0 0; }
.connect li { margin-bottom: 14px; }

.path-main { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding-bottom: 40px; }
.curriculum { flex: 1 1 260px; max-width: 340px; min-width: 0; padding: 28px 22px; }
.curriculum h2 { font-size: 28px; }
.module { margin-top: 22px; }
.module ol { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lesson-link { display: flex; gap: 12px; width: 100%; min-height: 44px; align-items: center; padding: 6px 8px; border: 0; border-radius: 2px; background: none;
  color: var(--muted); font: 18px/1.3 var(--display); text-align: left; cursor: pointer; }
.lesson-link:hover { color: var(--bright); background: rgba(212, 181, 106, .07); }
.lesson-link[aria-current=true] { color: var(--bright); font-weight: 600; background: rgba(212, 181, 106, .1); }
.lesson-link .mark { color: var(--gold); flex: none; width: 1em; text-align: center; }
.lesson-link[aria-current=true] .mark { text-shadow: 0 0 8px var(--gold); }
.lesson-link .saved { margin-left: auto; font: 500 10px var(--caps); letter-spacing: .14em; color: var(--gold); }

.lesson-col { flex: 999 1 560px; min-width: 0; }
.lesson-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 0 4px 14px; }
.frame { border: 1px solid var(--line-strong); padding: 10px; border-radius: 2px; box-shadow: 0 0 60px rgba(212, 181, 106, .08); }
.leaf { border: 1px solid rgba(212, 181, 106, .3); background: #fbf8f3; }
.journal { margin-top: 36px; }
.guide-note { margin: 0 0 22px; padding: 16px 18px; background: rgba(212, 181, 106, .07); border: 1px solid var(--line); font-style: italic; color: #d9d0ea; }
.done-badge { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 1px solid var(--gold); color: var(--gold); font: 500 13px var(--caps); letter-spacing: .12em; box-shadow: 0 0 18px rgba(212, 181, 106, .25); }
.tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; margin-top: 36px; }
.tools > * { flex: 1 1 300px; min-width: 0; }
.tools details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.toast { padding: 12px 18px; background: var(--panel); border: 1px solid var(--gold); color: var(--bright); font: 17px var(--display); }
.toast.bad { border-color: #ffb4a6; }

/* ---------- lesson text: the reading format, unchanged ---------- */
.story{max-width:680px;margin:0 auto;padding:44px 20px 90px;font:17px/1.75 Literata,Georgia,serif;background:#fbf8f3;color:#1f1a17}
.story h1{font:clamp(34px,6vw,48px)/1.05 "DM Serif Display",serif;letter-spacing:-.02em;margin:6px 0}
.story h2{font:30px/1.1 "DM Serif Display",serif;letter-spacing:-.01em;margin:0 0 22px}
.story .label{font:13px "Inter Tight",sans-serif;color:#6a5f58;margin:48px 0 4px}
.story p{margin:0}
.story p+p{text-indent:1.6em}
.story p:first-of-type::first-letter{font:3.4em/.8 "DM Serif Display",serif;float:left;margin:.08em .08em 0 0;color:#c8322a}
/* only the parts the format doesn't cover: lists, terms and sources inside a lesson */
.story .label:first-child { margin-top: 0; }
.story ol, .story ul { margin: 0; padding-left: 1.3em; }
.story dl { margin: 0; }
.story dt { font-weight: 600; margin-top: 10px; }
.story dd { margin: 0; }
.story .sources { font-size: 15px; color: #4a413b; }
.story .saved-at { font: 13px "Inter Tight", sans-serif; color: #6a5f58; margin-top: 40px; }

/* on a phone the lesson comes first; the curriculum follows it */
@media (max-width: 900px) { .lesson-col { order: -1; } .curriculum { max-width: none; } }
@media (max-width: 640px) {
  .hero { padding-top: 40px; }
  .panel { padding: 24px 18px; }
  .frame { padding: 6px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .bar > div { transition: none; } }
fieldset.field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 8px; }
