/* Per-essay overlay for "Granice agencji" (ARG Essay 09).
   Base layout, palette, callouts, and shared keyframes come from
   ../ailectricity/style.css. This file adds:
   - Hero SVG classes for the three-regime scale diagram
   - Three custom keyframes (infraDriftA/B/C, noiseTwinkle, windowPulse)
   - Opening-note, three-regimes content block, footnotes
*/

/* ---------- Opening note (editorial intro) ---------- */
.scale-content .opening-note {
  margin: 0 0 2.4rem;
  padding: 0.9rem 1.2rem;
  border-left: 2px solid rgba(99, 214, 198, 0.46);
  background: rgba(99, 214, 198, 0.04);
  color: rgba(236, 232, 220, 0.78);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.94rem;
  font-style: italic;
  line-height: 1.6;
}

/* ---------- Three regimes inline diagram (chapter IV) ---------- */
.scale-content .three-regimes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 2rem 0;
}

.scale-content .three-regimes section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(214, 199, 150, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 60%),
    rgba(13, 16, 22, 0.62);
}

.scale-content .three-regimes section:nth-child(2) {
  border-color: rgba(212, 182, 111, 0.42);
  background:
    linear-gradient(180deg, rgba(212, 182, 111, 0.07), transparent 60%),
    rgba(15, 18, 26, 0.72);
}

