@import url("https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Noto+Sans+KR:wght@400;600;700;800&display=swap");

/* =========================================================
   PROTOCOL : AEGIS
   COMPLETE TERMINAL STYLE
========================================================= */

:root {
  --bg: #070301;
  --bg-deep: #020100;

  --panel: rgba(22, 8, 2, 0.94);
  --panel-soft: rgba(36, 13, 3, 0.78);
  --panel-bright: rgba(55, 19, 4, 0.72);

  --orange: #ff641f;
  --orange-bright: #ffb25f;
  --orange-pale: #ffd39c;
  --orange-dark: #a64015;

  --text: #ffd8ad;
  --muted: #ad754f;
  --danger: #ff4747;
  --danger-dark: #721313;
  --black: #020100;

  --border: rgba(255, 100, 31, 0.72);
  --border-soft: rgba(255, 100, 31, 0.28);
  --border-faint: rgba(255, 100, 31, 0.12);

  --glow-small:
    0 0 5px rgba(255, 100, 31, 0.65);

  --glow:
    0 0 8px rgba(255, 100, 31, 0.75),
    0 0 22px rgba(255, 84, 15, 0.24);

  --glow-large:
    0 0 10px rgba(255, 100, 31, 0.8),
    0 0 28px rgba(255, 84, 15, 0.28),
    0 0 55px rgba(255, 70, 8, 0.12);

  --font-terminal:
    "Share Tech Mono",
    monospace;

  --font-korean:
    "Noto Sans KR",
    sans-serif;
}

/* =========================================================
   RESET
========================================================= */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-deep);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;

  color: var(--text);

  background:
    radial-gradient(
      circle at 48% 15%,
      rgba(255, 91, 20, 0.22),
      transparent 34%
    ),
    radial-gradient(
      circle at 86% 78%,
      rgba(255, 91, 20, 0.08),
      transparent 30%
    ),
    linear-gradient(
      180deg,
      #140601 0%,
      #090301 58%,
      #020100 100%
    );

  font-family: var(--font-terminal);
  letter-spacing: 0.025em;

  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

/* =========================================================
   GLOBAL CRT EFFECT
========================================================= */

body::before {
  content: "";

  position: fixed;
  inset: 0;
  z-index: 9990;

  pointer-events: none;

  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 4px
    );

  opacity: 0.72;
}

body::after {
  content: "";

  position: fixed;
  inset: 0;
  z-index: 9991;

  pointer-events: none;

  background:
    radial-gradient(
      ellipse at center,
      transparent 54%,
      rgba(0, 0, 0, 0.52) 100%
    );

  animation: screenPulse 8s infinite;
}

.crt-noise,
.scanline,
.flicker,
.vignette {
  position: fixed;
  inset: 0;

  pointer-events: none;
}

.crt-noise {
  z-index: 9986;

  opacity: 0.11;

  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 260 260' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.86'/%3E%3C/svg%3E");

  mix-blend-mode: screen;
}

.scanline {
  z-index: 9987;

  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 2px,
      rgba(0, 0, 0, 0.36) 3px,
      rgba(0, 0, 0, 0.36) 4px
    );

  opacity: 0.68;
}

.flicker {
  z-index: 9988;

  background: rgba(255, 120, 30, 0.018);

  animation: flicker 5.5s infinite;
}

.vignette {
  z-index: 9989;

  box-shadow:
    inset 0 0 90px rgba(0, 0, 0, 0.64),
    inset 0 0 190px rgba(0, 0, 0, 0.83);
}

@keyframes flicker {
  0%,
  100% {
    opacity: 0.16;
  }

  8% {
    opacity: 0.25;
  }

  9% {
    opacity: 0.07;
  }

  10% {
    opacity: 0.32;
  }

  13% {
    opacity: 0.14;
  }

  68% {
    opacity: 0.21;
  }

  70% {
    opacity: 0.06;
  }

  71% {
    opacity: 0.28;
  }
}

@keyframes screenPulse {
  0%,
  94%,
  100% {
    opacity: 1;
  }

  95% {
    opacity: 0.92;
  }

  96% {
    opacity: 1;
  }

  98% {
    opacity: 0.96;
  }
}

