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

:root {
  --bg-dark: #080a0c;
  --bg-panel: #0d1117;
  --bg-card: #111820;
  --bg-card2: #0f141a;
  --border: #1e2d3d;
  --border-bright: #2a3f55;
  --text-primary: #b8c9d8;
  --text-secondary: #6b8099;
  --text-dim: #3a4f60;
  --red: #8b0000;
  --red-bright: #cc2222;
  --red-glow: rgba(139,0,0,0.3);
  --keter-orange: #b84f00;
  --keter-glow: rgba(184,79,0,0.25);
  --highlight: #1e8fbf;
  --highlight-dim: rgba(30,143,191,0.15);
  --scan-color: rgba(30,143,191,0.03);
  --danger: #cc2222;
  --mono: 'Share Tech Mono', monospace;
  --body: 'Noto Sans KR', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--body);
  font-weight: 300;
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
  z-index: 9998;
}

/* ─── WARNING OVERLAY ─── */
#warning-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

#warning-box {
  border: 1px solid var(--red);
  background: #0a0000;
  padding: 2.5rem 3rem;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 60px var(--red-glow), inset 0 0 30px rgba(139,0,0,0.05);
  animation: flicker 8s infinite;
}

.warning-title {
  font-family: var(--mono);
  font-size: 1.3rem;
  color: var(--red-bright);
  letter-spacing: 0.2em;
  margin-bottom: 1.2rem;
  text-shadow: 0 0 10px var(--red-bright);
}

.warning-text {
  font-size: 0.88rem;
  color: #8a9aaa;
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.warning-text strong { color: var(--red-bright); }

#auth-bar-wrap {
  background: #0f0f0f;
  border: 1px solid #1a1a1a;
  height: 6px;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

#auth-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-bright) 100%);
  box-shadow: 0 0 8px var(--red-bright);
  transition: width 0.05s linear;
}

#auth-status {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
  letter-spacing: 0.1em;
}

#access-btn {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red-bright);
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  padding: 0.6rem 2rem;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

#access-btn:hover {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 20px var(--red-glow);
}

/* ─── MAIN CONTENT ─── */
.hidden { display: none !important; }

#main-content {
  animation: fadeIn 1s ease;
}

/* ─── HEADER ─── */
header {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 2rem;
}

.logo-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.logo-circle::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
}

.logo-circle::after {
  content: '';
  position: absolute;
  width: 1px;
  height: 100%;
  background: var(--text-dim);
  top: 0; left: 50%;
  transform: translateX(-50%);
}

.logo-circle span {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  z-index: 1;
}

.foundation-name {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: 0.1em;
}

.foundation-motto {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
}

.classification-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.classification-bar.keter {
  background: linear-gradient(90deg, #1a0000 0%, #0d0000 100%);
  border-top: 1px solid #2a0000;
  color: var(--red-bright);
  text-shadow: 0 0 8px var(--red-bright);
}

/* ─── DOCUMENT ─── */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.scp-document {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
}

.document-header {
  padding: 2rem 2.5rem 1.5rem;
  background: var(--bg-card2);
  border-bottom: 2px solid var(--red);
}

.scp-number {
  font-family: var(--mono);
  font-size: 2.5rem;
  color: #ccc;
  letter-spacing: 0.15em;
  text-shadow: 0 0 20px rgba(200,200,200,0.1);
  margin-bottom: 0.8rem;
}

.classification-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border-bright);
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  background: var(--bg-dark);
}

.keter-badge {
  border-color: var(--red);
  color: var(--red-bright);
  background: rgba(139,0,0,0.1);
  text-shadow: 0 0 6px rgba(204,34,34,0.4);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-bright), transparent);
  margin: 0;
}

/* ─── SECTIONS ─── */
.scp-section {
  padding: 2rem 2.5rem;
}

.scp-section + .scp-section {
  border-top: 1px solid var(--border);
}

.section-title {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--highlight);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  text-shadow: 0 0 10px rgba(30,143,191,0.3);
}

.section-body p {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}

