@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Fraunces:ital,opsz,wght@0,9..144,400;1,9..144,400&family=Inter:wght@400;500;600&display=swap');
/* Alice & Homer brand: obsidian, ivory, gold. Cormorant Garamond wordmark, Fraunces italic headlines, Inter body.
   Two views: night (default) and day, switched in the header and remembered per device. */
:root {
  --bg:#1d1a17; --panel:#27231f; --panel2:#2f2a25; --inset:#1d1a17;
  --head:#F4EEE3; --text:#e2dacd; --soft:#c9c0b2; --mute:#a39a8c;
  --gold:#C9A15B; --gold-text:#D6B06C; --on-gold:#141210;
  --line:rgba(244,238,227,.13); --header:rgba(29,26,23,.94); --err:#f0a0a0;
}
:root[data-theme="day"] {
  --bg:#F4EEE3; --panel:#FCF9F3; --panel2:#F3EADB; --inset:#F8F3EA;
  --head:#141210; --text:#2c2723; --soft:#4a423b; --mute:#73695e;
  --gold:#C9A15B; --gold-text:#8A6526; --on-gold:#141210;
  --line:rgba(20,18,16,.12); --header:rgba(244,238,227,.94); --err:#a33a2a;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--gold-text); }
.wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 80px; }

/* header */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--header); backdrop-filter: blur(8px); z-index: 5; }
.brand { color: var(--head); text-decoration: none; display: flex; flex-direction: column; gap: 4px; line-height: 1; }
.wordmark { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; font-size: 20px; letter-spacing: .2em; text-transform: uppercase; color: var(--head); white-space: nowrap; }
.wordmark span { font-style: italic; text-transform: none; letter-spacing: 0; color: var(--gold); margin: 0 .25em 0 .05em; }
.product { font-size: 10px; letter-spacing: .32em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
nav.tabs { display: flex; gap: 6px; align-items: center; }
nav.tabs a, nav.tabs button.theme { color: var(--mute); text-decoration: none; padding: 6px 10px; border-radius: 999px; font-size: 14px; white-space: nowrap; }
nav.tabs a.on { color: var(--on-gold); background: var(--gold); }
nav.tabs button.theme { background: transparent; border: 1px solid var(--line); min-height: 0; font-weight: 500; }

/* type */
h1 { font-family: Fraunces, Georgia, serif; font-style: italic; font-weight: 400; font-size: 32px; line-height: 1.15; margin: 8px 0 6px; color: var(--head); }
h2 { font-family: Fraunces, Georgia, serif; font-style: italic; font-weight: 400; font-size: 21px; margin: 30px 0 10px; color: var(--head); }
p.sub { color: var(--mute); margin: 0 0 20px; }

/* cards, forms, buttons */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0; }
label { display: block; font-size: 13px; color: var(--mute); margin: 12px 0 4px; }
input, textarea { width: 100%; background: var(--inset); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: inherit; }
input[type=file] { padding: 10px; }
textarea { min-height: 130px; resize: vertical; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--gold); color: var(--on-gold); border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px; }
button.ghost, .btn.ghostlink { background: transparent; color: var(--head); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row > * { flex: 1 1 140px; }
.msg { margin-top: 10px; font-size: 14px; color: var(--mute); min-height: 1.2em; }
.err { color: var(--err); }

/* post queue */
.when { font-weight: 600; color: var(--head); }
.due { color: var(--gold-text); font-size: 13px; font-weight: 600; }
.title { font-size: 17px; font-weight: 600; margin: 2px 0 8px; color: var(--head); }
.post { display: grid; grid-template-columns: 96px 1fr; gap: 14px; }
.post img.thumb { width: 96px; aspect-ratio: 9/16; object-fit: cover; border-radius: 8px; background: #000; }
.cap { white-space: pre-wrap; font-size: 14px; color: var(--soft); background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 140px; overflow: auto; }
.bar { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.posted { opacity: .55; }
.key { font-family: ui-monospace, Menlo, monospace; word-break: break-all; font-size: 13px; }

/* progress */
.prog { margin: 6px 0 14px; }
.prog-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); margin-bottom: 6px; }
.prog-top span:first-child { color: var(--gold-text); font-weight: 600; }
.prog-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.prog-bar i { display: block; height: 100%; background: var(--gold); transition: width .3s; }

/* course layout with module sidebar */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
.side { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; padding: 20px 16px 40px; border-right: 1px solid var(--line); }
.side-stage { font-family: Fraunces, Georgia, serif; font-style: italic; font-size: 15px; color: var(--head); }
.side-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; color: var(--soft); text-decoration: none; font-size: 14px; line-height: 1.35; }
.side-item:hover { background: var(--panel); color: var(--head); }
.side-item.on { background: var(--panel); color: var(--head); box-shadow: inset 2px 0 0 var(--gold); }
.side-item .tick { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: var(--mute); }
.side-item.done .tick { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 700; }
.course-list .side-item { font-size: 16px; padding: 10px 8px; }
.layout main .wrap { margin: 0; max-width: 800px; padding-left: 40px; padding-right: 24px; }
.side-toggle, .side-close { display: none; }
.side-close { justify-content: flex-end; }
.side-close button { background: transparent; color: var(--head); border: 1px solid var(--line); min-height: 36px; padding: 6px 14px; }