/* =========================================================
   SCROLLBAR
========================================================= */

* {
  scrollbar-width: thin;
  scrollbar-color:
    var(--orange-dark)
    rgba(0, 0, 0, 0.45);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.45);
  border-left: 1px solid var(--border-faint);
}

*::-webkit-scrollbar-thumb {
  background:
    linear-gradient(
      180deg,
      var(--orange-dark),
      #54200d
    );

  border: 1px solid rgba(255, 154, 80, 0.38);
}

*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(
      180deg,
      var(--orange),
      var(--orange-dark)
    );
}

/* =========================================================
   MAIN SHELL
========================================================= */

.shell {
  position: relative;
  z-index: 1;

  width: min(
    1180px,
    calc(100% - 28px)
  );

  margin: 0 auto;
  padding: 30px 0 52px;
}

/* =========================================================
   BOOT SCREEN
========================================================= */

.boot-screen {
  min-height: 86vh;

  display: flex;
  align-items: center;
  justify-content: center;
}

.boot-box {
  position: relative;

  width: 100%;
  padding: 32px;

  background:
    linear-gradient(
      180deg,
      rgba(32, 10, 2, 0.94),
      rgba(8, 2, 0, 0.96)
    );

  border: 2px solid var(--orange);

  box-shadow:
    var(--glow-large),
    inset 0 0 36px rgba(255, 90, 20, 0.08),
    9px 9px 0 rgba(0, 0, 0, 0.9);

  overflow: hidden;
}

.boot-box::before {
  content: "SYSTEM BOOT / ARCHIVED TERMINAL";

  display: block;

  margin-bottom: 24px;
  padding-bottom: 10px;

  color: var(--orange);
  border-bottom: 1px solid var(--border-soft);

  font-size: 13px;
  letter-spacing: 0.12em;
}

.boot-box::after {
  content: "";

  position: absolute;
  top: 0;
  left: -40%;

  width: 22%;
  height: 100%;

  pointer-events: none;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(255, 167, 88, 0.08),
      transparent
    );

  animation: bootSweep 4.2s linear infinite;
}

#bootText {
  position: relative;
  z-index: 1;

  min-height: 300px;
  margin: 0;

  white-space: pre-wrap;

  color: var(--orange-bright);

  font-size: clamp(
    16px,
    2.4vw,
    25px
  );

  line-height: 1.72;

  text-shadow:
    0 0 8px rgba(255, 120, 20, 0.72),
    0 0 18px rgba(255, 120, 20, 0.3);
}

.boot-bar {
  position: relative;
  z-index: 1;

  height: 15px;
  margin-top: 22px;

  border: 1px solid var(--orange);

  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 90, 20, 0.05) 0,
      rgba(255, 90, 20, 0.05) 8px,
      rgba(0, 0, 0, 0.25) 8px,
      rgba(0, 0, 0, 0.25) 11px
    );

  overflow: hidden;

  box-shadow:
    inset 0 0 12px rgba(255, 120, 20, 0.18),
    0 0 20px rgba(255, 120, 20, 0.16);
}

.boot-bar span {
  display: block;

  width: 0%;
  height: 100%;

  background:
    repeating-linear-gradient(
      90deg,
      var(--orange) 0,
      var(--orange) 9px,
      var(--orange-bright) 9px,
      var(--orange-bright) 12px
    );

  box-shadow:
    0 0 15px rgba(255, 120, 20, 0.68);

  transition: width 0.25s ease;
}

@keyframes bootSweep {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(700%);
  }
}

/* =========================================================
   SHARED PANELS
========================================================= */

.topbar,
.terminal-panel,
.reader-box {
  position: relative;

  background:
    linear-gradient(
      180deg,
      rgba(27, 9, 2, 0.95),
      rgba(10, 3, 1, 0.95)
    );

  border: 2px solid var(--orange);

  box-shadow:
    0 0 25px rgba(255, 110, 20, 0.14),
    inset 0 0 15px rgba(255, 130, 30, 0.04),
    8px 8px 0 #000;
}

