/**
 * arch.css — All styles for The Arch
 * ROOT0-ATTRIBUTION-v1.0 · David Lee Wise / ROOT0 / TriPod LLC
 */

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── BASE ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(130% 60% at 50% 0%, #1e2330 0%, var(--bg) 50%, var(--bg2) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/></svg>");
  min-height: 100vh;
  padding-bottom: 60px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ── HEADER ─────────────────────────────────────────────────── */
header {
  padding: 44px 0 0;
  text-align: center;
}

.kick {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 14px;
  opacity: 0.9;
}

h1.arch-title {
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(28px, 5.5vw, 52px);
  line-height: 1;
  letter-spacing: .06em;
  color: var(--inscribe);
  margin-bottom: 14px;
}

.sub {
  font-family: var(--body);
  font-style: italic;
  font-size: 17px;
  color: var(--txt2);
  max-width: 58ch;
  margin: 0 auto 20px;
  line-height: 1.55;
}

/* ── TOOLBAR ─────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}

.tool-btn {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  padding: 7px 16px;
  border: 1px solid var(--joint);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--txt2);
  cursor: pointer;
  transition: all var(--t-fast);
}
.tool-btn:hover { border-color: var(--bronze); color: var(--bronze); }
.tool-btn.active { border-color: var(--bronze-glow); color: var(--bronze-glow); background: rgba(192,146,62,.1); }

.kbd-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
.kbd-hint kbd {
  border: 1px solid var(--joint);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--faint);
  background: var(--mortar);
}

/* ── STAGE (arch + detail) ───────────────────────────────────── */
.stage {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  margin-top: 10px;
  align-items: start;
}

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

/* ── SVG ARCH ────────────────────────────────────────────────── */
svg.arch {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 40px 60px rgba(0,0,0,.6));
}

/* Stone hover/select */
.course .face { transition: filter var(--t-fast); }
.course:hover .face { filter: brightness(1.14) contrast(1.05); }
.course.sel .face   { filter: brightness(1.20) contrast(1.08); }
.course .ring       { transition: opacity var(--t-fast); }
.course.sel .ring   { opacity: 1 !important; }
.course { cursor: pointer; outline: none; }
.course:focus-visible { outline: none; } /* handled by SVG ring */

/* Keystone pulse animation */
@keyframes keystone-glow {
  0%, 100% { opacity: 0.4; stroke-width: 2; }
  50%       { opacity: 0.85; stroke-width: 3; }
}
.keystone-pulse {
  animation: keystone-glow 2.4s ease-in-out infinite;
}

/* ── DETAIL PANEL ────────────────────────────────────────────── */
.detail {
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  background: var(--panel);
  padding: 22px 24px 24px;
  min-height: 340px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

/* Detail animate-in */
@keyframes detail-in {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.detail.d-animate { animation: detail-in 0.22s ease both; }

/* Detail nav */
.d-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.d-position {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--dim);
}
.d-nav-btn {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: color var(--t-fast), background var(--t-fast);
}
.d-nav-btn:hover { color: var(--bronze); background: rgba(192,146,62,.08); }

/* Detail content */
.d-course-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 5px;
}

.d-name {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: .03em;
  line-height: 1.1;
  color: var(--inscribe);
  margin-bottom: 6px;
}
.d-name.key { color: var(--bronze-l); }

.d-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.d-blocks {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .04em;
}
.d-weight {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.d-weight b { color: var(--txt2); }

.d-quote {
  border-left: 3px solid var(--bronze-d);
  padding: 8px 14px;
  margin: 0 0 14px;
  font-style: italic;
  font-size: 15px;
  color: var(--txt2);
  line-height: 1.5;
  background: rgba(188,139,62,.06);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.d-body {
  font-size: 15.5px;
  color: var(--txt);
  line-height: 1.62;
  margin-bottom: 14px;
}
.d-body b { color: var(--inscribe); font-weight: 600; }

.d-prims {
  list-style: none;
  padding: 0;
  margin-bottom: 14px;
}
.d-prims li {
  font-size: 14px;
  color: var(--txt);
  padding: 6px 0 6px 18px;
  position: relative;
  line-height: 1.45;
  border-top: 1px solid var(--hair);
}
.d-prims li:first-child { border-top: 0; }
.d-prims li::before {
  content: "▪";
  position: absolute;
  left: 0;
  color: var(--bronze);
  font-size: 11px;
  top: 8px;
}

.d-bound, .d-threat {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.d-bound {
  border-left: 3px solid var(--bronze-d);
  background: rgba(188,139,62,.07);
}
.d-threat {
  border-left: 3px solid var(--danger);
  background: rgba(192,80,80,.06);
}
.d-bound-label, .d-threat-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.d-bound-label { color: var(--bronze); }
.d-threat-label { color: #a04040; }
.d-bound-text, .d-threat-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  font-style: italic;
}
.d-bound-text { color: var(--txt2); }
.d-threat-text { color: #b07070; }

/* ── AXES LEGEND ─────────────────────────────────────────────── */
.axes {
  display: flex;
  justify-content: center;
  gap: 44px;
  margin: 8px 0;
  flex-wrap: wrap;
}
.ax {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 7px;
}
.ax b { color: var(--txt2); }

/* ── KEYLINE ─────────────────────────────────────────────────── */
.keyline {
  margin: 28px auto 0;
  max-width: 72ch;
  text-align: center;
  font-family: var(--body);
  font-size: 17px;
  color: var(--txt2);
  line-height: 1.65;
  border-top: 1px solid var(--hair);
  padding-top: 22px;
}
.keyline b   { color: var(--bronze-l); font-weight: 600; }
.keyline .res{ color: var(--inscribe); }

/* ── STRUCTURE SUMMARY (footer) ──────────────────────────────── */
.structure-summary {
  margin: 24px auto 0;
  max-width: 78ch;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.8;
  text-align: center;
}
.structure-summary b { color: var(--txt2); }

/* ── INFO PANEL (overlay) ────────────────────────────────────── */
.info-panel {
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin: 20px 0 0;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
.info-panel[hidden] { display: none; }
.info-panel h3 {
  font-family: var(--disp);
  font-size: 18px;
  color: var(--inscribe);
  margin-bottom: 14px;
}
.info-panel p {
  font-size: 14.5px;
  color: var(--txt2);
  margin-bottom: 12px;
  line-height: 1.6;
}
.info-panel code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--bronze);
  background: rgba(192,146,62,.1);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ── SCROLLBAR ───────────────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--joint) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--joint); border-radius: 3px; }