/* lessons: the title on the page, each section on its own lighter panel */
.lesson .stage { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); margin-top: 8px; }
.lesson h1 { font-size: 40px; line-height: 1.1; margin: 10px 0 22px; }
.lesson article { font-size: 17.5px; line-height: 1.8; color: var(--text); }
.lesson article .sect { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 30px 8px; margin: 0 0 18px; }
.lesson article p, .lesson article li { color: var(--text); }
.lesson article p { margin: 0 0 1.1em; }
.lesson article strong { color: var(--head); font-weight: 600; }
.lesson article h2 { font-family: Fraunces, Georgia, serif; font-style: italic; font-weight: 400; font-size: 26px; line-height: 1.25; color: var(--gold-text); margin: 0 0 .5em; }
.lesson article h3 { font-family: Inter, sans-serif; font-style: normal; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); margin: 1.6em 0 .5em; }
.lesson article ul, .lesson article ol { padding-left: 1.2em; margin: 0 0 1.2em; }
.lesson article li { margin: .5em 0; padding-left: .2em; }
.lesson article li::marker { color: var(--gold); }
.lesson article a { color: var(--gold-text); text-underline-offset: 3px; }
.lesson article code { font-family: ui-monospace, Menlo, monospace; font-size: .86em; background: var(--inset); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.lesson article pre { background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
.lesson article pre code { background: none; border: 0; padding: 0; }
.lesson .note { background: var(--panel2); border-left: 3px solid var(--gold); border-radius: 0 12px 12px 0; padding: 6px 20px; margin: 1.4em 0; }
.lesson .note p { color: var(--text); margin: 10px 0; }
.complete-row { margin-top: 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
button.marked { background: transparent; color: var(--gold-text); border: 1px solid var(--gold); }
.pn { display: flex; justify-content: space-between; gap: 10px; margin-top: 28px; }

@media (max-width: 860px) {
  .layout { display: block; }
  .side { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100vh; height: 100dvh; z-index: 30; max-height: none; background: var(--bg); border: 0; padding-top: 16px; }
  .side.open { display: block; }
  .side-close { display: flex; }
  .layout main .wrap { padding: 16px 16px 80px; }
  .side-toggle { display: inline-flex; margin: 14px 16px 0; min-height: 38px; padding: 8px 14px; font-size: 14px; background: transparent; color: var(--head); border: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .post { grid-template-columns: 76px 1fr; } .post img.thumb { width: 76px; } h1 { font-size: 27px; }
  header.top { flex-wrap: wrap; row-gap: 10px; padding: 12px 16px 10px; }
  header.top .brand { width: 100%; }
  nav.tabs { width: 100%; justify-content: space-between; }
  nav.tabs a, nav.tabs button.theme { padding: 7px 10px; font-size: 14px; }
  .lesson article { font-size: 17px; } .lesson h1 { font-size: 32px; } .lesson article h2 { font-size: 23px; }
  .lesson article .sect { padding: 18px 18px 6px; border-radius: 14px; }
}

/* foldable sections */
.side-group { margin: 4px 0; }
.side-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; margin: 10px 0 4px; }
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary::before { content: ""; flex: 0 0 8px; height: 8px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.side-group[open] > summary::before { transform: rotate(45deg); }
.side-group > summary:hover { background: var(--panel); }
.side-group > summary > span:first-child { flex: 1; }
.side-group .count { font-family: Inter, sans-serif; font-style: normal; font-size: 12px; color: var(--mute); }
.side-group .count.all { color: var(--gold-text); font-weight: 600; }
.side-group .side-item { margin-left: 12px; }
.course-list .side-group > summary { font-size: 18px; }

/* screenshot placeholders (replaced by real images later) */
.lesson .shot { border: 1.5px dashed var(--gold); border-radius: 12px; padding: 14px 18px; margin: 1.2em 0; color: var(--soft); font-size: 15px; line-height: 1.5; background: transparent; }
.lesson .shot span { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 4px; font-weight: 600; }

/* lesson images and chat examples */
.lesson .fig { margin: 1.3em 0; }
.lesson .fig .fig-imgs { display: flex; gap: 12px; align-items: flex-start; }
.lesson .fig img { display: block; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line, rgba(127,127,127,.25)); box-shadow: 0 6px 22px rgba(0,0,0,.18); }
.lesson .fig-row .fig-imgs img { min-width: 0; }
.lesson .fig:not(.fig-row) img { max-height: 520px; width: auto; }
.lesson .fig figcaption { font-size: 14px; color: var(--soft); margin-top: 8px; line-height: 1.45; }
@media (max-width: 640px) { .lesson .fig-row .fig-imgs { flex-direction: column; } }
.lesson .chat { border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 12px; padding: 12px 14px; margin: 1.2em 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; }
.lesson .chat b { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 2px; }
.lesson .chat-you { align-self: flex-end; max-width: 85%; background: var(--panel2); padding: 8px 12px; border-radius: 10px; }
.lesson .chat-claude { max-width: 95%; padding: 4px 2px; }
.lesson .chat::before { content: "Example"; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
