.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: var(--r-sm);
  box-shadow: var(--elev-2), 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),
    var(--elev-4),
    -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 (redesign · featured + grid) ===== */
/* =====================================================================
           NEWS — Variant A · Featured + grid
           (replaces .news-grid / .news-card block in css/sections.css)
           ===================================================================== */
        /* shared chips */
        .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: var(--elev-1);
            padding: 4px 10px;
            border-radius: var(--r-xs);
        }

        .news-cat {
            display: inline-flex;
            align-items: center;
            font-family: var(--font-mono);
            font-weight: 700;
            font-size: 10px;
            letter-spacing: 1.5px;
            text-transform: uppercase;
            color: var(--accent);
            border: 1px solid var(--accent-soft);
            border-radius: var(--r-xs);
            padding: 3px 9px;
        }

        .news-lang {
            display: inline-flex;
            align-items: center;
            font-family: var(--font-mono);
            font-weight: 700;
            font-size: 10px;
            letter-spacing: 1.5px;
            color: #fff;
            background: rgba(255, 78, 201, 0.22);
            border: 1px solid rgba(255, 78, 201, 0.5);
            border-radius: var(--r-xs);
            padding: 3px 9px;
        }

        .news-fresh {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-weight: 800;
            font-size: 11px;
            letter-spacing: 2px;
            text-transform: uppercase;
            background: var(--magenta);
            color: #fff;
            border: 2px solid var(--shadow-ink);
            box-shadow: var(--elev-1);
            padding: 4px 10px;
            border-radius: var(--r-xs);
        }

        .news-fresh .pulse { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; animation: news-pulse 1.4s ease-in-out infinite; }

        @keyframes news-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

        .news-tagrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

        /* featured */
        .news-featured {
            display: grid;
            grid-template-columns: 1.15fr 0.85fr;
            background: var(--card-bg);
            border: var(--card-border);
            border-radius: var(--card-radius);
            box-shadow: var(--card-shadow);
            overflow: hidden;
            margin-bottom: 24px;
            transition: transform var(--t-base) ease, box-shadow var(--t-smooth) ease;
        }

        .news-clickable { cursor: pointer; }

        .news-clickable:focus-visible {
            outline: 3px solid var(--accent);
            outline-offset: 6px;
        }

        .news-featured:hover {
            transform: translateY(-5px);
            box-shadow: var(--elev-5), 0 20px 34px 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-featured-skeleton {
            pointer-events: none;
        }

        .news-featured-skeleton:hover {
            transform: none;
            box-shadow: var(--card-shadow);
        }

        .news-featured-skeleton .skeleton-art {
            min-height: 340px;
        }

        .news-featured-img { position: relative; overflow: hidden; min-height: 340px; background: #1a0a3e; }

        .news-featured-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s ease; }

        .news-featured:hover .news-featured-img img { transform: scale(1.05); }

        .news-featured-body { padding: 34px 36px; display: flex; flex-direction: column; gap: 16px; justify-content: center; }

        .news-featured-title {
            font-family: var(--font-display);
            font-weight: 900;
            font-style: italic;
            font-size: 32px;
            line-height: 1.08;
            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),
                var(--elev-2);
        }

        .news-featured-desc { font-size: 15px; color: var(--fg-dim); line-height: 1.65; }

        /* grid */
        .news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

        .news-card {
            background: var(--card-bg);
            border: var(--card-border);
            border-radius: var(--card-radius);
            box-shadow: var(--card-shadow);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            transition: transform var(--t-base) ease, box-shadow var(--t-smooth) ease;
        }

        .news-card:hover {
            transform: translateY(-6px);
            box-shadow: var(--elev-5), 0 20px 34px 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: 20px 20px 24px; display: flex; flex-direction: column; gap: 11px; }

        .news-card h3 {
            font-family: var(--font-display);
            font-weight: 900;
            font-style: italic;
            font-size: 17px;
            line-height: 1.18;
            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),
                var(--elev-1);
        }

        .news-card p { font-size: 13px; color: var(--fg-dim); line-height: 1.55; }

        .news-skeleton-card .skeleton-art {
            aspect-ratio: 16 / 9;
        }

        .news-load-message {
            grid-column: 1 / -1;
            margin-top: 4px;
        }

        /* show more */
        .btn-show-more {
            display: block;
            margin: 40px auto 0;
            font-family: var(--font-display);
            font-weight: 800;
            font-style: italic;
            font-size: 14px;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            color: #fff;
            background: rgba(255, 255, 255, 0.06);
            border: 2px solid var(--shadow-ink);
            border-radius: var(--r-md);
            box-shadow: var(--elev-3);
            padding: 14px 32px;
            transition: transform var(--t-fast), background var(--t-snappy);
        }

        .btn-show-more:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.12); }

        .btn-show-more[hidden] { display: none; }

        @media (max-width: 900px) {
            .news-featured { grid-template-columns: 1fr; }
            .news-featured-img { min-height: 220px; aspect-ratio: 16/9; }
            .news-grid { grid-template-columns: repeat(2, 1fr); }
        }

        .news-img.news-cover {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            background:
                radial-gradient(ellipse 80% 80% at 50% 30%, rgba(0, 255, 234, 0.22), transparent 70%),
                linear-gradient(135deg, rgba(255, 43, 182, 0.45) 0%, rgba(40, 15, 90, 0.6) 55%, rgba(0, 200, 180, 0.35) 100%),
                var(--bg-2);
        }

        .news-cover::after {
            content: '';
            position: absolute;
            inset: 0;
            background: repeating-linear-gradient(180deg, rgba(0, 255, 234, 0.05) 0px, rgba(0, 255, 234, 0.05) 1px, transparent 2px, transparent 5px);
            pointer-events: none;
        }

        .news-cover-tag {
            font-family: var(--font-mono);
            font-weight: 700;
            font-size: 11px;
            letter-spacing: 2px;
            text-transform: uppercase;
            color: var(--accent);
            text-shadow: 0 0 10px var(--accent-soft);
            z-index: 1;
        }

        .news-cover-label {
            font-family: var(--font-display);
            font-weight: 900;
            font-style: italic;
            font-size: 30px;
            line-height: 0.95;
            text-transform: uppercase;
            text-align: center;
            color: #fff;
            z-index: 1;
            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),
                var(--elev-2);
        }

        @media (max-width: 600px) {
            .news-grid { grid-template-columns: 1fr; }
            .news-featured-title { font-size: 26px; }
        }

