html {
  scroll-behavior: smooth;
}

:root {
  --marble: #f0ebe3;
  --gold: #c9a227;
  --gold-bright: #e8d48b;
  --sync-cyan: #4fd1d5;
  --core-orange: #ff7b29;
  --arrhythmia-green: #39ff14;
  --ink: #e6e2d8;
  --ink-soft: #a39e92;
  --vault: #0c0a08;
  --panel: rgba(18, 16, 14, 0.72);
  --panel-edge: rgba(201, 162, 39, 0.35);
  --hud-line: rgba(79, 209, 213, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-weight: 400;
  color: var(--ink);
  background-color: var(--vault);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(201, 162, 39, 0.16), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(79, 209, 213, 0.08), transparent 45%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(184, 115, 51, 0.06), transparent 50%),
    linear-gradient(180deg, #14110d 0%, #0c0a08 38%, #080706 100%);
  overflow-x: hidden;
  transition: background 400ms ease, color 400ms ease;
  line-height: 1.45;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(201, 162, 39, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 162, 39, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 40%, black 20%, transparent 75%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", "Palatino Linotype", serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg, rgba(12, 10, 8, 0.92), rgba(12, 10, 8, 0.78));
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(201, 162, 39, 0.22);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 -1px 0 rgba(79, 209, 213, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.brand-icon {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 8px rgba(201, 162, 39, 0.45));
}

.controls {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.btn-tech {
  border: 1px solid var(--panel-edge);
  background: linear-gradient(145deg, rgba(32, 28, 22, 0.95), rgba(18, 16, 14, 0.88));
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 20px rgba(0, 0, 0, 0.35);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.nav-link {
  text-decoration: none;
  display: inline-block;
}

.btn-tech:hover,
.btn-tech:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(79, 209, 213, 0.55);
  color: var(--gold-bright);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(79, 209, 213, 0.2),
    0 0 24px rgba(79, 209, 213, 0.15);
  outline: none;
}

main {
  position: relative;
  z-index: 1;
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 2rem 0 3.5rem;
}

.hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
  position: relative;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: min(420px, 70vw);
  height: 1px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--panel-edge), var(--sync-cyan), var(--panel-edge), transparent);
  opacity: 0.85;
}

.hero::before {
  top: 0.5rem;
}

.hero::after {
  bottom: 0.3rem;
}

.eyebrow {
  color: var(--sync-cyan);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.92;
}

.main-title {
  margin: 0;
  display: inline-block;
  position: relative;
  max-width: 100%;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  font-weight: 700;
  line-height: 1.05;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 35%, #8b6914 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 40px rgba(201, 162, 39, 0.25));
  word-break: normal;
  overflow-wrap: anywhere;
}

.core-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 2rem auto 1.6rem;
  display: grid;
  place-items: center;
}

.core-wrap::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, transparent, rgba(79, 209, 213, 0.12), transparent 40%, rgba(201, 162, 39, 0.1), transparent 75%);
  animation: coreHalo 10s linear infinite;
  opacity: 0.9;
}

.core-pulse {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8e7, var(--core-orange) 55%, #8b2500);
  box-shadow:
    0 0 40px rgba(255, 123, 41, 0.75),
    0 0 80px rgba(255, 123, 41, 0.25);
  animation: coreBeat 3s infinite;
}

.core-ring {
  position: absolute;
  width: 158px;
  height: 158px;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.55);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.12);
  animation: drawLine 4s linear infinite;
}

.core-ring.secondary {
  width: 202px;
  height: 202px;
  border-color: rgba(79, 209, 213, 0.4);
  animation-duration: 5.2s;
}

.core-gear {
  position: absolute;
  width: 40px;
  opacity: 0.95;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
}

.hero-copy {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-weight: 400;
}

.secret-message {
  opacity: 0;
  margin-top: 1.1rem;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--arrhythmia-green);
  text-shadow: 0 0 18px rgba(57, 255, 20, 0.35);
  transition: opacity 280ms ease;
  min-height: 1.4em;
}

.city-map,
.news-grid,
.status-panel {
  margin-top: 2rem;
}

.ornate-panel,
.news-column,
.widget,
.sector-card {
  position: relative;
  overflow: hidden;
}

.ornate-panel::before,
.news-column::before,
.widget::before,
.sector-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(201, 162, 39, 0.12);
  pointer-events: none;
  clip-path: polygon(0 10px, 10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px));
}

.city-map {
  padding: 1.5rem 1.35rem 1.35rem;
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-edge);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}

