/* GrastrokDocBot 1.1 — drop-in for doc-illa.com. Load after styles.css. */

.site-nav { max-width: min(56rem, 82%); }
.site-nav a.nav-diagram { color: var(--gold-2); opacity: 0.9; }

.site .shoot-a { animation: shoot-along 27s linear 0s infinite; }
.site .shoot-b { animation: shoot-along 27s linear 9s infinite; }
.site .shoot-c { animation: shoot-along 27s linear 18s infinite; }
.site .shoot-d { animation: shoot-along 31s linear 3.5s infinite; }
.site .shoot-e { animation: shoot-along 29s linear 12s infinite; }
.site .shoot-f { animation: shoot-along 33s linear 21s infinite; }
.site .shoot-g { animation: shoot-along 28s linear 7s infinite; }

.diagram-page {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 5.6rem 0 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.diagram-head {
  text-align: center;
  padding: 0 1.2rem 0.55rem;
}
.diagram-head .eyebrow { margin-bottom: 0.55rem; animation: none; opacity: 1; }
.diagram-head h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.7rem, 4.4vw, 3.1rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.diagram-head h1 em { font-style: italic; font-weight: 400; color: var(--gold-2); }
.diagram-head .rule { margin: 0.7rem auto 0.55rem; opacity: 1; animation: none; }
.diagram-lede {
  max-width: 42rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  font-weight: 300;
  text-wrap: pretty;
}
.diagram-punch {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.35rem, 3.4vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--gold-2);
  margin: 0 0 0.55rem;
  text-wrap: balance;
}
.diagram-stage {
  position: relative;
  flex: 1;
  min-height: min(78vh, 920px);
  height: min(78vh, 920px);
  margin: 0.4rem auto 1.4rem;
  width: min(100% - 1.2rem, 1180px);
  border: 1px solid var(--line);
  background: #070708;
  overflow: hidden;
  border-radius: 0.2rem;
}
.timeloop-bg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(42%, 340px);
  height: min(42%, 340px);
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: screen;
  border-radius: 50%;
  overflow: hidden;
  filter: saturate(0.45) brightness(0.55) blur(0.6px);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, #000 38%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, #000 38%, transparent 72%);
}
.timeloop-bg iframe,
.timeloop-bg img {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  border: 0;
}
.timeloop-ring {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  animation: timeloop-spin 64s linear infinite;
}
.timeloop-thumb {
  position: absolute;
  width: 58px;
  height: 32px;
  margin: -16px 0 0 -29px;
  border: 1px solid rgba(201, 163, 106, 0.4);
  opacity: 0.55;
  object-fit: cover;
  filter: saturate(0.7) brightness(0.75);
  box-shadow: 0 0 18px rgba(201, 163, 106, 0.18);
}
.timeloop-thumb:nth-child(1) { left: 50%; top: 10%; }
.timeloop-thumb:nth-child(2) { left: 86.4%; top: 30%; }
.timeloop-thumb:nth-child(3) { left: 86.4%; top: 70%; }
.timeloop-thumb:nth-child(4) { left: 50%; top: 90%; }
.timeloop-thumb:nth-child(5) { left: 13.6%; top: 70%; }
.timeloop-thumb:nth-child(6) { left: 13.6%; top: 30%; }
@keyframes timeloop-spin { to { transform: rotate(360deg); } }

