/* 마법소녀 정화 - 디스토피아 디자인 시스템 */
:root {
  /* Base — 회색조 디스토피아 */
  --bg-0: #0a0a0c;
  --bg-1: #111114;
  --bg-2: #16161a;
  --bg-3: #1d1d22;
  --bg-4: #25252b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --ink-0: #f4f1e8;
  --ink-1: #c9c5b8;
  --ink-2: #898578;
  --ink-3: #56544c;

  /* Accent — 정화의 불꽃 */
  --fire: #d4502e;
  --fire-glow: #e87555;
  --fire-deep: #8a2818;
  --ash: #6a625a;

  /* Faction tints */
  --f-inmate: #a8b5c8;
  --f-free: #c4b5d4;
  --f-hunter: #d9c4a0;
  --f-admin: #b0b8bf;
  --f-inquisitor: #d68870;

  /* Type */
  --serif: "Cormorant Garamond", "Noto Serif KR", serif;
  --sans: "Inter", "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  --radius: 2px;
  --radius-lg: 4px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--ink-1);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(212, 80, 46, 0.06), transparent 60%),
    radial-gradient(800px 500px at 0% 100%, rgba(196, 181, 212, 0.03), transparent 60%),
    var(--bg-0);
  min-height: 100vh;
}

/* Noise overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
}

/* Scanlines for hero only — clipped to image area to avoid rendering on dark side margins */
.scanlines {
  position: relative;
}
.scanlines::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  max-width: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.02) 0,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* Selection */
::selection { background: var(--fire); color: var(--bg-0); }

/* Headings */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; color: var(--ink-0); margin: 0; letter-spacing: -0.01em; }
.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow .dot { color: var(--fire); }

/* Layout */
.container { max-width: 1280px; margin: 0 auto; padding: 0 64px; }
.container-narrow { max-width: 980px; margin: 0 auto; padding: 0 64px; }

@media (max-width: 720px) {
  .container, .container-narrow { padding: 0 24px; }
}

/* Top chrome — gov't doc header */
.gov-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.gov-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}
.gov-bar .gov-id { color: var(--ink-1); display: flex; gap: 14px; align-items: center; }
.gov-bar .gov-id .seal {
  width: 18px; height: 18px;
  border: 1px solid var(--ink-2);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px;
  color: var(--ink-2);
}
.gov-bar .gov-id { flex: 0 1 340px; min-width: 0; }
.gov-bar .gov-meta { display: flex; gap: 24px; flex-shrink: 0; }

/* BGM player — compact */
.bgm {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.bgm-toggle {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  border-radius: var(--radius);
  transition: border-color .18s, color .18s, background .18s;
}
.bgm-toggle:hover {
  border-color: var(--fire);
  color: var(--fire);
}
.bgm-toggle.is-playing {
  border-color: var(--fire);
  color: var(--fire);
  background: rgba(212, 80, 46, 0.08);
}
.bgm-icon-play {
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
  margin-left: 2px;
}
.bgm-icon-pause {
  display: inline-flex;
  gap: 2.5px;
}
.bgm-icon-pause span {
  display: block;
  width: 2.5px;
  height: 9px;
  background: currentColor;
}
.bgm-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  outline: none;
  padding: 4px 0;
  margin: -4px 0;
}
.bgm-meta:focus-visible { outline: 1px solid var(--fire); outline-offset: 2px; }
.bgm-title {
  position: relative;
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--ink-0);
  overflow: hidden;
  min-width: 0;
  letter-spacing: 0.02em;
}
.bgm-title-track {
  white-space: nowrap;
}
.bgm-title:not(.is-marquee) .bgm-title-track {
  text-overflow: ellipsis;
  overflow: hidden;
}
.bgm-title.is-marquee .bgm-title-track {
  display: inline-flex;
  animation: bgmMarquee 14s linear infinite;
  will-change: transform;
}
.bgm-title.is-marquee .bgm-title-track > span {
  padding-right: 40px;
  flex-shrink: 0;
}
.bgm-title-measure {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  top: 0;
  left: -9999px;
  white-space: nowrap;
  font: inherit;
  letter-spacing: inherit;
}
@keyframes bgmMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.bgm-track {
  position: relative;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
  transition: height 0.15s ease, background 0.15s ease;
}
.bgm-meta:hover .bgm-track { background: rgba(255, 255, 255, 0.18); height: 3px; }
.bgm-track-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--fire);
  pointer-events: none;
}
.bgm-track-knob {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--fire);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s;
  border-radius: 50%;
}
.bgm-meta:hover .bgm-track-knob { opacity: 1; }
.bgm-time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Volume control — icon always visible, slider expands on hover */
.bgm-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.bgm-vol-btn {
  width: 22px;
  height: 22px;
  background: transparent;
  border: 0;
  color: var(--ink-2);
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s;
}
.bgm-vol-btn:hover { color: var(--fire); }
.bgm-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 56px;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}
.bgm-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fire);
  cursor: pointer;
  border: 0;
}
.bgm-vol-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fire);
  cursor: pointer;
  border: 0;
}
.bgm-vol-slider::-moz-range-track {
  background: rgba(255, 255, 255, 0.12);
  height: 2px;
}

@media (max-width: 560px) {
  .gov-bar .gov-id { flex: 0 1 340px; }
  .bgm { gap: 8px; }
  .bgm-vol-slider { width: 80px; }
}
.gov-bar .blink {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--fire);
  box-shadow: 0 0 8px var(--fire);
  animation: blink 1.6s infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes blink {
  0%, 60% { opacity: 1; }
  70%, 100% { opacity: 0.3; }
}

/* Stamp — 검열/공식 */
.stamp {
  display: inline-block;
  border: 1.5px solid currentColor;
  padding: 5px 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fire);
  transform: rotate(-2deg);
  opacity: 0.85;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-0);
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  border-radius: var(--radius);
}
.btn:hover { border-color: var(--ink-0); background: rgba(255, 255, 255, 0.04); }
.btn-fire {
  background: var(--fire);
  border-color: var(--fire);
  color: #1a0a06;
  font-weight: 600;
}
.btn-fire:hover {
  background: var(--fire-glow);
  border-color: var(--fire-glow);
  box-shadow: 0 0 24px rgba(212, 80, 46, 0.35);
}

/* Card */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

/* Divider */
.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}
.rule-strong { border-top-color: var(--line-strong); }

/* Section spacing */
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
@media (max-width: 720px) {
  .section { padding: 64px 0; }
}

/* Section header */
.section-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  margin-bottom: 56px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.section-head .lede {
  color: var(--ink-1);
  max-width: 60ch;
  margin-top: 14px;
  font-size: 18px;
  line-height: 1.7;
}
@media (max-width: 720px) {
  .section-head { grid-template-columns: 1fr; gap: 12px; }
  .section-head h2 { font-size: 32px; }
}

/* utility */
.text-fire { color: var(--fire); }
.text-mute { color: var(--ink-2); }
.text-ash { color: var(--ash); }

/* Tag chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.chip-fire { color: var(--fire); border-color: rgba(212, 80, 46, 0.4); }
