@keyframes sovereign-aurora-breathe {
  from { opacity: 0.3; transform: scale(0.92); }
  to { opacity: 0.58; transform: scale(1.08); }
}

@keyframes portal-backglow-breathe {
  from { opacity: 0.36; transform: scale(0.9); }
  to { opacity: 0.68; transform: scale(1.08); }
}

@keyframes portal-sigil-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}

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

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

@keyframes sovereign-glyph-ring-rotate {
  to { transform: rotate(360deg); }
}

@keyframes sovereign-core-pulse {
  from { opacity: 0.56; transform: scale(0.82); transform-origin: 180px 180px; }
  to { opacity: 1; transform: scale(1.18); transform-origin: 180px 180px; }
}

@media (min-width: 1100px) and (max-height: 820px) {
  .system-gate {
    padding-top: max(13px, env(safe-area-inset-top));
  }

  .system-gate__header {
    margin-bottom: 13px;
  }

  .system-gate__header h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
  }

  .system-gate__lead {
    line-height: 1.55;
  }

  .system-entry__content {
    min-height: 510px;
    padding-top: 27px;
    padding-bottom: 20px;
  }

  .system-entry__sigil {
    width: 78px;
    margin-bottom: 8px;
  }

  .system-entry__divider {
    margin-block: 10px;
  }

  .system-entry__copy {
    line-height: 1.55;
  }

  .system-gate__status {
    margin-top: 11px;
  }

  .system-gate__ad {
    padding: 9px 11px;
  }

  .system-gate__footer {
    margin-top: 10px;
  }
}

@media (max-width: 960px) {
  .system-gate__portals {
    grid-template-areas:
      "seal seal"
      "solomon kagome";
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sovereign-seal__visual {
    width: min(300px, 60vw);
  }

  .sovereign-seal__inscription {
    margin-top: -18px;
  }

  .system-entry__content {
    min-height: 570px;
  }
}

@media (max-width: 680px) {
  .system-gate {
    overflow: visible;
    padding-inline: 14px;
  }

  .system-gate__manuscript-frame {
    position: fixed;
  }

  .system-gate__header {
    margin-bottom: 10px;
    padding-inline: 8px;
  }

  .system-gate__header h1 {
    font-size: clamp(2.4rem, 13vw, 4rem);
    letter-spacing: 0.05em;
  }

  .system-gate__title-en {
    font-size: 0.72rem;
    letter-spacing: 0.26em;
  }

  .system-gate__lead {
    font-size: 0.78rem;
    line-height: 1.7;
  }

  .system-gate__portals {
    grid-template-areas:
      "seal"
      "solomon"
      "kagome";
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .sovereign-seal__visual {
    width: min(270px, 76vw);
  }

  .sovereign-seal__inscription {
    margin-top: -18px;
  }

  .system-entry {
    border-radius: 150px 150px 22px 22px;
  }

  .system-entry::before,
  .system-entry::after {
    border-radius: 138px 138px 15px 15px;
  }

  .system-entry__content {
    min-height: auto;
    padding: 31px 21px 24px;
  }

  .system-entry__sigil {
    width: 84px;
  }

  .system-entry__copy {
    font-size: 0.82rem;
  }

  .system-entry--solomon {
    order: 1;
  }

  .system-entry--kagome {
    order: 2;
    opacity: 0.82;
  }

  .system-gate__ad {
    text-align: center;
  }

  .system-gate__features {
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .system-gate__header h1 {
    font-size: 2.55rem;
  }

  .system-gate__title-en {
    letter-spacing: 0.18em;
  }

  .system-entry h2 {
    font-size: 1.74rem;
  }

  .system-entry__subtitle {
    font-size: 0.78rem;
  }

  .system-gate__action {
    min-height: 50px;
    gap: 9px;
    font-size: 0.84rem;
  }
}

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

  .system-gate__quantum-field {
    opacity: 0.48 !important;
  }

  .system-entry,
  .system-gate__header,
  .system-gate__footer,
  .sovereign-seal {
    opacity: 1;
    transform: none;
  }
}
