/* Lithgren Codex styles */
:root{
  --bg: #1a1410;
  --paper: #f2e6c9;
  --paper2: #ead9b1;
  --ink: #1e1a16;
  --muted: #5b5148;

  --shadow: rgba(0,0,0,.25);

  --emerald: #1f8a6b;
  --gold: #c7a64a;
  --crimson: #8b1e2d;
  --midnight: #121115;

  --radius: 14px;
  --radius2: 18px;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(31,138,107,.18), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(139,30,45,.20), transparent 55%),
    linear-gradient(180deg, #0f0b0a, var(--bg));
  color: var(--paper);
}

/* Layout */
.shell{
  display:grid;
  grid-template-columns: 280px 1fr;
  min-height:100vh;
}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  padding:18px 14px;
  border-right: 1px solid rgba(242,230,201,.10);
  background: linear-gradient(180deg, rgba(18,17,21,.85), rgba(18,17,21,.55));
  backdrop-filter: blur(6px);
}

.brand{
  padding:14px 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(31,138,107,.18), rgba(199,166,74,.10));
  border: 1px solid rgba(242,230,201,.10);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  margin-bottom:14px;
}
.brand h1{
  margin:0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing:.5px;
  font-size: 20px;
  color: var(--paper);
}
.brand .sub{
  margin:0;
  color: rgba(242,230,201,.78);
  font-size: 13px;
}

.nav{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.nav a{
  text-decoration:none;
  color: rgba(242,230,201,.90);
  padding:10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(242,230,201,.08);
  background: rgba(255,255,255,.03);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.nav a:hover{
  transform: translateX(2px);
  background: rgba(31,138,107,.10);
  border-color: rgba(31,138,107,.35);
}
.nav a.active{
  background: rgba(139,30,45,.14);
  border-color: rgba(139,30,45,.45);
}

.sidebar .meta{
  margin-top:14px;
  padding:12px;
  border-radius: var(--radius);
  border: 1px dashed rgba(242,230,201,.18);
  color: rgba(242,230,201,.75);
  font-size: 12px;
}

.main{
  padding: 28px 22px 60px;
}

.page{
  max-width: 1100px;
  margin: 0 auto;
}

/* Paper panels */
.paper{
  color: var(--ink);
  background: linear-gradient(180deg, var(--paper), var(--paper2));
  border-radius: var(--radius2);
  border: 1px solid rgba(30,26,22,.12);
  box-shadow: 0 18px 45px var(--shadow);
  overflow:hidden;
}
.paper .inner{
  padding: 22px 22px;
}
.paper h2, .paper h3{
  font-family: Georgia, "Times New Roman", serif;
  margin: 0 0 10px;
}
.paper p{
  margin: 0 0 12px;
  color: rgba(30,26,22,.86);
  line-height: 1.55;
}
.kicker{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-size: 12px;
  color: rgba(30,26,22,.70);
}
.kicker .dot{
  width:8px; height:8px; border-radius:999px;
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(31,138,107,.15);
}

/* Home split layout */
.hero{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 16px;
}
@media (max-width: 980px){
  .shell{ grid-template-columns: 1fr; }
  .sidebar{ position:relative; height:auto; }
  .hero{ grid-template-columns: 1fr; }
}

/* Map panel */
.map-panel{
  position:relative;
  border-radius: var(--radius2);
  border: 1px solid rgba(30,26,22,.14);
  background:
    radial-gradient(600px 220px at 30% 30%, rgba(31,138,107,.18), transparent 60%),
    radial-gradient(520px 240px at 80% 20%, rgba(139,30,45,.15), transparent 60%),
    linear-gradient(135deg, #f5ead0, #e7d3a8);
  min-height: 320px;
  overflow:hidden;
}
.map-panel .overlay{
  position:absolute;
  inset:0;
  background:
    repeating-linear-gradient(
      120deg,
      rgba(30,26,22,.05) 0px,
      rgba(30,26,22,.05) 2px,
      transparent 2px,
      transparent 10px
    );
  mix-blend-mode: multiply;
  opacity:.35;
}
.map-panel .label{
  position:absolute;
  left:18px;
  bottom:14px;
  right:18px;
  padding:10px 12px;
  border-radius: 14px;
  background: rgba(18,17,21,.72);
  color: rgba(242,230,201,.92);
  border: 1px solid rgba(242,230,201,.15);
}
.map-panel a{
  color: var(--gold);
  text-decoration:none;
}
.map-panel a:hover{ text-decoration:underline; }

/* Cards grid */
.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 980px){ .grid{ grid-template-columns: 1fr; } }

.card{
  border-radius: 16px;
  padding: 14px 14px;
  border: 1px solid rgba(30,26,22,.12);
  background: rgba(255,255,255,.55);
}
.card h3{
  margin:0 0 6px;
}
.badge{
  display:inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(30,26,22,.18);
  background: rgba(199,166,74,.18);
  color: rgba(30,26,22,.82);
}

/* Buttons / inputs */
.row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(30,26,22,.18);
  background: rgba(18,17,21,.86);
  color: rgba(242,230,201,.92);
  text-decoration:none;
  cursor:pointer;
}
.btn:hover{
  background: rgba(18,17,21,.94);
  border-color: rgba(199,166,74,.40);
}
input[type="search"]{
  width:min(520px, 100%);
  padding:10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(30,26,22,.18);
  background: rgba(255,255,255,.65);
  outline:none;
}
small.hint{ color: rgba(30,26,22,.65); }

/* Spoilers */
.spoiler{
  margin: 10px 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(139,30,45,.25);
  background: rgba(139,30,45,.06);
  overflow:hidden;
}
.spoiler summary{
  cursor:pointer;
  padding:10px 12px;
  list-style:none;
  color: rgba(30,26,22,.86);
  font-weight:600;
}
.spoiler summary::-webkit-details-marker{ display:none; }
.spoiler .content{
  padding: 0 12px 12px;
  color: rgba(30,26,22,.86);
}

/* Footer note */
.footer-note{
  margin-top: 14px;
  color: rgba(242,230,201,.72);
  font-size: 12px;
}