.topbar::before,
.terminal-panel::before,
.reader-box::before {
  content: "";

  position: absolute;
  inset: 5px;

  pointer-events: none;

  border: 1px solid rgba(255, 100, 31, 0.11);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;

  padding: 24px;

  margin-bottom: 18px;

  overflow: hidden;
}

.topbar::after {
  content: "AEGIS / ACTIVE";

  position: absolute;
  right: 20px;
  bottom: 8px;

  color: rgba(255, 100, 31, 0.23);

  font-size: 11px;
  letter-spacing: 0.14em;
}

.terminal-panel {
  padding: 20px;
  margin-bottom: 18px;
}

/* =========================================================
   HEADER
========================================================= */

.kicker {
  margin: 0 0 8px;

  color: var(--orange-bright);

  font-size: 13px;
  letter-spacing: 0.11em;
}

h1 {
  margin: 0;

  color: var(--orange);

  font-size: clamp(
    38px,
    7vw,
    86px
  );

  line-height: 0.95;
  letter-spacing: 0.08em;

  text-shadow:
    0 0 15px rgba(255, 110, 20, 0.5),
    0 0 28px rgba(255, 110, 20, 0.22);

  animation: titleGlow 4s ease-in-out infinite;
}

.subtitle {
  margin: 12px 0 0;

  color: var(--muted);

  font-family: var(--font-korean);
  font-size: 14px;
}

@keyframes titleGlow {
  0%,
  100% {
    text-shadow:
      0 0 13px rgba(255, 110, 20, 0.48),
      0 0 28px rgba(255, 110, 20, 0.2);
  }

  50% {
    text-shadow:
      0 0 18px rgba(255, 145, 60, 0.75),
      0 0 40px rgba(255, 90, 20, 0.3);
  }
}

/* =========================================================
   PANEL HEADINGS
========================================================= */

.panel-heading {
  position: relative;

  margin-bottom: 15px;
  padding: 0 0 10px 16px;

  color: var(--orange);

  border-bottom: 1px solid var(--border-soft);

  font-size: 20px;
  letter-spacing: 0.05em;
}

.panel-heading::before {
  content: "";

  position: absolute;
  left: 0;
  top: 4px;

  width: 7px;
  height: 14px;

  background: var(--orange);

  box-shadow: var(--glow-small);
}

.panel-heading::after {
  content: "";

  position: absolute;
  right: 0;
  bottom: -1px;

  width: 34%;
  height: 1px;

  background:
    linear-gradient(
      90deg,
      transparent,
      var(--orange)
    );
}

.row-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

/* =========================================================
   SYSTEM LOG
========================================================= */

.system-log {
  position: relative;

  padding: 8px 12px;

  border-left: 2px solid var(--border-soft);

  background:
    linear-gradient(
      90deg,
      rgba(255, 90, 20, 0.045),
      transparent
    );
}

.system-log p {
  margin: 0.42rem 0;

  color: var(--muted);
}

.system-log p::before {
  content: "> ";

  color: var(--orange);
}

.redacted {
  color: var(--orange-bright);

  font-size: clamp(
    18px,
    3vw,
    23px
  );

  text-shadow:
    0 0 14px rgba(255, 91, 20, 0.7);

  animation: redactedBlink 2.8s infinite;
}

@keyframes redactedBlink {
  0%,
  90%,
  100% {
    opacity: 1;
  }

  92% {
    opacity: 0.55;
  }

  94% {
    opacity: 1;
  }
}

/* =========================================================
   MAIN LAYOUT
========================================================= */

.layout {
  display: grid;

  grid-template-columns:
    minmax(0, 1.15fr)
    minmax(310px, 0.85fr);

  gap: 18px;
  align-items: start;
}

/* =========================================================
   RECORD LIST
========================================================= */

#records {
  min-height: 130px;
}