.scale-content .three-regimes span {
  color: rgba(212, 182, 111, 0.78);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

.scale-content .three-regimes h3 {
  margin: 0;
  color: var(--text, #ece8dc);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scale-content .three-regimes p {
  margin: 0;
  color: rgba(236, 232, 220, 0.78);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ---------- Footnotes ---------- */
.scale-content .footnotes {
  margin: 3rem 0 0;
  color: rgba(170, 164, 146, 0.92);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  line-height: 1.6;
}

.scale-content .footnotes hr {
  margin: 0 0 1.1rem;
  background: linear-gradient(90deg, transparent, rgba(214, 199, 150, 0.32), transparent);
}

.scale-content .footnotes ol {
  margin: 0;
  padding-left: 1.4rem;
}

.scale-content .footnotes li {
  margin-bottom: 0.6rem;
}

.scale-content .fn-ref {
  font-size: 0.78em;
  vertical-align: super;
  line-height: 0;
  margin-left: 0.15em;
}

.scale-content .fn-ref a {
  color: #f0d99c;
  text-decoration: none;
  font-weight: 700;
  padding: 0.05em 0.2em;
  border: 1px solid rgba(212, 182, 111, 0.55);
  border-radius: 3px;
  background: rgba(212, 182, 111, 0.08);
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.scale-content .fn-ref a::before { content: "["; }
.scale-content .fn-ref a::after { content: "]"; }

.scale-content .fn-ref a:hover,
.scale-content .fn-ref a:focus-visible {
  color: #0a0c12;
  background: #f0d99c;
  border-color: #f0d99c;
  outline: none;
}

.scale-content .fn-back {
  margin-left: 0.3em;
  color: rgba(99, 214, 198, 0.82);
  text-decoration: none;
}

.scale-content .fn-back:hover,
.scale-content .fn-back:focus-visible {
  color: #63d6c6;
  outline: none;
}

/* ====================================================
   SCALE-GRAPHIC — hero SVG: three regimes of time scale
   ==================================================== */

.scale-graphic .grid-line {
  stroke: rgba(214, 199, 150, 0.05);
}

/* ---------- Vertical time axis ---------- */
.scale-graphic .time-axis-line {
  stroke-width: 1.5;
  opacity: 0.7;
}

.scale-graphic .time-axis-tick {
  stroke: rgba(214, 199, 150, 0.58);
  stroke-width: 1.5;
}

.scale-graphic .time-axis-label {
  fill: rgba(170, 164, 146, 0.78);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-anchor: end;
}

.scale-graphic .time-axis-label--strong {
  fill: rgba(212, 182, 111, 0.95);
  font-weight: 600;
}

/* ---------- Band labels ---------- */
.scale-graphic .band-label {
  fill: rgba(170, 164, 146, 0.62);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-anchor: start;
}

.scale-graphic .band-label--strong {
  fill: rgba(212, 182, 111, 0.92);
}

/* ---------- TOP BAND: infrastructure (slow drift) ---------- */
.scale-graphic .infra-block rect {
  fill: rgba(106, 143, 220, 0.07);
  stroke: rgba(106, 143, 220, 0.46);
  stroke-width: 1.2;
}

.scale-graphic .infra-block text {
  fill: rgba(170, 184, 220, 0.82);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-anchor: middle;
}

.scale-graphic .infra-block--a {
  animation: infraDriftA 14s ease-in-out infinite;
}

.scale-graphic .infra-block--b {
  animation: infraDriftB 18s ease-in-out infinite;
  animation-delay: -3s;
}

.scale-graphic .infra-block--c {
  animation: infraDriftC 22s ease-in-out infinite;
  animation-delay: -7s;
}

@keyframes infraDriftA {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

@keyframes infraDriftB {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-8px); }
}

@keyframes infraDriftC {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

/* ---------- MIDDLE BAND: negotiation window (gold-highlighted) ---------- */
.scale-graphic .window-tint {
  fill: rgba(212, 182, 111, 0.05);
  stroke: rgba(212, 182, 111, 0.3);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.scale-graphic .window-glow {
  fill: url(#windowGlow);
  opacity: 0.7;
  animation: windowPulse 5.4s ease-in-out infinite;
}

@keyframes windowPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.92; }
}

.scale-graphic .window-node circle {
  stroke: rgba(212, 182, 111, 0.72);
}

.scale-graphic .window-node text {
  fill: rgba(236, 232, 220, 0.86);
}

.scale-graphic .window-node--agent text:last-child,
.scale-graphic .window-node--world text:last-child {
  fill: rgba(212, 182, 111, 0.82);
  font-size: 10px;
}

.scale-graphic .window-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 6 5;
  opacity: 0.85;
  animation: lineFlow 3.8s linear infinite;
}

.scale-graphic .window-line-label {
  fill: rgba(212, 182, 111, 0.86);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-anchor: middle;
}

/* ---------- BOTTOM BAND: noise / traces (fast twinkle) ---------- */
.scale-graphic .noise-dot {
  fill: rgba(99, 214, 198, 0.7);
}

.scale-graphic .noise-dot--1 { animation: noiseTwinkle 1.6s steps(2, end) infinite; }
.scale-graphic .noise-dot--2 { animation: noiseTwinkle 2.1s steps(2, end) infinite; animation-delay: -0.3s; }
.scale-graphic .noise-dot--3 { animation: noiseTwinkle 1.9s steps(2, end) infinite; animation-delay: -0.6s; }
.scale-graphic .noise-dot--4 { animation: noiseTwinkle 2.4s steps(2, end) infinite; animation-delay: -0.9s; }
.scale-graphic .noise-dot--5 { animation: noiseTwinkle 1.7s steps(2, end) infinite; animation-delay: -1.2s; }

@keyframes noiseTwinkle {
  50% { opacity: 0.15; }
}

.scale-graphic .noise-trace {
  fill: none;
  stroke: rgba(99, 214, 198, 0.34);
  stroke-width: 1.2;
  stroke-dasharray: 3 4;
  animation: noiseTraceFlow 8s linear infinite;
}

@keyframes noiseTraceFlow {
  to { stroke-dashoffset: -28; }
}

/* ---------- Caption ---------- */
.scale-graphic .caption {
  fill: rgba(170, 164, 146, 0.76);
  text-anchor: start;
  font-style: italic;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 720px) {
  .scale-content .three-regimes {
    grid-template-columns: 1fr;
  }
}
