:root{
  --bg: #14110d;
  --bg2: #1b1611;
  --panel: rgba(255,248,235,0.06);
  --panel2: rgba(255,248,235,0.09);
  --text: rgba(255,248,235,0.92);
  --muted: rgba(255,248,235,0.68);
  --line: rgba(255,248,235,0.16);

  --accent: rgba(212, 175, 55, 0.85);
  --accent2: rgba(152, 178, 140, 0.55);

  --shadow: 0 14px 44px rgba(0,0,0,0.55);
  --radius: 18px;

  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --serif: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg2));
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

body::before{
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;        
  pointer-events: none;

  background:
    radial-gradient(900px 650px at var(--a1x, 20%) var(--a1y, 10%),
      rgba(212,175,55,0.16) 0%,
      rgba(212,175,55,0.10) 26%,
      rgba(212,175,55,0.05) 46%,
      transparent 72%),
    radial-gradient(820px 560px at var(--a2x, 85%) var(--a2y, 22%),
      rgba(152,178,140,0.14) 0%,
      rgba(152,178,140,0.09) 26%,
      rgba(152,178,140,0.045) 46%,
      transparent 72%),
    radial-gradient(980px 720px at var(--a3x, 40%) var(--a3y, 110%),
      rgba(255,248,235,0.10) 0%,
      rgba(255,248,235,0.06) 30%,
      rgba(255,248,235,0.03) 52%,
      transparent 78%),
    radial-gradient(760px 560px at var(--a4x, 65%) var(--a4y, 65%),
      rgba(212,175,55,0.09) 0%,
      rgba(212,175,55,0.055) 30%,
      rgba(212,175,55,0.03) 52%,
      transparent 78%);

  filter: saturate(112%) contrast(102%);
  transform: translate3d(0,0,0);
  opacity: 0.75;

  animation: aurora-drift 26s ease-in-out infinite alternate;
}

body::after{
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.35' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='420' height='420' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  opacity: 0.07;
  mix-blend-mode: soft-light;
}

@keyframes aurora-drift{
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.02) rotate(-1.2deg); }
  50%  { transform: translate3d( 2.5%, 1.5%, 0) scale(1.05) rotate( 1.6deg); }
  100% { transform: translate3d(-1%,  2%, 0) scale(1.03) rotate(-0.6deg); }
}

@media (prefers-reduced-motion: reduce){
  body::before{ animation: none; }
}

a{ color: rgba(255,248,235,0.92); text-decoration: none; }
a:hover{ text-decoration: underline; }

.skip{
  position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip:focus{
  left: 14px; top: 14px; width: auto; height: auto;
  padding: 10px 12px;
  background: rgba(0,0,0,0.70);
  border: 1px solid var(--line);
  border-radius: 10px;
  z-index: 50;
}

.topbar{
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  padding: 20px 18px 10px;
  max-width: 1040px;
  margin: 0 auto;
}

.brand{
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 240px;
}
.sigil{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 35%, rgba(255,248,235,0.20), transparent 45%),
    conic-gradient(from 180deg, rgba(212,175,55,0.40), rgba(152,178,140,0.25), rgba(212,175,55,0.40));
  box-shadow: 0 0 0 1px rgba(255,248,235,0.12), 0 10px 24px rgba(0,0,0,0.60);
  position: relative;
}
.sigil::after{
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 12px;
  background: rgba(0,0,0,0.32);
  box-shadow: inset 0 0 0 1px rgba(255,248,235,0.10);
}

.title{
  font-weight: 700;
  letter-spacing: 0.2px;
}
.subtitle{
  font-size: 13px;
  color: var(--muted);
}

.nav{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.navlink{
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: rgba(255,248,235,0.84);
  background: rgba(255,248,235,0.03);
}
.navlink:hover{
  border-color: rgba(255,248,235,0.16);
  background: rgba(255,248,235,0.05);
  text-decoration: none;
}
.navlink.active{
  border-color: rgba(212,175,55,0.22);
  background: rgba(212,175,55,0.08);
}

.layout{
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 18px 24px;
}

.card{
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid rgba(255,248,235,0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(8px);
}

h1, h2, h3{
  font-family: var(--serif);
  letter-spacing: 0.2px;
}
h1{ font-size: 30px; margin: 0 0 10px; }
h2{ font-size: 20px; margin: 0 0 10px; }
h3{ font-size: 16px; margin: 0 0 8px; }

.small{ font-size: 13px; }
.muted{ color: var(--muted); }

.pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,248,235,0.14);
  background: rgba(0,0,0,0.22);
  font-family: var(--mono);
  font-size: 12px;
  vertical-align: middle;
}
.pill::before{
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(212,175,55,0.85);
  box-shadow: 0 0 0 2px rgba(212,175,55,0.12);
}
.pill.moss::before{ background: rgba(152,178,140,0.80); box-shadow: 0 0 0 2px rgba(152,178,140,0.14); }
.pill.ash::before{ background: rgba(255,248,235,0.45); box-shadow: 0 0 0 2px rgba(255,248,235,0.10); }

