:root {
  color-scheme: dark;
  --cyan: #34f5ff;
  --mint: #49ffb6;
  --amber: #ffcf70;
  --panel: #10181a;
  --panel-deep: #050a0c;
  --steel: #243235;
  --text: #e8fbff;
  --muted: #8cb6bd;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 12%, rgba(52, 245, 255, 0.18), transparent 22rem),
    radial-gradient(circle at 92% 86%, rgba(73, 255, 182, 0.12), transparent 26rem),
    linear-gradient(135deg, #030607, #0a1214 44%, #151817);
  color: var(--text);
  font-family:
    "Arial Narrow",
    "Roboto Condensed",
    Arial,
    sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(73, 255, 182, 0.025) 0 1px, transparent 1px 88px);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, rgba(52, 245, 255, 0.15), transparent 18%, transparent 82%, rgba(73, 255, 182, 0.14)),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(255, 255, 255, 0.035) 22px 23px);
  opacity: 0.65;
  pointer-events: none;
}

.viewport {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 44px);
}

.browser-shell {
  width: min(1220px, 100%);
  border: 1px solid rgba(52, 245, 255, 0.28);
  background: rgba(2, 7, 9, 0.72);
  box-shadow:
    0 0 48px rgba(52, 245, 255, 0.18),
    0 34px 90px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
}

.browser-bar {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(52, 245, 255, 0.2);
  background: linear-gradient(180deg, rgba(42, 55, 57, 0.78), rgba(9, 17, 19, 0.88));
}

.browser-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px currentColor;
}

.browser-bar span:nth-child(2) {
  background: var(--mint);
}

.browser-bar span:nth-child(3) {
  background: var(--cyan);
}

.address {
  height: 24px;
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  margin-left: 9px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9bd7df;
  background: rgba(0, 0, 0, 0.28);
  font: 11px/1.2 "Courier New", monospace;
  letter-spacing: 0;
  overflow: hidden;
  white-space: nowrap;
}

.construction-panel {
  position: relative;
  min-height: min(760px, calc(100svh - 98px));
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.07), transparent 23%, rgba(255, 255, 255, 0.035) 52%, transparent),
    repeating-linear-gradient(110deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 7px),
    linear-gradient(145deg, #11191b, var(--panel-deep));
}

.construction-panel::before {
  position: absolute;
  inset: 22px;
  content: "";
  border: 1px solid rgba(52, 245, 255, 0.22);
  box-shadow: inset 0 0 28px rgba(52, 245, 255, 0.1);
  pointer-events: none;
  z-index: 2;
}

.construction-panel::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(rgba(52, 245, 255, 0.06), transparent 1px),
    linear-gradient(90deg, rgba(52, 245, 255, 0.04), transparent 1px);
  background-size: 100% 4px, 4px 100%;
  mix-blend-mode: screen;
  opacity: 0.45;
  pointer-events: none;
  z-index: 4;
}

.matrix-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.54;
  z-index: 0;
}

.panel-content {
  position: relative;
  z-index: 3;
  min-height: inherit;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(13px, 2vw, 22px);
  padding: clamp(56px, 8vw, 96px) clamp(18px, 14vw, 170px);
  text-align: center;
}

.microcopy,
.log-tail,
.status-text {
  font-family: "Courier New", monospace;
  letter-spacing: 0;
}

.microcopy {
  margin: 0;
  color: var(--mint);
  font-size: clamp(10px, 1.1vw, 13px);
  text-shadow: 0 0 12px rgba(73, 255, 182, 0.72);
  animation: pulse 2s ease-in-out infinite;
}

h1 {
  margin: 0;
  max-width: 100%;
  color: #efffff;
  font-family: "Courier New", monospace;
  font-size: clamp(38px, 8vw, 104px);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow:
    0 0 10px rgba(52, 245, 255, 0.92),
    0 0 28px rgba(52, 245, 255, 0.44),
    3px 0 0 rgba(73, 255, 182, 0.32),
    -3px 0 0 rgba(255, 207, 112, 0.22);
  overflow-wrap: anywhere;
}

.portrait-frame {
  position: relative;
  width: min(330px, 62vw);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid rgba(52, 245, 255, 0.52);
  background: #020608;
  box-shadow:
    0 0 0 7px rgba(52, 245, 255, 0.055),
    0 0 36px rgba(52, 245, 255, 0.28);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: grayscale(1) contrast(1.28) brightness(0.8) sepia(0.22) hue-rotate(130deg) saturate(1.7);
}

.portrait-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 0 38%, rgba(52, 245, 255, 0.22) 38% 39%, transparent 39% 67%, rgba(73, 255, 182, 0.2) 67% 68%, transparent 68%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
  animation: scan 4.5s linear infinite;
  pointer-events: none;
}

.portrait-overlay::before,
.portrait-overlay::after {
  position: absolute;
  inset: 11% 8%;
  content: "";
  border: 1px solid rgba(73, 255, 182, 0.4);
  clip-path: polygon(0 0, 38% 0, 38% 16%, 100% 16%, 100% 100%, 64% 100%, 64% 84%, 0 84%);
}

.portrait-overlay::after {
  inset: 18% 16%;
  border-color: rgba(255, 207, 112, 0.35);
  transform: translateX(3px);
}

/* Глитч эффект */
.glitch-overlay {
  position: absolute;
  inset: 0;
  background: inherit;
  pointer-events: none;
  opacity: 0;
  animation: glitch 8s infinite;
}

