/* ==========================================================================
   Bion · The Visitor's Path — PostHog public face
   --------------------------------------------------------------------------
   The public face is PostHog's recognizable design language: a light cream
   canvas (--p-canvas) under white cards with 2px near-black borders and hard
   offset shadows, bold mixed-case grotesque sans headlines, airy spacing,
   playful microcopy, and PostHog orange (--p-accent) used sparingly as the
   pop. The old dark PS1 menu survives ONLY as details: the "> " selection
   cursors (active nav link, course rows, note rows, Overview), the rotated
   "Completed" stamp, the save-slot course rows, and chunky borders.
   Mono (--p-mono) is PostHog's technical accent for codes and week chips.

   Pure CSS/SVG ornament — no raster assets, no external fonts (serif stack
   shared with Castle Keep for the long-form note reader). The private face
   is untouched (Castle Keep owns castle_keep.css); this file owns the
   public face.

   Stable test classes are preserved: .pub-note, .pub-board-item,
   .pub-course-title, .pub-course-code, .pub-module, .pub-note-link,
   .pub-assignment, .pub-note-title, .pub-note-context, .pub-note-body,
   .pub-empty, .pub-path, .sky — plus the revision classes
   .pub-crumbs, .notes-group, .pub-board-code, .pub-board-meta,
   .pub-board-stamp, .pub-overview-meta, and the COURSES screen classes
   .pub-cr-row, .pub-cr-cur, .pub-cr-code, .pub-cr-name,
   .pub-cr-sem, .pub-cr-preview, .pub-cr-meta, .pub-cr-counts, .pub-cr-btn.
   The finder window (.pub-window, .pub-window-bar) is the chrome for ALL
   five public pages — Courses, the Notes library, the Assignments board,
   course interiors and the note reader. The three index pages (Courses,
   Notes, Assignments) share ONE two-pane composition: a left item list
   (.pub-cr-list / .pub-index-list) and a right detail pane (.pub-cr-preview
   / .pub-index-preview). Course interiors and the note reader use a single
   content pane (.pub-content).
   ========================================================================== */

:root{
  --p-accent:#f54e00; --p-line:#121212;
  --p-serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  /* PostHog public-face palette */
  --p-canvas:#f4f2eb; --p-card:#ffffff;
  --p-ink:#151515; --p-ink-soft:#5b5b5b; --p-ink-faint:#767676;
  --p-accent-text:#d93f00; --p-accent-soft:rgba(245,78,0,.08);
  --p-shadow-1:3px 3px 0 rgba(17,17,17,.18);
  --p-shadow-2:4px 4px 0 rgba(17,17,17,.25);
  --p-shadow-3:5px 5px 0 rgba(17,17,17,.45);
  --p-shadow-btn-hover:6px 6px 0 rgba(0,0,0,.55);
  --p-shadow-accent:5px 5px 0 rgba(245,78,0,.35);
  --p-sans:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI",Helvetica,Arial,sans-serif;
  --p-mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}

body.bion-public{
  margin:0;
  background:var(--p-canvas);
  color:var(--p-ink);
  font-family:var(--p-sans);-webkit-font-smoothing:antialiased;
}
/* links keep their own colors (component rules set them); only kill the
   underline globally — the cascade must not force color:inherit over
   .pub-cr-btn{color:#fff} etc. */
body.bion-public a{text-decoration:none}
*{box-sizing:border-box}
/* keyboard focus — orange outline so links/buttons read on the cream canvas */
body.bion-public a:focus-visible,body.bion-public button:focus-visible{
  outline:2px solid var(--p-accent);outline-offset:2px;
}

/* ==========================================================================
   1. Themed nav — PostHog white menu bar
   --------------------------------------------------------------------------
   A white menu bar with a near-black bottom border: brand pushed left,
   links right. Inactive links are ink text; the active link is orange with
   a "> " cursor (the rule below is asserted byte-for-byte by tests).
   ========================================================================== */