/* ─── NOTICE BOX ─── */
.notice-box {
  background: #0a0c0f;
  border: 1px solid var(--keter-orange);
  border-left: 3px solid var(--keter-orange);
  padding: 1.2rem 1.5rem;
  margin-top: 1rem;
  box-shadow: 0 0 20px var(--keter-glow);
}

.notice-title {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--keter-orange);
  letter-spacing: 0.15em;
  margin-bottom: 0.8rem;
  text-shadow: 0 0 6px var(--keter-orange);
}

.notice-box ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.notice-box li {
  font-size: 0.88rem;
  color: #8a9aaa;
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.7;
}

.notice-box li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--keter-orange);
}

/* ─── PROFILE IMAGE ─── */
.profile-image-wrap {
  float: right;
  margin: 0 0 1.5rem 1.8rem;
  max-width: 260px;
  width: 38%;
  border: 1px solid var(--border-bright);
  background: var(--bg-card2);
  box-shadow: 0 0 30px rgba(0,0,0,0.7), 0 0 0 1px rgba(30,143,191,0.08);
}

.profile-image {
  display: block;
  width: 100%;
  filter: sepia(0.15) contrast(1.05) brightness(0.92);
}

.profile-image-wrap {
  cursor: zoom-in;
}

.profile-image-wrap:hover .profile-image {
  filter: sepia(0.1) contrast(1.08) brightness(0.98);
}

.profile-zoom-hint {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--highlight);
  text-align: center;
  padding: 0.3rem 0.5rem;
  background: rgba(30,143,191,0.08);
  border-top: 1px solid rgba(30,143,191,0.15);
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.2s;
}

.profile-image-wrap:hover .profile-zoom-hint {
  opacity: 1;
}

/* ─── LIGHTBOX ─── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-width: min(680px, 92vw);
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  box-shadow: 0 0 80px rgba(0,0,0,0.9), 0 0 30px rgba(30,143,191,0.06);
  transform: scale(0.92) translateY(12px);
  transition: transform 0.3s ease;
}

.lightbox.open .lightbox-panel {
  transform: scale(1) translateY(0);
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1.2rem;
  background: #08090d;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.lightbox-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.lightbox-close {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red-bright);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.lightbox-close:hover {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 12px var(--red-glow);
}

.lightbox-img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  filter: sepia(0.12) contrast(1.06) brightness(0.94);
}

.lightbox-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.55rem 1.2rem;
  background: #08090d;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.07em;
}

.profile-image-caption {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
  padding: 0.5rem 0.8rem;
  border-top: 1px solid var(--border);
  letter-spacing: 0.05em;
  line-height: 1.6;
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

.danger { color: var(--red-bright); font-weight: 700; }
.no-awareness { color: #5a7a8a; font-style: italic; }

/* ─── ANOMALY BOX ─── */
.anomaly-box {
  background: #080d12;
  border: 1px solid #1e2d3d;
  border-left: 3px solid var(--red-bright);
  padding: 1.4rem 1.6rem;
  margin: 1.2rem 0;
  box-shadow: inset 0 0 30px rgba(139,0,0,0.05), 0 0 20px rgba(0,0,0,0.3);
}

.anomaly-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--red-bright);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  text-shadow: 0 0 8px var(--red-bright);
}

.anomaly-box p {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 0.8rem !important;
}

