/* ──────────────────────────────────────────────────────────────
   INSTRUCTIONS — the design system
   Print bones (contents, numbered figures, captions, folios) in
   the nereu skin. Two skins driven by data-style on <html>,
   token-for-token the landing's:
     - base :root        = "nereu-alt" (calm)
     - [data-style=nereu] = "nereu" (default, bold)
   ────────────────────────────────────────────────────────────── */

:root{
  --ink:#1f292e; --muted:#586a72; --sky:#9fd2ef; --panel:#fffef9;
  --line:#697a82; --soft:#edf5f4; --accent:#ed702e; --accent2:#5b93ad;
  --yellow:#f3c948; --green:#71a764; --pink:#d982a5; --purple:#8563a5;
  --shadow:0 9px 22px rgba(38,66,78,.27); --radius:20px;
  --border-w:1px;
  --font:"Trebuchet MS",Verdana,sans-serif;
  --prose:Georgia,"Iowan Old Style",serif;
  --measure:66ch;
  --rail-w:290px;
  --page-grad:linear-gradient(#a9d9f2,#78b8e5);
}
html[data-style="nereu"]{
  --ink:#172237; --muted:#4c6072; --sky:#79bdf0; --panel:#fff9e9;
  --line:#172237; --soft:#e7f4fb; --accent:#f47725; --accent2:#278de1;
  --yellow:#ffd84f; --green:#7cbc67; --pink:#efa4c2; --purple:#9b58b5;
  --shadow:5px 6px rgba(35,73,105,.3); --radius:15px;
  --border-w:2px;
  --page-grad:linear-gradient(#8ac9f5,#6eb4e9);
}

*{box-sizing:border-box;margin:0;padding:0}
button,a,input{font:inherit}
button{cursor:pointer}

html{background:var(--sky)}
body{
  font-family:var(--font);
  color:var(--ink);
  background:var(--page-grad) fixed;
  min-height:100vh;
  font-size:15px;line-height:1.5;
}

.panelized{
  background:var(--panel);
  border:var(--border-w) solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

/* ── Shell: floating panels on the sky, like the portal ── */
.shell{
  display:grid;grid-template-columns:var(--rail-w) minmax(0,1fr);
  gap:14px;align-items:start;
  max-width:1180px;margin:0 auto;padding:16px 16px 90px;
}

/* ── Rail: masthead + table of contents ── */
.rail{
  background:var(--panel);border:var(--border-w) solid var(--line);
  border-radius:var(--radius);box-shadow:var(--shadow);
  padding:20px 16px 16px;
  position:sticky;top:16px;max-height:calc(100vh - 32px);
  display:flex;flex-direction:column;
}
.rail-inner{overflow-y:auto;scrollbar-width:thin;min-height:0}

.masthead{text-align:center;margin-bottom:16px}
.masthead h1{
  font-size:29px;font-weight:900;letter-spacing:-1px;line-height:1;
}
html[data-style="nereu"] .masthead h1{
  color:var(--yellow);
  -webkit-text-stroke:1.5px var(--line);
  text-shadow:3px 3px var(--line);
}
.masthead .issue-line{
  margin-top:8px;font-size:10px;font-weight:bold;letter-spacing:1px;
  text-transform:uppercase;color:var(--muted);
}

.toc{font-size:12px;margin-top:4px}
.toc ol{list-style:none}
.toc > ol > li{margin-bottom:8px}
.toc .part{
  display:inline-block;margin:14px 0 8px;padding:3px 11px;
  background:#344c58;color:#fff;border-radius:999px;
  font-size:9px;font-weight:900;letter-spacing:1.2px;text-transform:uppercase;
}
html[data-style="nereu"] .toc .part{border:2px solid var(--line);border-radius:7px}

/* collapsible parts (native details/summary, no JS) */
.toc-part summary{list-style:none;cursor:pointer;user-select:none;display:flex;align-items:center;gap:7px}
.toc-part summary::-webkit-details-marker{display:none}
.toc-part summary::after{
  content:"›";font-size:15px;font-weight:bold;color:var(--muted);
  transition:transform .12s;transform:translateY(1px);
}
.toc-part[open] summary::after{transform:rotate(90deg)}
.toc-part summary:hover .part{background:var(--accent)}
.toc a{
  display:flex;align-items:baseline;gap:6px;min-width:0;
  color:inherit;text-decoration:none;font-weight:bold;
  padding:4px 7px;border-radius:8px;
}
.toc a:hover .t{text-decoration:underline}
.toc .n{min-width:1.7em}
.toc .sub .n{font-weight:normal}
.toc .t{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:1}
.toc .leader{flex:1;border-bottom:1px dotted var(--muted);transform:translateY(-3px);min-width:12px}
.toc .pg{color:var(--muted);font-variant-numeric:tabular-nums;font-weight:normal}
.toc .sub{margin-top:2px;padding-left:1.5em}
.toc .sub li{margin:1px 0}

/* current section: accent pill */
.toc a[aria-current]{background:var(--accent);color:#fff}
html[data-style="nereu"] .toc a[aria-current]{border-radius:8px;box-shadow:2px 2px rgba(35,73,105,.3)}
.toc a[aria-current] .leader{border-bottom-color:rgba(255,255,255,.7)}
.toc a[aria-current] .pg{color:#fff}

/* future issues: greyed, badged */
.toc .soon{opacity:.55}
.toc .soon a{cursor:default;font-weight:normal}
.toc .soon .badge{
  font-size:8px;font-weight:900;letter-spacing:.8px;text-transform:uppercase;
  border:1px solid var(--muted);color:var(--muted);
  padding:1px 5px;border-radius:999px;
}
html[data-style="nereu"] .toc .soon .badge{border-radius:6px}

/* Bibi lives at the bottom of the rail, like the portal's host bubble */
.rail-host{
  margin-top:12px;display:flex;gap:8px;align-items:center;flex-shrink:0;
  padding:8px;border:var(--border-w) solid var(--line);border-radius:12px;
  background:var(--soft);font-size:10px;line-height:1.3;
}
.rail-host img{width:34px;height:34px;object-fit:contain}

/* ── Content panel ── */
.content{
  background:var(--panel);border:var(--border-w) solid var(--line);
  border-radius:var(--radius);box-shadow:var(--shadow);
  min-width:0;overflow:hidden;
}

.running-head{
  position:sticky;top:0;z-index:5;background:var(--panel);
  display:flex;justify-content:space-between;align-items:center;gap:16px;
  padding:12px 34px;
  border-bottom:var(--border-w) solid var(--line);
  font-size:11px;font-weight:bold;
}
.running-head .crumb .sep{color:var(--muted);padding:0 6px}
.running-head .folio{
  color:var(--muted);letter-spacing:1px;font-variant-numeric:tabular-nums;
  white-space:nowrap;font-size:9.5px;
}

.article{padding:30px 34px 10px;max-width:calc(var(--measure) + 68px)}

.kicker{
  display:inline-block;margin-bottom:14px;padding:3px 11px;
  background:var(--purple);color:#fff;border-radius:999px;
  font-size:9px;font-weight:900;letter-spacing:1.2px;text-transform:uppercase;
}
html[data-style="nereu"] .kicker{border:2px solid var(--line);border-radius:7px}

h2.section{
  font-size:30px;font-weight:900;line-height:1.05;letter-spacing:-.5px;
  border-bottom:3px solid var(--accent);padding-bottom:12px;margin-bottom:20px;
  display:flex;gap:16px;align-items:baseline;
}
h2.section .no{color:var(--accent)}
h3{font-size:18px;margin:28px 0 10px}
.byline{
  font-size:10px;font-weight:bold;letter-spacing:1.2px;text-transform:uppercase;
  color:var(--muted);margin:-10px 0 20px;
}

.article p{
  font-family:var(--prose);
  font-size:16px;line-height:1.6;
  max-width:var(--measure);
  margin-bottom:14px;
}

/* ── Figures ── */
figure.fig{
  border:var(--border-w) solid var(--line);border-radius:14px;
  overflow:hidden;background:#fff;
  box-shadow:var(--shadow);
  margin:26px 0;max-width:var(--measure);
}
figure.fig .art{display:block;width:100%}
figure.fig figcaption{
  border-top:1px dotted var(--muted);
  padding:9px 13px 11px;font-size:11.5px;line-height:1.45;color:var(--muted);
  background:var(--panel);
}
figure.fig figcaption b{
  display:inline-block;margin-right:6px;padding:1px 8px;
  background:var(--green);color:#fff;border-radius:999px;
  font-size:9px;font-weight:900;letter-spacing:.8px;text-transform:uppercase;
  transform:translateY(-1px);
}
html[data-style="nereu"] figure.fig figcaption b{border:1.5px solid var(--line);border-radius:6px}

/* placeholder art (until a human draws it) */
.fig-placeholder{
  height:210px;display:grid;place-items:center;
  background:var(--soft);
  background-image:repeating-linear-gradient(45deg,transparent 0 8px,rgba(31,41,46,.06) 8px 9px);
  color:var(--muted);font-size:12px;font-style:italic;text-align:center;padding:20px;
}

/* live figure: yellow titlebar, straight from the editor's windows */
.win-title{
  display:flex;align-items:center;gap:9px;
  background:var(--yellow);
  border-bottom:var(--border-w) solid var(--line);
  padding:7px 11px;font-size:10px;font-weight:900;letter-spacing:1.2px;text-transform:uppercase;
}
.win-title .box{
  width:11px;height:11px;border:1.5px solid var(--line);
  border-radius:3px;background:var(--panel);flex:0 0 auto;
}
.live canvas{display:block;width:100%;height:300px}
.win-controls{
  display:flex;gap:22px;flex-wrap:wrap;align-items:center;
  border-top:var(--border-w) solid var(--line);
  background:var(--soft);
  padding:10px 12px;font-size:11px;font-weight:bold;
}
.win-controls label{display:flex;align-items:center;gap:8px}
.win-controls input[type=range]{accent-color:var(--accent);width:130px}
.win-controls output{font-variant-numeric:tabular-nums;color:var(--muted);min-width:4.5ch}

/* ── The "In Nereu:" box — Bibi's aside ── */
aside.in-nereu{
  max-width:var(--measure);
  display:grid;grid-template-columns:44px 1fr;gap:12px;align-items:center;
  border:var(--border-w) solid var(--line);border-radius:14px;
  background:var(--soft);
  padding:13px 15px;margin:26px 0;
  font-size:13px;line-height:1.5;
}
aside.in-nereu img{width:44px;height:44px;object-fit:contain}
aside.in-nereu b.tag{
  display:inline-block;margin-right:6px;padding:1px 8px;
  background:var(--accent);color:#fff;border-radius:999px;
  font-size:9px;font-weight:900;letter-spacing:1px;text-transform:uppercase;
}
html[data-style="nereu"] aside.in-nereu b.tag{border:1.5px solid var(--line);border-radius:6px}

/* ── Footer strip: dark, like the portal footer; holds the skin toggle ── */
.footer-chrome{
  position:fixed;left:0;right:0;bottom:0;z-index:10;
  display:flex;align-items:center;gap:18px;
  padding:10px 18px;background:#223640;color:#dce7eb;font-size:9.5px;
}
.footer-chrome .grow{flex:1}
.skin-toggle{display:flex;align-items:center;gap:5px}
.skin-toggle span{opacity:.7}
.skin-toggle button{
  border:1px solid #4b6472;border-radius:999px;padding:3px 9px;
  background:transparent;color:#dce7eb;font-size:9px;
}
.skin-toggle button.active{background:#fff;color:#223640;border-color:#fff;font-weight:bold}

/* ── Responsive: rail folds above content ── */
@media (max-width:880px){
  .shell{grid-template-columns:1fr;padding:12px 12px 90px}
  .rail{position:static;max-height:none}
  .running-head,.article{padding-left:20px;padding-right:20px}
}

/* ── Print: the booklet falls out of the web page ── */
@media print{
  body{background:#fff}
  .rail,.running-head,.footer-chrome{display:none}
  .shell{display:block;max-width:none;padding:0}
  .content{border:none;box-shadow:none;border-radius:0}
  body{font-size:11pt}
  figure.fig{box-shadow:none}
  .win-controls{display:none}
}
