@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=IM+Fell+DW+Pica:ital@0;1&display=swap');

/* ============================================================
   looks.css — MoribundMurdoch
   Chalkboard dark · IM Fell · Purple ink
   ============================================================ */

:root {

  /* ---------- chalkboard palette ---------- */
  --bg:          #08080c;
  --bg-soft:     #101018;
  --bg-deep:     #040407;

  --chalk:       #f0ece2;
  --chalk-dim:   #d4cfc4;
  --muted:       #8f8a82;
  --muted-soft:  #b5b0a8;

  /* ---------- purple ink system ---------- */
  --accent:      #b89cff;
  --accent-soft: #cdbdff;
  --accent-dim:  #8a6fd4;
  --accent-pale: #6e56b0;
  --accent-glow: rgba(184,156,255,.20);
  --accent-bg:   rgba(184,156,255,.08);
  --accent-bg2:  rgba(184,156,255,.14);

  /* ---------- surfaces ---------- */
  --card:        #0e0e16;
  --card-soft:   #14141f;
  --card-hover:  #161624;
  --line:        #252232;
  --line-strong: #352f4a;
  --line-soft:   #1c1a27;

  /* ---------- tokens ---------- */
  --radius:      14px;
  --radius-sm:   8px;
  --radius-lg:   20px;
  --shadow:      0 16px 48px rgba(0,0,0,.65);
  --shadow-sm:   0 4px 16px rgba(0,0,0,.40);
  --shadow-glow: 0 0 32px rgba(184,156,255,.10);

  /* ---------- animation ---------- */
  --ease-out:    cubic-bezier(.16,1,.3,1);
  --ease-in-out: cubic-bezier(.45,0,.55,1);
  --dur-fast:    120ms;
  --dur-mid:     200ms;
  --dur-slow:    350ms;
}


/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  position: relative;
  overflow-x: hidden;

  font-family: "IM Fell English", "Georgia", serif;
  line-height: 1.7;
  letter-spacing: .022em;
  color: var(--chalk);

  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 40% at 15% 0%,   rgba(184,156,255,.07) 0%, transparent 100%),
    radial-gradient(ellipse 50% 30% at 85% 5%,   rgba(120,90,200,.05)  0%, transparent 100%),
    radial-gradient(ellipse 80% 50% at 50% 110%,  rgba(255,255,255,.02) 0%, transparent 100%),
    linear-gradient(175deg, #141420 0%, #0d0d16 35%, #08080c 100%);
  min-height: 100vh;
}

/* Chalk grain texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .09;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Faint ruled-line feel across the page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .025;
  background-image: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 27px,
    rgba(255,255,255,.6) 27px,
    rgba(255,255,255,.6) 28px
  );
}

body > * {
  position: relative;
  z-index: 1;
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4 {
  font-family: "IM Fell DW Pica", "IM Fell English", serif;
  font-weight: 400;
  font-style: normal;
  letter-spacing: .05em;
  margin: .15em 0 .5em;
  color: var(--chalk);
  line-height: 1.25;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; letter-spacing: .06em; }
h4 { font-size: 1.05rem; color: var(--chalk-dim); }

p {
  margin: 0 0 1rem;
}

em, i {
  font-style: italic;
  color: var(--chalk-dim);
}

code {
  font-family: "Courier New", monospace;
  font-size: .85em;
  background: rgba(184,156,255,.08);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .1em .4em;
  color: var(--accent-soft);
}


/* ============================================================
   LINKS
   ============================================================ */

a {
  color: var(--chalk-dim);
  text-decoration: none;
  transition:
    color       var(--dur-mid) var(--ease-out),
    text-shadow var(--dur-mid) var(--ease-out),
    opacity     var(--dur-fast) ease;
}

a:hover {
  color: var(--accent-soft);
  text-shadow: 0 0 14px rgba(184,156,255,.18);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
  color: var(--accent-soft);
}


/* ============================================================
   LAYOUT
   ============================================================ */

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

/* Two-column shell layout */
.mor-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}

