/* resources/page.css — shared styles for resource subpages */

:root {
  --bg-deep: #070F1E;
  --bg: #0A1628;
  --bg-card: #14253F;
  --bg-elev: #182E4D;
  --border: rgba(244, 230, 200, 0.10);
  --text: #F0EADB;
  --text-mute: #93A4BF;
  --text-dim: #6A7993;
  --gold: #D4A24C;
  --gold-soft: #E8C887;
  --gold-deep: #B8862E;
  --maroon: #5C1A20;
  --maroon-soft: #7A2530;
  --grain: 0.04;
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, sans-serif;
}

/* Light theme — mirrors the homepage palette; applied when the saved theme
   (localStorage 'dtm-theme') is 'light'. */
html[data-mode="light"] {
  --bg-deep: #EDE5D2;
  --bg: #F5EFE3;
  --bg-card: #FFFCF4;
  --bg-elev: #F0E8D5;
  --border: rgba(10, 22, 40, 0.10);
  --text: #0A1628;
  --text-mute: #4A5B78;
  --text-dim: #7B8AA4;
  --gold: #B8862E;
  --gold-soft: #C99D3F;
  --gold-deep: #8C621A;
  --maroon: #6B1F26;
  --maroon-soft: #8B2A33;
  --grain: 0.025;
}

body { transition: background-color .4s ease, color .4s ease; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-left: 92px;
}
@media (max-width: 820px) {
  body { padding-left: 0; padding-top: 0; }
}

body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

::selection { background: var(--gold); color: var(--bg); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  color: var(--text);
}
p { margin: 0; }
a { color: inherit; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
}
@media (max-width: 820px) {
  .container { padding: 0 24px; }
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--maroon-soft);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--maroon-soft);
  opacity: 0.8;
}

/* ─── Side rail (same as main) ────────────────────────────────────── */
.brand-mark {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  display: grid; place-items: center;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 18px;
  font-weight: 700;
  font-style: italic;
  text-decoration: none;
}

.topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  height: 60px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; height: 60px;
  gap: 12px;
}
.topbar-inner a {
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  font-size: 15px;
}
/* topbar hidden — floating menu used on mobile instead */

/* ── Mobile floating menu ── */
.mob-menu { display: none; }
@media (max-width: 820px) {
  .mob-menu { display: block; position: fixed; bottom: 18px; right: 18px; z-index: 300; }
  .mob-menu-btn {
    appearance: none; width: 48px; height: 48px; border-radius: 50%;
    border: 1.5px solid var(--gold);
    background: color-mix(in srgb, var(--bg-deep) 88%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    color: var(--gold); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    transition: background .2s, color .2s, border-color .2s;
  }
  .mob-letter { font-family: var(--font-display); font-size: 18px; font-weight: 700; font-style: italic; line-height: 1; }
  .mob-lines { display: flex; flex-direction: column; gap: 2.5px; }
  .mob-lines i { display: block; width: 14px; height: 1.5px; background: currentColor; border-radius: 1px; transition: transform .2s ease, opacity .2s ease; }
  .mob-menu-btn[aria-expanded="true"] { background: var(--gold); color: var(--bg-deep); border-color: var(--gold); }
  .mob-menu-btn[aria-expanded="true"] .mob-lines i:nth-child(1) { transform: translateY(4px) rotate(45deg); }
  .mob-menu-btn[aria-expanded="true"] .mob-lines i:nth-child(2) { opacity: 0; }
  .mob-menu-btn[aria-expanded="true"] .mob-lines i:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }
  .mob-menu-panel {
    position: absolute; bottom: calc(100% + 10px); right: 0;
    width: 200px;
    background: color-mix(in srgb, var(--bg-deep) 92%, transparent);
    backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(212,162,76,0.2); border-radius: 14px;
    padding: 6px; pointer-events: none;
    opacity: 0; transform: translateY(6px) scale(0.97);
    transition: opacity .22s ease, transform .22s ease;
  }
  .mob-menu-panel.open { opacity: 1; transform: none; pointer-events: auto; }
  .mob-menu-link {
    display: block; padding: 11px 14px;
    color: var(--text-mute); text-decoration: none;
    font-size: 14px; font-weight: 500; border-radius: 9px;
    opacity: 0; transform: translateX(-10px);
    transition: color .15s, background .15s, opacity .2s ease, transform .2s ease;
  }
  .mob-menu-panel.open .mob-menu-link { opacity: 1; transform: none; }
  .mob-menu-link:nth-child(1) { transition-delay: .05s; }
  .mob-menu-link:nth-child(2) { transition-delay: .10s; }
  .mob-menu-link:nth-child(3) { transition-delay: .15s; }
  .mob-menu-link:nth-child(4) { transition-delay: .20s; }
  .mob-menu-link:nth-child(5) { transition-delay: .25s; }
  .mob-menu-link:hover { color: var(--gold); background: rgba(212,162,76,0.08); }
}