.diagram-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.diagram-canvas.dragging { cursor: grabbing; }
.diagram-toolbar {
  position: absolute;
  z-index: 5;
  left: 0.7rem;
  top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.diagram-toolbar button {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(9, 9, 10, 0.78);
  color: var(--gold-2);
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.48rem 0.62rem;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
}
.diagram-toolbar button.is-on {
  border-color: var(--gold);
  color: var(--ink);
}
.diagram-toolbar button.punch {
  border-color: var(--gold);
  color: var(--gold-2);
}
.diagram-toolbar button:hover { border-color: var(--gold); }
.diagram-legend {
  position: absolute;
  z-index: 5;
  right: 0.7rem;
  top: 0.7rem;
  width: min(16.5rem, calc(100% - 1.4rem));
  background: rgba(9, 9, 10, 0.82);
  border: 1px solid var(--line);
  padding: 0.7rem 0.8rem 0.75rem;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  line-height: 1.45;
}
.diagram-legend h2 {
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.45rem;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.22rem 0;
}
.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
}
.swatch-core { background: #f4efe6; }
.swatch-agent { background: #e8d3a4; }
.swatch-hardware { background: #c9a36a; }
.swatch-frontier { background: #d8c6a0; }
.swatch-public { background: #b7c0c8; }
.swatch-impossible { background: #8a6a4a; }
.swatch-qubit { background: #6e7a88; }
.swatch-phantom { background: #3a342c; }
.diagram-inspector {
  position: absolute;
  z-index: 5;
  left: 0.7rem;
  bottom: 0.7rem;
  width: min(26rem, calc(100% - 1.4rem));
  background: rgba(9, 9, 10, 0.88);
  border: 1px solid var(--line);
  padding: 0.75rem 0.85rem 0.8rem;
}
.diagram-inspector .k {
  font-family: var(--sans);
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.diagram-inspector h3 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0.15rem 0 0.25rem;
}
.diagram-inspector p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  font-weight: 300;
}
.diagram-inspector .meta {
  margin-top: 0.4rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.64rem;
  color: var(--gold-2);
  letter-spacing: 0.04em;
}
.diagram-log {
  position: absolute;
  z-index: 5;
  right: 0.7rem;
  bottom: 0.7rem;
  width: min(24rem, calc(100% - 1.4rem));
  max-height: 9.2rem;
  overflow: hidden;
  background: rgba(9, 9, 10, 0.84);
  border: 1px solid var(--line);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.6rem;
  line-height: 1.55;
  color: var(--gold-2);
  padding: 0.55rem 0.7rem;
}
.diagram-log .log-k { color: var(--muted); }
.diagram-log .log-bad { color: #d4a574; }
.diagram-hud {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 0.7rem;
  transform: translateX(-50%);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  pointer-events: none;
  white-space: nowrap;
}
@media (max-width: 860px) {
  .diagram-page { padding-top: 7.4rem; }
  .diagram-stage { height: min(72vh, 760px); min-height: 62vh; width: calc(100% - 0.6rem); }
  .diagram-legend { display: none; }
  .diagram-inspector {
    width: calc(100% - 1.2rem);
    padding: 0.5rem 0.65rem 0.55rem;
  }
  .diagram-inspector h3 { font-size: 1.05rem; }
  .diagram-inspector p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .diagram-log { display: none; }
  .diagram-hud { top: auto; bottom: 7.4rem; font-size: 0.5rem; }
  .diagram-toolbar { max-width: 72%; }
  .diagram-toolbar button { min-height: 2.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .timeloop-ring { animation: none; }
  .site .shoot-a,
  .site .shoot-b,
  .site .shoot-c,
  .site .shoot-d,
  .site .shoot-e,
  .site .shoot-f,
  .site .shoot-g { animation: none; }
}
.diagram-loop {
  margin: 0 auto 2.6rem;
  width: min(720px, calc(100% - 1.4rem));
}
.diagram-loop .reel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #09090a;
  overflow: hidden;
}
.diagram-loop iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.diagram-quote {
  margin: 0.75rem 0 0.35rem;
  max-width: 42rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-style: italic;
  line-height: 1.35;
  color: var(--gold-2, #e8d3a4);
  opacity: 0.92;
}
.diagram-tiny {
  margin: 0.45rem 0 0.2rem;
  max-width: 42rem;
  font-family: Outfit, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--ink-3, #9a958c);
  opacity: 0.72;
}

/* ARTISTIC ASI Build|War toggle — soft-pad cartoon only */
.diagram-toolbar button#btn-asi.asi-build {
  border-color: rgba(90, 150, 220, 0.85);
  color: #9ec4ef;
}
.diagram-toolbar button#btn-asi.asi-war {
  border-color: rgba(200, 70, 55, 0.95);
  color: #f0a090;
  box-shadow: 0 0 12px rgba(176, 64, 54, 0.35);
}
.diagram-toolbar button#btn-asi::after {
  content: " artistic";
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin-left: 0.25rem;
}

/* ASI·War soft-pad play — compact cue only */
canvas.war-play {
  cursor: crosshair;
}

/* GRASTROK 3X — L3 HUD (DOM only; spare, literary) */
.g3x-strata {
  position: absolute;
  z-index: 6;
  left: 0.7rem;
  bottom: 0.7rem;
  width: min(22rem, calc(100% - 1.4rem));
  max-height: 11rem;
  overflow: hidden;
  padding: 0.55rem 0.7rem 0.65rem;
  background: rgba(9, 9, 10, 0.88);
  border: 1px solid var(--line, rgba(201,163,106,0.28));
  color: var(--muted, #9a958c);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.78rem;
  line-height: 1.45;
  pointer-events: none;
}
.g3x-strata-k {
  font-family: Outfit, system-ui, sans-serif;
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold, #c9a36a);
  margin-bottom: 0.35rem;
}
.g3x-line { margin: 0.18rem 0; }
.g3x-tag {
  font-family: Outfit, system-ui, sans-serif;
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-2, #e8d3a4);
  margin-right: 0.35rem;
  opacity: 0.85;
}
.g3x-rels {
  margin-top: 0.4rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.03em;
  color: var(--gold-2, #e8d3a4);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.diagram-toolbar button.g3x-epoch,
.diagram-toolbar button#btn-epoch {
  border-color: rgba(201, 163, 106, 0.45);
  color: var(--gold-2, #e8d3a4);
}
@media (max-width: 860px) {
  .g3x-strata {
    width: calc(100% - 1.2rem);
    max-height: 7.5rem;
    font-size: 0.72rem;
    bottom: 0.55rem;
  }
  .g3x-line:nth-child(4) { /* doc-myth may clamp on small */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}