.pub-nav{
  display:flex;align-items:center;gap:6px;flex-wrap:wrap;
  background:#fff;
  border-bottom:2px solid var(--p-line);padding:10px 22px;
}
.pub-nav .pub-nav-brand{
  color:var(--p-ink);font-size:13.5px;letter-spacing:.02em;
  font-weight:800;margin-right:auto;white-space:nowrap;
}
.pub-nav a{
  color:var(--p-ink);font-size:13px;letter-spacing:.01em;
  padding:6px 12px;border:2px solid transparent;border-radius:6px;font-weight:600;
}
.pub-nav a:hover{color:var(--p-accent)}
.pub-nav a.is-active{color:var(--p-accent-text);background:var(--p-accent-soft);border:2px solid var(--p-accent)}
.pub-nav a.is-active::before{content:"> ";color:var(--p-accent)}

/* ==========================================================================
   2. Common public scene shell
   ========================================================================== */
.pub-scene{max-width:1180px;margin:0 auto;padding:30px 26px 70px}
.pub-page-sub{font-size:14px;color:var(--p-ink-soft);margin-top:6px;margin-bottom:24px}
/* centered heads (Notes library, Assignments board) center their sub-lines too */
.pub-library .pub-page-sub,.pub-board-scene .pub-page-sub{text-align:center}
.pub-empty{font-style:italic;font-size:14px;color:var(--p-ink-soft);padding:12px 4px}

/* breadcrumbs — ink trail with faint › separators (Courses › … › Notes) */
.pub-crumbs{
  font-size:13px;font-weight:600;
  color:var(--p-ink-faint);margin-bottom:18px;
}
.pub-crumbs a{color:var(--p-ink);font-weight:600}
.pub-crumbs a:hover{color:var(--p-accent)}

/* ==========================================================================
   3. (removed — the valley banner was dropped on request; the homepage is
   now the cream canvas + the COURSES frame)
   ========================================================================== */

/* ==========================================================================
   3b. The COURSES screen — PS1-style save-browser
   --------------------------------------------------------------------------
   A white card frame (near-black border, hard offset shadow) holding the
   course list on the left and a preview panel on the right, like a
   save-game / location selector. PostHog palette only (--p-* vars).
   ========================================================================== */
[hidden]{display:none !important}
/* the shared PostHog white frame — ONE window for the whole public face:
   white panel, 2px near-black border, hard 5px offset shadow. The finder
   window draws its own chrome — the bar owns the top padding. */
.pub-window{
  position:relative;z-index:5;max-width:980px;margin:26px auto 0;
  padding:0;overflow:hidden;
  background:var(--p-card);
  border:2px solid var(--p-line);border-radius:10px;
  box-shadow:var(--p-shadow-3);
}
/* window title — 24px inside the finder bar (the old 34px masthead is gone) */
.pub-page-title{
  margin:0;font-size:24px;letter-spacing:normal;
  color:var(--p-ink);font-weight:800;
}

/* --- the item list (finder left pane) ----------------------------------- */
.pub-cr-list,.pub-index-list{
  width:250px;flex:0 0 250px;
  border-right:1px solid rgba(18,18,18,.15);
  padding:10px 8px;
  overflow-y:auto;max-height:560px;
  scrollbar-width:thin;scrollbar-color:var(--p-line) transparent;
}
/* notes/board rows carry long titles — a wider list pane than courses */
.pub-index-list.wide{
  width:46%;flex:0 0 46%;min-width:320px;
}
.pub-cr-row,.pub-index-row{
  position:relative;display:block;
  padding:9px 10px 9px 26px;margin-bottom:2px;
  border-radius:6px;
  font-size:13px;color:var(--p-ink);cursor:pointer;
  transition:background .12s;
}
a.pub-cr-row,a.pub-index-row{display:block}
.pub-cr-row:hover,.pub-cr-row.on,.pub-index-row:hover{
  background:rgba(18,18,18,.05);
  transform:none;
  box-shadow:none;
}
/* selection cursor — the default row carries it; hovering a row moves it
   there (one visible cursor at a time). Closed rows never carry it. */