.city-map h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.65rem, 3.2vw, 2.15rem);
  color: var(--gold-bright);
  font-weight: 600;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.sector {
  text-align: left;
  border: 1px solid rgba(79, 209, 213, 0.2);
  background: linear-gradient(165deg, rgba(26, 22, 18, 0.95), rgba(14, 12, 10, 0.88));
  padding: 1.1rem 1rem 1.15rem;
  color: inherit;
  cursor: pointer;
  min-height: 152px;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  position: relative;
}

.sector::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sync-cyan), var(--gold));
  opacity: 0;
  transition: opacity 180ms ease;
}

.sector h3 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
  color: var(--ink);
}

.sector p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.sector:hover,
.sector:focus-visible {
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.45),
    0 0 28px rgba(79, 209, 213, 0.12);
  transform: translateY(-5px);
  outline: none;
}

.sector:hover::after,
.sector:focus-visible::after {
  opacity: 1;
}

.sector-card {
  margin-top: 1rem;
  padding: 1.2rem 1.2rem;
  border: 1px solid rgba(79, 209, 213, 0.28);
  background: linear-gradient(180deg, rgba(20, 26, 28, 0.75), rgba(12, 14, 16, 0.82));
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.sector-card h3 {
  margin: 0 0 0.45rem;
  color: var(--sync-cyan);
  font-size: 1.4rem;
}

.sector-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.news-column {
  border: 1px solid var(--panel-edge);
  padding: 1.2rem 1.2rem 1.15rem;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.news-column h2 {
  margin: 0 0 0.85rem;
  font-size: 1.45rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}

.news-column.official h2 {
  color: var(--gold-bright);
}

.news-column.underground h2 {
  color: #7fdc9a;
  border-bottom-color: rgba(57, 255, 20, 0.15);
}

.news-column ul {
  margin: 0;
  padding-left: 1.15rem;
}

.news-column li {
  margin-bottom: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.news-column li:last-child {
  margin-bottom: 0;
}

.status-panel {
  display: flex;
  gap: 1rem;
}

.widget {
  flex: 1;
  border: 1px solid rgba(79, 209, 213, 0.25);
  padding: 1.15rem 1.2rem;
  background: linear-gradient(135deg, rgba(18, 22, 24, 0.88), rgba(12, 10, 8, 0.9));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
}

.widget h3 {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.widget p {
  margin-bottom: 0;
  font-size: 1.65rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--sync-cyan);
  text-shadow: 0 0 24px rgba(79, 209, 213, 0.35);
}

.timeline {
  position: relative;
  display: grid;
  gap: 1.1rem;
  margin-top: 2rem;
  padding: 0.5rem 0 0.5rem 5.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2rem;
  width: 2px;
  background: linear-gradient(
    180deg,
    rgba(201, 162, 39, 0.15),
    rgba(201, 162, 39, 0.85),
    rgba(79, 209, 213, 0.45),
    rgba(201, 162, 39, 0.15)
  );
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.2);
}

.timeline-item {
  position: relative;
  min-height: 120px;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -3.78rem;
  top: 1.8rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.2), 0 0 16px rgba(201, 162, 39, 0.35);
}

.timeline-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-year {
  position: absolute;
  left: -5.5rem;
  top: 1.15rem;
  width: 3rem;
  text-align: right;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-bright);
}

.timeline-card {
  border: 1px solid var(--panel-edge);
  background: var(--panel);
  backdrop-filter: blur(8px);
  padding: 1.05rem 1.15rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

.timeline-era {
  margin: 0 0 0.35rem;
  color: var(--sync-cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
}

.timeline-card h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  color: var(--ink);
}

.timeline-card p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.timeline-item.featured .timeline-card {
  border-color: rgba(255, 123, 41, 0.45);
  box-shadow: 0 14px 36px rgba(255, 123, 41, 0.12);
}

.timeline-item.featured::before {
  background: var(--core-orange);
  box-shadow: 0 0 0 4px rgba(255, 123, 41, 0.2), 0 0 18px rgba(255, 123, 41, 0.45);
}

.timeline-item.underground .timeline-card {
  border-color: rgba(57, 255, 20, 0.22);
}

.edge-glow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  border: 1px solid transparent;
  box-shadow: inset 0 0 50px rgba(79, 209, 213, 0.08);
  animation: edgePulse 5s ease-in-out infinite;
}

.digital-fractures {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 2;
  background-image: repeating-linear-gradient(
    118deg,
    transparent 0 36px,
    rgba(57, 255, 20, 0.07) 36px 37px,
    transparent 37px 74px
  );
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 350ms ease;
}

body.mode-arrhythmia {
  color: #c8ffd8;
  background-image:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(57, 255, 20, 0.08), transparent 50%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(0, 255, 255, 0.06), transparent 45%),
    linear-gradient(185deg, #060808 0%, #020302 50%, #000100 100%);
}

