@import url("./raven/assets/raven-obsidian-noir.css");
:root{color-scheme:dark;background:#07080a;color:#f2ece2;font-family:Arial,sans-serif}
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden}
body{display:grid;grid-template-rows:minmax(0,1fr) auto;height:100dvh;background:#07080a}
#site-stage{position:relative;min-height:0;background:#07080a}
#site-content{display:block;width:100%;height:100%;min-height:0;border:0;background:#07080a}
#site-recovery{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;background:radial-gradient(ellipse 70% 45% at 50% 0%,rgba(212,166,106,.09),#07080a 70%);text-align:center}
#site-recovery[hidden]{display:none}
#site-recovery.is-loading{inset:10px 10px auto;flex-direction:row;flex-wrap:wrap;gap:8px;padding:8px 14px;border:1px solid rgba(212,166,106,.26);border-radius:3px;background:rgba(16,18,24,.94);backdrop-filter:blur(10px);font-size:13px}
#site-recovery.is-loading p{margin:0}
#site-recovery a,#site-retry{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 18px;color:#d4a66a;border:1px solid #826a48;border-radius:3px;background:#101218;font:inherit;transition:border-color 180ms ease,background-color 180ms ease,color 180ms ease}
#site-recovery a:hover,#site-retry:hover{border-color:#d4a66a;background:#171a22;color:#ebd0a5}
#site-retry[hidden]{display:none}
@font-face {
  font-family: RavenPlex;
  src: url("./raven/terminal-preview/assets/ibm-plex-arabic.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: RavenShellDisplay;
  src: url("./raven/terminal-preview/assets/cinzel.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --shell-ink: #07080a;
  --shell-surface: #101218;
  --shell-elevated: #171a22;
  --shell-hover: #1f232e;
  --shell-paper: #f2ece2;
  --shell-muted: #a8a196;
  --shell-rule: #282c36;
  --shell-rule-brass: rgba(212, 166, 106, 0.22);
  --shell-border-control: #826a48;
  --shell-copper: #d4a66a;
  --shell-copper-bright: #ebd0a5;
  --shell-crimson: #9e3b33;
}
body { font-family: RavenPlex, Arial, sans-serif; }
button, summary, select, input { font: inherit; }
button, summary { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--shell-copper-bright);
  outline-offset: -2px;
}
noscript { position:absolute; inset:0; padding:32px; background:var(--shell-ink); }
noscript a { color:var(--shell-copper); }

/* Fixed Obsidian Cinema Transport Bar — stays compact, crisp, and unobtrusive. */
.site-player {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  grid-template-areas: "track transport settings";
  align-items: center;
  gap: clamp(4px,1.5vw,18px);
  min-width: 0;
  color: var(--shell-paper);
  background: linear-gradient(180deg, rgba(16, 18, 24, 0.96), rgba(9, 10, 14, 0.98));
  border-top: 1px solid var(--shell-rule-brass);
  box-shadow: inset 0 1px 0 rgba(242, 236, 226, 0.05), 0 -8px 28px rgba(0, 0, 0, 0.55);
  padding: 0 max(8px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px,env(safe-area-inset-left));
}
.music-controls { grid-area:transport; display:flex; align-items:center; direction:ltr; gap:2px; }
.music-controls button, .music-settings summary {
  position: relative;
  display: inline-grid;
  align-items: center;
  justify-items: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--shell-paper);
  font-size: 0;
  transition: background-color 180ms ease, color 180ms ease;
}
.music-controls button::before, .music-settings summary::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
}
.music-controls button::before, #music-toggle::after { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); }
#music-prev::before, #music-next::before { width:12px; height:12px; clip-path:polygon(0 8%,72% 50%,0 92%,0 8%,82% 8%,100% 8%,100% 92%,82% 92%,82% 8%); }
#music-prev::before { transform:translate(-50%,-50%) rotate(180deg); }
#music-toggle { color:#07080a; }
#music-toggle::after {
  content: "";
  z-index: 0;
  position:absolute;
  width: 30px; height:30px;
  border-radius:50%;
  background: linear-gradient(145deg, #e5bf87, #c69454);
  box-shadow: 0 0 0 1px rgba(235, 208, 165, 0.35), 0 4px 14px rgba(212, 166, 106, 0.25);
  transition: transform 180ms cubic-bezier(.22,1,.36,1), background-color 180ms ease, box-shadow 180ms ease;
}
#music-toggle:hover::after {
  transform: translate(-50%,-50%) scale(1.06);
  background: linear-gradient(145deg, #f2d9b2, #d4a66a);
  box-shadow: 0 0 0 1px rgba(235, 208, 165, 0.6), 0 6px 18px rgba(212, 166, 106, 0.35);
}
#music-toggle::before { z-index:1; width:11px; height:12px; transform:translate(-40%,-50%); clip-path:polygon(0 0,100% 50%,0 100%); }
#music-toggle[aria-pressed="true"]::before { transform:translate(-50%,-50%); clip-path:polygon(0 0,33% 0,33% 100%,0 100%,0 0,67% 0,100% 0,100% 100%,67% 100%,67% 0); }
.music-controls button:hover, .music-settings summary:hover { background: rgba(212, 166, 106, 0.11); color: var(--shell-copper-bright); }
#music-toggle:hover { color: #07080a; background: transparent; }
.music-copy { grid-area:track; min-width:0; padding-inline:clamp(4px,1.5vw,20px) 0; }
.music-track { display:flex; align-items:baseline; gap:.8em; min-width:0; margin:0; font-size:0; line-height:1.2; }
#music-track-title { order:-1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font:500 14px/1.4 RavenPlex,Arial,sans-serif; color:var(--shell-paper); }
#music-track-number { flex:none; margin-inline-start:.65rem; font:400 12px/1.4 RavenPlex,Arial,sans-serif; color:var(--shell-copper); font-variant-numeric:tabular-nums; }
#music-status { margin:0; color:var(--shell-muted); font:400 11px/1.25 RavenPlex,Arial,sans-serif; }
.music-settings { grid-area:settings; border-inline-start:1px solid var(--shell-rule); color:var(--shell-paper); }
.music-settings summary { display:grid; gap:10px; grid-template-columns: auto 10px; font-size:13px; padding:0 12px; list-style:none; }
.music-settings summary::-webkit-details-marker { display:none; }
.music-settings summary::before { display:none; }
.music-settings summary::after {
  content:""; width:7px;height:7px;
  border-top:1.5px solid var(--shell-copper); border-left:1.5px solid var(--shell-copper); transform:translateY(2px) rotate(45deg);
  transition: transform 180ms ease;
}
.music-settings[open] summary::after { transform:translateY(-2px) rotate(225deg); }
.music-settings-panel {
  position:absolute;
  inset-inline-end:max(8px,env(safe-area-inset-right));
  inset-block-end:100%;
  width:min(380px,calc(100% - 16px));
  max-height:calc(100dvh - 56px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y:auto;
  overscroll-behavior:contain;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:8px 16px;
  padding:clamp(16px,2vw,22px);
  border:1px solid var(--shell-rule-brass);
  border-top:2px solid var(--shell-copper);
  border-radius:3px 3px 0 0;
  background:rgba(14, 16, 22, 0.97);
  backdrop-filter:blur(16px);
  box-shadow:0 -18px 50px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(242, 236, 226, 0.06);
  font-size:14px;
}
html[dir="rtl"] .music-settings-panel { inset-inline-end:max(8px,env(safe-area-inset-left)); }
.music-settings-panel > *, .music-settings-panel label { min-width:0; }
.music-track-select, .music-volume { display:grid; align-items:center; gap:5px; }
.music-track-select { grid-column:1/-1; }
.music-track-select > span, .music-volume > span { color:var(--shell-muted); font-size:12px; }
#music-track-picker, #music-mute {
  min-height:44px; padding:6px 12px; border:1px solid var(--shell-border-control);
  border-radius:3px; background:var(--shell-elevated); color:var(--shell-paper);
  transition: border-color 180ms ease, background-color 180ms ease;
}
#music-track-picker:hover, #music-mute:hover { border-color:var(--shell-copper); background:var(--shell-hover); }
#music-track-picker { width:100%; }
#music-volume { width:100%; height:44px; margin:0; accent-color:var(--shell-copper); direction:ltr; }
.music-cinematic, .music-download { display:inline-flex; align-items:center; min-height:44px; gap:8px; }
.music-cinematic { grid-column:1/-1; border-top:1px solid var(--shell-rule); padding-block-start:6px; }
#music-cinematic { width:19px;height:19px; margin:0; accent-color:var(--shell-copper); }
#music-cinematic-hint, #music-volume-hint { grid-column:1/-1; margin:0; color:var(--shell-muted); font-size:12px; line-height:1.55; }
.music-download { grid-column:1/-1; justify-self:start; color:var(--shell-copper); text-underline-offset:4px; }
.music-download:hover { color:var(--shell-copper-bright); }