/* ─── SCALE DIAGRAM ─── */
.scale-diagram {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.2rem;
  padding: 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.scale-item {
  flex: 1;
  min-width: 120px;
}

.scale-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.scale-bar-wrap {
  background: #0a0a0a;
  height: 8px;
  border: 1px solid var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.scale-bar {
  height: 100%;
  border-radius: 1px;
  width: 0;
  transition: width 1.5s ease;
}

.scale-bar.intent { background: linear-gradient(90deg, #1e4a6b, var(--highlight)); }
.scale-bar.disaster { background: linear-gradient(90deg, #4a0000, var(--red-bright)); box-shadow: 0 0 6px var(--red-bright); }

.scale-arrow {
  font-size: 1.5rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.scale-note {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

/* ─── IMPORTANT NOTE ─── */
.important-note {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  background: rgba(139,0,0,0.07);
  border: 1px solid rgba(139,0,0,0.3);
  padding: 1rem 1.2rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: #a0b0be;
  line-height: 1.7;
}

.note-icon {
  font-family: var(--mono);
  color: var(--red-bright);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
  text-shadow: 0 0 8px var(--red-bright);
}

/* ─── REDACT ─── */
.highlight {
  color: var(--highlight);
  background: var(--highlight-dim);
  padding: 0 0.2em;
}

.redact-inline {
  background: #222;
  color: #222;
  padding: 0 0.15em;
  border-radius: 1px;
  user-select: none;
  cursor: default;
  transition: all 0.3s;
}

.redact-inline:hover {
  background: #333;
  color: #666;
}

/* ─── TABS ─── */
.appendix-section { padding-bottom: 0; }

.tab-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.55rem 1.1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
  position: relative;
  bottom: -1px;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-card2);
}

.tab-btn.active {
  background: var(--bg-panel);
  color: var(--highlight);
  border-color: var(--border-bright);
  border-bottom-color: var(--bg-panel);
  text-shadow: 0 0 8px rgba(30,143,191,0.35);
}

.tab-content {
  display: none;
  padding: 1.5rem 0 2rem;
}

.tab-content.active { display: block; }

/* ─── INCIDENT LOG ─── */
.incident-log {
  background: #060809;
  border: 1px solid var(--border);
  font-family: var(--mono);
}

.log-header {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 1.2rem;
  background: #0a0d10;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.log-date { color: var(--text-dim); }

.log-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.log-entry {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.log-entry:hover { background: rgba(30,143,191,0.03); }

.log-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}

.log-id {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.log-severity {
  font-size: 0.68rem;
  padding: 0.1rem 0.5rem;
  border-radius: 1px;
  letter-spacing: 0.1em;
}

.severity-low    { background: rgba(30,80,30,0.3);  border: 1px solid #2a5a2a; color: #5a9a5a; }
.severity-mid    { background: rgba(80,60,10,0.3);  border: 1px solid #6a5010; color: #c8a040; }
.severity-high   { background: rgba(100,20,20,0.3); border: 1px solid #7a1010; color: var(--red-bright); }
.severity-critical { background: rgba(139,0,0,0.2); border: 1px solid var(--red); color: var(--red-bright); text-shadow: 0 0 6px var(--red-bright); animation: flicker 3s infinite; }

.log-entry p {
  font-size: 0.82rem;
  color: #7a8a94;
  line-height: 1.75;
  font-family: var(--mono);
  margin: 0;
}

.log-restricted {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.5rem;
  letter-spacing: 0.08em;
  font-family: var(--mono);
}

.log-footer {
  padding: 0.5rem 1.2rem;
  background: #0a0d10;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.08em;
}

/* ─── INTERVIEW ─── */
.interview-body {
  padding: 0 !important;
}

.interview-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.8rem 1.4rem;
  background: #08090c;
  border-bottom: 1px solid var(--border);
  font-size: 0.73rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.dialogue {
  padding: 1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.line {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.speaker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding-top: 0.1rem;
  flex-shrink: 0;
  width: 64px;
}

.line.interviewer .speaker { color: var(--highlight); }
.line.subject .speaker { color: #8a6a3a; }

.speech {
  font-size: 0.83rem;
  color: #8a9aaa;
  line-height: 1.7;
}

.line.subject .speech { color: #9aaa94; }

/* ─── APPENDIX LABEL ─── */
.appendix-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  padding: 0.6rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

/* ─── INTENT / RESULT BLOCK ─── */
.intent-result-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.intent-row {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.ir-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.55rem;
  border-radius: 1px;
  flex-shrink: 0;
  margin-top: 0.15rem;
  white-space: nowrap;
}

.intent-label {
  background: rgba(30,80,143,0.2);
  border: 1px solid rgba(30,143,191,0.3);
  color: var(--highlight);
}

.result-label {
  background: rgba(139,0,0,0.2);
  border: 1px solid rgba(139,0,0,0.4);
  color: var(--red-bright);
}

.ir-text {
  font-size: 0.84rem;
  color: #8a9aaa;
  line-height: 1.75;
  font-family: var(--body);
}

.ir-text em {
  color: var(--text-dim);
  font-style: italic;
}

/* ─── CONSEQUENCE LIST ─── */
.consequence-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.3rem;
}

.consequence-list li {
  font-size: 0.84rem;
  color: #8a9aaa;
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.75;
}

.consequence-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--red-bright);
  font-size: 0.7rem;
  top: 0.25rem;
}

/* ─── RESEARCHER COMMENT (log footer variant) ─── */
.researcher-comment {
  padding: 1rem 1.4rem !important;
  text-align: left !important;
  background: #08090d;
  border-top: 1px solid rgba(139,0,0,0.2) !important;
}

.rc-header {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--red-bright);
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
  text-shadow: 0 0 6px rgba(204,34,34,0.3);
}

.researcher-comment p {
  font-size: 0.83rem;
  color: #7a8a8a;
  line-height: 1.8;
  font-style: italic;
}

/* ─── RESEARCHER NOTE ─── */
.researcher-note {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--highlight);
  padding: 1.4rem 1.6rem;
}

.researcher-note p {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 0.8rem !important;
}

.researcher-sign {
  color: var(--text-secondary) !important;
  font-style: italic;
  font-size: 0.82rem !important;
  margin-top: 1rem !important;
}

.note-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-bright), transparent);
  margin: 1rem 0;
}

/* ─── DOCUMENT FOOTER ─── */
.document-footer {
  background: #060809;
  border-top: 1px solid var(--border);
  padding: 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes flicker {
  0%, 89%, 91%, 93%, 95%, 100% { opacity: 1; }
  90% { opacity: 0.4; }
  92% { opacity: 0.85; }
  94% { opacity: 0.3; }
  96% { opacity: 0.9; }
}

@keyframes glitch {
  0%, 100% { transform: translate(0); clip-path: none; }
  20% { transform: translate(-3px, 0); clip-path: polygon(0 15%, 100% 15%, 100% 30%, 0 30%); color: #ff2222; }
  40% { transform: translate(3px, 0); clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%); color: #2299ff; }
  60% { transform: translate(-2px, 1px); clip-path: none; }
  80% { transform: translate(2px, -1px); }
}

@keyframes glitch-hard {
  0%, 100% { transform: translate(0) skew(0); opacity: 1; }
  10% { transform: translate(-4px, 0) skew(-1deg); opacity: 0.9; }
  20% { transform: translate(4px, 0) skew(1deg); opacity: 1; }
  30% { transform: translate(-2px, 2px) skew(0); }
  40% { transform: translate(0); opacity: 0.6; }
  50% { transform: translate(3px, -1px); opacity: 1; }
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 8px var(--red-glow); border-color: var(--red); }
  50%       { box-shadow: 0 0 22px rgba(204,34,34,0.55), 0 0 4px rgba(204,34,34,0.3) inset; border-color: var(--red-bright); }
}

@keyframes pulse-blue {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 16px rgba(30,143,191,0.25); }
}

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

@keyframes severity-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.97); }
}

@keyframes scan {
  0%   { top: -4%; }
  100% { top: 104%; }
}

@keyframes scan-fast {
  0%   { top: -4%; }
  100% { top: 104%; }
}

@keyframes keter-glow-pulse {
  0%, 100% { text-shadow: 0 0 8px var(--red-bright); }
  50%       { text-shadow: 0 0 20px var(--red-bright), 0 0 40px rgba(204,34,34,0.4); }
}

@keyframes border-spark {
  0%   { border-color: var(--red); }
  50%  { border-color: var(--red-bright); }
  100% { border-color: var(--red); }
}

@keyframes o5-stamp {
  0%   { opacity: 0; transform: scale(1.4) rotate(-4deg); }
  60%  { opacity: 1; transform: scale(0.96) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(-2deg); }
}

/* ─── SCANLINE ─── */
.scanline {
  position: fixed;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(30,143,191,0.07), transparent);
  pointer-events: none;
  z-index: 9997;
  animation: scan 9s linear infinite;
}

.scanline-fast {
  position: fixed;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,30,30,0.04), transparent);
  pointer-events: none;
  z-index: 9996;
  animation: scan-fast 3.5s linear infinite;
}