.record {
  position: relative;

  padding: 15px 46px 15px 17px;
  margin: 12px 0;

  border: 1px solid transparent;
  border-left: 4px solid var(--orange);

  background:
    linear-gradient(
      90deg,
      rgba(255, 90, 20, 0.08),
      rgba(255, 255, 255, 0.025)
    );

  cursor: pointer;

  overflow: hidden;

  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.record::before {
  content: "";

  position: absolute;
  top: 0;
  left: -45%;

  width: 26%;
  height: 100%;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(255, 173, 100, 0.07),
      transparent
    );

  transition: left 0.45s ease;
}

.record::after {
  content: "OPEN";

  position: absolute;
  right: 13px;
  top: 50%;

  color: rgba(255, 100, 31, 0.35);

  font-size: 11px;
  letter-spacing: 0.1em;

  transform:
    translateY(-50%)
    rotate(90deg);
}

.record:hover {
  transform: translateX(3px);

  border-color: var(--border-soft);

  background:
    linear-gradient(
      90deg,
      rgba(255, 90, 20, 0.17),
      rgba(255, 255, 255, 0.035)
    );

  box-shadow:
    0 0 17px rgba(255, 90, 20, 0.11);
}

.record:hover::before {
  left: 120%;
}

.record:active {
  transform:
    translateX(3px)
    scale(0.995);
}

.record.pinned {
  border-left-color: var(--orange-bright);

  background:
    linear-gradient(
      90deg,
      rgba(255, 154, 85, 0.18),
      rgba(255, 90, 20, 0.05)
    );

  box-shadow:
    inset 0 0 16px rgba(255, 137, 51, 0.055);
}

.record.pinned::after {
  content: "FIXED";

  color: rgba(255, 180, 96, 0.55);
}

.pin-label {
  display: inline-block;

  margin-left: 8px;
  padding: 2px 5px;

  color: #1a0801;
  background: var(--orange-bright);

  font-size: 11px;
  letter-spacing: 0.06em;

  box-shadow:
    0 0 9px rgba(255, 173, 95, 0.4);
}

.record-no {
  color: var(--orange-bright);

  font-size: 14px;
  letter-spacing: 0.065em;
}

.record-name {
  margin: 7px 0 4px;

  color: var(--text);

  font-family: var(--font-korean);
  font-size: 19px;
  font-weight: 700;

  word-break: keep-all;
}

.record-date {
  color: var(--muted);

  font-size: 13px;
}

/* =========================================================
   FORM ELEMENTS
========================================================= */

label {
  display: block;

  margin: 14px 0 7px;

  color: var(--orange-bright);

  font-size: 13px;
  letter-spacing: 0.05em;
}