.news-page {
  min-height: 100vh;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, #12052c 0%, #080313 100%);
}

/* News page reuses the main site header (#site-header) as-is: transparent at the
   top, solid + compact once scrolled (the .scrolled toggle lives in layout.css,
   driven by a small scroll handler in news.php). Content is padded down below
   the fixed header via .news-page-shell. */

.news-page .main-nav a,
.news-page .news-modal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  color: #fff;
  background: rgba(255,255,255,0.07);
  border: 2px solid var(--shadow-ink);
  border-radius: var(--r-md);
  box-shadow: var(--elev-3);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: transform var(--t-fast) ease, border-color var(--t-snappy) ease, background var(--t-snappy) ease;
}

.news-page .main-nav a:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(0,255,234,0.12);
}

.news-page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(92px, 7vw, 116px) 0 80px;
}

.news-page-article {
  position: relative;
  background: linear-gradient(135deg, rgba(57,24,116,0.96) 0%, rgba(20,8,48,0.98) 100%);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.news-page-article::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 5px);
}

.news-page-img {
  position: relative;
  /* Explicit (definite) height so the img's height:100% resolves; matches the
     index modal cover (.news-modal-img). Viewport-bound so it stays a banner. */
  height: clamp(200px, 40vh, 430px);
  background: #1a0a3e;
  overflow: hidden;
  border-bottom: 3px solid var(--shadow-ink);
}