@media(max-width:600px) {
  .site-player { gap:2px; padding-left:max(4px,env(safe-area-inset-left)); padding-right:max(4px,env(safe-area-inset-right)); }
  .music-track { display:grid; gap:1px; }
  #music-track-title { font-size:13px; }
  #music-track-number { margin:0; font-size:10px; }
  #music-status:not(:empty):not([data-phase="error"]):not([data-phase="blocked"]) { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .music-copy:has(#music-status:is([data-phase="error"],[data-phase="blocked"])) #music-track-number { display:none; }
  #music-status:is([data-phase="error"],[data-phase="blocked"]) { color:var(--shell-copper); font-size:10px; line-height:1.3; }
  .music-settings summary { gap:5px; padding:0 6px; font-size:12px; }
}

/* Keep the archive action and its live availability message outside the
   reading frame on compact phones. */
@media(max-width:600px) {
  body:has(> [data-raven-visitor-widget]) {
    grid-template-rows:minmax(0,1fr) auto auto;
  }
  body > [data-raven-visitor-widget] {
    grid-row:2;
    padding-left:max(8px,env(safe-area-inset-left));
    padding-right:max(8px,env(safe-area-inset-right));
    background:rgba(10, 12, 16, 0.96);
    border-top:1px solid var(--shell-rule);
    text-align:end;
  }
  body:has(> [data-raven-visitor-widget]) .site-player { grid-row:3; }
  body > [data-raven-visitor-widget] .rvw-launcher {
    position:static;
    max-width:100%;
    padding-block:2px;
    line-height:1.3;
    border:0;
    background:transparent;
    box-shadow:none;
  }
  body:has(#music-settings[open]) > [data-raven-visitor-widget] { display:none; }
}
@media(max-height:420px) {
  .music-settings-panel { grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; padding:8px 12px; }
  .music-track-select,.music-volume { grid-template-columns:auto minmax(0,1fr); }
  .music-cinematic { grid-column:1; }
  .music-download { grid-column:2; grid-row:3; }
}

/* ==========================================================================
   ENTRY GATE — Obsidian Archival Noir Cinema Screening Spread
   ========================================================================== */
.archive-entry:not([open]) { display:none; }
.archive-entry {
  position:fixed;
  inset:0;
  width:100%;
  max-width:none;
  height:100dvh;
  max-height:none;
  margin:0;
  padding:0;
  border:0;
  overflow:auto;
  overscroll-behavior:contain;
  background:
    radial-gradient(ellipse 82% 48% at 24% -6%, rgba(212, 166, 106, 0.13) 0%, rgba(16, 18, 24, 0.55) 42%, transparent 72%),
    radial-gradient(ellipse 55% 40% at 86% 100%, rgba(158, 59, 51, 0.08) 0%, transparent 65%),
    #07080a;
  color:var(--shell-paper);
  font-family:RavenPlex,Arial,sans-serif;
}
.archive-entry::backdrop { background:#040507; }
.archive-entry-bar {
  position:sticky;
  top:0;
  z-index:3;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  padding:max(8px,env(safe-area-inset-top)) max(5vw,env(safe-area-inset-right)) 8px max(5vw,env(safe-area-inset-left));
  background:rgba(7, 8, 10, 0.86);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--shell-rule-brass);
}
.archive-wordmark {
  font:500 1.48rem/1 RavenShellDisplay,Georgia,serif;
  letter-spacing:.26em;
  color:var(--shell-paper);
}
.archive-bar-actions { display:flex; align-items:center; gap:.85rem; }
#archive-language {
  min-width:44px;
  min-height:44px;
  border:1px solid transparent;
  border-radius:3px;
  background:transparent;
  color:var(--shell-copper);
  font:500 .875rem/1 RavenPlex,Arial,sans-serif;
  transition:border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}
