/* Abyssal Lapidary Guide — gothic Victorian workshop theme */
:root {
  --bg: #07060a;
  --bg-mid: #0e0c12;
  --bg-elev: #141018;
  --bg-card: #16121c;
  --line: #2a2230;
  --line-warm: #3d2a28;
  --text: #ebe4d6;
  --muted: #a89a8c;
  --parchment: #d4c4a8;
  --vermilion: #b3261e;
  --vermilion-bright: #e8453c;
  --vermilion-dim: #6e1a16;
  --gold: #c9a227;
  --gold-soft: #a88b3a;
  --amethyst: #8b6bb5;
  --emerald: #3d8b6e;
  --ruby: #c23a3a;
  --ok: #6fbf8a;
  --warn: #d4a05a;
  --danger: #d47979;
  --link: #d4a27a;
  --link-hover: #f0c9a0;
  --radius: 4px;
  --max: 760px;
  --font-display: "Cinzel", "Palatino Linotype", Palatino, serif;
  --font-body: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-ui: "DM Sans", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 50% -8%, rgba(179, 38, 30, 0.18), transparent 55%),
    radial-gradient(ellipse 700px 400px at 85% 20%, rgba(139, 107, 181, 0.08), transparent 50%),
    radial-gradient(ellipse 600px 380px at 10% 60%, rgba(201, 162, 39, 0.05), transparent 45%),
    linear-gradient(180deg, var(--bg-mid) 0%, var(--bg) 40%, #050408 100%);
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
}
/* subtle grain + vignette */
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 49;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.55) 100%);
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.15rem 3.5rem; position: relative; z-index: 1; }

/* —— Header —— */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7, 6, 10, 0.82);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line-warm);
  box-shadow: 0 1px 0 rgba(179, 38, 30, 0.45);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: .75rem 1.15rem;
  display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--text); text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.02rem;
  letter-spacing: .04em; text-transform: none;
}
.brand-mark {
  width: 22px; height: 22px; flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(179, 38, 30, 0.55));
}
.brand .guide { color: var(--vermilion-bright); font-weight: 700; }
.brand .sep { color: var(--gold-soft); opacity: .7; margin: 0 .15rem; }
nav { display: flex; flex-wrap: wrap; gap: .65rem 1.05rem; font-family: var(--font-ui); }
nav a {
  color: var(--muted); text-decoration: none; font-size: .84rem;
  letter-spacing: .03em; text-transform: uppercase;
}
nav a:hover, nav a[aria-current="page"] {
  color: var(--parchment);
  text-shadow: 0 0 12px rgba(232, 69, 60, 0.25);
}
nav a[aria-current="page"] {
  border-bottom: 1px solid var(--vermilion);
  padding-bottom: 1px;
}

/* —— Badges —— */
.badge {
  display: inline-block; font-family: var(--font-ui);
  font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase;
  padding: .28rem .7rem; border-radius: 2px;
  background: linear-gradient(180deg, #2a1814 0%, #1a100e 100%);
  color: var(--gold);
  border: 1px solid var(--gold-soft);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.15), 0 0 12px rgba(179, 38, 30, 0.12);
}
.badge.demo {
  color: var(--parchment);
  border-color: var(--vermilion-dim);
  background: linear-gradient(180deg, #2a1214 0%, #140a0c 100%);
  box-shadow: inset 0 0 0 1px rgba(232, 69, 60, 0.2), 0 0 16px rgba(179, 38, 30, 0.2);
}

/* —— Hero —— */
.hero-banner {
  position: relative;
  margin: 0 -1.15rem 1.5rem;
  min-height: 220px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-warm);
}
.hero-banner img {
  display: block; width: 100%; height: 100%;
  min-height: 220px; max-height: 340px;
  object-fit: cover; object-position: center 40%;
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(7,6,10,0.35) 0%, rgba(7,6,10,0.55) 40%, rgba(7,6,10,0.96) 100%),
    linear-gradient(90deg, rgba(7,6,10,0.75) 0%, transparent 55%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.4rem 1.15rem 1.3rem;
}
.hero-scrim .badge { align-self: flex-start; margin-bottom: .65rem; }
.hero-scrim h1 {
  margin: 0 0 .45rem;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.2;
  color: var(--text);
  text-shadow: 0 2px 24px rgba(0,0,0,0.85), 0 0 40px rgba(179, 38, 30, 0.25);
}
.hero-scrim .lede {
  margin: 0; max-width: 36em;
  color: var(--parchment);
  font-size: 1.02rem;
  text-shadow: 0 1px 12px rgba(0,0,0,0.8);
}
.page-banner {
  position: relative;
  margin: .6rem 0 1.2rem;
  border: 1px solid var(--line-warm);
  box-shadow:
    inset 0 0 0 1px rgba(201, 162, 39, 0.12),
    0 8px 28px rgba(0,0,0,0.45);
  overflow: hidden;
  background: var(--bg-elev);
}
.page-banner img {
  display: block; width: 100%; height: auto;
  max-height: 220px; object-fit: cover; object-position: center;
}
.page-banner .cap {
  font-family: var(--font-ui); font-size: .75rem; color: var(--muted);
  padding: .4rem .7rem; border-top: 1px solid var(--line);
  background: rgba(10,8,12,0.9);
}
@media (max-width: 560px) {
  .hero-banner { min-height: 180px; }
  .hero-banner img { min-height: 180px; max-height: 240px; }
  .page-banner img { max-height: 160px; }
}

