/* Base — nền, chữ, lớp, cuộn. Cuộn native, không scroll-jacking. */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* v2.1: BỎ scroll-snap — trang giờ là các khối cao thấp khác nhau, snap
     proximity tạo cú khựng giả ở giữa trang (feedback 26/08). Cuộn thuần. */
  scroll-behavior: smooth;
}

body {
  background: var(--paper-0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(15px, 1.05vw + 10px, 17px);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.9s ease;
}
/* tầng giấy theo panel đang đứng (JS đặt data-panel; không JS = paper-0) */
body[data-panel="chaos"]      { background: var(--paper-1); }
body[data-panel="patterns"]   { background: var(--paper-2); }
body[data-panel="narratives"] { background: var(--paper-3); }
body[data-panel="coda"]       { background: var(--paper-4); }

/* Lớp: canvas 0 · nội dung 1 · grain 2. Canvas không bao giờ chứa chữ. */
#sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
main, .site-footer { position: relative; z-index: 1; }

.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Panel khung --- */
.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(56px, 10vh, 120px) var(--gutter);
}
.panel-inner {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
}

/* --- Chữ --- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.82em;
  letter-spacing: 0.04em;
}
h1, h2 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  text-wrap: balance;
}
.poster-title {
  font-size: clamp(40px, 7vw, 88px);
  line-height: 0.94;
  letter-spacing: -0.01em;
  margin-bottom: 1.6rem;
}
.panel-title {
  font-size: clamp(30px, 4.4vw, 56px);
  line-height: 1.02;
  margin-bottom: 1.8rem;
  max-width: 15em;
}
.body-block {
  max-width: var(--measure);
  margin-bottom: 1.4rem;
  color: var(--ink);
}
.close-line {
  max-width: var(--measure);
  margin-top: 2.2rem;
  font-family: var(--font-display);
  font-size: 1.16em;
  font-style: italic;
  color: var(--ink);
}

/* --- Nút & focus. Đây là control thật: focus ring thật. --- */
/* Nút = PHÍM CÁCH của máy đánh chữ (v2.7): thanh dài bo tròn hai đầu, viền
   nét vẽ, THÀNH PHÍM 3D bên dưới — rê chuột phím hạ nhẹ, bấm thì LÚN hẳn. */
.btn {
  display: inline-block;
  position: relative;
  background: var(--hematite); /* dấu được vẽ có chủ ý */
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  padding: 0.85em 2.6em;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 5px 0 #7c2a1e,
    0 6.5px 0 var(--ink),
    inset 0 2px 0 rgba(244, 241, 235, 0.28);
  transition: transform 90ms ease, box-shadow 90ms ease, background 150ms ease;
}
.btn:hover {
  background: #9d3225;
  transform: translateY(2px);
  box-shadow:
    0 3px 0 #7c2a1e,
    0 4.5px 0 var(--ink),
    inset 0 2px 0 rgba(244, 241, 235, 0.28);
}
.btn:active {
  transform: translateY(5px);
  box-shadow:
    0 0.5px 0 #7c2a1e,
    0 1.5px 0 var(--ink),
    inset 0 2px 0 rgba(244, 241, 235, 0.2);
}
:is(a, button):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* --- Footer marquee --- */
.site-footer {
  border-top: 1px solid var(--rule);
  overflow: hidden;
  background: transparent;
}
.marquee { overflow: hidden; white-space: nowrap; padding: 14px 0; }
.marquee-track {
  display: inline-block;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--ink-soft);
  animation: marquee 36s linear infinite;
}
@keyframes marquee {
  to { transform: translateX(-33.333%); }
}