#archive-language:hover { border-color:var(--shell-rule-brass); background:rgba(212,166,106,.08); color:var(--shell-copper-bright); }
.archive-entry button, .archive-entry a { font-family:inherit; }
#archive-skip, #archive-enter, .archive-sound {
  min-height:44px;
  padding:5px 0;
  border:0;
  background:transparent;
  color:var(--shell-paper);
  font-size:.875rem;
  transition:color 180ms ease;
}
#archive-skip { display:inline-flex; align-items:center; gap:.7em; }
#archive-skip::after, .archive-night-shortcuts a::after {
  content:"";
  width:7px;
  height:7px;
  border-block-start:1.5px solid currentColor;
  border-inline-end:1.5px solid currentColor;
  transform:rotate(45deg);
  transition:transform 200ms cubic-bezier(.22,1,.36,1);
}
.archive-entry[dir="rtl"] #archive-skip::after,
.archive-entry[dir="rtl"] .archive-night-shortcuts a::after { transform:rotate(-45deg); }
.archive-spread {
  display:grid;
  align-content:center;
  align-items:center;
  grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);
  gap:clamp(1.75rem,5vh,3.75rem) clamp(2rem,6vw,6.5rem);
  max-width:100rem;
  min-height:calc(100dvh - 64px);
  margin:auto;
  padding:clamp(1.5rem,5vh,4.5rem) max(5vw,env(safe-area-inset-right)) max(2rem,env(safe-area-inset-bottom)) max(5vw,env(safe-area-inset-left));
}
.archive-featured, .archive-screen { min-width:0; }
.archive-featured { container-type:inline-size; }
.archive-entry-media {
  position:relative;
  aspect-ratio:910/512;
  overflow:hidden;
  background:#050608;
  border:1px solid var(--shell-rule-brass);
  border-bottom:0;
  border-radius:3px 3px 0 0;
  box-shadow:0 24px 64px rgba(0, 0, 0, 0.72);
}
.archive-entry-art, .archive-intro { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.archive-intro, .archive-sound { display:none; }
.archive-sound {
  position:absolute;
  inset-block-end:.65rem;
  inset-inline-end:.65rem;
  padding:.4em .85em;
  border:1px solid var(--shell-border-control);
  border-radius:3px;
  background:rgba(7, 8, 10, 0.9);
  backdrop-filter:blur(8px);
}
.archive-entry.is-intro .archive-intro, .archive-entry.is-intro .archive-sound { display:block; }
.archive-entry-content { min-width:0; container-type:inline-size; }
.archive-feature h1 {
  margin:0;
  font:400 clamp(2.25rem,4.2vw,4.35rem)/1.2 RavenShellDisplay,Georgia,serif;
  letter-spacing:-.025em;
  color:var(--shell-paper);
  text-wrap:balance;
}
.archive-entry[dir="rtl"] h1 { font-family:RavenPlex,Arial,sans-serif; font-weight:600; letter-spacing:0; }
#archive-entry-copy {
  margin:0 0 .5em;
  color:var(--shell-copper);
  font-size:.875rem;
  letter-spacing:.03em;
}
.archive-entry a { display:flex; align-items:center; min-height:44px; color:inherit; text-decoration:none; transition:color 180ms ease, background-color 180ms ease, border-color 180ms ease; }
.archive-entry a:hover, #archive-enter:hover, #archive-skip:hover { color:var(--shell-copper-bright); text-decoration:underline; text-underline-offset:.28em; }
.archive-story-shortcuts {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  border:1px solid var(--shell-rule-brass);
  border-radius:0 0 3px 3px;
  background:linear-gradient(180deg, #13161e, #0e1016);
  box-shadow:inset 0 1px 0 rgba(242, 236, 226, 0.05), 0 14px 36px rgba(0, 0, 0, 0.5);
}
.archive-story-shortcuts a {
  justify-content:center;
  gap:.7rem;
  min-height:54px;
  padding:.5rem .8rem;
  text-align:center;
  line-height:1.4;
  font-weight:500;
}
.archive-story-shortcuts a+a { border-inline-start:1px solid var(--shell-rule); }
.archive-story-shortcuts a:hover { background:#1a1e29; text-decoration:none; color:var(--shell-copper-bright); }
.archive-story-shortcuts a::before { content:""; flex:none; color:var(--shell-copper); }
#archive-episodes::before {
  border-block:5px solid transparent;
  border-left:8px solid currentColor;
}
#archive-case::before {
  width:13px; height:10px;
  border:1.5px solid currentColor;
  border-radius:1px;
  background:linear-gradient(currentColor,currentColor) 2px 2px / 6px 1px no-repeat;
}
.archive-play { margin-block:clamp(1.25rem,3.5vh,2.4rem) .55rem; }
#archive-play-edit {
  justify-content:space-between;
  gap:1rem;
  padding:.72em 1.2em;
  min-height:50px;
  border-radius:3px;
  background:linear-gradient(135deg, #e0b67a 0%, #c69454 100%);
  color:#07080a;
  font-weight:700;
  box-shadow:inset 0 1px 0 rgba(255, 248, 234, 0.4), 0 10px 28px rgba(212, 166, 106, 0.22);
  transition:transform 200ms cubic-bezier(.22,1,.36,1), box-shadow 200ms ease, filter 200ms ease;
}
#archive-play-edit:hover {
  color:#07080a;
  text-decoration:none;
  filter:brightness(1.08);
  transform:translateY(-1px);
  box-shadow:inset 0 1px 0 rgba(255, 248, 234, 0.55), 0 14px 34px rgba(212, 166, 106, 0.32);
}
#archive-play-edit::after {
  content:""; width:8px; height:8px;
  border-block-start:2px solid currentColor;
  border-inline-end:2px solid currentColor;
  transform:rotate(45deg);
}
.archive-entry[dir="rtl"] #archive-play-edit::after { transform:rotate(-45deg); }
.archive-time-shortcuts { display:flex; flex-wrap:wrap; gap:0 1.6rem; }
.archive-time-shortcuts a {
  gap:.5rem;
  padding:.25em 0;
  color:var(--shell-paper);
  font-size:.94rem;
  text-decoration:underline;
  text-decoration-color:rgba(212, 166, 106, 0.45);
  text-underline-offset:.38em;
}
.archive-night-shortcuts {
  grid-column:1/-1;
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  border-block:1px solid var(--shell-rule-brass);
  background:rgba(16, 18, 24, 0.55);
}
.archive-night-shortcuts a {
  justify-content:space-between;
  gap:.4rem;
  padding:.65em clamp(.55rem,1.4vw,1.35rem);
  font-size:.96rem;
  min-height:54px;
}
.archive-night-shortcuts a+a { border-inline-start:1px solid var(--shell-rule); }
.archive-night-shortcuts a:hover { background:rgba(212, 166, 106, 0.08); text-decoration:none; color:var(--shell-copper-bright); }
.archive-night-shortcuts a::after { flex-shrink:0; width:5px; height:5px; margin-inline-end:3px; color:var(--shell-copper); }
#archive-enter { padding-inline:0; margin-block-start:.45rem; color:var(--shell-muted); font-size:.82rem; }
#archive-enter::before { content:"♪" / ""; display:inline; margin-inline-end:.5em; color:var(--shell-copper); }