input,
textarea,
.select,
select {
  width: 100%;

  color: var(--text);
  background:
    linear-gradient(
      180deg,
      rgba(11, 3, 0, 0.98),
      rgba(4, 1, 0, 0.98)
    );

  border: 1px solid var(--orange-dark);

  outline: none;

  padding: 12px;

  caret-color: var(--orange-bright);

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

input:hover,
textarea:hover,
.select:hover,
select:hover {
  border-color: rgba(255, 100, 31, 0.7);
}

input:focus,
textarea:focus,
.select:focus,
select:focus {
  border-color: var(--orange);

  background:
    linear-gradient(
      180deg,
      rgba(26, 8, 1, 0.98),
      rgba(8, 2, 0, 0.98)
    );

  box-shadow:
    0 0 0 2px rgba(255, 90, 20, 0.17),
    0 0 15px rgba(255, 90, 20, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: rgba(173, 117, 79, 0.62);
}

.search {
  margin-bottom: 12px;
}

textarea {
  min-height: 168px;

  resize: vertical;

  line-height: 1.68;

  font-family: var(--font-korean);
  font-size: 14px;
}

select,
.select {
  cursor: pointer;
}

/* =========================================================
   BUTTONS
========================================================= */

button {
  color: var(--text);
}

.primary-btn,
.utility-btn,
.danger-btn {
  position: relative;

  border: 1px solid var(--orange);

  background:
    linear-gradient(
      180deg,
      #1c0902,
      #0d0301
    );

  color: var(--text);

  padding: 11px 14px;
  margin-top: 12px;

  cursor: pointer;

  box-shadow:
    3px 3px 0 #000,
    inset 0 0 8px rgba(255, 90, 20, 0.04);

  overflow: hidden;

  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.primary-btn::before,
.utility-btn::before,
.danger-btn::before {
  content: "";

  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(255, 196, 135, 0.12),
      transparent
    );

  transform: translateX(-120%);

  transition: transform 0.38s ease;
}

.primary-btn:hover::before,
.utility-btn:hover::before,
.danger-btn:hover::before {
  transform: translateX(120%);
}

.primary-btn:hover,
.utility-btn:hover {
  color: #fff0da;

  background:
    linear-gradient(
      180deg,
      #371003,
      #180500
    );

  border-color: var(--orange-bright);

  box-shadow:
    3px 3px 0 #000,
    var(--glow-small);
}

.primary-btn:active,
.utility-btn:active,
.danger-btn:active {
  transform: translateY(2px);

  box-shadow:
    1px 1px 0 #000;
}

.primary-btn {
  width: 100%;

  color: var(--orange-bright);

  font-weight: 800;
  letter-spacing: 0.04em;
}

.utility-btn {
  white-space: nowrap;
}

.wide {
  width: 100%;
}

.danger-btn {
  border-color: var(--danger);

  color: #ffd0d0;

  background:
    linear-gradient(
      180deg,
      #240202,
      #0f0000
    );
}

.danger-btn:hover {
  border-color: #ff8b8b;

  background:
    linear-gradient(
      180deg,
      #420606,
      #1a0000
    );

  box-shadow:
    3px 3px 0 #000,
    0 0 10px rgba(255, 48, 48, 0.34);
}

/* =========================================================
   DETAILS / ADMIN
========================================================= */

.divider {
  height: 1px;

  margin: 22px 0;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(255, 90, 20, 0.45),
      transparent
    );
}

details {
  border: 1px solid var(--border-faint);

  background: rgba(255, 90, 20, 0.025);

  padding: 12px;
}

details[open] {
  border-color: var(--border-soft);

  box-shadow:
    inset 0 0 15px rgba(255, 90, 20, 0.035);
}

summary {
  color: var(--orange);

  cursor: pointer;

  user-select: none;
}

summary:hover {
  color: var(--orange-bright);

  text-shadow: var(--glow-small);
}

#adminStatus,
#sendStatus {
  min-height: 1.4em;
  margin-top: 10px;

  color: var(--muted);

  font-size: 13px;
}

/* =========================================================
   FOOTER
========================================================= */

footer {
  position: relative;

  margin-top: 26px;
  padding: 18px 12px 0;

  color: var(--muted);

  text-align: center;
  line-height: 1.7;
}

footer::before {
  content: "";

  display: block;

  width: min(460px, 80%);
  height: 1px;

  margin: 0 auto 16px;

  background:
    linear-gradient(
      90deg,
      transparent,
      var(--orange-dark),
      transparent
    );
}

/* =========================================================
   MESSAGE READER
========================================================= */

.reader {
  position: fixed;
  inset: 0;
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background:
    radial-gradient(
      circle at center,
      rgba(70, 21, 3, 0.18),
      rgba(0, 0, 0, 0.9) 58%
    );

  backdrop-filter: blur(3px);

  animation: readerBackdropIn 0.24s ease both;
}

.reader-box {
  width: min(820px, 100%);
  min-height: 360px;
  max-height: calc(100vh - 40px);

  padding: 28px;

  overflow-y: auto;

  animation: readerOpen 0.34s cubic-bezier(0.18, 0.82, 0.28, 1) both;
}

.reader-box::after {
  content: "";

  position: absolute;
  left: 0;
  top: -40%;

  width: 100%;
  height: 35%;

  pointer-events: none;

  background:
    linear-gradient(
      180deg,
      transparent,
      rgba(255, 134, 55, 0.065),
      transparent
    );

  animation: readerScan 2.8s linear infinite;
}

.close-btn {
  position: absolute;
  right: 16px;
  top: 10px;
  z-index: 4;

  border: 0;

  background: transparent;

  color: var(--orange);

  font-size: 30px;

  cursor: pointer;

  transition:
    color 0.18s ease,
    transform 0.18s ease,
    text-shadow 0.18s ease;
}

