/* Restored sections share the film's paper, graphite and gold. */
[hidden] { display: none !important; }
.restored-nav {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px;
  padding: 18px 0; border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.restored-nav a { font-size: 13px; text-decoration: none; color: var(--muted); padding: 8px 0; }
.restored-nav a[aria-current] { color: var(--ink); box-shadow: 0 1px var(--gold); }
.restored-nav .all-sections { margin-left: auto; color: var(--ink); }
#restored-view { min-height: 55vh; padding: 20px 0 60px; }
.restore-heading {
  display: flex; justify-content: space-between; align-items: start; gap: 20px;
  padding: 35px 0 45px; border-bottom: 1px solid var(--line); margin-bottom: 28px;
  background: radial-gradient(ellipse at 85% 70%, #b18b4210, transparent 55%);
}
.restore-heading small { font: 10px Georgia, serif; letter-spacing: .22em; color: var(--muted); }
.restore-heading h1 { margin: 18px 0; font-size: clamp(35px, 5vw, 62px); }
.restore-heading p { color: var(--muted); font-size: 13px; line-height: 1.9; }
.restore-heading>a { flex-shrink: 0; font-size: 12px; margin-top: 24px; }
.restore-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; margin: 22px 0; }
.restore-controls label, .source-search { display: grid; gap: 8px; font-size: 11px; color: var(--muted); }
.restore-controls input, .restore-controls select, .source-search input {
  padding: 11px 12px; max-width: 230px; min-width: 125px; background: #fff6;
  border: 1px solid var(--line); border-radius: 3px; color: var(--ink); font: inherit; font-size: 13px;
}
.restore-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.restore-tabs [aria-pressed=true], .restore-tabs [aria-current] { color: var(--paper); background: var(--ink); }
.restore-count { font-size: 11px; letter-spacing: .05em; color: var(--muted); margin: 26px 0; }
.restore-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; align-items: start; }
.restore-card { border: 1px solid var(--line); border-radius: 2px; background: #faf7f070; min-width: 0; }
.restore-card>summary { padding: 24px; cursor: pointer; list-style: none; position: relative; }
.restore-card>summary::-webkit-details-marker { display: none; }
.restore-card>summary:after { content: '+'; position: absolute; top: 20px; right: 18px; color: var(--gold); }
.restore-card[open]>summary:after { content: '−'; }
.restore-card>summary>small { display: block; font-size: 10px; color: var(--muted); padding-right: 18px; }
.restore-card h2 { font-family: 'KaiTi', 'Songti SC', Georgia, serif; font-size: 24px; font-weight: 400; line-height: 1.55; margin: 12px 0; }
.restore-card>summary>span { display: block; font-size: 11px; color: var(--muted); line-height: 1.8; overflow-wrap: anywhere; }
.restore-detail { padding: 0 24px 25px; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.restore-detail h3 { font-size: 12px; font-weight: 600; margin: 25px 0 7px; }
.restore-detail p { white-space: pre-line; margin: 7px 0 20px; }
.restore-detail .source { margin: 10px 0; font-size: 12px; }
.restore-detail .source small { line-height: 1.8; }
.restore-related { display: flex; gap: 12px 18px; flex-wrap: wrap; margin: 20px 0; }
.restore-related a { color: var(--accent); text-underline-offset: 5px; font-size: 12px; }
.restore-note { border: 0; border-top: 1px solid var(--line); padding: 18px 0; margin-top: 24px; }
.restore-note>summary { cursor: pointer; font-size: 13px; color: var(--ink); margin-bottom: 12px; }
.restore-note p { color: var(--muted); font-size: 12px; line-height: 2; max-width: 82ch; }
.section-index { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0 25px; }
.section-index details { border-bottom: 1px solid var(--line); padding: 25px 0; }
.section-index summary { cursor: pointer; }
.section-index small { font: 11px Georgia, serif; color: var(--gold); }
.section-index h2 { font-family: 'KaiTi', 'Songti SC', serif; font-size: 27px; font-weight: 400; display: inline; margin-left: 18px; }
.section-index p { font-size: 12px; line-height: 2; color: var(--muted); }
.section-index .pill { display: inline-block; font-size: 11px; margin-top: 10px; }
.life-sky {
  display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 28px; padding: 28px 0 45px;
  background-image: radial-gradient(#403a2326 1px, transparent 1px); background-size: 37px 37px;
}
.life-circle {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; min-width: 0; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 22px; gap: 12px; background: radial-gradient(circle at 30% 24%, #fff8, #e9e2d380);
  text-decoration: none; position: relative; transition: border-color .2s, background .2s;
}
.life-circle:before { content: ''; border: 1px solid #b18b4225; position: absolute; inset: 5px -3px; border-radius: 50%; transform: rotate(22deg); pointer-events: none; }
.life-circle small { font-size: 9px; color: var(--muted); }
.life-circle span { font: 19px/1.6 'KaiTi', 'Songti SC', serif; }
.life-circle:hover, .life-circle:focus-visible { border-color: var(--gold); background: #e8dcc1; }
.life-circle:nth-child(even) { transform: translateY(20px); }
.private-workbench { display: grid; grid-template-columns: minmax(0,1fr) 230px; gap: 28px; margin: 25px 0; }
.private-workbench>[data-calculator-host] { border: 1px solid var(--line); padding: 20px; background: #faf7f0; min-width: 0; }
.private-workbench h2 { font-size: 21px; font-weight: 400; }
.private-workbench p { font-size: 13px; line-height: 1.9; }
.private-calculator { border: 0; display: block; width: 100%; height: 870px; background: #faf7f0; }
.private-workbench:has(iframe)>[data-calculator-host] { padding: 0; }
.watch-status { display: flex; align-items: center; gap: 9px; margin: 20px 0 35px; font-size: 12px; color: var(--muted); }
.watch-status>span { width: 8px; height: 8px; border: 1px solid var(--muted); border-radius: 50%; }
.order-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.order-pair>a { padding: 45px 25px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.order-pair small { color: var(--gold); letter-spacing: .15em; font: 11px Georgia,serif; }
.order-pair h2 { font: 38px 'KaiTi',serif; margin: 30px 0; }
.order-pair p { font-size: 13px; color: var(--muted); }
.restore-sources { margin-top: 25px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.restore-sources>div { min-width: 0; overflow-wrap: anywhere; }
.restore-empty { grid-column: 1/-1; }
#restored-view a:focus-visible, #restored-view button:focus-visible, #restored-view summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
@media(max-width:1000px) {
  .restore-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .section-index { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .life-sky { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
}
@media(max-width:700px) {
  .restore-heading { display: block; padding-top: 20px; }
  .restore-heading h1 { font-size: 40px; }
  .restore-heading>a { display: inline-block; margin: 12px 0 0; }
  .restore-grid, .private-workbench, .restore-sources, .order-pair { grid-template-columns: 1fr; }
  .section-index { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
  .section-index h2 { font-size: 23px; margin-left: 9px; }
  .life-sky { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
  .life-circle { padding: 15px; }
  .life-circle span { font-size: 18px; }
  .restore-controls>label { flex: 1 1 135px; min-width: 0; }
  .restore-controls input, .restore-controls select { width: 100%; max-width: 100%; }
  .restored-nav { gap: 6px 20px; }
  .restored-nav .all-sections { margin-left: 0; }
  .private-calculator { height: 1100px; }
  .restore-card>summary, .restore-detail { padding-left: 18px; padding-right: 18px; }
}
@media(prefers-reduced-motion:reduce) { .life-circle { transition: none; } }

/* Fate methods: compact grid, distinct input and reading states. */
.fate-method-nav { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.fate-method-nav .pill { display:grid; gap:9px; padding:18px 10px; min-height:78px; text-align:center; border-radius:3px; text-decoration:none; white-space:normal; }
.fate-method-nav small { font-size:10px; opacity:.72; }
.fate-step { font:11px Georgia,serif; letter-spacing:.12em; color:var(--muted); }
.private-workbench>[data-calculator-host]>button { min-height:44px; }
@media(max-width:1050px) { .fate-method-nav { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media(max-width:600px) { .fate-method-nav { grid-template-columns:repeat(2,minmax(0,1fr)); } .fate-method-nav .pill { padding:15px 10px; } }

/* Space + time: lightweight dimensional navigation, no external assets. */
body { --ui-radius:18px; }
.bubble-entry { display:inline-flex; align-items:center; min-height:44px; text-decoration:none; }
.restored-nav .all-sections { border:1px solid var(--line); padding:9px 17px; border-radius:30px; }
.bubble-hub { display:block; padding:0; }
.bubble-toolbar { display:flex; align-items:end; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.bubble-filters { display:flex; flex-wrap:wrap; gap:7px; }
.bubble-filters button,.bubble-pagination button,.bubble-meta button {
  font:inherit; font-size:12px; min-height:44px; border:1px solid var(--line); border-radius:30px;
  background:transparent; color:var(--ink); padding:10px 17px; cursor:pointer;
}
.bubble-filters button[aria-pressed=true] { background:#252824; color:#f8f6ef; border-color:#252824; }
.bubble-search { display:grid; gap:7px; font-size:11px; color:var(--muted); }
.bubble-search input { border:0; border-bottom:1px solid var(--line); color:var(--ink); background:transparent; min-height:44px; font:inherit; font-size:16px; width:200px; border-radius:0; }
.bubble-meta { display:flex; align-items:center; gap:14px; margin:22px 0 0; font:11px Georgia,serif; color:var(--muted); }
.bubble-meta button { margin-left:auto; border:0; }
.bubble-grid {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:28px 40px; padding:22px 24px 30px;
  max-width:1060px; margin:auto; perspective:1000px;
  background:radial-gradient(ellipse at 50% 48%,#d5d6c743,transparent 70%);
}
.bubble-cell { min-width:0; text-align:center; --bubble-hue:45; }
.tone-cosmos { --bubble-hue:205; }
.tone-letters { --bubble-hue:36; }
.tone-lives { --bubble-hue:150; }
.tone-tools { --bubble-hue:80; }
.feature-bubble {
  aspect-ratio:1; width:100%; max-width:238px; margin:auto; position:relative; isolation:isolate;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:18px;
  border-radius:50%; color:#202722; text-decoration:none; transform-style:preserve-3d;
  transform:rotateY(var(--bubble-x,0deg)) rotateX(var(--bubble-y,0deg)); transition:transform .25s ease,box-shadow .25s;
}
.feature-bubble:before {
  content:''; position:absolute; inset:0; z-index:-1; border-radius:50%; border:1px solid #fff9;
  background:radial-gradient(ellipse at 30% 18%,#fffffff5,transparent 35%),
    radial-gradient(circle at 68% 80%,hsla(var(--bubble-hue),23%,58%,.46),transparent 62%),
    radial-gradient(circle at 42% 37%,#f7f8f0 20%,hsla(var(--bubble-hue),20%,88%,.9) 52%,#747e7270 83%,#fff8 97%);
  box-shadow:inset 0 0 24px #fff8,inset -10px -18px 28px #53595035,0 21px 29px -20px #35413280;
  animation:bubble-breathe 7s ease-in-out infinite alternate;
}
.feature-bubble:after { content:''; position:absolute; inset:13% -4%; border:1px solid #52645538; border-radius:50%; transform:rotate(-32deg); pointer-events:none; }
.bubble-cell:nth-child(2n) .feature-bubble:before { animation-delay:-3s; }
.bubble-cell:nth-child(3n) .feature-bubble:after { transform:rotate(35deg); }
.bubble-number { font:10px Georgia,serif; letter-spacing:.2em; opacity:.65; }
.bubble-title { font:clamp(19px,2.5vw,29px)/1.3 'KaiTi','Songti SC',Georgia,serif; letter-spacing:.06em; max-width:83%; overflow-wrap:anywhere; }
.bubble-arrow { font:22px Georgia,serif; opacity:.58; }
.feature-bubble:hover { box-shadow:0 0 0 1px #495d5050; }
.feature-bubble:focus-visible { outline:3px solid #4e755b !important; outline-offset:7px !important; }
.bubble-caption { border:0; margin:17px 0 0; font-size:11px; color:var(--muted); }
.bubble-caption summary { cursor:pointer; width:fit-content; margin:auto; padding:8px 20px; }
.bubble-caption p { font-size:12px; line-height:1.8; max-width:27ch; margin:12px auto; }
.bubble-pagination { display:flex; align-items:center; justify-content:center; gap:25px; border-top:1px solid var(--line); padding-top:22px; }
.bubble-pagination [role=status] { min-width:60px; text-align:center; font:12px Georgia,serif; }
.bubble-pagination button:disabled { opacity:.4; cursor:default; }
.bubble-empty { grid-column:1/-1; text-align:center; padding:70px 15px; }
.bubble-still .feature-bubble:before { animation:none; }
.bubble-still .feature-bubble { transform:none; }
@keyframes bubble-breathe { to { transform:translateY(-5px) scale(.975); filter:brightness(1.04); } }
.world-scene { position:relative; min-height:330px; overflow:hidden; padding:60px 45px; margin:20px 0 28px; border:1px solid var(--line); border-radius:24px; isolation:isolate; }
.scene-copy { position:relative; z-index:2; max-width:58%; }
.scene-copy small { font:10px/1.8 Georgia,serif; letter-spacing:.14em; }
.scene-copy h1 { font:clamp(35px,5vw,65px)/1.2 'KaiTi','Songti SC',Georgia,serif; margin:28px 0 17px; }
.scene-copy p { font-size:13px; line-height:1.8; }
body[data-section-theme=physics] { background:#101318; --ink:#eae8df; --muted:#b3b7bc; --line:#373d46; --gold:#d9b982; }
body[data-section-theme=physics] .world-scene { background:radial-gradient(ellipse at 72% 56%,#343240,#080b11 65%); color:#faf8f2; border-color:#41424a; }
body[data-section-theme=physics] .card,
body[data-section-theme=physics] .tools { --ink:#242820; --muted:#646b64; --line:#cdd1c7; --gold:#80642e; color:var(--ink); background:#f1f0e9; }
body[data-section-theme=physics] .tools { padding:15px; border-radius:14px; }
body[data-section-theme=physics] .card { border-color:#d1d1c9; }
.black-hole { position:absolute; width:50%; height:100%; right:-2%; top:0; pointer-events:none; }
.accretion { position:absolute; width:96%; height:55%; top:27%; left:0; border-radius:50%; transform:rotate(-17deg) scaleY(.39); background:repeating-conic-gradient(from 20deg,#f4dab380 0deg,#7d796738 2deg,#fff6dbb0 4deg,#443b3b80 6deg); box-shadow:0 0 28px #efc09077,inset 0 0 35px #ffd592; filter:blur(1px); }
.event-horizon { position:absolute; width:49%; aspect-ratio:1; left:23%; top:50%; transform:translateY(-50%); border-radius:50%; background:#040508; border:2px solid #ffe4b9; box-shadow:0 0 6px 2px #fff1d0,0 0 19px 8px #dfb27d80,0 0 58px 15px #bfb0ce35; }
.event-horizon:after { content:''; position:absolute; inset:-13px -9px; border:1px solid #ffe5b947; border-radius:50%; transform:rotate(-23deg); }
body[data-section-theme=literature] .world-scene { background:linear-gradient(110deg,#f2eee3 35%,#dfddd1); color:#2c302b; }
.script-cloud { position:absolute; inset:0 0 0 39%; overflow:hidden; color:#4c5b4c; opacity:.22; font-family:'Noto Serif',Georgia,serif; pointer-events:none; }
.script-cloud span { position:absolute; font-size:90px; transform:rotate(-10deg); }
.script-cloud span:nth-child(1) { left:44%; top:20%; font-size:150px; }
.script-cloud span:nth-child(2) { left:4%; top:3%; }
.script-cloud span:nth-child(3) { left:73%; top:3%; }
.script-cloud span:nth-child(4) { left:6%; top:48%; font-size:145px; }
.script-cloud span:nth-child(5) { left:69%; top:57%; }
.script-cloud span:nth-child(6) { left:37%; top:-14%; }
.script-cloud span:nth-child(7) { left:34%; top:71%; }
.script-cloud span:nth-child(8) { left:77%; top:32%; font-size:64px; }
.script-cloud span:nth-child(9) { left:14%; top:80%; font-size:59px; }
.script-cloud span:nth-child(10) { left:89%; top:72%; font-size:56px; }
.script-cloud span:nth-child(11) { left:0; top:29%; font-size:50px; }
body[data-section-theme=library-home] .hero { background:radial-gradient(ellipse at 80% 15%,#a2b49a25,transparent 60%); }
body[data-section-theme=fate] { background-color:#eff2e7; background-image:radial-gradient(ellipse at 80% 10%,#dceaa7aa,transparent 48%); background-size:auto; background-repeat:no-repeat; --ink:#202a24; --muted:#596355; --line:#c3cdb8; --gold:#647c29; }
body[data-section-theme=fate] .restore-heading { position:relative; overflow:hidden; isolation:isolate; padding:35px 30px; background:linear-gradient(110deg,#edf1e7,#dceba7); border:1px solid #bbcba0; border-radius:24px; }
body[data-section-theme=fate] .restore-heading:after { content:''; position:absolute; z-index:-1; right:15%; top:-110px; width:290px; height:290px; border:38px solid #25352d0d; border-radius:50%; box-shadow:0 0 0 1px #45603938,0 0 0 35px #91a16612; }
body[data-section-theme=fate] .restore-heading h1 { font-family:'KaiTi','Songti SC',Georgia,serif; line-height:1.25; }
body[data-section-theme=fate] .fate-method-nav { gap:9px; }
body[data-section-theme=fate] .fate-method-nav .pill { border-radius:17px; background:#ffffff70; border-color:#c1cbb5; transition:background .2s; }
body[data-section-theme=fate] .fate-method-nav .pill[aria-current] { background:#25352a; color:#d9f792; border-color:#25352a; }
body[data-section-theme=fate] .private-workbench>[data-calculator-host] { background:#f9fbf2; border-radius:22px; overflow:hidden; }
body[data-section-theme=fate] .private-calculator { background:#f9fbf2; height:1050px; }
body[data-section-theme=fate] [data-open-calculator] { background:#d5f08e; color:#25332a; border-color:#a3ba6a; font-size:14px; padding:13px 24px; border-radius:28px; }
body[data-section-theme=fate] .private-workbench aside { padding:6px 3px; }
@media(max-width:760px) {
  .bubble-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:25px 20px; padding:20px 8px; }
  .feature-bubble { gap:12px; }
  .bubble-title { font-size:21px; }
  .bubble-search { width:100%; }
  .bubble-search input { width:100%; }
  .bubble-filters { gap:6px; }
  .bubble-filters button { padding:8px 12px; }
  .world-scene { padding:30px 23px; min-height:310px; }
  .scene-copy { max-width:100%; }
  .scene-copy h1 { max-width:75%; }
  .black-hole { width:67%; height:58%; top:44%; right:-18%; opacity:.7; }
  .scene-copy p { max-width:74%; }
  .script-cloud { left:30%; opacity:.13; }
  body[data-section-theme=fate] .restore-heading { padding:26px 21px; }
  body[data-section-theme=fate] .private-calculator { height:1300px; }
}
@media(prefers-reduced-motion:reduce) {
  .feature-bubble,.feature-bubble:before { animation:none; transform:none; transition:none; }
}

/* Keep the global navigation quiet and put the choices closer to the fold. */
body.grid-edition[data-section-theme] .restored-nav {
  display:flex; flex-wrap:wrap; gap:4px 19px; padding:12px 0; margin-bottom:12px;
}
body.grid-edition[data-section-theme] .restored-nav a {
  width:auto; min-width:0; padding:9px 2px; border:0; font-size:12px; min-height:36px;
}
body.grid-edition[data-section-theme] .restored-nav .all-sections {
  margin-left:auto; border:1px solid var(--line); border-radius:25px; padding:9px 18px;
}
body[data-section-theme=compass] .restore-heading { padding:20px 0 24px; margin-bottom:18px; }
body[data-section-theme=compass] .restore-heading h1 { font-size:clamp(34px,4.5vw,52px); margin:15px 0; }
.restore-heading h1:focus { outline:none; }
@media(max-width:600px) {
  body.grid-edition[data-section-theme] .restored-nav { gap:2px 15px; }
  body.grid-edition[data-section-theme] .restored-nav .all-sections { margin-left:0; }
}

/* High-contrast navigation around the black-hole artwork. */
body[data-section-theme=physics] main { background:#191f27; }
body[data-section-theme=physics] header { color:#eef0e9; }
body[data-section-theme=physics] header :is(a,span,strong,b,label,small) { color:#eef0e9; }
body[data-section-theme=physics] header select { color:#242c25; background:#f2f1e8; border-color:#b6c2b2; }
body[data-section-theme=physics] :is(.restored-nav a,.pathways a,#filters a) { color:#dce5dc; }
body[data-section-theme=physics] .pathways a * { color:inherit; }
body[data-section-theme=physics] :is(.restored-nav a,#filters a)[aria-current] { color:#f3edcf; border-color:#a9b59c; background:#303a38; }
body[data-section-theme=physics] #workspace>.tools { color:#243126; }
body[data-section-theme=physics] #workspace>details { color:#e4e9e1; background:#212a34; border-color:#647061; }
body[data-section-theme=physics] #workspace>details>summary { color:#e4e9e1; }
body[data-section-theme=physics] footer { color:#c2cbbf; }


