/* ============================================================
   산만인류 : SANMAN DNA — Studio Sanman 3rd Exhibition
   base.css · DNA Lab 공통 디자인 시스템
   ============================================================ */

:root {
  /* ── 베이스: 순흑 연구실 ── */
  --c-void:        #000000;
  --c-abyss:       #05080d;
  --c-panel:       #0a0f17;
  --c-panel-2:     #0e1420;
  --c-line:        #18222f;
  --c-line-soft:   rgba(120,160,200,.12);

  /* ── DNA 액센트: 차가운 형광 ── */
  --c-helix-cyan:  #6bd5ff;
  --c-helix-blue:  #3a86ff;
  --c-helix-deep:  #14305c;
  --c-violet:      #8a7cff;

  /* ── 신호점 (포스터의 미세 RGB 도트) ── */
  --c-signal-r:    #ff4d5e;
  --c-signal-g:    #5bff9b;

  /* ── 텍스트 ── */
  --c-ice:         #eaf2ff;
  --c-ice-dim:     #9fb2c6;
  --c-ice-faint:   #5d6f80;
  --c-ice-ghost:   #38465a;

  /* ── 유리 ── */
  --c-glass:       rgba(220,235,250,.05);
  --c-glass-2:     rgba(180,210,240,.03);
  --c-glass-edge:  rgba(150,195,240,.22);

  /* ── 타이포 ── */
  --f-display: "Saira", "Chakra Petch", "Arial Narrow", sans-serif;
  --f-mono:    "JetBrains Mono", "IBM Plex Mono", "Courier New", monospace;
  --f-ko:      "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  --f-en:      "Saira", "Noto Sans KR", system-ui, sans-serif;

  /* ── 레이아웃 ── */
  --frame-w: 18px;
  --radius:  14px;
  --max-w:   1240px;

  /* ── 트랜지션 ── */
  --ease:  cubic-bezier(.22,.61,.36,1);
  --t-fast: 180ms var(--ease);
  --t-med:  360ms var(--ease);
  --t-slow: 720ms var(--ease);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*::selection { background: var(--c-helix-blue); color: var(--c-void); }

html, body {
  background: var(--c-void);
  color: var(--c-ice);
  font-family: var(--f-ko);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body { min-height: 100vh; line-height: 1.62; font-size: 16px; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { font-weight: 500; line-height: 1.18; }

/* ============================================================
   외곽 프레임 — 차가운 글래스/메탈 엣지 + 코너 틱
   ============================================================ */
.frame {
  position: relative;
  min-height: 100vh;
  padding: var(--frame-w);
  background:
    radial-gradient(ellipse at 50% -8%, rgba(58,134,255,.08), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(107,213,255,.05), transparent 50%),
    linear-gradient(180deg, var(--c-void) 0%, var(--c-abyss) 100%);
}
/* 스캔라인 + 코드 텍스처 오버레이 */
.frame::before {
  content: "";
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg, rgba(120,170,220,.035) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
  opacity: .5;
}
/* 네 모서리 발광 보더 */
.frame-edge {
  position: fixed; z-index: 30; pointer-events: none;
  inset: 8px;
  border: 1px solid var(--c-line);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px rgba(58,134,255,.05),
    inset 0 0 60px rgba(0,0,0,.7);
}
.frame-edge::before, .frame-edge::after {
  content: ""; position: absolute; width: 22px; height: 22px;
  border: 1px solid var(--c-helix-cyan); opacity: .5;
}
.frame-edge::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.frame-edge::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ============================================================
   상단 바
   ============================================================ */
.topbar {
  position: fixed;
  top: var(--frame-w); left: var(--frame-w); right: var(--frame-w);
  z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px;
  background: linear-gradient(180deg, rgba(0,0,0,.94), rgba(0,0,0,.6) 70%, transparent);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--f-display);
  letter-spacing: .26em; font-size: 12px; font-weight: 600;
  color: var(--c-ice); text-transform: uppercase;
}
.brand-mark { width: 30px; height: 22px; display: grid; place-items: center; }
.brand-mark svg { width: 100%; height: 100%; stroke: var(--c-helix-cyan); fill: none; stroke-width: 6; filter: drop-shadow(0 0 6px rgba(107,213,255,.4)); }

.nav { display: flex; gap: 2px; align-items: center; }
.nav a {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: .2em; text-transform: uppercase;
  padding: 8px 13px; color: var(--c-ice-dim);
  border: 1px solid transparent; border-radius: 3px;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.nav a:hover, .nav a.active {
  color: var(--c-helix-cyan);
  border-color: rgba(107,213,255,.3);
  background: rgba(58,134,255,.07);
}

.topbar-ctrls { display: flex; align-items: center; gap: 10px; }

.lang-toggle {
  display: inline-flex; border: 1px solid rgba(107,213,255,.3);
  border-radius: 3px; overflow: hidden;
}
.lang-toggle button {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em;
  padding: 6px 10px; color: var(--c-ice-dim); transition: all var(--t-fast);
}
.lang-toggle button.active { background: var(--c-helix-blue); color: var(--c-void); }
.lang-toggle button:not(.active):hover { color: var(--c-helix-cyan); }

/* BGM 토글 */
.bgm-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px;
  border: 1px solid rgba(107,213,255,.3); border-radius: 3px;
  background: rgba(0,0,0,.4); color: var(--c-ice-dim);
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; transition: all var(--t-fast); user-select: none;
}
.bgm-toggle:hover { color: var(--c-helix-cyan); border-color: rgba(107,213,255,.7); }
.bgm-toggle[aria-pressed="true"] {
  color: var(--c-helix-cyan); border-color: var(--c-helix-cyan);
  background: rgba(58,134,255,.12);
  animation: bgm-pulse 2.4s ease-in-out infinite;
}
@keyframes bgm-pulse {
  0%,100% { box-shadow: 0 0 0 rgba(107,213,255,0); }
  50%     { box-shadow: 0 0 14px rgba(107,213,255,.4); }
}
.bgm-toggle .bgm-icon { width: 12px; height: 12px; display: inline-flex; align-items: center; justify-content: center; }
.bgm-toggle .bgm-icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.6; }
.bgm-toggle .bgm-bars { display: none; gap: 2px; align-items: flex-end; height: 12px; }
.bgm-toggle .bgm-bars span { display: inline-block; width: 2px; background: currentColor; border-radius: 1px; height: 30%; }
.bgm-toggle[aria-pressed="true"] .bgm-icon { display: none; }
.bgm-toggle[aria-pressed="true"] .bgm-bars { display: inline-flex; }
.bgm-toggle[aria-pressed="true"] .bgm-bars span { animation: bgm-bar 1s ease-in-out infinite; }
.bgm-toggle[aria-pressed="true"] .bgm-bars span:nth-child(2) { animation-delay: .15s; }
.bgm-toggle[aria-pressed="true"] .bgm-bars span:nth-child(3) { animation-delay: .3s; }
@keyframes bgm-bar { 0%,100% { height: 25%; } 50% { height: 95%; } }
.bgm-toggle .bgm-track {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .08em;
  text-transform: none; opacity: .7; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============================================================
   모바일 햄버거 + 드로어
   ============================================================ */
.hamburger {
  display: none; width: 36px; height: 36px;
  border: 1px solid rgba(107,213,255,.3); border-radius: 3px;
  background: rgba(0,0,0,.4); position: relative; transition: all var(--t-fast);
}
.hamburger:hover { border-color: rgba(107,213,255,.7); }
.hamburger span { position: absolute; left: 8px; right: 8px; height: 1.5px; background: var(--c-helix-cyan); transition: all var(--t-med); }
.hamburger span:nth-child(1) { top: 11px; }
.hamburger span:nth-child(2) { top: 17px; }
.hamburger span:nth-child(3) { top: 23px; }
.hamburger[aria-expanded="true"] span:nth-child(1) { top: 17px; transform: rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { top: 17px; transform: rotate(-45deg); }

.nav-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(330px, 82vw); background: var(--c-abyss);
  border-left: 1px solid rgba(107,213,255,.18);
  padding: 84px 28px 32px; z-index: 60;
  transform: translateX(100%); transition: transform var(--t-med);
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: -20px 0 60px rgba(0,0,0,.85);
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer a {
  font-family: var(--f-ko); font-size: 17px; letter-spacing: .06em;
  padding: 15px 4px; color: var(--c-ice);
  border-bottom: 1px solid rgba(107,213,255,.1);
  display: flex; align-items: center; gap: 12px; transition: color var(--t-fast);
}
.nav-drawer a:hover, .nav-drawer a.active { color: var(--c-helix-cyan); }
.nav-drawer a .num { font-family: var(--f-mono); font-size: 10px; letter-spacing: .25em; color: var(--c-helix-blue); min-width: 28px; }
.nav-drawer .ext-links {
  margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(107,213,255,.15);
  display: flex; flex-direction: column; gap: 8px;
}
.nav-drawer .ext-links a { border: none; padding: 4px 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; color: var(--c-ice-dim); }
.nav-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.72);
  backdrop-filter: blur(2px); z-index: 55; opacity: 0; pointer-events: none;
  transition: opacity var(--t-med);
}
.nav-backdrop.open { opacity: 1; pointer-events: auto; }

/* ============================================================
   STUDIO SANMAN 로고 (1차 원본 SVG 재사용)
   ============================================================ */
.ssm-logo, .ssm-mark { width: 100%; height: auto; stroke: currentColor; fill: none; display: block; }
.ssm-mark { stroke-width: 6; }
.brand-mark { color: var(--c-helix-cyan); }
.ssm-block { display: inline-flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ssm-block .ssm-logo { max-width: 240px; }
.ssm-block .ssm-label { font-family: var(--f-display); font-size: 13px; letter-spacing: .34em; text-transform: uppercase; color: var(--c-helix-cyan); }

/* ============================================================
   DNA 캡슐 (시료관) — 포스터의 글래스 케이스
   ============================================================ */
.capsule {
  position: relative;
  border-radius: 999px;
  background:
    linear-gradient(135deg, var(--c-glass) 0%, transparent 40%),
    linear-gradient(315deg, var(--c-glass-2) 0%, transparent 45%),
    var(--c-panel);
  border: 1px solid var(--c-glass-edge);
  box-shadow:
    inset 0 1px 0 rgba(220,240,255,.18),
    inset 0 -10px 30px rgba(0,0,0,.6),
    0 14px 40px rgba(0,0,0,.55);
  overflow: hidden;
}
.capsule::after { /* 유리 반사 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255,255,255,.07) 0 28%, transparent 32%),
    linear-gradient(250deg, rgba(180,220,255,.05) 0 24%, transparent 30%);
}

/* DNA 이중나선 (CSS 도트) — 캡슐/구분선 내부에 삽입 */
.helix {
  --helix-h: 60px;
  position: relative; width: 100%; height: var(--helix-h);
  overflow: hidden;
}
.helix .strand { position: absolute; inset: 0; }
.helix .rung {
  position: absolute; top: 0; width: 2px; height: 100%;
  margin-left: -1px;
}
.helix .rung i {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-helix-cyan);
  box-shadow: 0 0 8px rgba(107,213,255,.7);
}
.helix .rung b {
  position: absolute; height: 1px; left: 50%; transform-origin: left center;
  background: linear-gradient(90deg, var(--c-helix-blue), transparent);
  opacity: .5;
}

/* 유전 코드 스트립 */
.code-strip {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .42em;
  color: var(--c-ice-ghost); text-transform: uppercase;
  white-space: nowrap; overflow: hidden; user-select: none;
}

/* 4작가 글리프 */
.glyphset { display: inline-flex; gap: 14px; align-items: center; }
.glyph { width: 26px; height: 26px; stroke: var(--c-ice); fill: none; stroke-width: 1.4; }
.glyph.fill { fill: var(--c-ice); stroke: none; }

/* ============================================================
   유틸
   ============================================================ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .3em;
  text-transform: uppercase; color: var(--c-helix-cyan);
}
.eyebrow.dim { color: var(--c-ice-faint); }

.divider {
  display: flex; align-items: center; gap: 14px;
  color: var(--c-ice-faint); margin: 28px 0;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-helix-deep) 50%, transparent);
}
.divider span { font-family: var(--f-mono); font-size: 10px; letter-spacing: .3em; text-transform: uppercase; }

.note { font-family: var(--f-ko); font-size: 15px; line-height: 1.9; color: var(--c-ice-dim); max-width: 64ch; }
.note em, .lede em { color: var(--c-helix-cyan); font-style: normal; }

.btn-line {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  padding: 15px 26px; border: 1px solid rgba(107,213,255,.35); border-radius: 4px;
  color: var(--c-ice); transition: all var(--t-fast); background: rgba(58,134,255,.05);
}
.btn-line:hover { border-color: var(--c-helix-cyan); background: rgba(58,134,255,.14); box-shadow: 0 0 24px rgba(58,134,255,.2); }
.btn-line .arrow { width: 22px; height: 1px; background: currentColor; position: relative; }
.btn-line .arrow::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }

/* lang 전환 */
[data-lang-en], [data-lang-ko] { transition: opacity var(--t-fast); }
html[lang="ko"] [data-lang-en] { display: none; }
html[lang="en"] [data-lang-ko] { display: none; }

/* 접근성 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 전역 푸터 */
.site-foot {
  margin-top: 80px; padding: 30px 24px 14px;
  border-top: 1px solid var(--c-line);
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .18em;
  color: var(--c-ice-faint); text-transform: uppercase;
}
.site-foot a { color: var(--c-ice-dim); }
.site-foot a:hover { color: var(--c-helix-cyan); }

/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 980px) {
  :root { --frame-w: 12px; }
  .topbar { padding: 10px 14px; }
  .nav a { padding: 6px 9px; font-size: 10px; letter-spacing: .14em; }
  .brand { font-size: 11px; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .hamburger { display: block; }
  .bgm-toggle .bgm-track { display: none; }
}
@media (max-width: 560px) {
  .topbar { padding: 8px 12px; }
  .brand span:last-child { display: none; }
}