.log-tail {
  display: grid;
  gap: 4px;
  width: min(470px, 100%);
  margin-top: 3px;
  color: #b7eef3;
  font-size: clamp(11px, 1.35vw, 15px);
  text-align: left;
  text-shadow: 0 0 11px rgba(52, 245, 255, 0.52);
}

.log-tail p {
  margin: 0;
}

/* Мигающий курсор */
.cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
  color: var(--cyan);
}

/* Анимация печатающегося текста */
.typing {
  display: inline-block;
}

.status-text {
  margin: 0;
  color: #ffffff;
  font-size: clamp(19px, 3.3vw, 45px);
  font-weight: 800;
  text-shadow:
    0 0 12px rgba(73, 255, 182, 0.78),
    0 0 26px rgba(52, 245, 255, 0.55);
  animation: glow 3s ease-in-out infinite alternate;
}

.left-telemetry,
.right-rings {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.left-telemetry {
  left: clamp(28px, 4vw, 62px);
  top: 30%;
  width: 86px;
  display: grid;
  gap: 24px;
}

.bars {
  height: 230px;
  display: flex;
  align-items: end;
  gap: 7px;
  padding: 11px;
  border-left: 1px solid rgba(52, 245, 255, 0.35);
  border-bottom: 1px solid rgba(52, 245, 255, 0.35);
}

.bars i {
  width: 8px;
  height: 42%;
  display: block;
  background: linear-gradient(180deg, var(--cyan), var(--mint));
  box-shadow: 0 0 14px rgba(52, 245, 255, 0.7);
  animation: bars 1.6s ease-in-out infinite alternate;
}

.bars i:nth-child(2) { animation-delay: -0.3s; }
.bars i:nth-child(3) { animation-delay: -0.7s; }
.bars i:nth-child(4) { animation-delay: -1.1s; }
.bars i:nth-child(5) { animation-delay: -0.5s; }
.bars i:nth-child(6) { animation-delay: -1.4s; }
.bars i:nth-child(7) { animation-delay: -0.9s; }
.bars i:nth-child(8) { animation-delay: -0.2s; }

.signal-lines {
  display: grid;
  gap: 8px;
}

.signal-lines span {
  height: 2px;
  background: linear-gradient(90deg, var(--mint), transparent);
  box-shadow: 0 0 9px rgba(73, 255, 182, 0.6);
  animation: pulse-line 2s ease-in-out infinite;
}

.signal-lines span:nth-child(1) { animation-delay: 0s; }
.signal-lines span:nth-child(2) { animation-delay: 0.5s; }
.signal-lines span:nth-child(3) { animation-delay: 1s; }
.signal-lines span:nth-child(4) { animation-delay: 1.5s; }

.right-rings {
  right: clamp(26px, 5vw, 76px);
  top: 27%;
  width: 180px;
  aspect-ratio: 1;
}

.ring,
.ring-core {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(52, 245, 255, 0.52);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(52, 245, 255, 0.17);
}

.ring-a {
  animation: rotate 11s linear infinite;
  clip-path: polygon(50% 0, 100% 0, 100% 62%, 50% 62%);
}

.ring-b {
  inset: 22px;
  border-color: rgba(73, 255, 182, 0.55);
  animation: rotate 7s linear infinite reverse;
  clip-path: polygon(0 0, 72% 0, 72% 100%, 0 100%);
}

.ring-c {
  inset: 47px;
  border-color: rgba(255, 207, 112, 0.52);
  animation: rotate 5.5s linear infinite;
  clip-path: polygon(0 32%, 100% 32%, 100% 100%, 0 100%);
}

.ring-core {
  inset: 76px;
  background: var(--cyan);
  box-shadow: 0 0 25px rgba(52, 245, 255, 0.82);
  animation: core-pulse 2s ease-in-out infinite;
}

/* Анимации */
@keyframes scan {
  0% { transform: translateY(-8px); opacity: 0.72; }
  50% { opacity: 0.95; }
  100% { transform: translateY(8px); opacity: 0.72; }
}

@keyframes bars {
  from { height: 18%; }
  to { height: 92%; }
}

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

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes glow {
  from {
    text-shadow:
      0 0 12px rgba(73, 255, 182, 0.78),
      0 0 26px rgba(52, 245, 255, 0.55);
  }
  to {
    text-shadow:
      0 0 20px rgba(73, 255, 182, 1),
      0 0 40px rgba(52, 245, 255, 0.8);
  }
}

@keyframes glitch {
  0%, 90%, 100% { opacity: 0; }
  91% { opacity: 0.3; transform: translate(2px, 2px); }
  92% { opacity: 0.5; transform: translate(-2px, -2px); }
  93% { opacity: 0.3; transform: translate(1px, -1px); }
  94% { opacity: 0; }
}

@keyframes pulse-line {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes core-pulse {
  0%, 100% {
    box-shadow: 0 0 25px rgba(52, 245, 255, 0.82);
  }
  50% {
    box-shadow: 0 0 40px rgba(52, 245, 255, 1);
  }
}

@media (max-width: 760px) {
  .viewport {
    padding: 10px;
  }

  .browser-bar {
    height: 38px;
    padding-inline: 10px;
  }

  .address {
    font-size: 10px;
  }

  .construction-panel {
    min-height: calc(100svh - 58px);
  }

  .construction-panel::before {
    inset: 10px;
  }

  .panel-content {
    padding: 48px 24px;
  }

  .left-telemetry,
  .right-rings {
    opacity: 0.38;
    transform: scale(0.72);
  }

  .left-telemetry {
    left: -6px;
    top: auto;
    bottom: 20px;
  }

  .right-rings {
    right: -20px;
    top: 88px;
  }

  .log-tail {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
