:root {
  --ink: #03080b;
  --panel: #071116;
  --blue: #52b8ff;
  --gold: #ffd54d;
  --muted: #6e8b96;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--ink);
  color: #eef8fb;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  overflow: hidden;
}

button {
  font: inherit;
}

.ark-shell {
  --pointer-x: 50%;
  --pointer-y: 50%;
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(16, 75, 98, 0.25), transparent 31%),
    radial-gradient(circle at 14% 22%, rgba(53, 103, 82, 0.12), transparent 28%),
    radial-gradient(circle at 85% 80%, rgba(38, 85, 106, 0.13), transparent 31%),
    linear-gradient(145deg, #020608 0%, #061014 48%, #020608 100%);
}

.ark-shell::before,
.ark-shell::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
}

.ark-shell::before {
  opacity: 0.22;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    rgba(154, 220, 235, 0.04) 4px
  );
  mix-blend-mode: screen;
}

.ark-shell::after {
  background: radial-gradient(
    circle at center,
    transparent 34%,
    rgba(0, 3, 5, 0.82) 112%
  );
}

.tactical-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
  pointer-events: none;
}

.grid-plane {
  position: absolute;
  inset: -24%;
  z-index: 0;
  opacity: 0.17;
  background-image:
    linear-gradient(rgba(78, 174, 209, 0.23) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 174, 209, 0.23) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse at center, black 10%, transparent 68%);
  transform: perspective(800px) rotateX(67deg) translateY(36%);
  transform-origin: center bottom;
  animation: grid-drift 14s linear infinite;
  pointer-events: none;
}

.pointer-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    380px circle at var(--pointer-x) var(--pointer-y),
    rgba(72, 181, 229, 0.095),
    transparent 70%
  );
  transition: background-position 180ms ease-out;
  pointer-events: none;
}

.scan-beam {
  position: absolute;
  top: -22%;
  right: -20%;
  bottom: -22%;
  z-index: 1;
  width: 28%;
  opacity: 0.25;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(87, 201, 255, 0.16) 48%,
    rgba(184, 233, 255, 0.26) 50%,
    transparent 53%
  );
  filter: blur(1px);
  transform: skewX(-18deg);
  animation: scan 8s ease-in-out infinite;
  pointer-events: none;
}

.interface-frame {
  position: absolute;
  inset: clamp(14px, 2.2vw, 34px);
  z-index: 3;
  border: 1px solid rgba(114, 196, 222, 0.09);
  pointer-events: none;
}

.corner {
  position: absolute;
  width: clamp(26px, 4vw, 64px);
  height: clamp(26px, 4vw, 64px);
  opacity: 0.68;
}

.corner::after {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(255, 213, 77, 0.75);
  content: "";
}

.corner-tl {
  top: -1px;
  left: -1px;
  border-top: 1px solid var(--blue);
  border-left: 1px solid var(--blue);
}

.corner-tl::after {
  top: -3px;
  left: -3px;
}

.corner-tr {
  top: -1px;
  right: -1px;
  border-top: 1px solid var(--blue);
  border-right: 1px solid var(--blue);
}

.corner-tr::after {
  top: -3px;
  right: -3px;
}

.corner-bl {
  bottom: -1px;
  left: -1px;
  border-bottom: 1px solid var(--blue);
  border-left: 1px solid var(--blue);
}

.corner-bl::after {
  bottom: -3px;
  left: -3px;
}

.corner-br {
  right: -1px;
  bottom: -1px;
  border-right: 1px solid var(--blue);
  border-bottom: 1px solid var(--blue);
}

.corner-br::after {
  right: -3px;
  bottom: -3px;
}

.frame-tick {
  position: absolute;
  left: 50%;
  width: min(24vw, 260px);
  height: 5px;
  border-right: 1px solid rgba(95, 190, 222, 0.5);
  border-left: 1px solid rgba(95, 190, 222, 0.5);
  background: repeating-linear-gradient(
    90deg,
    transparent 0 13px,
    rgba(99, 187, 216, 0.25) 14px 15px
  );
  transform: translateX(-50%);
}

.tick-top {
  top: -3px;
}

.tick-bottom {
  bottom: -3px;
}