.pub-cr-cur{visibility:hidden;color:var(--p-accent);font-weight:900;position:absolute;left:8px;top:9px}
/* the default row (server-marked .is-default = first OPEN course) and the
   library/board ACTIVE row (.is-active, server-marked) wear the same sidebar
   ACTIVE treatment (orange bar + soft tint) until the visitor hovers another
   row */
.pub-cr-row.is-default:not(.closed),.pub-index-row.is-active{
  background:var(--p-accent-soft);
  box-shadow:inset 3px 0 0 var(--p-accent);
}
.pub-cr-row.is-default:not(.closed) .pub-cr-cur{visibility:visible}
.pub-cr-list:hover .pub-cr-row.is-default .pub-cr-cur{visibility:hidden}
.pub-cr-list:hover .pub-cr-row:hover:not(.closed) .pub-cr-cur{visibility:visible}
/* library/board rows: the PS1 selection cursor rides the active row only */
.pub-index-row.is-active::before{
  content:">";color:var(--p-accent);font-weight:900;
  position:absolute;left:8px;top:9px;
}
/* save-slot rows: code / name / semester stacked like a PS1 save screen */
.pub-cr-code,.pub-index-code{display:block;font-family:var(--p-mono);font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--p-ink)}
.pub-cr-name,.pub-index-name{display:block;font-size:15.5px;font-weight:700;margin-top:1px}
.pub-cr-sem,.pub-index-sub{display:block;font-size:13px;color:var(--p-ink-soft);margin-top:2px}
/* closed courses — identity listed but inert and muted */
.pub-cr-row.closed{
  color:var(--p-ink-faint);cursor:default;
  background:#faf9f4;
}
.pub-cr-row.closed .pub-cr-code{color:var(--p-ink-faint)}
.pub-cr-row.closed:hover,.pub-cr-row.closed.on{
  background:#faf9f4;border-color:var(--p-line);box-shadow:var(--p-shadow-1);transform:none;
}

/* --- the preview (finder right pane) ------------------------------------ */
.pub-cr-preview,.pub-index-preview{
  flex:1;min-width:0;
  padding:18px 22px;
  overflow-y:auto;max-height:560px;
  scrollbar-width:thin;scrollbar-color:var(--p-line) transparent;
  min-height:300px;
}
.pub-cr-pv-code{
  font-family:var(--p-mono);font-size:12px;font-weight:700;letter-spacing:.04em;
  color:var(--p-accent-text);
}
.pub-cr-pv-name{font-size:17px;font-weight:800;color:var(--p-ink);margin:2px 0 1px;line-height:1.25}
.pub-cr-pv-sem{font-size:13px;color:var(--p-ink-soft)}
.pub-cr-meta{
  display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:11px;
  font-size:13px;color:var(--p-ink-soft);
}
.pub-cr-meta span{white-space:nowrap}
.pub-cr-meta .pub-cr-private{
  font-style:italic;color:var(--p-ink-faint);
  font-size:12px;
}
.pub-cr-counts{
  list-style:none;margin:12px 0 0;padding:12px 0 0;
  display:flex;flex-wrap:wrap;gap:5px 18px;
  border-top:1px solid rgba(18,18,18,.12);
  font-size:13px;color:var(--p-ink-soft);font-weight:600;
}
.pub-cr-counts b{font-family:var(--p-mono);color:var(--p-accent-text);font-weight:700;font-size:13px;margin-left:4px}
.pub-cr-btn{
  display:inline-block;margin-top:14px;padding:10px 20px;
  background:var(--p-ink);
  color:#fff;font-weight:800;font-size:14px;
  border:none;border-radius:8px;
  box-shadow:var(--p-shadow-2);cursor:pointer;
  transition:background .12s,transform .12s,box-shadow .12s;
}
.pub-cr-btn:hover{
  background:#000;
  transform:translateY(-2px);
  box-shadow:var(--p-shadow-btn-hover);
}

/* ==========================================================================
   4. Notes library — folder tabs with white note rows (PS1 NOTES screen)
   --------------------------------------------------------------------------
   Inside the shared frame, each course is a folder tab with an ink
   divider and indented note rows beneath it — the brief's folder metaphor
   (the old "library shelf" of tomes is gone).
   ========================================================================== */
