.section {
  padding: 100px 40px;
  max-width: 1320px; margin: 0 auto;
  position: relative;
}
.section.section-dark { background: var(--section-bg-alt); }
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body);
  font-weight: 800; font-size: 12px;
  letter-spacing: 3px; text-transform: uppercase;
  background: var(--accent); color: #1a0530;
  border: 2px solid var(--shadow-ink);
  padding: 6px 12px; border-radius: 8px;
  box-shadow: 0 3px 0 var(--shadow-ink), 0 0 18px rgba(255,40,180,0.3);
  margin-bottom: 18px;
}
.section h2 {
  font-family: var(--font-display);
  font-weight: 900; font-style: italic;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.05; text-transform: uppercase; color: #fff;
  margin-bottom: 18px;
  text-shadow:
    -2px -2px 0 var(--shadow-ink), 2px -2px 0 var(--shadow-ink),
    -2px  2px 0 var(--shadow-ink), 2px  2px 0 var(--shadow-ink),
    0 6px 0 var(--shadow-ink),
    -4px 0 18px rgba(255,40,180,0.35), 4px 0 18px rgba(0,255,200,0.25);
}
.section-subtitle {
  font-size: 17px; color: var(--fg-dim);
  max-width: 640px; margin-bottom: 50px;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.news-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.3s ease;
}
.news-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 10px 0 var(--shadow-ink), 0 18px 32px rgba(0,0,0,0.5),
    -4px 0 18px rgba(255,40,180,0.2), 4px 0 18px rgba(0,255,200,0.2);
}
.news-img {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  background: #1a0a3e;
}
.news-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.news-card:hover .news-img img { transform: scale(1.06); }
.news-body { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 10px; }
.news-date {
  display: inline-flex; width: fit-content;
  font-weight: 800; font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase;
  background: var(--accent); color: #1a0530;
  border: 2px solid var(--shadow-ink);
  box-shadow: 0 2px 0 var(--shadow-ink);
  padding: 4px 10px; border-radius: 6px;
}
.news-card h3 {
  font-family: var(--font-display);
  font-weight: 900; font-style: italic;
  font-size: 18px; line-height: 1.15;
  text-transform: uppercase; color: #fff;
  text-shadow:
    -1px -1px 0 var(--shadow-ink), 1px -1px 0 var(--shadow-ink),
    -1px  1px 0 var(--shadow-ink), 1px  1px 0 var(--shadow-ink),
    0 2px 0 var(--shadow-ink);
}
.news-card p { font-size: 13px; color: var(--fg-dim); line-height: 1.55; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 18px; overflow: hidden;
  background: #1a0a3e;
  cursor: pointer;
  border: 3px solid var(--shadow-ink);
  box-shadow: 0 5px 0 var(--shadow-ink), 0 12px 24px rgba(0,0,0,0.4);
  transition: transform 0.25s;
}
.gallery-item:hover { transform: translateY(-4px); }
.gallery-item img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.05); }
#faq { text-align: center; }
#faq .section-eyebrow,
#faq h2,
#faq .section-subtitle {
  margin-left: auto; margin-right: auto;
}
#faq .section-subtitle { text-align: center; }
.faq-list {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 920px; margin: 0 auto; text-align: left;
}
.faq-item {
  background: var(--card-bg);
  border: var(--card-border); border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.faq-question {
  width: 100%; background: transparent;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 24px;
  font-family: var(--font-display);
  font-weight: 900; font-style: italic;
  font-size: 17px; text-transform: uppercase;
  color: #fff; text-align: left; gap: 16px;
}
.faq-icon {
  width: 32px; height: 32px;
  background: var(--accent); border-radius: 8px;
  color: #1a0530;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 900; font-size: 20px;
  border: 2px solid var(--shadow-ink);
  box-shadow: 0 2px 0 var(--shadow-ink);
  transition: transform 0.3s;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item.open .faq-answer { max-height: 400px; }
.faq-answer p { padding: 0 24px 22px; color: var(--fg-dim); font-size: 14px; line-height: 1.6; }
.dev-popup-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(8,2,26,0.85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.dev-popup-backdrop.active { opacity: 1; pointer-events: auto; }
.dev-popup {
  position: relative;
  background: linear-gradient(180deg, rgba(74,30,150,0.95), rgba(40,15,90,0.98));
  border: var(--card-border); border-radius: var(--card-radius);
  box-shadow: 0 12px 0 var(--shadow-ink), 0 24px 60px rgba(0,0,0,0.6);
  padding: 48px 40px 40px;
  max-width: 480px; width: 100%; text-align: center;
  transform: scale(0.92); transition: transform 0.3s ease;
}
.dev-popup-backdrop.active .dev-popup { transform: scale(1); }
.popup-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  background: var(--accent);
  border: 2px solid var(--shadow-ink);
  box-shadow: 0 2px 0 var(--shadow-ink);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.popup-close::before, .popup-close::after {
  content: ""; position: absolute;
  width: 16px; height: 2.5px;
  background: var(--shadow-ink); border-radius: 2px;
}
.popup-close::before { transform: rotate(45deg); }
.popup-close::after { transform: rotate(-45deg); }
.popup-title {
  font-family: var(--font-display);
  font-weight: 900; font-style: italic;
  font-size: clamp(28px, 4vw, 40px);
  text-transform: uppercase; color: #fff;
  margin-bottom: 18px;
  text-shadow:
    -2px -2px 0 var(--shadow-ink), 2px -2px 0 var(--shadow-ink),
    -2px  2px 0 var(--shadow-ink), 2px  2px 0 var(--shadow-ink),
    0 4px 0 var(--shadow-ink);
}
.popup-body { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.popup-text { color: var(--fg-dim); font-size: 15px; line-height: 1.6; }
.popup-button {
  font-family: var(--font-display);
  font-weight: 900; font-style: italic;
  font-size: 14px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--cta-fg); background: var(--cta-bg);
  border: var(--cta-border); border-radius: var(--cta-radius);
  box-shadow: var(--cta-shadow);
  padding: 12px 26px; position: relative;
}
.popup-button::after { content: "OK"; }
.popup-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--shadow-ink), 0 14px 24px rgba(0,255,234,0.45);
}
body.page-404 { min-height: 100vh; }
.nf {
  position: relative; z-index: 1; min-height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 100px 32px 110px;
}
.nf-vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  box-shadow:
    inset 0 0 160px 40px rgba(255,120,40,0.28),
    inset 0 0 60px 10px rgba(12,3,34,0.9);
}
.nf-tag {
  position: absolute; top: 26px; left: 32px; z-index: 5;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent-hot);
  text-shadow: 0 0 14px rgba(255,78,201,0.6);
}
.nf-tag .cursor {
  display: inline-block; width: 9px; height: 1em;
  background: var(--accent-hot); margin-left: 3px;
  vertical-align: -1px;
  animation: nf-blink 1s steps(1) infinite;
}
@keyframes nf-blink { 50% { opacity: 0; } }
.nf-back {
  position: absolute; top: 24px; right: 32px; z-index: 5;
  font-family: var(--font-display);
  font-weight: 900; font-style: italic; font-size: 16px;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--cta-fg); background: var(--cta-bg);
  border: var(--cta-border); border-radius: var(--cta-radius);
  box-shadow: var(--cta-shadow);
  padding: 12px 22px; display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.25s ease;
}
.nf-back:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--shadow-ink), 0 14px 24px rgba(0,255,234,0.45); }
.nf-stage {
  width: 100%; max-width: 760px;
  display: flex; flex-direction: column; align-items: center; gap: 30px;
}
.nf-code {
  font-family: var(--font-display);
  font-weight: 900; font-style: italic;
  font-size: clamp(110px, 17vw, 210px);
  line-height: 0.82; letter-spacing: -2px; color: #fff;
  text-shadow:
    -4px -4px 0 var(--shadow-ink), 4px -4px 0 var(--shadow-ink),
    -4px  4px 0 var(--shadow-ink), 4px  4px 0 var(--shadow-ink),
    0 12px 0 var(--shadow-ink),
    -8px 0 36px rgba(255,40,180,0.6), 8px 0 36px rgba(0,255,200,0.5);
}
.nf-console {
  width: 100%; background: rgba(8,2,26,0.94);
  border: 3px solid var(--shadow-ink); border-radius: 16px;
  box-shadow: 0 8px 0 var(--shadow-ink), 0 18px 40px rgba(0,0,0,0.55);
  overflow: hidden; position: relative;
}
.nf-console-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  background: linear-gradient(180deg, rgba(124,58,237,0.4), rgba(40,15,90,0.6));
  border-bottom: 3px solid var(--shadow-ink);
}
.nf-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--shadow-ink); }
.nf-dot:nth-child(1) { background: #ff4d6d; }
.nf-dot:nth-child(2) { background: var(--gold-1); }
.nf-dot:nth-child(3) { background: var(--mint-1); }
.nf-console-title {
  margin-left: 8px; font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.nf-console-body {
  padding: 22px 24px; font-family: var(--font-mono);
  font-size: 14px; line-height: 1.45; min-height: 322px;
}
.nf-cline {
  display: flex; align-items: baseline; gap: 8px;
  white-space: pre-wrap; word-break: break-word;
  margin-bottom: 7px; color: rgba(255,255,255,0.82); opacity: 0;
}
.nf-cline.shown { opacity: 1; }
.nf-cline::before { content: ">"; color: var(--accent); flex-shrink: 0; }
.nf-cline.err { color: #ff6b8a; }
.nf-cline.err::before { content: "!"; color: #ff4d6d; }
.nf-cline.hint { color: var(--accent); }
.nf-cline.hint::before { content: "#"; }
.nf-cline-text { flex: 1; }
.nf-tag-chip {
  flex-shrink: 0; font-weight: 700; font-size: 11px; letter-spacing: 1px;
  padding: 2px 9px; border-radius: 5px;
  border: 2px solid var(--shadow-ink); opacity: 0; transition: opacity 0.12s;
}
.nf-tag-chip.show { opacity: 1; }
.nf-tag-chip.ok { background: var(--mint-1); color: var(--shadow-ink); }
.nf-tag-chip.fail { background: #ff4d6d; color: #fff; }
.nf-tag-chip.warn { background: var(--gold-1); color: var(--shadow-ink); }
.nf-prompt::before { content: ">"; }
.nf-prompt { color: var(--accent); font-family: var(--font-mono); font-size: 14px; }
.nf-prompt .cursor {
  display: inline-block; width: 9px; height: 1em;
  background: var(--accent); margin-left: 4px;
  vertical-align: -1px; animation: nf-blink 1s steps(1) infinite;
}
@media (max-width: 720px) {
  .nf { padding: 78px 16px 104px; }
  .nf-tag { font-size: 12px; top: 18px; left: 18px; }
  .nf-back { position: fixed; top: auto; right: auto; bottom: 18px; left: 50%; transform: translateX(-50%); font-size: 14px; }
  .nf-code { font-size: clamp(96px, 34vw, 150px); }
  .nf-console-body { padding: 18px 16px; font-size: 12px; min-height: 300px; }
}

/* History Section */
.history-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-top: 30px;
  min-height: 520px;
}

.history-tabs {
  background: rgba(0, 0, 0, 0.25);
  border-right: 3px solid var(--shadow-ink);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.history-tab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  text-align: left;
  transition: all 0.3s ease;
  position: relative;
}

.history-tab::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: transparent;
  transition: background 0.3s;
}

.history-tab.active {
  background: rgba(0, 255, 234, 0.04);
}

.history-tab.active::after {
  background: var(--accent);
}

.tab-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--fg-dim);
  transition: color 0.3s;
}

.history-tab.active .tab-num {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-soft);
}