.hero { padding: 1.4rem 0 .4rem; }
.hero h1, article > h1 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.25;
  margin: .5rem 0 .75rem;
  color: var(--text);
}
.lede { color: var(--muted); font-size: 1.05rem; margin: 0 0 1.1rem; }
.meta-row {
  display: flex; flex-wrap: wrap; gap: .5rem .85rem;
  align-items: center; color: var(--muted); font-size: .88rem;
  font-family: var(--font-ui); margin: .8rem 0 1rem;
}

/* —— Cards —— */
.cards {
  display: grid; grid-template-columns: 1fr; gap: .95rem;
  margin: 1.5rem 0 2rem;
}
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  position: relative;
  background:
    linear-gradient(165deg, rgba(36, 22, 28, 0.9) 0%, var(--bg-card) 55%);
  border: 1px solid var(--line-warm);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1.1rem 1.15rem;
  text-decoration: none; color: inherit; display: block;
  box-shadow:
    inset 0 0 0 1px rgba(201, 162, 39, 0.08),
    0 4px 18px rgba(0,0,0,0.35);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.card::before, .card::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border-color: var(--gold-soft); border-style: solid; opacity: .55;
  pointer-events: none;
}
.card::before { top: 6px; left: 6px; border-width: 1px 0 0 1px; }
.card::after { bottom: 6px; right: 6px; border-width: 0 1px 1px 0; }
.card:hover {
  border-color: var(--vermilion);
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(232, 69, 60, 0.2),
    0 8px 28px rgba(179, 38, 30, 0.18),
    0 4px 18px rgba(0,0,0,0.45);
}
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-bottom: .45rem;
  color: var(--vermilion-bright);
  opacity: .9;
}
.card-icon svg { width: 22px; height: 22px; }
.card h2 {
  margin: 0 0 .35rem; font-size: 1.08rem;
  font-family: var(--font-display); font-weight: 600;
  letter-spacing: .02em; color: var(--parchment);
}
.card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }

/* —— Panels / callouts / tables —— */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line-warm);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  margin: 1.25rem 0;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.06);
}
.panel h2, .panel h3 { margin-top: 0; }
h2 {
  font-family: var(--font-display);
  font-size: 1.22rem; font-weight: 600;
  letter-spacing: .02em;
  margin: 1.85rem 0 .65rem;
  color: var(--parchment);
  border-bottom: 1px solid var(--line);
  padding-bottom: .35rem;
}
h3 {
  font-family: var(--font-display);
  font-size: 1.02rem; margin: 1.3rem 0 .45rem;
  color: var(--text); font-weight: 600;
}
ul, ol { padding-left: 1.25rem; }
li { margin: .38rem 0; }

.table-wrap { overflow-x: auto; margin: 1rem 0; }
table {
  width: 100%; border-collapse: collapse; font-size: .94rem;
  background: rgba(12, 10, 14, 0.6);
  border: 1px solid var(--line-warm);
}
th, td {
  text-align: left; padding: .6rem .7rem;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
th {
  color: var(--gold); font-weight: 600; font-size: .8rem;
  font-family: var(--font-ui); letter-spacing: .05em; text-transform: uppercase;
  background: rgba(36, 22, 28, 0.7);
  border-bottom-color: var(--line-warm);
}
tr:last-child td { border-bottom: none; }

.callout {
  border: 1px solid var(--line-warm);
  border-left: 3px solid var(--vermilion);
  background: linear-gradient(90deg, rgba(179, 38, 30, 0.1), rgba(20, 14, 18, 0.85));
  padding: .85rem 1.05rem; margin: 1.1rem 0;
  border-radius: 0 3px 3px 0;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.05);
}
.callout.warn {
  border-left-color: var(--warn);
  background: linear-gradient(90deg, rgba(212, 160, 90, 0.1), rgba(20, 16, 12, 0.85));
}
.callout.note {
  border-left-color: var(--amethyst);
  background: linear-gradient(90deg, rgba(139, 107, 181, 0.12), rgba(16, 12, 22, 0.85));
}

.cite { font-size: .84rem; color: var(--muted); font-family: var(--font-ui); }
.art-credit {
  font-family: var(--font-ui); font-size: .78rem; color: var(--muted);
  margin: .4rem 0 1.2rem; opacity: .85;
}

.breadcrumbs {
  font-size: .86rem; color: var(--muted); margin: 1rem 0 .4rem;
  font-family: var(--font-ui);
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--link-hover); }

.site-footer {
  border-top: 1px solid var(--line-warm);
  margin-top: 2.8rem; padding: 1.5rem 0 2.2rem;
  color: var(--muted); font-size: .86rem;
  font-family: var(--font-ui);
  background: linear-gradient(180deg, transparent, rgba(20, 10, 12, 0.35));
}
.site-footer .wrap { display: grid; gap: .55rem; }
.site-footer a { color: var(--link); }
.footer-ornament {
  display: flex; align-items: center; gap: .75rem;
  color: var(--gold-soft); font-size: .7rem; letter-spacing: .2em;
  text-transform: uppercase; margin-bottom: .35rem; opacity: .7;
}
.footer-ornament::before, .footer-ornament::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-warm), transparent);
}

.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em;
  background: #100c12; border: 1px solid var(--line);
  border-radius: 3px; padding: .05rem .35rem; color: var(--parchment);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.diamond-rule {
  display: flex; align-items: center; justify-content: center;
  gap: .6rem; margin: 1.4rem 0; color: var(--gold-soft); opacity: .55;
}
.diamond-rule::before, .diamond-rule::after {
  content: ""; flex: 1; max-width: 140px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-warm));
}
.diamond-rule span {
  display: inline-block; width: 7px; height: 7px;
  border: 1px solid var(--gold-soft);
  transform: rotate(45deg);
}