.mor-sidebar {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mor-main {
  min-width: 0;
}

@media (max-width: 720px) {
  .mor-layout {
    grid-template-columns: 1fr;
  }

  .mor-sidebar {
    position: static;
  }
}


/* ============================================================
   TOPBAR
   ============================================================ */

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;

  padding: 14px 28px;

  border-bottom: 1px solid var(--line);

  background:
    linear-gradient(180deg,
      rgba(6,6,10,.94) 0%,
      rgba(9,9,14,.80) 100%
    );
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);

  position: sticky;
  top: 0;
  z-index: 100;

  box-shadow:
    0 1px 0 var(--line),
    0 4px 24px rgba(0,0,0,.40);
}


/* ============================================================
   BRAND / LOGO
   ============================================================ */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;

  font-family: "IM Fell DW Pica", serif;
  font-size: 1.05rem;
  letter-spacing: .12em;
  color: var(--chalk);
  text-transform: uppercase;
  text-decoration: none;

  opacity: .9;
  transition:
    opacity var(--dur-mid) ease,
    color   var(--dur-mid) ease;
}

.brand:hover {
  opacity: 1;
  color: var(--chalk);
  text-shadow: none;
}

/* The actual logo image inside .brand */
.brand-logo {
  height: 40px;
  width: 40px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: block;
  flex-shrink: 0;

  transition:
    border-color var(--dur-mid) ease,
    box-shadow   var(--dur-mid) ease,
    opacity      var(--dur-mid) ease;
}

.brand:hover .brand-logo {
  border-color: var(--accent-dim);
  box-shadow: 0 0 12px rgba(184,156,255,.18);
  opacity: .9;
}


/* ============================================================
   NAV
   ============================================================ */

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  color: var(--muted-soft);
  font-size: .88rem;
  letter-spacing: .06em;
  padding: .4rem .7rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition:
    color        var(--dur-mid) var(--ease-out),
    background   var(--dur-mid) var(--ease-out),
    border-color var(--dur-mid) var(--ease-out),
    text-shadow  var(--dur-mid) var(--ease-out);
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--chalk);
  background: rgba(255,255,255,.04);
  border-color: var(--line-strong);
  text-shadow: 0 0 12px rgba(255,255,255,.08);
  outline: none;
}

.nav a.active,
.nav a[aria-current="page"] {
  color: var(--accent-soft);
  background: var(--accent-bg);
  border-color: var(--accent-dim);
  text-shadow: 0 0 12px rgba(184,156,255,.20);
}


/* ============================================================
   PILLS  (buttons / badge-style links)
   ============================================================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;

  padding: 6px 14px;

  border: 1px solid var(--line-strong);
  border-radius: 999px;

  background: rgba(255,255,255,.025);
  color: var(--chalk-dim);

  font-family: "IM Fell English", serif;
  font-size: .88rem;
  letter-spacing: .04em;

  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;

  transition:
    background    var(--dur-mid) var(--ease-out),
    border-color  var(--dur-mid) var(--ease-out),
    color         var(--dur-mid) var(--ease-out),
    box-shadow    var(--dur-mid) var(--ease-out),
    transform     var(--dur-fast) var(--ease-out);
}

.pill:hover,
.pill:focus-visible {
  background: var(--accent-bg2);
  border-color: var(--accent);
  color: var(--accent-soft);
  box-shadow:
    0 0 0 1px var(--accent-glow),
    0 0 20px rgba(184,156,255,.10),
    var(--shadow-sm);
  transform: translateY(-1px);
  outline: none;
}

.pill:active {
  transform: translateY(0);
}

.pill.active,
.pill[aria-current="page"] {
  background: var(--accent-bg2);
  border-color: var(--accent);
  color: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-glow);
}


/* ============================================================
   CARDS
   ============================================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg,
      rgba(255,255,255,.025) 0%,
      rgba(255,255,255,.008) 60%,
      transparent 100%
    ),
    var(--card);

  border-radius: var(--radius);
  padding: 18px;

  box-shadow: var(--shadow-sm);

  transition:
    border-color var(--dur-mid) var(--ease-out),
    box-shadow   var(--dur-mid) var(--ease-out),
    transform    var(--dur-mid) var(--ease-out),
    background   var(--dur-mid) var(--ease-out);
}

.card:hover {
  border-color: var(--line-strong);
  background:
    linear-gradient(160deg,
      rgba(184,156,255,.04) 0%,
      rgba(255,255,255,.01) 60%,
      transparent 100%
    ),
    var(--card-hover);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(184,156,255,.08),
    var(--shadow-glow);
  transform: translateY(-2px);
}

.card-featured {
  border-color: var(--line-strong);
  background:
    linear-gradient(145deg,
      rgba(184,156,255,.06) 0%,
      rgba(255,255,255,.01) 100%
    ),
    var(--card-soft);
}


/* ============================================================
   TEXT HELPERS
   ============================================================ */