.tab-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color 0.3s;
}

.history-tab:hover .tab-title,
.history-tab:hover .tab-num {
  color: #fff;
}

.history-tab.active .tab-title {
  color: #fff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.history-content-panel {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  background: rgba(12, 4, 32, 0.2);
}

.history-chapter-meta {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
}

.meta-status {
  color: var(--accent-hot);
  font-weight: 800;
  text-shadow: 0 0 8px rgba(255, 78, 201, 0.4);
}

.meta-date {
  color: var(--fg-dim);
}

.history-chapter-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 24px;
  text-transform: uppercase;
  color: #fff;
  margin-top: 10px;
  text-shadow:
    -1px -1px 0 var(--shadow-ink), 1px -1px 0 var(--shadow-ink),
    -1px  1px 0 var(--shadow-ink), 1px  1px 0 var(--shadow-ink),
    0 3px 0 var(--shadow-ink);
  transition: opacity 0.15s ease;
}

.history-text {
  font-size: 15px;
  color: var(--fg-dim);
  line-height: 1.75;
  white-space: pre-wrap;
  max-width: 820px;
  transition: opacity 0.15s ease;
}

.history-text.fade,
.history-chapter-title.fade {
  opacity: 0;
}

@media (max-width: 860px) {
  .history-container {
    grid-template-columns: 1fr;
  }
  .history-tabs {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 3px solid var(--shadow-ink);
    padding: 0;
    scroll-snap-type: x mandatory;
  }
  .history-tab {
    padding: 18px 24px;
    justify-content: center;
    border-left: none;
    flex-shrink: 0;
    scroll-snap-align: start;
    width: auto;
  }
  .history-tab::after {
    left: 0; right: 0; bottom: 0; top: auto; height: 4px; width: auto;
  }
  .history-content-panel {
    padding: 28px 20px;
  }
  .history-chapter-title {
    font-size: 20px;
  }
  .history-text {
    font-size: 14px;
  }
}


@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
