/* xanadu.science — light-academia research portal
   Centered manuscript column, leather sidebars, jewel-toned drop caps,
   brass HUD instruments. Palette: ivory, lapis, emerald, amethyst, brass.  */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ivory: #f5f0e5;
  --lapis: #2a4a8a;
  --emerald: #2a6a4a;
  --amethyst: #6a2a7a;
  --brass: #b89040;
  --text: #2a2418;
  --text-secondary: #6a5e48;
  --leather: #5a4030;
}

html, body {
  background: var(--ivory);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 18px;
  line-height: 1.85;
  min-height: 100vh;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* === LEATHER BOOK BINDING SIDEBARS === */
.binding {
  position: fixed;
  top: 0;
  width: 80px;
  height: 100vh;
  z-index: 5;
  pointer-events: none;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.35);
}
.binding-left { left: 0; border-right: 1px solid var(--brass); }
.binding-right { right: 0; border-left: 1px solid var(--brass); }
.binding svg { width: 80px; height: 100%; display: block; }

/* Faint stitched seam parallel to the spine */
.binding::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background-image: repeating-linear-gradient(to bottom,
    rgba(184, 144, 64, 0.65) 0 6px,
    transparent 6px 14px);
}
.binding-left::before { right: 14px; }
.binding-right::before { left: 14px; }

@media (max-width: 720px) {
  .binding { width: 24px; }
  .binding svg { width: 24px; }
  .binding-left::before { right: 6px; }
  .binding-right::before { left: 6px; }
}

/* === OBSERVATORY PORTAL === */
.portal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 100px 80px;
  position: relative;
  text-align: center;
}

.portal-frame {
  position: relative;
  width: min(420px, 80vw);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-circle {
  width: 200px;
  height: 200px;
  border: 1px solid var(--lapis);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: radial-gradient(circle at center,
    rgba(245, 240, 229, 1) 60%,
    rgba(184, 144, 64, 0.05) 100%);
  box-shadow: 0 0 0 8px rgba(184, 144, 64, 0.07),
              0 0 0 9px rgba(42, 74, 138, 0.18);
  transition: box-shadow 0.4s ease;
}
.portal-circle:hover {
  box-shadow: 0 0 0 8px rgba(184, 144, 64, 0.14),
              0 0 0 9px rgba(42, 74, 138, 0.30);
}

.portal-title {
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: clamp(13px, 1.5vw, 16px);
  letter-spacing: 0.18em;
  color: var(--lapis);
  font-weight: 500;
}
.portal-subtitle {
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-secondary);
  margin-top: 8px;
}

.cardinal {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 10px;
  color: var(--brass);
  letter-spacing: 0.15em;
}
.cardinal em { font-style: normal; }
.cardinal-n { top: 0; left: 50%; transform: translateX(-50%); }
.cardinal-e { right: 0; top: 50%; transform: translateY(-50%); }
.cardinal-s { bottom: 0; left: 50%; transform: translateX(-50%); }
.cardinal-w { left: 0; top: 50%; transform: translateY(-50%); }

.portal-meta {
  margin-top: 56px;
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
}

@media (max-width: 720px) {
  .portal { padding: 100px 40px 60px; }
}

/* === MANUSCRIPT BODY === */
.manuscript {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 24px 160px;
  position: relative;
  z-index: 2;
}

.manuscript article {
  margin: 80px 0;
  position: relative;
  padding: 0 4px;
  border-left: 1px solid rgba(184, 144, 64, 0.25);
  border-right: 1px solid rgba(184, 144, 64, 0.25);
  padding-left: 18px;
  padding-right: 18px;
}

.section-mark {
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: clamp(13px, 1.5vw, 15px);
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--brass);
  margin-bottom: 18px;
  text-transform: uppercase;
}

.manuscript article p {
  margin-bottom: 1.4em;
}

.manuscript article p em {
  font-style: italic;
  color: var(--text-secondary);
}

/* Jewel-toned drop caps, rotating: lapis, emerald, amethyst */
.manuscript article:nth-of-type(3n+1) p:first-of-type::first-letter {
  font-family: 'Cinzel', serif;
  font-size: 4em;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.12em 0 0;
  color: var(--lapis);
  text-shadow: 2px 2px 8px rgba(42, 74, 138, 0.20);
  font-weight: 700;
}
.manuscript article:nth-of-type(3n+2) p:first-of-type::first-letter {
  font-family: 'Cinzel', serif;
  font-size: 4em;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.12em 0 0;
  color: var(--emerald);
  text-shadow: 2px 2px 8px rgba(42, 106, 74, 0.20);
  font-weight: 700;
}
.manuscript article:nth-of-type(3n+3) p:first-of-type::first-letter {
  font-family: 'Cinzel', serif;
  font-size: 4em;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.12em 0 0;
  color: var(--amethyst);
  text-shadow: 2px 2px 8px rgba(106, 42, 122, 0.20);
  font-weight: 700;
}

/* HUD divider inside articles */
.hud-divider {
  display: flex;
  justify-content: center;
  margin: 0 0 20px;
  opacity: 0.85;
}

/* Free-standing HUD instrument, between articles */
.hud-instrument {
  display: flex;
  justify-content: center;
  margin: 60px 0;
  cursor: pointer;
  outline: none;
}
.hud-instrument svg {
  transition: transform 0.2s ease;
}
.hud-instrument:focus svg { filter: drop-shadow(0 0 6px rgba(184, 144, 64, 0.7)); }

/* Catalog list */
.catalog {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  border-top: 1px dashed rgba(184, 144, 64, 0.4);
}
.catalog li {
  border-bottom: 1px dashed rgba(184, 144, 64, 0.4);
  padding: 14px 0;
  font-size: 0.96em;
}
.catalog .entry-id {
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 0.85em;
  color: var(--brass);
  letter-spacing: 0.12em;
  margin-right: 8px;
}
.catalog em {
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* Manuscript footer */
.manuscript-foot {
  margin-top: 100px;
  text-align: center;
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-secondary);
  padding-top: 40px;
  border-top: 1px solid rgba(184, 144, 64, 0.3);
}

/* === ELASTIC BOUNCE === */
@keyframes elastic-bounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.15); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.elastic-bounce {
  animation: elastic-bounce 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* === RESPONSIVE === */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .manuscript { padding: 0 36px 120px; }
  .manuscript article { padding-left: 12px; padding-right: 12px; }
  .portal-circle { width: 160px; height: 160px; }
}
