/* Bramble Archives — Iron & Blood shared theme */
:root {
  --ink: #030404 !important;
  --void: #050606 !important;
  --wine: #160506 !important;
  --blood: #8f1118 !important;
  --ember: #4f090d !important;
  --bone: #d9d9d4 !important;
  --faded-bone: #979a98 !important;
  --ash: #9a9d9b !important;
  --gold: #89908e !important;
  --gold-light: #b8bfbc !important;
  --deep-gold: #303534 !important;
  --tarnished-gold: #747b79 !important;
  --bg-deep: #040505 !important;
  --bg-mid: #090b0b !important;
  --bg-card: #101212 !important;
  --bg-raised: #171a1a !important;
  --border: #303535 !important;
  --border-gold: #555d5b !important;
  --red-deep: #49080c !important;
  --red: #861017 !important;
  --red-light: #bd2930 !important;
  --cream: #c8cbc8 !important;
  --cream-dim: #929794 !important;
  --cream-faint: #606563 !important;
  --white: #e2e4e1 !important;
}

html { color-scheme: dark; background: #030404; }
body { color: #d9d9d4; background-color: #050606 !important; }

body:has(.warden-gate) {
  background-image:
    radial-gradient(ellipse at center, rgba(105, 8, 14, 0.12) 0%, rgba(9, 10, 10, 0.48) 50%, rgba(0, 0, 0, 0.9) 100%),
    linear-gradient(180deg, rgba(4, 5, 5, 0.5), rgba(9, 10, 10, 0.66) 52%, rgba(0, 0, 0, 0.9)),
    url("cathedral-painting.jpg") !important;
}

body:has(.shell) {
  background-image: radial-gradient(circle at 50% 0, rgba(115, 10, 16, 0.18), transparent 46%) !important;
}

nav,
.top-nav {
  background-color: rgba(3, 4, 4, 0.97) !important;
  border-color: rgba(119, 126, 124, 0.24) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.34);
}

.nav-home,
.nav-search,
nav a.active,
nav a:hover {
  color: #c3c8c5 !important;
  border-color: #721016 !important;
}

.page-hero,
.chapter-header,
.hero {
  background-color: #070808 !important;
  background-image:
    linear-gradient(180deg, rgba(3, 4, 4, 0.12), rgba(3, 4, 4, 0.94)),
    radial-gradient(ellipse at 50% 10%, rgba(113, 9, 16, 0.2), transparent 62%) !important;
  border-color: rgba(134, 16, 23, 0.28) !important;
}

.page-title,
.chapter-title,
.hero-title,
h1,
h2,
h3 {
  color: #dfe1de !important;
  text-shadow: 0 2px 0 #000, 0 0 22px rgba(84, 5, 10, 0.22);
}

.page-chapter,
.chapter-eyebrow,
.hero-subtitle,
.section-label {
  color: #a51b22 !important;
}

.content-section,
.card,
.chapter-card,
.quiz-card,
.info-card,
.stat {
  border-color: rgba(102, 111, 108, 0.35) !important;
  border-radius: 0 !important;
  background-color: #0e1010 !important;
  background-image: linear-gradient(145deg, rgba(25, 28, 28, 0.9), rgba(7, 8, 8, 0.96)) !important;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.38) !important;
}

button,
.button,
.btn,
.btn-next,
input,
textarea,
select {
  border-radius: 0 !important;
}