.pub-notes{list-style:none;margin:0;padding:0}
.pub-note{
  position:relative;display:flex;align-items:center;gap:10px;
  background:var(--p-card);
  border-bottom:1px solid rgba(18,18,18,.12);
  padding:10px 14px 10px 26px;margin-bottom:8px;color:var(--p-ink);
  transition:background .12s,transform .12s;
}
.pub-note a{font-weight:700;font-size:14px;color:var(--p-ink)}
.pub-note:hover{transform:translateX(3px)}
.pub-note a:hover{color:var(--p-accent)}
.pub-note .pub-note-course{
  font-size:11px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--p-ink-faint);margin-left:auto;white-space:nowrap;
}
/* PS1 selection cursor — the first row carries it; hovering moves it */
.pub-note::before{
  content:">";position:absolute;left:10px;top:50%;transform:translateY(-50%);
  color:var(--p-accent);font-weight:800;visibility:hidden;
}
.pub-notes li:first-child .pub-note::before{visibility:visible}
.pub-notes:hover li:first-child .pub-note::before{visibility:hidden}
.pub-notes:hover .pub-note:hover::before{visibility:visible}

/* notes grouped by course — folder tab + divider + indented rows */
.notes-group{margin:20px 0 4px}
.notes-group h2{
  display:inline-block;margin:0;padding:6px 16px;
  font-size:14px;font-weight:700;
  color:var(--p-ink);
  background:var(--p-card);
  border:2px solid var(--p-line);
  border-radius:8px;
}
.notes-group h2::before{content:"> ";color:var(--p-accent)}
.notes-group .pub-notes{margin:0;padding:10px 0 0 18px}

/* ==========================================================================
   5. Board — ASSIGNMENTS screen grouped by course
   --------------------------------------------------------------------------
   Inside the shared frame: a mono course-code header per course, a divider,
   then that course's finished work as white cards with the rotated
   "Completed" stamp.
   ========================================================================== */
.pub-board{list-style:none;margin:0;padding:0}
.pub-board-group{margin:0 0 18px}
.pub-board-group .pub-board-code{
  display:block;margin:0;font-family:var(--p-mono);font-size:13px;font-weight:700;
  letter-spacing:.04em;color:var(--p-ink);
}
.pub-board-items{list-style:none;margin:0;padding:0}
.pub-board-item{
  position:relative;background:var(--p-card);
  border-bottom:1px solid rgba(18,18,18,.12);
  padding:11px 100px 10px 14px;margin-bottom:8px;
  display:flex;flex-direction:column;gap:3px;
}
.pub-board-title{font-size:14px;font-weight:700;line-height:1.3;color:var(--p-ink)}
.pub-board-meta{display:flex;flex-wrap:wrap;gap:12px;font-size:12.5px;color:var(--p-ink-soft)}
.pub-board-due{color:var(--p-ink-faint)}
/* assignment detail — the work itself: description + the submitted doc link */
.pub-item-description{font-family:var(--p-serif);font-size:16px;line-height:1.7;color:var(--p-ink);margin-top:14px}

/* ==========================================================================
   6. Course interior + note reader — window body panes
   ========================================================================== */
.pub-course-title,.pub-note-title{
  font-size:26px;font-weight:800;letter-spacing:normal;color:var(--p-ink);line-height:1.25;
}
.pub-course-title,.pub-note-title{margin:0 0 4px}
/* tab bar (course hub — PS1 menu): one tab per section; the active tab
   merges into the content pane and carries the "> " cursor like the nav */