.sidenav {
  --rail-bg: #0A1628;
  --rail-bg-deep: #050B16;
  --rail-text: #C7B68A;
  --rail-text-mute: #8A95AB;
  --rail-border: rgba(244, 230, 200, 0.14);
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 92px;
  z-index: 100;
  background: var(--rail-bg);
  display: flex; flex-direction: column;
  align-items: center;
  padding: 28px 0 24px;
  border-right: 1px solid var(--rail-border);
  box-shadow:
    inset -1px 0 0 0 rgba(255,255,255,0.04),
    8px 0 40px -16px rgba(0, 0, 0, 0.35);
  overflow-y: auto; overflow-x: hidden;
}
@media (max-width: 820px) {
  .sidenav { display: none; }
}
@media (max-height: 820px) {
  .sidenav { padding: 16px 0 16px; }
  .sidenav-channel { margin: 16px 0; }
  .sidenav-links { gap: 18px; }
  .sidenav-foot { gap: 8px; padding-top: 4px; }
}
.sidenav-brand {
  display: grid; place-items: center;
  text-decoration: none;
  margin-bottom: 8px;
}
.sidenav-channel {
  flex: 1;
  width: 60px;
  margin: 32px 0;
  border-radius: 32px;
  background: linear-gradient(180deg, #4A1318 0%, #5C1A20 50%, #4A1318 100%);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.6),
    inset 0 0 0 1px rgba(255, 200, 160, 0.06),
    inset 0 -1px 0 rgba(255,255,255,0.06),
    0 1px 0 rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 0;
  position: relative;
}
.sidenav-channel::before,
.sidenav-channel::after {
  content: "";
  position: absolute; left: 50%;
  transform: translateX(-50%);
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px color-mix(in srgb, var(--gold) 80%, transparent);
}
.sidenav-channel::before { top: 12px; }
.sidenav-channel::after  { bottom: 12px; }

.sidenav-links {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 32px;
  height: 100%;
  justify-content: center;
}
.sidenav-link {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--rail-text);
  transition: color .25s ease;
  cursor: pointer;
  position: relative;
}
.sidenav-link:hover { color: #FFF8E6; }
.sidenav-link.active { color: var(--gold); }
.sidenav-link-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  transition: all .25s ease;
}
.sidenav-link:hover .sidenav-link-dot { opacity: 1; transform: scale(1.15); }
.sidenav-link.active .sidenav-link-dot {
  opacity: 1;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 22%, transparent),
              0 0 14px color-mix(in srgb, var(--gold) 90%, transparent);
}
.sidenav-link-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1;
}

.sidenav-foot {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 8px;
}
.sidenav-foot a {
  color: var(--rail-text-mute);
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 6px;
  transition: color .2s ease, background .2s ease;
}
.sidenav-foot a:hover {
  color: var(--gold);
  background: rgba(255,255,255,0.06);
}

/* ─── Page header ─────────────────────────────────────────────────── */
.page-head {
  padding: 88px 0 56px;
  position: relative;
}
@media (max-width: 820px) {
  .page-head { padding: 72px 0 36px; }
}
.crumbs {
  display: flex; align-items: center; gap: 8px;
  width: fit-content;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 32px;
}
.crumbs a {
  color: var(--maroon-soft);
  text-decoration: none;
  transition: color .2s ease;
}
.crumbs a:hover { color: var(--gold); }
.crumbs .sep { color: var(--text-dim); opacity: 0.5; }
.crumbs .here { color: var(--text); }

.page-head .eyebrow { margin-bottom: 24px; }
.page-head h1 {
  font-size: clamp(34px, 6vw, 84px);
  line-height: 1.02;
  margin-bottom: 24px;
  max-width: 900px;
}
.page-head h1 .accent {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}
.page-head .lede {
  font-size: 18px;
  color: var(--text-mute);
  line-height: 1.6;
  max-width: 680px;
  text-wrap: pretty;
}