/* ─── KETER BADGE PULSE ─── */
.keter-badge {
  animation: keter-glow-pulse 2.5s ease-in-out infinite;
}

/* ─── CLASSIFICATION BAR FLICKER ─── */
.classification-bar.keter {
  animation: border-spark 3s ease-in-out infinite;
}

/* ─── ANOMALY BOX PULSE ─── */
.anomaly-box {
  animation: pulse-red 4s ease-in-out infinite;
}

/* ─── IMPORTANT NOTE BLINK ─── */
.note-icon {
  animation: blink-text 1.4s step-end infinite;
}

/* ─── SEVERITY CRITICAL PULSE ─── */
.severity-critical {
  animation: severity-pulse 1.2s ease-in-out infinite;
}

/* ─── NOTICE BOX PULSE ─── */
.notice-box {
  animation: pulse-blue 5s ease-in-out infinite;
}

/* ─── SECTION TITLE HOVER ─── */
.section-title {
  transition: letter-spacing 0.3s;
}
.section-title:hover {
  letter-spacing: 0.25em;
}

/* ─── O5 STAMP ─── */
.o5-stamp {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--red-bright);
  border: 2px solid var(--red-bright);
  padding: 0.2rem 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transform: rotate(-2deg);
  opacity: 0;
  margin-left: 0.8rem;
  vertical-align: middle;
  text-shadow: 0 0 8px var(--red-bright);
  box-shadow: 0 0 10px var(--red-glow);
}