.brand-panel {
  position: relative;
  z-index: 4;
  display: flex;
  width: min(100%, 1050px);
  min-height: 480px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 42px 24px;
  text-align: center;
  animation: panel-arrive 1.1s cubic-bezier(0.2, 0.85, 0.3, 1) both;
}

.brand-lockup {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.2vw, 30px);
  margin: 0;
  line-height: 0.8;
  filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.5));
}

.brand-word {
  position: relative;
  color: #ecf8fb;
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(3.35rem, 10.8vw, 8.8rem);
  font-weight: 800;
  letter-spacing: -0.075em;
  text-transform: uppercase;
  text-shadow:
    0 0 1px #fff,
    0 0 24px rgba(104, 202, 255, 0.12);
}

.brand-word::before {
  position: absolute;
  right: 4%;
  bottom: -18px;
  left: 7%;
  height: 1px;
  opacity: 0.45;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  content: "";
}

.emblem-slot {
  position: relative;
  display: grid;
  width: clamp(2.7rem, 6.5vw, 5.5rem);
  height: clamp(4.2rem, 9.7vw, 8.2rem);
  flex: 0 0 auto;
  place-items: center;
}

.emblem {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #fff0a4 0%, var(--gold) 44%, #b47b00 100%);
  filter: drop-shadow(0 0 8px rgba(255, 213, 77, 0.55));
  mask: url("/tryzub.svg") center / contain no-repeat;
  -webkit-mask: url("/tryzub.svg") center / contain no-repeat;
  animation: emblem-pulse 3.8s ease-in-out infinite;
}

.emblem-aura {
  position: absolute;
  width: 165%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 213, 77, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 213, 77, 0.15), transparent 66%);
  box-shadow: 0 0 42px rgba(255, 213, 77, 0.08);
  animation: aura 4s ease-in-out infinite;
}