.small {
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.55;
}

.label {
  font-size: .78rem;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: "IM Fell DW Pica", serif;
}

.accent-text {
  color: var(--accent-soft);
}


/* ============================================================
   INPUTS
   ============================================================ */

input,
textarea,
select {
  width: 100%;

  padding: 10px 14px;

  border-radius: var(--radius-sm);
  border: 1px solid var(--line);

  background: rgba(255,255,255,.018);
  color: var(--chalk);

  font-family: "IM Fell English", serif;
  font-size: 1rem;
  line-height: 1.5;

  appearance: none;

  transition:
    border-color var(--dur-mid) var(--ease-out),
    box-shadow   var(--dur-mid) var(--ease-out),
    background   var(--dur-mid) var(--ease-out);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  font-style: italic;
}

input:hover,
textarea:hover {
  border-color: var(--line-strong);
  background: rgba(255,255,255,.025);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow:
    0 0 0 3px rgba(184,156,255,.10),
    0 0 18px rgba(184,156,255,.07);
  background: rgba(255,255,255,.03);
}


/* ============================================================
   SEPARATORS
   ============================================================ */

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 24px 0;
  opacity: .7;
}

.rule {
  border: none;
  height: 1px;
  margin: 28px 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--line-strong) 20%,
    var(--line-strong) 80%,
    transparent 100%
  );
}


/* ============================================================
   DEWEY NAV (sidebar)
   ============================================================ */

.dewey-nav a {
  display: block;
  font-size: .88rem;
  color: var(--muted-soft);
  padding: .3rem .5rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition:
    color        var(--dur-mid) var(--ease-out),
    border-color var(--dur-mid) var(--ease-out),
    background   var(--dur-mid) var(--ease-out),
    padding-left var(--dur-mid) var(--ease-out);
}

.dewey-nav a:hover,
.dewey-nav a:focus-visible {
  color: var(--chalk);
  border-left-color: var(--accent-dim);
  background: rgba(184,156,255,.04);
  padding-left: .85rem;
  outline: none;
}

.dewey-nav a.active {
  color: var(--accent-soft);
  border-left-color: var(--accent);
  background: var(--accent-bg);
}


/* ============================================================
   WIKI CONTENT (rendered MediaWiki HTML)
   ============================================================ */

.mw-content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--chalk-dim);
}

.mw-content h1,
.mw-content h2,
.mw-content h3,
.mw-content h4 {
  color: var(--chalk);
  margin-top: 1.6em;
  padding-bottom: .3em;
  border-bottom: 1px solid var(--line);
}

.mw-content a {
  color: var(--accent-soft);
  border-bottom: 1px solid rgba(184,156,255,.25);
  transition:
    color        var(--dur-mid) ease,
    border-color var(--dur-mid) ease;
}

.mw-content a:hover {
  color: var(--chalk);
  border-bottom-color: var(--accent);
}

.mw-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: .92rem;
}

.mw-content th,
.mw-content td {
  padding: 8px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.mw-content th {
  background: rgba(184,156,255,.06);
  color: var(--chalk);
  font-weight: 400;
  letter-spacing: .04em;
}

.mw-content blockquote {
  margin: 1.2em 0;
  padding: .8em 1.2em;
  border-left: 3px solid var(--accent-dim);
  background: rgba(184,156,255,.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--chalk-dim);
  font-style: italic;
}


/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.card {
  animation: fade-up var(--dur-slow) var(--ease-out) both;
}

.card:nth-child(1)  { animation-delay:  0ms; }
.card:nth-child(2)  { animation-delay: 40ms; }
.card:nth-child(3)  { animation-delay: 80ms; }
.card:nth-child(4)  { animation-delay:120ms; }
.card:nth-child(5)  { animation-delay:160ms; }
.card:nth-child(6)  { animation-delay:200ms; }
.card:nth-child(7)  { animation-delay:240ms; }
.card:nth-child(8)  { animation-delay:280ms; }


/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}


/* ============================================================
   SELECTION
   ============================================================ */

::selection {
  background: rgba(184,156,255,.22);
  color: var(--chalk);
}