.news-page-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-page-body {
  position: relative;
  padding: clamp(28px, 5vw, 64px);
}

.news-page-body h1 {
  margin: 20px 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 5.2vw, 76px);
  font-weight: 900;
  font-style: italic;
  line-height: 0.98;
  text-transform: uppercase;
  color: #fff;
  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),
    var(--elev-4);
}

.news-page .news-date,
.news-page .news-cat {
  border-color: var(--shadow-ink);
  box-shadow: var(--elev-2);
}

.news-page-excerpt {
  max-width: 820px;
  margin-bottom: 28px;
  color: rgba(255,255,255,0.78);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.news-page-text {
  display: grid;
  gap: 16px;
  max-width: 860px;
  color: rgba(255,255,255,0.88);
  font-size: 17px;
  line-height: 1.75;
}

.news-page-text p,
.news-page-text ul {
  margin: 0;
}

.news-page-text ul {
  padding-left: 22px;
}

.news-page-text a {
  color: var(--accent);
  text-decoration: underline;
}

.news-page-text code {
  color: var(--accent);
  font-family: var(--font-mono);
}

.news-page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.news-page-tags span {
  display: inline-flex;
  padding: 6px 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-xs);
}

/* Share row */
.news-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.news-share-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.news-share-btn {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255,255,255,0.07);
  border: 2px solid var(--shadow-ink);
  border-radius: var(--r-md);
  box-shadow: var(--elev-3);
  cursor: pointer;
  transition: transform var(--t-fast) ease, background var(--t-snappy) ease, border-color var(--t-snappy) ease, color var(--t-snappy) ease;
}
.news-share-btn:hover {
  transform: translateY(-2px);
  color: var(--shadow-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.news-share-btn img { width: 20px; height: 20px; filter: brightness(0) invert(1); }
.news-share-btn:hover img { filter: brightness(0); }
.news-share-btn svg { width: 22px; height: 22px; }
.news-share-toast {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--accent);
  opacity: 0;
  transition: opacity var(--t-snappy) ease;
}
.news-share-toast.show { opacity: 1; }

.news-page .news-modal-link {
  margin-top: 30px;
  background: var(--cta-bg);
  color: var(--cta-fg);
  border: var(--cta-border);
  border-radius: var(--cta-radius);
}

/* Keep it a readable CTA on hover (don't inherit the ghost-button hover);
   the hard shadow stays the same size so the black strip doesn't grow. */
.news-page .news-modal-link:hover {
  transform: translateY(-2px);
  background: var(--cta-bg);
  border-color: var(--shadow-ink);
  filter: brightness(1.08);
  box-shadow: var(--elev-3), 0 12px 22px rgba(0,255,234,0.4);
}

.news-page .empty {
  grid-column: 1 / -1;
  padding: clamp(42px, 8vw, 86px);
  color: var(--fg-dim);
  font-size: 20px;
}

.privacy-copy .news-page-text h2 {
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 30px);
  font-style: italic;
  font-weight: 900;
  color: #fff;
}
.privacy-page .header-actions { margin-left: auto; }
.privacy-copy .news-page-text hr {
  width: 100%;
  margin: 24px 0 6px;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.18);
}

@media (max-width: 900px) {
  .news-page-img { height: clamp(170px, 30vh, 280px); }
}

@media (max-width: 680px) {
  .news-page .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .news-page .main-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .news-page .main-nav a,
  .news-page .news-modal-link {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 12px;
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--cta-radius); overflow: hidden;
  background: #1a0a3e;
  cursor: pointer;
  border: 3px solid var(--shadow-ink);
  box-shadow: var(--elev-3), 0 12px 24px rgba(0,0,0,0.4);
  transition: transform var(--t-base);
}
.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: var(--r-sm);
  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: var(--elev-1);
  transition: transform var(--t-smooth);
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height var(--t-smooth) 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; }
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 var(--t-fast) ease, box-shadow var(--t-base) ease;
}
.nf-back:hover { transform: translateY(-2px); box-shadow: var(--elev-5), 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),
    var(--elev-5),
    -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: var(--r-lg);
  box-shadow: var(--elev-5), 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: var(--hex-attack); }