.pub-tabs{
  display:flex;gap:6px;align-items:flex-end;
  border-bottom:2px solid var(--p-line);
  margin-bottom:16px;padding:0 4px;
}
.pub-tab{
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 14px;margin-bottom:-2px;
  font-size:13px;font-weight:700;color:var(--p-ink);
  border:2px solid transparent;border-radius:6px 6px 0 0;
  line-height:1.25;text-decoration:none;
}
.pub-tab:hover{border-color:var(--p-line);background:rgba(18,18,18,.04)}
.pub-tab.on{
  border:2px solid var(--p-line);border-bottom-color:#fff;
  color:var(--p-ink);background:#fff;
}
.pub-tab.on::before{content:"> ";color:var(--p-accent)}
.pub-tab-count{
  font-family:var(--p-mono);font-size:11px;font-weight:700;
  color:var(--p-accent-text);border:1px solid var(--p-line);border-radius:6px;
  padding:0 5px;line-height:1.5;
}
.pub-tab-content{min-height:220px}
/* tab content lists (module/assignment/note rows keep their own rules) */
.pub-tab-content ul{list-style:none;margin:0;padding:0}
/* overview tab: the counts summary chips double as quick links to the tabs */
.pub-overview-counts{
  list-style:none;margin:14px 0 0;padding:0;
  display:flex;flex-wrap:wrap;gap:8px;
}
.pub-overview-counts a{
  font-size:12.5px;font-weight:600;color:var(--p-ink);
  background:#fff;border:2px solid var(--p-line);border-radius:6px;padding:3px 10px;
}
.pub-overview-counts a:hover{color:var(--p-accent)}
.pub-overview-counts b{font-family:var(--p-mono);color:var(--p-accent-text);margin-left:4px}
/* assignments tab footer link back to the full board lens */
.pub-tab-more{
  display:inline-block;margin-top:6px;font-size:12.5px;font-weight:700;
  color:var(--p-ink-soft);
}
.pub-tab-more:hover{color:var(--p-accent)}
/* course code chip (in the h1 — not duplicated in the overview) */
.pub-course-code{
  display:inline-block;vertical-align:middle;
  font-family:var(--p-mono);font-size:11px;font-weight:700;letter-spacing:.04em;
  color:var(--p-accent-text);margin-left:8px;
  border:2px solid var(--p-line);border-radius:6px;padding:2px 8px;
  background:#fff;
}
.pub-overview-meta{
  list-style:none;margin:10px 0 0;padding:0;
  display:flex;flex-wrap:wrap;gap:8px;
}
.pub-overview-meta li{
  font-size:12.5px;color:var(--p-ink);background:#fff;
  border:2px solid var(--p-line);border-radius:6px;padding:3px 10px;font-weight:600;
}
.pub-module,.pub-note-link,.pub-assignment{
  display:flex;align-items:center;gap:10px;padding:11px 14px;margin-bottom:8px;
  border-bottom:1px solid rgba(18,18,18,.12);border-radius:8px;background:var(--p-card);
}
.pub-module-week{
  font-family:var(--p-mono);font-size:11px;font-weight:700;color:var(--p-ink);
  letter-spacing:.04em;background:#fff;border:2px solid var(--p-line);border-radius:6px;
  padding:1px 8px;white-space:nowrap;
}
.pub-module-title{font-weight:700;font-size:13px}
.pub-note-link a{font-weight:700;font-size:13px;color:var(--p-ink)}
.pub-note-link a:hover{color:var(--p-accent)}
.pub-note-link::before{content:">";color:var(--p-accent);font-weight:800}
.pub-assignment{flex-wrap:wrap}
.pub-assignment-title{font-weight:700;font-size:14px}
.pub-assignment-kind{font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:var(--p-ink-soft)}
.pub-assignment-due{font-size:12px;color:var(--p-ink-soft)}
.pub-assignment-link{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;color:var(--p-ink)}
.pub-assignment-link:hover{color:var(--p-accent)}
.pub-note-context{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 18px;font-size:12px;color:var(--p-ink-soft)}
.pub-note-context span{background:#fff;border:2px solid var(--p-line);border-radius:6px;padding:2px 9px}
.pub-note-body{font-family:var(--p-serif);font-size:17px;line-height:1.75;color:var(--p-ink)}
body.bion-public .pub-note-body a{text-decoration:underline dotted 1.5px;color:var(--p-accent-text)}
.pub-note-body h1,.pub-note-body h2,.pub-note-body h3{color:var(--p-ink);margin:16px 0 8px}
.pub-note-body h1{font-size:20px;border-bottom:2px solid var(--p-line);padding-bottom:6px}
.pub-note-body p{margin:9px 0}
.pub-note-body ul{margin:9px 0 9px 22px;list-style:disc}
.pub-note-body li{line-height:1.65}

/* ==========================================================================
   6b. Finder windows — Notes library + Assignments board
   --------------------------------------------------------------------------
   macOS-Finder-style drill-down: a title bar with traffic-light dots, a
   left item list and a detail pane on the right. These two pages reuse the
   Courses screen's two-pane composition via the .pub-index-list /
   .pub-index-preview aliases (see §3b) — there is no sidebar anymore.
   Clicking a row shows its detail in the pane (wiki-links in a note body
   keep the loop going). PostHog palette only — no new colors.
   ========================================================================== */
.pub-window-bar{
  position:relative;
  display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;
  padding:12px 20px 10px;
  border-bottom:1px solid rgba(18,18,18,.15);
}
.win-dots i{
  display:inline-block;width:10px;height:10px;border-radius:50%;
  margin-right:6px;vertical-align:baseline;
}
.win-dots .d-orange{background:var(--p-accent)}
.win-dots .d-cream{background:#f4f2eb;border:1px solid var(--p-line)}
.win-dots .d-navy{background:#233a5e}
/* the window title is smaller than the full-bleed page titles (24px not 34) */
.pub-window-bar .pub-page-sub{
  margin:0 0 0 8px;text-align:left;font-size:13px;
}
/* course + note titles sit on the bar baseline like the page titles */
.pub-window-bar .pub-course-title,.pub-window-bar .pub-note-title{margin:0}
.pub-win-body{display:flex;align-items:stretch;min-height:340px}
.pub-content{
  flex:1;min-width:0;
  padding:18px 22px;
  overflow-y:auto;max-height:560px;
  scrollbar-width:thin;scrollbar-color:var(--p-line) transparent;
}
.pub-back{font-size:12.5px;color:var(--p-ink-soft);margin:0 0 14px}
.pub-back a{color:var(--p-ink);font-weight:600}
.pub-back a:hover{color:var(--p-accent)}
/* note rows in the pane keep the hairline row style; hover gets a soft bg */
.pub-content .pub-note:hover{background:rgba(18,18,18,.04)}
/* board rows become links — keep the row look, add a hover tint */
.pub-content a.pub-board-item{color:var(--p-ink)}
.pub-content a.pub-board-item:hover{background:rgba(18,18,18,.04)}
.pub-item-meta{
  list-style:none;margin:12px 0 0;padding:0;
  display:flex;flex-wrap:wrap;gap:8px;font-size:13px;color:var(--p-ink);
}
.pub-item-meta li{
  background:#fff;border:2px solid var(--p-line);border-radius:6px;
  padding:3px 10px;font-weight:600;
}

/* ==========================================================================
   7. Responsive — frames and rows stack
   ========================================================================== */
@media(max-width:760px){
  .pub-nav{padding:8px 14px}
  .pub-nav a{padding:5px 9px}
  .pub-window{margin:12px;box-shadow:var(--p-shadow-3)}
  .pub-cr-row,.pub-index-row{padding:10px 10px 10px 30px}
  .pub-cr-preview,.pub-index-preview{display:none}
  .pub-scene{padding:22px 16px 50px}
  .notes-group .pub-notes{padding-left:8px}
  /* finder windows stack: full-width list above the content pane */
  .pub-win-body{flex-direction:column;min-height:0}
  .pub-cr-list,.pub-index-list,.pub-index-list.wide{
    width:100%;flex:none;max-height:none;overflow:visible;
    border-right:none;border-bottom:1px solid rgba(18,18,18,.15);
  }
  .pub-index-row.has-stamp{padding-right:10px}
  .pub-content{max-height:none;overflow:visible}
  /* hub tabs scroll horizontally on small screens so they never wrap */
  .pub-tabs{overflow-x:auto;flex-wrap:nowrap}
  .pub-tab{white-space:nowrap;flex:0 0 auto}
}