.tiny-btn{
  margin-left: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,248,235,0.16);
  background: rgba(255,248,235,0.05);
  color: rgba(255,248,235,0.86);
  font-size: 12px;
  cursor: pointer;
}
.tiny-btn:hover{ background: rgba(255,248,235,0.08); }

.hero{
  display: grid;
  gap: 18px;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: stretch;
}

.grid{
  margin-top: 18px;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
}
.wide{ grid-column: 1 / -1; }

.list{ margin: 10px 0 0; padding-left: 18px; }
.list li{ margin: 8px 0; }

.now{
  margin-top: 10px;
  border: 1px solid rgba(255,248,235,0.12);
  border-radius: 14px;
  padding: 10px;
  background: rgba(0,0,0,0.22);
}
.now-row{
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px dashed rgba(255,248,235,0.12);
}
.now-row:last-child{ border-bottom: 0; }
.now .k{ font-family: var(--mono); color: rgba(212,175,55,0.85); }
.now .v{ color: rgba(255,248,235,0.86); }

.terminal{
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(255,248,235,0.12);
  background: rgba(0,0,0,0.30);
  overflow: hidden;
}
.terminal-top{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,248,235,0.10);
  background: rgba(255,248,235,0.04);
}
.dot{ width: 10px; height: 10px; border-radius: 50%; background: rgba(255,248,235,0.18); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4); }
.terminal-title{ margin-left: 6px; font-family: var(--mono); font-size: 12px; color: rgba(255,248,235,0.70); }
.terminal-body{
  margin: 0; padding: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255,248,235,0.88);
  white-space: pre-wrap;
}

.badgewall{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0 0;
}
.badge{
  width: 88px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255,248,235,0.14);
  background: rgba(255,248,235,0.05);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.badge:hover{ background: rgba(255,248,235,0.08); text-decoration: none; }
.badge-faux{
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,248,235,0.78);
}

.details{
  margin-top: 12px;
  border: 1px solid rgba(255,248,235,0.10);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.16);
}
.details summary{ cursor: pointer; color: rgba(255,248,235,0.86); }
.code{
  margin: 10px 0 0;
  border-radius: 12px;
  border: 1px solid rgba(255,248,235,0.10);
  background: rgba(0,0,0,0.26);
  padding: 10px;
  overflow: auto;
}
.code code{
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255,248,235,0.85);
}

.prose .lead{ font-size: 16px; color: rgba(255,248,235,0.86); }
.prose hr{
  border: none;
  border-top: 1px solid rgba(255,248,235,0.14);
  margin: 18px 0;
}

/* Books: shelves + status */
.shelves{ display: grid; gap: 18px; margin-top: 12px; }
.shelf{
  border: 1px solid rgba(255,248,235,0.12);
  border-radius: 16px;
  background: rgba(0,0,0,0.18);
  padding: 14px;
}
.shelfhead{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.shelfhead h2{ margin: 0; }
.booklist{ margin: 0; padding-left: 18px; }
.booklist li{ margin: 14px 0; }
.booktitle{ display: block; font-weight: 650; font-family: var(--sans); }
.bookmeta{ display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 2px; }
.booknote{ margin: 6px 0 0; color: rgba(255,248,235,0.84); }

/* Thoughts: reverse-chron posts */
.post{
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(255,248,235,0.14);
}
.post:first-of-type{ border-top: 0; padding-top: 0; margin-top: 0; }
.posthead{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.posthead h2{
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
}
.posthead time{
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255,248,235,0.70);
}
.tagrow{ margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag{ padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(255,248,235,0.12); background: rgba(255,248,235,0.04); font-size: 12px; color: rgba(255,248,235,0.78); }

.footer{
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 18px 26px;
  color: rgba(255,248,235,0.62);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.footer a{ color: rgba(255,248,235,0.72); }
.sep{ opacity: 0.6; }

@media (max-width: 860px){
  .hero{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: 1fr; }
}