.o5-stamp.visible {
  animation: o5-stamp 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
}

/* ─── REDACT INLINE GLITCH ON HOVER ─── */
.redact-inline {
  transition: all 0.15s;
  position: relative;
}

.redact-inline.glitching {
  color: #444 !important;
  background: #333 !important;
  animation: glitch-hard 0.25s steps(1) forwards;
}

/* ─── LOG ENTRY HOVER RED LEFT BORDER ─── */
.log-entry {
  border-left: 3px solid transparent;
  transition: border-color 0.3s, background 0.2s;
}

.log-entry:hover {
  border-left-color: var(--red-bright);
  background: rgba(204,34,34,0.04) !important;
}

/* ─── INTENT/RESULT LABEL PULSE ─── */
.result-label {
  animation: severity-pulse 2s ease-in-out infinite;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 620px) {
  .scp-section { padding: 1.5rem 1.2rem; }
  .document-header { padding: 1.5rem 1.2rem; }
  .scp-number { font-size: 1.8rem; }
  .header-inner { padding: 0.8rem 1rem; }
  .classification-bar { padding: 0.35rem 1rem; font-size: 0.7rem; }
  .document-footer { padding: 1rem 1.2rem; }
  .footer-row { flex-direction: column; gap: 0.15rem; }
  .scale-diagram { flex-direction: column; align-items: stretch; }
  .scale-arrow { transform: rotate(90deg); text-align: center; }
  .profile-image-wrap { float: none; width: 100%; max-width: 100%; margin: 0 0 1.2rem 0; }
  .tab-btn { font-size: 0.65rem; padding: 0.4rem 0.55rem; }
  .speaker { width: 48px; font-size: 0.65rem; }
  .intent-row { flex-direction: column; gap: 0.3rem; }
  .ir-label { width: fit-content; }
}

/* 탭 네비게이션 스크롤 */
.tab-nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.tab-nav::-webkit-scrollbar { height: 3px; }
.tab-nav::-webkit-scrollbar-track { background: transparent; }
.tab-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