.close-btn:hover {
  color: var(--orange-bright);

  transform: rotate(90deg);

  text-shadow: var(--glow);
}

.decrypt {
  position: relative;
  z-index: 2;

  min-height: 180px;
  padding: 22px;

  color: var(--orange-bright);

  white-space: pre-wrap;
  line-height: 1.85;

  border: 1px solid var(--border-soft);

  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 90, 20, 0.035) 0,
      rgba(255, 90, 20, 0.035) 1px,
      transparent 1px,
      transparent 7px
    );

  text-shadow:
    0 0 10px rgba(255, 90, 20, 0.62);

  animation: decryptPulse 1.4s ease-in-out infinite;
}

#messageView {
  position: relative;
  z-index: 2;

  animation: messageAppear 0.32s ease both;
}

#viewMeta {
  margin-bottom: 12px;
  padding-bottom: 10px;

  color: var(--muted);

  border-bottom: 1px dashed var(--border-soft);

  font-size: 13px;
  letter-spacing: 0.08em;
}

#viewTitle {
  margin: 0 42px 16px 0;

  color: var(--orange-bright);

  font-family: var(--font-korean);
  font-size: clamp(22px, 4vw, 31px);
  font-weight: 800;
  line-height: 1.35;

  text-shadow:
    0 0 13px rgba(255, 115, 32, 0.28);

  word-break: keep-all;
}

#viewMessage {
  min-height: 140px;
  padding: 20px;

  color: var(--text);

  white-space: pre-wrap;
  line-height: 1.88;

  border-left: 2px solid var(--orange-dark);

  background:
    linear-gradient(
      90deg,
      rgba(255, 90, 20, 0.065),
      transparent
    );

  font-family: var(--font-korean);
  font-size: 16px;

  word-break: keep-all;
  overflow-wrap: anywhere;
}

.admin-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 20px;
}

.admin-tools button {
  margin-top: 0;
}

/* =========================================================
   TYPING CURSOR
========================================================= */

#viewMessage.typing::after,
.decrypt.typing::after {
  content: "█";

  margin-left: 3px;

  color: var(--orange);

  font-family: var(--font-terminal);

  text-shadow: var(--glow-small);

  animation:
    terminalCursor 0.7s steps(1) infinite;
}

@keyframes terminalCursor {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

/* =========================================================
   READER ANIMATIONS
========================================================= */

@keyframes readerBackdropIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes readerOpen {
  from {
    opacity: 0;

    transform:
      translateY(18px)
      scaleY(0.92);

    filter:
      brightness(2)
      blur(2px);
  }

  48% {
    filter:
      brightness(1.25)
      blur(0);
  }

  to {
    opacity: 1;

    transform:
      translateY(0)
      scaleY(1);

    filter:
      brightness(1)
      blur(0);
  }
}

@keyframes readerScan {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(500%);
  }
}

@keyframes decryptPulse {
  0%,
  100% {
    border-color: var(--border-soft);

    box-shadow:
      inset 0 0 10px rgba(255, 90, 20, 0.025);
  }

  50% {
    border-color: rgba(255, 117, 45, 0.55);

    box-shadow:
      inset 0 0 22px rgba(255, 90, 20, 0.065),
      0 0 15px rgba(255, 90, 20, 0.08);
  }
}

@keyframes messageAppear {
  from {
    opacity: 0;

    transform: translateY(8px);

    filter: blur(2px);
  }

  to {
    opacity: 1;

    transform: translateY(0);

    filter: blur(0);
  }
}