body.mode-arrhythmia::before {
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(57, 255, 20, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 20, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: none;
}

body.mode-arrhythmia::after {
  opacity: 0.12;
}

body.mode-arrhythmia .topbar,
body.mode-arrhythmia .news-column,
body.mode-arrhythmia .widget,
body.mode-arrhythmia .sector,
body.mode-arrhythmia .sector-card,
body.mode-arrhythmia .timeline-card,
body.mode-arrhythmia .city-map,
body.mode-arrhythmia .ency-article,
body.mode-arrhythmia .ency-toc {
  background: rgba(4, 8, 6, 0.78);
  border-color: rgba(57, 255, 20, 0.28);
}

body.mode-arrhythmia .ornate-panel::before,
body.mode-arrhythmia .news-column::before,
body.mode-arrhythmia .widget::before,
body.mode-arrhythmia .sector-card::before,
body.mode-arrhythmia .ency-article::before {
  border-color: rgba(57, 255, 20, 0.1);
}

body.mode-arrhythmia .timeline::before {
  background: linear-gradient(
    180deg,
    rgba(57, 255, 20, 0.12),
    rgba(57, 255, 20, 0.88),
    rgba(0, 255, 255, 0.35),
    rgba(57, 255, 20, 0.12)
  );
}

body.mode-arrhythmia .timeline-year,
body.mode-arrhythmia .timeline-era {
  color: #7dffb0;
}

body.mode-arrhythmia .timeline-item::before {
  background: var(--arrhythmia-green);
  box-shadow: 0 0 0 4px rgba(57, 255, 20, 0.15), 0 0 20px rgba(57, 255, 20, 0.4);
}

body.mode-arrhythmia .timeline-item.featured::before {
  background: var(--sync-cyan);
  box-shadow: 0 0 0 4px rgba(79, 209, 213, 0.2), 0 0 20px rgba(79, 209, 213, 0.45);
}

body.mode-arrhythmia .digital-fractures {
  opacity: 0.38;
}

body.mode-arrhythmia .underground {
  box-shadow: 0 0 22px rgba(57, 255, 20, 0.22);
}

body.mode-arrhythmia .secret-message {
  opacity: 1;
}

body.mode-arrhythmia .main-title {
  background: linear-gradient(135deg, #9fff9f 0%, #39ff14 40%, #00ffc8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 28px rgba(57, 255, 20, 0.35));
}

body.mode-arrhythmia .glitch-target {
  position: relative;
  animation: glitch 1.6s infinite;
}

body.mode-arrhythmia .glitch-target::before,
body.mode-arrhythmia .glitch-target::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  pointer-events: none;
}

body.mode-arrhythmia .glitch-target::before {
  text-shadow: 2px 0 #00ff00;
  transform: translate(-2px, 0);
  opacity: 0.75;
}

body.mode-arrhythmia .glitch-target::after {
  text-shadow: -2px 0 #00ffff;
  transform: translate(2px, 0);
  opacity: 0.6;
}

body.mode-arrhythmia .edge-glow {
  box-shadow: inset 0 0 60px rgba(57, 255, 20, 0.12);
  animation: edgePulseArr 3.2s ease-in-out infinite;
}

body.mode-arrhythmia .btn-tech {
  border-color: rgba(57, 255, 20, 0.35);
  color: #c8ffd8;
}

body.mode-arrhythmia .hero-copy,
body.mode-arrhythmia .news-column li,
body.mode-arrhythmia .timeline-card p,
body.mode-arrhythmia .sector p {
  color: rgba(186, 255, 210, 0.78);
}

body.mode-arrhythmia .timeline-card h2,
body.mode-arrhythmia .sector h3 {
  color: #e8fff0;
}

body.mode-arrhythmia .brand {
  color: #9fff9f;
}

body.mode-arrhythmia .widget p {
  color: var(--arrhythmia-green);
  text-shadow: 0 0 28px rgba(57, 255, 20, 0.45);
}

body.mode-arrhythmia .sector-card {
  border-color: rgba(57, 255, 20, 0.35);
}

body.mode-arrhythmia .sector-card h3 {
  color: var(--arrhythmia-green);
}

body.mode-arrhythmia .ency-meta {
  color: #7dffb0;
}

body.mode-arrhythmia .ency-entry-title,
body.mode-arrhythmia .ency-section-title,
body.mode-arrhythmia .ency-list strong {
  color: #e8fff0;
}

body.mode-arrhythmia .ency-lead,
body.mode-arrhythmia .ency-section p,
body.mode-arrhythmia .ency-list li,
body.mode-arrhythmia .ency-identifier-text {
  color: rgba(186, 255, 210, 0.78);
}

body.mode-arrhythmia .ency-toc-list a {
  color: #c8ffd8;
  border-bottom-color: rgba(57, 255, 20, 0.35);
}

body.mode-arrhythmia .ency-toc-list a:hover,
body.mode-arrhythmia .ency-toc-list a:focus-visible {
  color: var(--arrhythmia-green);
  border-color: var(--arrhythmia-green);
}

body.mode-arrhythmia .ency-note {
  background: rgba(57, 255, 20, 0.06);
  border-left-color: var(--arrhythmia-green);
}

body.mode-arrhythmia .ency-math {
  color: var(--arrhythmia-green);
}

@keyframes coreBeat {
  0%,
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 24px rgba(255, 123, 41, 0.55);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 48px rgba(255, 123, 41, 0.9);
  }
}