.core-orbit,
.core-crosshair {
  position: absolute;
  top: 42%;
  left: 50%;
  z-index: 1;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.core-orbit::before,
.core-orbit::after {
  position: absolute;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(82, 184, 255, 0.8);
  content: "";
}

.orbit-one {
  width: clamp(290px, 53vw, 620px);
  border: 1px solid rgba(86, 183, 220, 0.11);
  border-right-color: rgba(255, 213, 77, 0.36);
  animation: orbit 24s linear infinite;
}

.orbit-one::before {
  top: 19%;
  right: 7%;
  width: 3px;
  height: 3px;
}

.orbit-one::after {
  bottom: 8%;
  left: 25%;
  width: 2px;
  height: 2px;
}

.orbit-two {
  width: clamp(220px, 40vw, 470px);
  border: 1px dashed rgba(90, 187, 222, 0.11);
  animation: orbit-reverse 18s linear infinite;
}

.orbit-two::before {
  top: 2%;
  left: 43%;
  width: 3px;
  height: 3px;
}

.orbit-two::after {
  right: 3%;
  bottom: 32%;
  width: 2px;
  height: 2px;
  background: var(--gold);
}

.core-crosshair {
  width: clamp(350px, 64vw, 760px);
  opacity: 0.16;
  background:
    linear-gradient(
      90deg,
      transparent calc(50% - 0.5px),
      var(--blue) 50%,
      transparent calc(50% + 0.5px)
    ),
    linear-gradient(
      0deg,
      transparent calc(50% - 0.5px),
      var(--blue) 50%,
      transparent calc(50% + 0.5px)
    );
  mask-image: radial-gradient(circle, black 0%, transparent 65%);
}

.actions {
  position: relative;
  z-index: 3;
  display: grid;
  width: min(100%, 650px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
  margin-top: clamp(62px, 9vh, 92px);
}

.action-button {
  position: relative;
  display: grid;
  height: 82px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  overflow: hidden;
  border: 1px solid rgba(105, 201, 235, 0.43);
  color: #eaf8fb;
  background: rgba(5, 16, 21, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 12px 42px rgba(0, 0, 0, 0.34);
  clip-path: polygon(
    14px 0,
    100% 0,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    0 100%,
    0 14px
  );
  cursor: pointer;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.action-button::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    108deg,
    transparent 20%,
    rgba(139, 221, 255, 0.16) 49%,
    transparent 72%
  );
  content: "";
  transform: translateX(-120%);
  transition: transform 520ms cubic-bezier(0.18, 0.8, 0.28, 1);
}

.action-button::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 38px;
  height: 2px;
  background: var(--blue);
  box-shadow: 0 0 15px rgba(82, 184, 255, 0.75);
  content: "";
  transition: width 220ms ease;
}

.action-button:hover,
.action-button:focus-visible {
  border-color: rgba(116, 211, 246, 0.88);
  color: #fff;
  background: rgba(9, 32, 42, 0.83);
  box-shadow:
    inset 0 0 22px rgba(67, 176, 217, 0.08),
    0 16px 46px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(66, 176, 225, 0.08);
  transform: translateY(-3px);
}

.action-button:hover::before,
.action-button:focus-visible::before {
  transform: translateX(120%);
}

.action-button:hover::after,
.action-button:focus-visible::after {
  width: 68%;
}

.action-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.action-button:active {
  transform: translateY(0) scale(0.99);
}

.action-portal {
  border-color: rgba(255, 213, 77, 0.48);
  background:
    linear-gradient(135deg, rgba(255, 213, 77, 0.05), transparent 50%),
    rgba(5, 16, 21, 0.76);
}

.action-portal::after {
  background: var(--gold);
  box-shadow: 0 0 15px rgba(255, 213, 77, 0.64);
}

.action-portal:hover,
.action-portal:focus-visible {
  border-color: rgba(255, 221, 100, 0.95);
  background:
    linear-gradient(135deg, rgba(255, 213, 77, 0.1), transparent 55%),
    rgba(21, 28, 24, 0.85);
}

.button-code,
.button-state,
.button-arrow {
  position: relative;
  z-index: 1;
  font-family: Consolas, "Courier New", monospace;
}

.button-code {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.button-label {
  position: relative;
  z-index: 1;
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(0.9rem, 1.5vw, 1.08rem);
  font-weight: 700;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.button-state {
  color: var(--gold);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.button-arrow {
  color: var(--gold);
  font-size: 1.15rem;
  transition: transform 180ms ease;
}

.action-portal:hover .button-arrow,
.action-portal:focus-visible .button-arrow {
  transform: translate(3px, -3px);
}

.system-message {
  position: relative;
  z-index: 3;
  min-height: 18px;
  margin: 20px 0 0;
  color: rgba(161, 208, 221, 0.75);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.system-message::before {
  color: var(--gold);
  content: "[ ";
}

.system-message::after {
  color: var(--gold);
  content: " ]";
}

.system-message.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes panel-arrive {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes grid-drift {
  to {
    background-position: 68px 68px;
  }
}

@keyframes scan {
  0%,
  13% {
    transform: translateX(-520%) skewX(-18deg);
  }
  58%,
  100% {
    transform: translateX(520%) skewX(-18deg);
  }
}

@keyframes orbit {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes orbit-reverse {
  from {
    transform: translate(-50%, -50%) rotate(360deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(0deg);
  }
}

@keyframes emblem-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 7px rgba(255, 213, 77, 0.42));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(255, 213, 77, 0.75));
  }
}

@keyframes aura {
  0%,
  100% {
    opacity: 0.56;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@media (max-width: 680px) {
  .brand-panel {
    min-height: 440px;
    padding-inline: 22px;
  }

  .brand-lockup {
    gap: clamp(8px, 2.6vw, 14px);
  }

  .brand-word {
    letter-spacing: -0.085em;
  }

  .actions {
    width: min(100%, 340px);
    grid-template-columns: 1fr;
    margin-top: 62px;
  }

  .action-button {
    height: 70px;
  }

  .core-orbit,
  .core-crosshair {
    top: 37%;
  }

  .system-message {
    max-width: 340px;
    line-height: 1.6;
  }
}

@media (max-height: 620px) and (min-width: 681px) {
  .brand-panel {
    min-height: 380px;
    padding-block: 24px;
  }

  .actions {
    margin-top: 48px;
  }

  .action-button {
    height: 70px;
  }
}

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