@media(max-width:780px) {
  .archive-entry-bar { padding:2px max(1.25rem,env(safe-area-inset-right)) 2px max(1.25rem,env(safe-area-inset-left)); }
  .archive-wordmark { font-size:1.25rem; }
  .archive-spread {
    display:block;
    min-height:0;
    max-width:38rem;
    padding:0 0 max(1.25rem,env(safe-area-inset-bottom));
  }
  .archive-entry-media { border-inline:0; border-radius:0; }
  .archive-entry-content {
    padding:clamp(1.1rem,4vw,1.8rem) max(1.25rem,env(safe-area-inset-right)) 0 max(1.25rem,env(safe-area-inset-left));
  }
  .archive-feature h1 { font-size:clamp(2rem,7vw,3.2rem); }
  .archive-story-shortcuts { border-inline:0; border-radius:0; }
  .archive-play { margin-block:.95rem .25rem; }
  .archive-night-shortcuts {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 1.25rem; margin:.9rem 1.25rem 0; border-block-end:0; background:transparent;
  }
  .archive-night-shortcuts a, .archive-night-shortcuts a+a { min-height:44px; padding:.38em 0; border-inline-start:0; border-block-end:1px solid var(--shell-rule); }
  .archive-story-shortcuts a { min-height:48px; padding:.46rem .5rem; gap:.42rem; font-size:clamp(.875rem,3.6vw,1rem); }
  .archive-sound { font-size:.8rem; }
}
@media(min-width:580px) and (max-height:480px) {
  .archive-spread { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:start; gap:3vw; max-width:none; padding:1rem 3vw; }
  .archive-entry-content { padding:0; }
  .archive-feature h1 { font-size:2rem; }
  .archive-night-shortcuts { margin-inline:0; grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { transition:none !important; animation:none !important; }
}

.archive-entry.is-fallback.art-unavailable .archive-spread {
  display:grid;
  align-content:center;
  grid-template-columns:minmax(0,1fr);
  max-width:46rem;
}
.archive-entry.is-fallback.art-unavailable .archive-screen { display:none; }

@container (max-width:16.75rem) {
  .archive-story-shortcuts { grid-template-columns:minmax(0,1fr); }
  .archive-story-shortcuts a+a { border-inline-start:0; border-block-start:1px solid var(--shell-rule); }
}
