/* ══════════════════════════════════════════════════════
   BITOTEM — Sub-page shared stylesheet
   All child pages: system, works, exhibition, artist, collect
   ══════════════════════════════════════════════════════ */

:root {
  --mono: 'IBM Plex Mono', monospace;
  --bg:      #050505;
  --fg:      rgba(255,255,255,0.84);
  --fg-high: rgba(255,255,255,1.00);
  --fg-low:  rgba(255,255,255,0.33);
  --fg-dim:  rgba(255,255,255,0.13);
  --max-w:   680px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2.0;
  font-weight: 300;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── SubNav ─────────────────────────────────────────── */
.subnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.4s ease;
}
.subnav.scrolled { border-bottom-color: rgba(255,255,255,0.05); }

.subnav-logo {
  font-size: 11px; font-weight: 300; letter-spacing: 0.12em;
  text-transform: uppercase; text-decoration: none;
  color: rgba(255,255,255,0.71);
  transition: color 0.3s; cursor: pointer;
  font-family: var(--mono);
}
.subnav-logo:hover { color: rgba(255,255,255,1.00); border: none; }

.subnav-links {
  display: flex; align-items: center; gap: 28px;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.subnav-link {
  font-size: 11px; font-weight: 300; letter-spacing: 0.08em;
  text-transform: uppercase; text-decoration: none;
  color: rgba(255,255,255,0.26);
  transition: color 0.3s; border: none;
  font-family: var(--mono);
}
.subnav-link:hover  { color: rgba(255,255,255,0.52); border: none; }
.subnav-link.active { color: rgba(255,255,255,0.65); pointer-events: none; }

.subnav-right {
  display: flex; align-items: center; gap: 12px;
}

.subnav-invert {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 8px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 3px;
  background: none;
  cursor: pointer;
  user-select: none;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.10em;
  color: rgba(255,255,255,0.42);
  transition: color 0.2s, border-color 0.2s;
  -webkit-appearance: none; appearance: none;
  margin: 0;
}
.subnav-invert:hover {
  color: rgba(255,255,255,0.72);
  border-color: rgba(255,255,255,0.32);
}
.subnav-invert.active {
  color: rgba(255,255,255,0.72);
  border-color: rgba(255,255,255,0.30);
}
.subnav-inv-label {
  font-size: 10px;
  letter-spacing: 0.08em;
}
.subnav-inv-icon {
  font-size: 11px;
  opacity: 0.7;
}
.subnav-sep {
  color: rgba(255,255,255,0.10); user-select: none;
  font-size: 11px;
}
.subnav-index {
  font-size: 11px; font-weight: 300; letter-spacing: 0.12em;
  text-transform: uppercase; cursor: pointer; user-select: none;
  color: rgba(255,255,255,0.44);
  transition: color 0.3s; font-family: var(--mono);
}
.subnav-index:hover { color: rgba(255,255,255,0.68); }

@media (max-width: 640px) {
  .subnav-links { display: none; }
}

/* ── Page container ─────────────────────────────────── */
.page-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px 28px 80px;
}

/* ── Typography ─────────────────────────────────────── */
.page-title {
  font-size: 14px; font-weight: 400;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--fg-high); margin-bottom: 12px;
}
.page-subtitle {
  font-size: 11px; letter-spacing: 0.08em;
  color: var(--fg-low); margin-bottom: 64px;
}
.section-label {
  font-size: 10px; font-weight: 400;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.29);
  margin-bottom: 20px; margin-top: 60px; display: block;
}
.section-label:first-child { margin-top: 0; }

p { margin-bottom: 20px; }
p:last-child { margin-bottom: 0; }

a {
  color: inherit; text-decoration: none;
  border-bottom: 0.5px solid rgba(255,255,255,0.23);
  transition: border-color 0.2s;
}
a:hover { border-bottom-color: rgba(255,255,255,0.71); }
a.no-ul { border: none; }

hr.divider {
  border: none; border-top: 0.5px solid rgba(255,255,255,0.08);
  margin: 56px 0;
}

/* ── Footer ─────────────────────────────────────────── */
.page-footer {
  border-top: 0.5px solid rgba(255,255,255,0.08);
  padding: 28px 28px;
  max-width: var(--max-w); margin: 0 auto;
  font-size: 10px; line-height: 2.2;
  color: rgba(255,255,255,0.20);
}

/* ── INDEX dropdown ──────────────────────────────────── */
#sub-index-menu {
  position: fixed;
  top: 48px; right: 28px;
  width: 220px;
  background: rgba(8,8,8,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 0.5px solid rgba(255,255,255,0.08);
  z-index: 100;
  padding: 16px 20px 14px;
  box-sizing: border-box;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#sub-index-menu.open {
  opacity: 1; pointer-events: auto;
  transform: translateY(0);
}

#sub-close-menu { display: none; }

.sub-menu-item {
  display: block; padding: 8px 0; text-decoration: none;
  text-align: left; border: none;
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#sub-index-menu.open .sub-menu-item { opacity: 1; transform: translateY(0); }

.sub-menu-title {
  display: block; font-size: 11px; font-weight: 300;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.71); transition: color 0.2s;
}
.sub-menu-sub {
  display: block; font-size: 9px; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.21); margin-top: 1px;
  transition: color 0.2s;
}
.sub-menu-item:hover .sub-menu-title { color: rgba(255,255,255,1.00); }
.sub-menu-item:hover .sub-menu-sub   { color: rgba(255,255,255,0.46); }

.sub-menu-lang {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; font-size: 10px; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.26);
}
.sub-menu-count {
  margin-top: 8px; font-size: 9px; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.16);
}

/* ── Totem grid (static 4×4 render) ─────────────────── */
.totem-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 3px; width: 100%; aspect-ratio: 1;
}
.totem-cell {
  aspect-ratio: 1;
  background: rgba(255,255,255,0.08);
  transition: background 0.2s;
}
.totem-cell.on { background: rgba(255,255,255,1.00); }

/* ── Form elements ───────────────────────────────────── */
.form-field {
  width: 100%; margin-bottom: 1px;
}
.form-field label {
  display: block; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--fg-low);
  margin-bottom: 6px; border: none;
}
.form-field input,
.form-field textarea {
  width: 100%; background: transparent;
  border: 0.5px solid rgba(255,255,255,0.18);
  border-radius: 0; padding: 12px 14px;
  font-family: var(--mono); font-size: 12px; font-weight: 300;
  color: var(--fg); outline: none;
  transition: border-color 0.2s;
  resize: none;
}
.form-field input:focus,
.form-field textarea:focus { border-color: rgba(255,255,255,0.46); }
.form-field textarea { min-height: 120px; }

.form-submit {
  width: 100%; margin-top: 2px; padding: 14px;
  background: transparent;
  border: 0.5px solid rgba(255,255,255,0.29);
  font-family: var(--mono); font-size: 11px; font-weight: 300;
  letter-spacing: 0.20em; text-transform: uppercase;
  color: rgba(255,255,255,0.71);
  cursor: pointer; transition: all 0.3s;
}
.form-submit:hover {
  border-color: rgba(255,255,255,0.71);
  color: rgba(255,255,255,1.00);
}