.page-divider {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.page-divider .count strong {
  color: var(--gold);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  font-weight: 600;
  margin-right: 4px;
}

/* ─── Role accordion ──────────────────────────────────────────────── */
.roles {
  padding: 24px 0 120px;
  display: flex; flex-direction: column;
  gap: 16px;
}
@media (max-width: 820px) {
  .roles { padding: 12px 0 80px; }
}

.role {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .25s ease, background .25s ease;
}
.role[open] {
  border-color: color-mix(in srgb, var(--gold) 30%, var(--border));
  background: var(--bg-elev);
}
.role > summary {
  list-style: none;
  cursor: pointer;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 24px;
  transition: padding .25s ease;
}
@media (max-width: 820px) {
  .role > summary {
    padding: 20px 20px;
    grid-template-columns: 44px 1fr auto;
    gap: 14px;
  }
}
.role > summary::-webkit-details-marker { display: none; }
.role-num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  display: flex; align-items: baseline; gap: 4px;
}
.role-num .slash { color: var(--text-dim); font-weight: 400; opacity: 0.7; font-size: 16px; }
.role-title {
  display: flex; flex-direction: column; gap: 6px;
}
.role-title h3 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.role-title .tag {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--maroon-soft);
  font-weight: 800;
}
.role-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-mute);
  transition: all .25s ease;
}
.role:hover .role-toggle {
  border-color: var(--gold);
  color: var(--gold);
}
.role[open] .role-toggle {
  background: var(--gold);
  border-color: var(--gold);
  color: #1A0F00;
  transform: rotate(45deg);
}

.role-body {
  padding: 0 32px 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (max-width: 820px) {
  .role-body { padding: 0 20px 24px; gap: 24px; }
}

.role-overview {
  font-size: 16px;
  color: var(--text-mute);
  line-height: 1.7;
  padding: 24px 28px;
  background: var(--bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  text-wrap: pretty;
}

.role-section h4 {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

.role-phase {
  margin-bottom: 28px;
}
.role-phase:last-child { margin-bottom: 0; }
.role-phase h5 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.role-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex; flex-direction: column;
  gap: 12px;
}
.role-list li {
  padding-left: 28px;
  position: relative;
  font-size: 14.5px;
  color: var(--text-mute);
  line-height: 1.6;
  text-wrap: pretty;
}
.role-list li::before {
  content: "";
  position: absolute;
  left: 8px; top: 0.7em;
  width: 8px; height: 1px;
  background: var(--maroon-soft);
}
.role-list li strong {
  color: var(--text);
  font-weight: 600;
}
.role-list li em {
  font-style: italic;
  color: var(--gold-soft);
  font-weight: 500;
}

.role-download {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 8px;
  padding: 12px 18px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  text-decoration: none;
  border-radius: 999px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  transition: all .2s ease;
}
.role-download:hover {
  background: var(--gold);
  color: #1A0F00;
}

.roles--has-downloads { padding-bottom: 24px; }

/* ─── Additional downloads ─────────────────────────────────────────── */
.downloads {
  padding: 32px 0 160px;
}
@media (max-width: 820px) {
  .downloads { padding: 28px 24px 110px; }
}
.downloads-head {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
@media (max-width: 820px) {
  .downloads-head { padding-top: 24px; margin-bottom: 24px; }
}
.downloads-head h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.downloads-head .lede {
  font-size: 15px;
  color: var(--text-mute);
  line-height: 1.6;
  max-width: 600px;
}
.downloads-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* ─── Footer (matches home page) ─────────────────────────────────── */
footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
@media (max-width: 920px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .foot-col:nth-child(2), .foot-col:nth-child(3) { display: none; }
}

.foot-brand .brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text);
  font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em;
}
.foot-brand .brand-mark { width: 38px; height: 38px; font-size: 16px; }
.brand-sub {
  font-family: var(--font-body); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--text-mute); font-weight: 500;
  display: block; line-height: 1; margin-top: 3px;
}
.foot-brand p {
  color: var(--text-mute); font-size: 14px; margin-top: 16px; max-width: 360px; line-height: 1.6;
}
.foot-col h5 {
  font-family: var(--font-body); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-dim); font-weight: 600; margin-bottom: 18px;
}
.foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.foot-col a { color: var(--text-mute); text-decoration: none; font-size: 14px; transition: color .2s ease; }
.foot-col a:hover { color: var(--gold); }
.foot-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 32px; border-top: 1px solid var(--border); gap: 20px; flex-wrap: wrap;
}
.foot-bottom p { font-size: 12.5px; color: var(--text-dim); }
.foot-trademark {
  max-width: 100%;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.6;
  padding: 24px 64px 0;
  border-top: 1px dashed var(--border);
  margin-top: 32px;
}
@media (max-width: 820px) {
  .foot-trademark { padding-left: 24px; padding-right: 24px; }
}