@keyframes coreHalo {
  to {
    transform: rotate(360deg);
  }
}

@keyframes edgePulse {
  0%,
  100% {
    box-shadow: inset 0 0 40px rgba(79, 209, 213, 0.06);
  }
  50% {
    box-shadow: inset 0 0 70px rgba(201, 162, 39, 0.12);
  }
}

@keyframes edgePulseArr {
  0%,
  100% {
    box-shadow: inset 0 0 45px rgba(57, 255, 20, 0.08);
  }
  50% {
    box-shadow: inset 0 0 80px rgba(57, 255, 20, 0.16);
  }
}

@keyframes drawLine {
  0% {
    transform: rotate(0deg);
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: rotate(360deg);
    opacity: 0.75;
  }
}

@keyframes glitch {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(1px, -1px);
  }
  40% {
    transform: translate(-1px, 1px);
  }
  60% {
    transform: translate(1px, 0);
  }
  80% {
    transform: translate(-1px, -1px);
  }
}

.ency-article {
  position: relative;
  padding: 1.6rem 1.5rem 1.85rem;
  margin-top: 0.5rem;
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-edge);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}

.ency-article-head {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.22);
}

.ency-meta {
  margin: 0 0 0.4rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sync-cyan);
}

.ency-entry-title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1.15;
}

.ency-lead {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 72ch;
}

.ency-lead--tight {
  margin-top: -0.35rem;
  margin-bottom: 1.35rem;
}

.ency-toc {
  margin: 0 0 1.75rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(165deg, rgba(26, 22, 18, 0.65), rgba(14, 12, 10, 0.55));
  border: 1px solid rgba(79, 209, 213, 0.2);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.ency-toc-title {
  margin: 0 0 0.65rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.ency-toc-list {
  margin: 0;
  padding-left: 1.2rem;
}

.ency-toc-list li {
  margin-bottom: 0.4rem;
}

.ency-toc-list li:last-child {
  margin-bottom: 0;
}

.ency-toc-list a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(79, 209, 213, 0.35);
  transition: color 140ms ease, border-color 140ms ease;
}

.ency-toc-list a:hover,
.ency-toc-list a:focus-visible {
  color: var(--sync-cyan);
  border-color: var(--sync-cyan);
  outline: none;
}

.ency-section {
  margin-top: 1.75rem;
  scroll-margin-top: 5.5rem;
}

.ency-section:first-of-type {
  margin-top: 0.25rem;
}

.ency-section-title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.25rem, 2.8vw, 1.55rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

.ency-section-num {
  color: var(--sync-cyan);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85em;
  font-weight: 500;
  margin-right: 0.35rem;
}

.ency-section p {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 72ch;
}

.ency-list {
  margin: 0;
  padding-left: 1.15rem;
  max-width: 72ch;
}

.ency-list li {
  margin-bottom: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.ency-list li:last-child {
  margin-bottom: 0;
}

.ency-list strong {
  color: var(--ink);
  font-weight: 600;
}

.ency-note {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--core-orange);
  background: rgba(255, 123, 41, 0.06);
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-width: 72ch;
}

.ency-section--identifier {
  margin-top: 2rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(201, 162, 39, 0.2);
}

.ency-section--identifier .ency-section-title {
  color: var(--gold-bright);
}

.ency-identifier-text {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
  max-width: 72ch;
}

.ency-math {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  color: var(--sync-cyan);
}

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

  .news-grid {
    grid-template-columns: 1fr;
  }

  .status-panel {
    flex-direction: column;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls {
    width: 100%;
  }

  .btn-tech {
    width: 100%;
    text-align: center;
  }

  .main-title {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .hero-copy {
    font-size: 0.98rem;
  }

  .timeline {
    padding-left: 3rem;
  }

  .timeline::before {
    left: 0.85rem;
  }

  .timeline-item::before {
    left: -2.1rem;
  }

  .timeline-year {
    position: static;
    width: auto;
    text-align: left;
    margin-bottom: 0.45rem;
  }
}