/* =========================================================
   ACCESSIBILITY
========================================================= */

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
.record:focus-visible {
  outline: 2px solid var(--orange-bright);
  outline-offset: 3px;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 860px) {
  .shell {
    width: min(
      calc(100% - 18px),
      1180px
    );

    padding-top: 18px;
  }

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

  .topbar {
    display: block;

    padding: 18px;
  }

  .utility-btn {
    width: 100%;

    margin-top: 16px;
  }

  h1 {
    font-size: clamp(
      40px,
      12vw,
      62px
    );

    word-break: break-word;
  }

  .terminal-panel {
    padding: 16px;
  }

  .row-heading {
    display: block;
  }

  .select,
  .row-heading select {
    width: 100%;

    margin-top: 10px;
  }

  .boot-box {
    padding: 24px 20px;
  }

  #bootText {
    min-height: 260px;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 560px) {
  body {
    letter-spacing: 0.012em;
  }

  body::after {
    background:
      radial-gradient(
        ellipse at center,
        transparent 68%,
        rgba(0, 0, 0, 0.42) 100%
      );
  }

  .crt-noise {
    opacity: 0.07;
  }

  .scanline {
    opacity: 0.5;
  }

  .vignette {
    box-shadow:
      inset 0 0 70px rgba(0, 0, 0, 0.56);
  }

  .shell {
    width: calc(100% - 12px);

    padding:
      8px
      0
      30px;
  }

  .boot-screen {
    min-height: 94vh;
  }

  .boot-box {
    padding: 18px 14px;

    border-width: 1px;

    box-shadow:
      0 0 20px rgba(255, 100, 31, 0.14),
      4px 4px 0 #000;
  }

  .boot-box::before {
    margin-bottom: 16px;

    font-size: 10px;
  }

  #bootText {
    min-height: 320px;

    font-size: 14px;
    line-height: 1.62;
  }

  .boot-bar {
    height: 12px;
  }

  .topbar,
  .terminal-panel,
  .reader-box {
    border-width: 1px;

    box-shadow:
      0 0 18px rgba(255, 100, 31, 0.11),
      4px 4px 0 #000;
  }

  .topbar {
    margin-bottom: 12px;
    padding: 16px 14px;
  }

  .topbar::after {
    display: none;
  }

  .kicker {
    font-size: 11px;
  }

  h1 {
    font-size: clamp(
      37px,
      13vw,
      54px
    );

    line-height: 0.98;
  }

  .subtitle {
    font-size: 12px;
    line-height: 1.6;
  }

  .terminal-panel {
    margin-bottom: 12px;
    padding: 14px 12px;
  }

  .panel-heading {
    padding-left: 13px;

    font-size: 17px;
  }

  .panel-heading::before {
    width: 5px;
    height: 12px;
  }

  .system-log {
    padding-left: 9px;

    font-size: 13px;
  }

  .redacted {
    font-size: 16px;

    overflow-wrap: anywhere;
  }

  .record {
    padding:
      13px
      38px
      13px
      13px;

    margin: 9px 0;
  }

  .record::after {
    right: 8px;

    font-size: 9px;
  }

  .record-no {
    font-size: 11px;
  }

  .record-name {
    margin-top: 6px;

    font-size: 16px;
    line-height: 1.48;
  }

  .pin-label {
    margin-left: 4px;
    padding: 2px 4px;

    font-size: 9px;
  }

  input,
  textarea,
  .select,
  select {
    padding: 11px;

    font-size: 16px;
  }

  textarea {
    min-height: 150px;

    font-size: 14px;
  }

  .primary-btn,
  .utility-btn,
  .danger-btn {
    min-height: 44px;

    padding: 11px 12px;
  }

  footer {
    margin-top: 18px;

    font-size: 12px;
  }

  .reader {
    align-items: stretch;

    padding: 7px;

    background: rgba(0, 0, 0, 0.93);
  }

  .reader-box {
    width: 100%;
    min-height: 100%;
    max-height: calc(100vh - 14px);

    margin: 0;
    padding: 54px 15px 24px;

    border-radius: 0;
  }

  .close-btn {
    right: 14px;
    top: 8px;

    width: 44px;
    height: 44px;

    font-size: 30px;
  }

  .decrypt {
    min-height: 210px;
    padding: 16px 13px;

    font-size: 14px;
  }

  #viewMeta {
    font-size: 11px;
    line-height: 1.55;
  }

  #viewTitle {
    margin-right: 0;

    font-size: 22px;
  }

  #viewMessage {
    min-height: 180px;
    padding: 15px 12px;

    font-size: 15px;
    line-height: 1.82;
  }

  .admin-tools {
    display: grid;

    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 8px;
  }

  .admin-tools button {
    width: 100%;

    font-size: 12px;
  }
}