.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: var(--hex-attack); }
.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: var(--hex-attack); 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 (redesign · досье-терминал) ===== */
/* =====================================================================
           HISTORY — Variant A · Досье-терминал
           (replaces the "History Section" block in css/sections.css)
           ===================================================================== */
        .history-container {
            position: relative;
            display: grid;
            grid-template-columns: 300px 1fr;
            background: var(--card-bg);
            border: var(--card-border);
            border-radius: var(--card-radius);
            box-shadow: var(--card-shadow);
            overflow: hidden;
            margin-top: 30px;
        }

        /* faint scanlines on the whole archive */
        .history-container::before {
            content: '';
            position: absolute;
            inset: 0;
            pointer-events: none;
            background: repeating-linear-gradient(180deg, rgba(0, 255, 234, 0.022) 0px, rgba(0, 255, 234, 0.022) 1px, transparent 2px, transparent 4px);
            mix-blend-mode: screen;
            z-index: 3;
        }

        /* ---- left index ---- */
        .history-tabs {
            position: relative;
            z-index: 1;
            background: rgba(0, 0, 0, 0.28);
            border-right: 3px solid var(--shadow-ink);
            display: flex;
            flex-direction: column;
            padding: 22px 0 16px;
        }

        .history-tabs-head {
            padding: 0 24px 18px;
            border-bottom: 2px solid rgba(255, 255, 255, 0.06);
            margin-bottom: 12px;
        }

        .history-case {
            font-family: var(--font-mono);
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 2px;
            color: var(--accent);
            text-shadow: 0 0 8px var(--accent-soft);
        }

        .history-case-sub {
            font-family: var(--font-mono);
            font-size: 10px;
            letter-spacing: 1.5px;
            color: rgba(255, 255, 255, 0.4);
            margin-top: 5px;
        }

        .history-tab {
            position: relative;
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 15px 24px;
            text-align: left;
            transition: background var(--t-base) ease;
        }

        .history-tab::after {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background: transparent;
            transition: background var(--t-base);
        }

        .history-tab:hover { background: rgba(255, 255, 255, 0.03); }

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

        .history-tab.active::after { background: var(--accent); box-shadow: 0 0 12px var(--accent); }

        .history-led {
            flex-shrink: 0;
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.18);
            border: 1px solid rgba(255, 255, 255, 0.25);
            transition: all var(--t-base);
        }

        .history-tab.active .history-led { background: var(--accent); border-color: #fff; box-shadow: 0 0 10px var(--accent); }

        .history-tab.read:not(.active) .history-led { background: rgba(0, 255, 234, 0.45); border-color: transparent; }

        .history-tab .tab-num {
            font-family: var(--font-mono);
            font-size: 13px;
            font-weight: 700;
            color: var(--fg-dim);
            transition: color var(--t-base);
        }

        .history-tab.active .tab-num { color: var(--accent); }

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

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

        /* ---- right document ---- */
        .history-content-panel {
            position: relative;
            z-index: 1;
            padding: 34px 40px 30px;
            background: rgba(12, 4, 32, 0.22);
            display: flex;
            flex-direction: column;
            min-height: 480px;
        }

        .history-hud { position: absolute; width: 18px; height: 18px; border-color: var(--accent-soft); pointer-events: none; opacity: 0.7; z-index: 2; }
        .history-hud.tl { top: 16px; left: 16px; border-left: 2px solid; border-top: 2px solid; }
        .history-hud.tr { top: 16px; right: 16px; border-right: 2px solid; border-top: 2px solid; }
        .history-hud.bl { bottom: 16px; left: 16px; border-left: 2px solid; border-bottom: 2px solid; }
        .history-hud.br { bottom: 16px; right: 16px; border-right: 2px solid; border-bottom: 2px solid; }

        .history-chapter-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 2px solid rgba(255, 255, 255, 0.06);
            padding-bottom: 14px;
            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); display: inline-flex; align-items: center; gap: 8px; }

        .meta-status .blink { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-hot); box-shadow: 0 0 8px var(--accent-hot); animation: hist-blink 1.4s steps(1) infinite; }

        @keyframes hist-blink { 50% { opacity: 0.25; } }

        .meta-date { color: rgba(255, 255, 255, 0.45); white-space: nowrap; }

        .history-stamp {
            position: absolute;
            top: 92px;
            right: 30px;
            font-family: var(--font-display);
            font-weight: 900;
            font-style: italic;
            font-size: 15px;
            letter-spacing: 2px;
            text-transform: uppercase;
            color: rgba(255, 78, 201, 0.5);
            border: 2.5px solid rgba(255, 78, 201, 0.4);
            border-radius: var(--r-sm);
            padding: 5px 12px;
            transform: rotate(8deg);
            pointer-events: none;
            z-index: 2;
        }

        .history-chapter-title {
            font-family: var(--font-display);
            font-weight: 900;
            font-style: italic;
            font-size: 28px;
            text-transform: uppercase;
            color: #fff;
            margin: 22px 0 6px;
            padding-right: 210px;
            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),
                var(--elev-2);
            transition: opacity var(--t-fast) ease, transform var(--t-fast) ease;
        }

        .history-text {
            flex: 1;
            margin-top: 14px;
            font-size: 14.5px;
            color: var(--fg-dim);
            line-height: 1.8;
            white-space: pre-wrap;
            max-width: 68ch;
            transition: opacity var(--t-fast) ease, transform var(--t-fast) ease;
        }

        .history-chapter-title.fade,
        .history-text.fade { opacity: 0; transform: translateY(6px); }

        /* ---- footer: progress + nav ---- */
        .history-foot {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin-top: 26px;
            padding-top: 18px;
            border-top: 2px solid rgba(255, 255, 255, 0.06);
            flex-wrap: wrap;
        }

        .history-progress { display: flex; align-items: center; gap: 8px; }

        .history-prog-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); transition: all var(--t-base); }

        .history-prog-dot.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

        .history-prog-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; color: var(--fg-dim); margin-left: 6px; white-space: nowrap; }

        .history-nav { display: flex; gap: 10px; }

        .history-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-family: var(--font-display);
            font-weight: 800;
            font-style: italic;
            font-size: 12px;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: #fff;
            background: rgba(255, 255, 255, 0.06);
            border: 2px solid var(--shadow-ink);
            border-radius: var(--r-md);
            box-shadow: var(--elev-3);
            padding: 10px 18px;
            transition: transform 0.12s, background var(--t-snappy), opacity var(--t-snappy);
        }

        .history-btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.12); }

        .history-btn.primary { color: var(--cta-fg); background: linear-gradient(180deg, #2dffe6, #00c8b3); }

        .history-btn:disabled { opacity: 0.32; pointer-events: none; }

        @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: 12px 8px;
                gap: 6px;
                scroll-snap-type: x mandatory;
            }
            .history-tabs-head { display: none; }
            .history-tab {
                flex-shrink: 0;
                flex-direction: column;
                gap: 6px;
                padding: 12px 16px;
                border-radius: var(--r-md);
                scroll-snap-align: start;
                text-align: center;
            }
            .history-tab::after { left: 0; right: 0; bottom: 0; top: auto; height: 3px; width: auto; }
            .history-content-panel { padding: 28px 22px; min-height: 0; }
            .history-chapter-title { font-size: 22px; max-width: 100%; padding-right: 0; }
            .history-stamp { display: none; }
            .history-foot { justify-content: space-between; }
        }


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