button,
.button,
.btn,
.btn-next {
  border-color: #626a68 !important;
  color: #e0e2df !important;
  background-color: #171a1a !important;
  background-image: linear-gradient(180deg, #242828, #101212) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 5px 16px rgba(0, 0, 0, 0.38) !important;
}

button:hover,
.button:hover,
.btn:hover,
.btn-next:hover {
  border-color: #99151c !important;
  background-color: #3f080c !important;
  background-image: linear-gradient(180deg, #681017, #2b0609) !important;
}

a { text-decoration-color: rgba(151, 25, 31, 0.62); }

.page-rule,
.section-rule { background: #871017 !important; }

.page-nav {
  border-color: rgba(106, 115, 112, 0.22) !important;
}

.key-input {
  border-color: #59615f !important;
  color: #e1e3e0 !important;
  background: linear-gradient(180deg, rgba(4, 5, 5, 0.94), rgba(16, 18, 18, 0.96)) !important;
  outline-color: #111313 !important;
}

.key-input:focus {
  border-color: #9e171e !important;
  box-shadow: 0 0 0 2px rgba(133, 0, 8, .2), inset 0 2px 10px #000 !important;
}

.enter-button {
  border-color: #6c7472 !important;
  color: #e6e8e5 !important;
  background: linear-gradient(180deg, #363b3a 0%, #202423 52%, #101212 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 0 3px rgba(0,0,0,.5), 0 5px 20px rgba(0,0,0,.62) !important;
}

.enter-button::before,
.enter-button::after { color: #8c9390 !important; }

.chapter-list a {
  border-color: rgba(102, 111, 108, 0.28) !important;
  color: #b9bfbc !important;
}

.chapter-list a:hover {
  color: #eceeeb !important;
  border-color: #85131a !important;
  background: linear-gradient(90deg, rgba(105, 10, 16, 0.19), transparent) !important;
}

.device-note,
.lead,
.note-text,
.stat span,
.empty { color: #929795 !important; }

.home,
.stat strong,
.item-title,
.card h2 { color: #c8cdca !important; }

.remove:hover,
.clear:hover {
  color: #cc4a50 !important;
  border-color: #86131a !important;
}

::selection { color: #fff; background: #711016; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #050606; }
::-webkit-scrollbar-thumb { border: 2px solid #050606; background: #3a403e; }
::-webkit-scrollbar-thumb:hover { background: #711016; }

/* Shared top bar and slide-out syllabus navigation */
body.has-bramble-nav { padding-top: 70px !important; }
body.has-bramble-nav > nav { display: none !important; }
html.bramble-access-check body { visibility: hidden; }

.bramble-access-gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 30px 18px;
  visibility: visible !important;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(118, 10, 16, .2), transparent 52%),
    #040505;
}

.bramble-access-card {
  width: min(560px, 100%);
  padding: clamp(30px, 8vw, 58px);
  border: 1px solid #424947;
  background: linear-gradient(145deg, rgba(22,25,24,.98), rgba(5,6,6,.99));
  box-shadow: 0 28px 90px rgba(0,0,0,.62);
  text-align: center;
}

.bramble-access-card img { width: min(300px, 88%); height: auto; margin-bottom: 24px; }
.bramble-access-kicker { margin: 0 0 10px; color: #9e171e; font: 600 .66rem "Cinzel",serif; letter-spacing: .2em; text-transform: uppercase; }
.bramble-access-card h1 { margin: 0; font: 700 clamp(2.7rem,10vw,4.8rem)/1 "UnifrakturCook",serif; }
.bramble-access-card > p:not(.bramble-access-kicker) { margin: 20px auto 28px; color: #a8aeab; font-size: 1.08rem; line-height: 1.6; }
.bramble-access-card > a { display: block; padding: 12px 14px; border: 1px solid #626a68; color: #e0e2df; background: linear-gradient(180deg,#242828,#101212); font: 600 .7rem "Cinzel",serif; letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }
.bramble-access-card > a:hover { border-color: #99151c; background: linear-gradient(180deg,#681017,#2b0609); }
.bramble-access-card .bramble-access-back { margin-top: 10px; border-color: transparent; color: #858d89; background: transparent; }

.bramble-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 9000;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  height: 70px;
  padding: 0 18px 0 12px;
  border-bottom: 1px solid #353a39;
  background: rgba(4, 5, 5, 0.96);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.bramble-menu-button {
  display: grid !important;
  place-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
}

.bramble-menu-button span {
  display: block;
  width: 24px;
  height: 2px;
  background: #c8cdca;
  transition: transform .18s ease, width .18s ease;
}

.bramble-menu-button:hover span:nth-child(2) { width: 17px; }
.bramble-menu-button:focus-visible { outline: 2px solid #9e171e; outline-offset: 1px; }

.bramble-topbar-logo {
  justify-self: center;
  height: 56px;
  text-decoration: none;
}

.bramble-topbar-logo img {
  display: block;
  width: auto;
  height: 100%;
  object-fit: contain;
}

.bramble-study-link {
  color: #aeb4b1;
  font: 600 .7rem/1 "Cinzel", Georgia, serif;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
}

.bramble-study-link:hover { color: #fff; }

.bramble-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9090;
  opacity: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(3px);
  transition: opacity .22s ease;
}

.bramble-drawer-overlay[hidden] { display: none; }

.bramble-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 9100;
  width: min(390px, 92vw);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 18px 22px 28px;
  border-right: 1px solid #4f5654;
  background:
    linear-gradient(180deg, rgba(103, 10, 16, .14), transparent 230px),
    #070808;
  box-shadow: 20px 0 60px rgba(0, 0, 0, .7);
  transform: translateX(-104%);
  transition: transform .22s ease;
}

.bramble-drawer-open { overflow: hidden; }
.bramble-drawer-open .bramble-drawer { transform: translateX(0); }
.bramble-drawer-open .bramble-drawer-overlay { opacity: 1; }

.bramble-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding-bottom: 16px;
  border-bottom: 1px solid #303534;
}

.bramble-drawer-profile {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #daddda;
  text-decoration: none;
}

.bramble-drawer-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border: 1px solid #59615f;
  border-radius: 50%;
  color: #858d89;
  background: radial-gradient(circle at 50% 35%, #2a2e2d, #0b0d0c 72%);
  font: 700 1.2rem "Cinzel", Georgia, serif;
}

.bramble-drawer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bramble-drawer-profile strong,
.bramble-drawer-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bramble-drawer-profile strong { font: 600 .88rem/1.3 "Cinzel", Georgia, serif; letter-spacing: .04em; }
.bramble-drawer-profile small { margin-top: 5px; color: #858d89; font-size: .78rem; }
.bramble-drawer-profile:hover strong { color: #fff; }

.bramble-drawer-close {
  width: 42px;
  height: 42px;
  padding: 0 !important;
  border: 0 !important;
  color: #aeb4b1 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 1.8rem !important;
  line-height: 1 !important;
}

.bramble-drawer-label {
  margin: 24px 0 10px;
  color: #9b171e;
  font: 600 .68rem/1 "Cinzel", Georgia, serif;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.bramble-drawer-nav {
  display: block !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.bramble-drawer-link {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  padding: 11px 4px;
  border-bottom: 1px solid rgba(91, 99, 96, .2);
  color: #b4bab7;
  font-size: .98rem;
  letter-spacing: .02em;
  text-decoration: none;
}

.bramble-drawer-link span {
  color: #8f171d;
  font: 600 1rem/1.2 "Cinzel", Georgia, serif;
}

.bramble-drawer-link:hover,
.bramble-drawer-link.is-active {
  padding-left: 9px;
  color: #f0f1ef !important;
  border-color: #761017 !important;
  background: linear-gradient(90deg, rgba(112, 12, 18, .2), transparent);
}

.bramble-drawer-link.is-active span { color: #b22a30; }

.bramble-drawer-secondary {
  display: grid;
  gap: 8px;
  margin: 24px 0 18px;
}

.bramble-drawer-secondary a {
  padding: 10px 12px;
  border: 1px solid #3d4341;
  color: #adb3b0;
  font: 600 .64rem/1.3 "Cinzel", Georgia, serif;
  letter-spacing: .08em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.bramble-drawer-secondary a:hover { color:#fff; border-color:#86131a; background:#31070a; }
.bramble-drawer-secondary a[hidden] { display:none; }

.bramble-beta-notice {
  margin-top: auto;
  padding: 18px 4px 0;
  border-top: 1px solid #303534;
}

.bramble-beta-notice strong {
  color: #a92127;
  font: 600 .65rem/1 "Cinzel", Georgia, serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.bramble-beta-notice p {
  margin: 9px 0 0;
  color: #7f8784;
  font-size: .82rem;
  line-height: 1.48;
}

@media (max-width: 560px) {
  body.has-bramble-nav { padding-top: 62px !important; }
  .bramble-topbar {
    grid-template-columns: 46px 1fr 62px;
    height: 62px;
    padding: 0 10px 0 8px;
  }
  .bramble-topbar-logo { height: 46px; }
  .bramble-study-link { font-size: .59rem; letter-spacing: .06em; }
}

@media (prefers-reduced-motion: reduce) {
  .bramble-drawer,
  .bramble-drawer-overlay,
  .bramble-menu-button span { transition: none; }
}