/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 360px) {
  h1 {
    font-size: 34px;
  }

  .boot-box {
    padding-left: 10px;
    padding-right: 10px;
  }

  #bootText {
    font-size: 12px;
  }

  .terminal-panel {
    padding-left: 10px;
    padding-right: 10px;
  }

  .record-name {
    font-size: 15px;
  }

  .admin-tools {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }
}
/* =========================================================
   CUSTOM TERMINAL CURSOR
========================================================= */

body {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='9' cy='9' r='5' fill='none' stroke='%23ff641f' stroke-width='1.5'/%3E%3Cpath d='M9 1v4M9 13v4M1 9h4M13 9h4' stroke='%23ffb25f' stroke-width='1.5'/%3E%3Ccircle cx='9' cy='9' r='1.5' fill='%23ffb25f'/%3E%3C/svg%3E")
    9 9,
    crosshair;
}

button,
.record,
summary,
select,
.select,
.close-btn {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M4 3l17 8-8 3-3 8z' fill='%23ff641f' stroke='%23ffd39c' stroke-width='1'/%3E%3C/svg%3E")
    4 3,
    pointer;
}

input,
textarea {
  cursor: text;
}
/* =========================================================
   AEGIS CURSOR FOLLOW HUD
   기존 커서 위에 추가되는 효과
========================================================= */

@media (pointer: fine) {

  .aegis-cursor-hud {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;

    width: 34px;
    height: 34px;

    pointer-events: none;

    border: 1px solid rgba(255, 100, 31, 0.78);
    border-radius: 50%;

    box-shadow:
      0 0 7px rgba(255, 100, 31, 0.65),
      inset 0 0 7px rgba(255, 100, 31, 0.12);

    transform: translate(-50%, -50%);

    opacity: 0.82;

    transition:
      width 0.16s ease,
      height 0.16s ease,
      opacity 0.16s ease,
      border-color 0.16s ease,
      box-shadow 0.16s ease;
  }

  .aegis-cursor-hud::before,
  .aegis-cursor-hud::after {
    content: "";

    position: absolute;
    left: 50%;
    top: 50%;

    background: rgba(255, 178, 95, 0.8);

    transform: translate(-50%, -50%);

    box-shadow:
      0 0 5px rgba(255, 178, 95, 0.65);
  }

  .aegis-cursor-hud::before {
    width: 46px;
    height: 1px;
  }

  .aegis-cursor-hud::after {
    width: 1px;
    height: 46px;
  }

  .aegis-cursor-hud.interactive {
    width: 46px;
    height: 46px;

    opacity: 1;

    border-color: var(--orange-bright);

    box-shadow:
      0 0 10px rgba(255, 100, 31, 0.9),
      inset 0 0 10px rgba(255, 178, 95, 0.22);

    animation:
      hudRotate 3.2s linear infinite;
  }

  .aegis-cursor-hud.clicking {
    width: 25px;
    height: 25px;

    opacity: 1;

    border-color: var(--orange-pale);

    box-shadow:
      0 0 15px rgba(255, 100, 31, 1),
      inset 0 0 9px rgba(255, 178, 95, 0.4);
  }

  .aegis-cursor-pulse {
    position: fixed;
    z-index: 9998;

    width: 18px;
    height: 18px;

    pointer-events: none;

    border: 1px solid var(--orange-bright);
    border-radius: 50%;

    box-shadow:
      0 0 8px rgba(255, 100, 31, 0.6);

    transform: translate(-50%, -50%);

    animation:
      hudPulse 0.45s ease-out forwards;
  }
}

@keyframes hudRotate {
  from {
    rotate: 0deg;
  }

  to {
    rotate: 360deg;
  }
}

@keyframes hudPulse {
  from {
    width: 18px;
    height: 18px;

    opacity: 0.9;
  }

  to {
    width: 70px;
    height: 70px;

    opacity: 0;
  }
}
