@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:200;font-display:swap;src:url(../fonts/be-vietnam-pro-latin-200-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Be Vietnam Pro';font-style:italic;font-weight:300;font-display:swap;src:url(../fonts/be-vietnam-pro-latin-300-italic.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:300;font-display:swap;src:url(../fonts/be-vietnam-pro-latin-300-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/be-vietnam-pro-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/be-vietnam-pro-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:200;font-display:swap;src:url(../fonts/be-vietnam-pro-latin-ext-200-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Be Vietnam Pro';font-style:italic;font-weight:300;font-display:swap;src:url(../fonts/be-vietnam-pro-latin-ext-300-italic.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:300;font-display:swap;src:url(../fonts/be-vietnam-pro-latin-ext-300-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/be-vietnam-pro-latin-ext-400-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/be-vietnam-pro-latin-ext-500-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:200;font-display:swap;src:url(../fonts/be-vietnam-pro-vietnamese-200-normal.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:'Be Vietnam Pro';font-style:italic;font-weight:300;font-display:swap;src:url(../fonts/be-vietnam-pro-vietnamese-300-italic.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:300;font-display:swap;src:url(../fonts/be-vietnam-pro-vietnamese-300-normal.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/be-vietnam-pro-vietnamese-400-normal.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/be-vietnam-pro-vietnamese-500-normal.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:400;font-display:swap;src:url(../fonts/cormorant-garamond-cyrillic-400-italic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/cormorant-garamond-cyrillic-400-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:500;font-display:swap;src:url(../fonts/cormorant-garamond-cyrillic-500-italic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:300;font-display:swap;src:url(../fonts/cormorant-garamond-latin-300-italic.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:400;font-display:swap;src:url(../fonts/cormorant-garamond-latin-400-italic.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/cormorant-garamond-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:500;font-display:swap;src:url(../fonts/cormorant-garamond-latin-500-italic.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/cormorant-garamond-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/cormorant-garamond-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:300;font-display:swap;src:url(../fonts/cormorant-garamond-latin-ext-300-italic.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:400;font-display:swap;src:url(../fonts/cormorant-garamond-latin-ext-400-italic.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/cormorant-garamond-latin-ext-400-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:500;font-display:swap;src:url(../fonts/cormorant-garamond-latin-ext-500-italic.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/cormorant-garamond-latin-ext-500-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/cormorant-garamond-latin-ext-600-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:300;font-display:swap;src:url(../fonts/cormorant-garamond-vietnamese-300-italic.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:400;font-display:swap;src:url(../fonts/cormorant-garamond-vietnamese-400-italic.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/cormorant-garamond-vietnamese-400-normal.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:500;font-display:swap;src:url(../fonts/cormorant-garamond-vietnamese-500-italic.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/cormorant-garamond-vietnamese-500-normal.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/cormorant-garamond-vietnamese-600-normal.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}

:root {
  --ink: #02040d;
  --ink-2: #060b1f;
  --text: #e9efff;
  --prose: #c6d3f2;
  --dim: #8fa3cf;
  --accent: #8cb8ff;
  --accent-2: #5d93ff;
  --glow: rgba(93, 147, 255, .55);
  --warm: #ffd49a;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --side: max(6.5vw, 28px);
  --col: min(34vw, 500px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--ink); color: var(--text); -webkit-text-size-adjust: 100%; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  background: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-gated { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Song ngữ: chỉ hiện đúng ngôn ngữ đang chọn. */
html[data-lang="vi"] .en, html[data-lang="en"] .vi { display: none !important; }

/* ---------- Lớp nền ---------- */
#gl { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; display: block; }
#fallback { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
#fallback img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: saturate(.9) brightness(.62); }
.grain {
  position: fixed; inset: -2px; z-index: 6; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(1, 2, 10, .55) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .7  0 0 0 0 .8  0 0 0 0 1  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .5;
  mix-blend-mode: soft-light;
}

/* ---------- HUD ---------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) var(--side) 0;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 18px var(--glow); }
.brand span { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 21px; letter-spacing: .01em; }
.hud-r { display: flex; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1px solid rgba(150, 185, 255, .18);
  background: rgba(6, 12, 32, .45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 11.5px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--dim);
  transition: color .3s, border-color .3s, background .3s;
}
.pill:hover { color: var(--text); border-color: rgba(150, 185, 255, .4); }
.lang i { width: 1px; height: 12px; background: rgba(150, 185, 255, .3); }
html[data-lang="vi"] .lang [data-l="vi"], html[data-lang="en"] .lang [data-l="en"] { color: var(--text); }
body.is-gated .sound { opacity: 0; pointer-events: none; }
.sound { transition: opacity .6s; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 2px; height: 3px; background: var(--accent); border-radius: 1px; transition: height .3s; }
.sound[aria-pressed="true"] .eq i { animation: eq 1.1s ease-in-out infinite alternate; }
.sound[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: -.4s; }
.sound[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: -.8s; }
.sound[aria-pressed="true"] .eq i:nth-child(4) { animation-delay: -.2s; }
@keyframes eq { 0% { height: 3px; } 100% { height: 12px; } }

/* ---------- Mục lục chương ---------- */
.chapters { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 20; transition: opacity .8s; }
body.is-gated .chapters, body.is-gated .progress { opacity: 0; pointer-events: none; }
.chapters ol { list-style: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.chapters button {
  position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  height: 22px; padding-right: 2px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
}
.chapters button > span { opacity: 0; transform: translateX(6px); transition: opacity .35s, transform .35s var(--ease); white-space: nowrap; text-shadow: 0 1px 12px var(--ink); }
.chapters button::after {
  content: ''; width: 6px; height: 6px; border-radius: 3px; background: rgba(150, 185, 255, .35);
  transition: height .45s var(--ease), background .3s, box-shadow .3s;
}
.chapters li.on button::after { height: 20px; background: var(--accent); box-shadow: 0 0 12px var(--glow); }
.chapters ol:hover button > span, .chapters button:focus-visible > span, .chapters li.on button > span { opacity: 1; transform: none; }
.chapters ol:not(:hover) li.on button > span { opacity: 0; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 41; pointer-events: none; transition: opacity .8s; }
.progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: 0 0 10px var(--glow); }

/* ---------- Cổng mở đầu ---------- */
#gate {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 46%, rgba(4, 10, 30, .35), rgba(1, 3, 10, .92) 70%);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.gate-inner { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 560px; }
.gate-orb { width: 74px; height: 74px; border-radius: 50%; margin-bottom: 26px; box-shadow: 0 0 60px rgba(93, 147, 255, .5), 0 0 0 1px rgba(150, 185, 255, .25); animation: breathe 5s ease-in-out infinite; }
.gate-orb img { border-radius: 50%; }
@keyframes breathe { 50% { box-shadow: 0 0 90px rgba(93, 147, 255, .7), 0 0 0 1px rgba(150, 185, 255, .4); transform: scale(1.03); } }
.gate-title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(34px, 5.4vw, 64px); line-height: 1.08; margin: 14px 0 12px; text-shadow: 0 0 40px rgba(93, 147, 255, .45); }
.gate-line { color: var(--dim); font-size: 15px; margin-bottom: 38px; }
.enter { position: relative; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 6px; transition: transform .6s var(--ease); }
.enter:not(:disabled):hover { transform: scale(1.05); }
.enter:disabled { cursor: progress; }
.enter .ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.enter .ring circle { fill: rgba(8, 16, 42, .55); stroke: rgba(150, 185, 255, .16); stroke-width: 1.2; }
.enter .ring .fill { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 352; stroke-dashoffset: 352; filter: drop-shadow(0 0 6px var(--glow)); transition: stroke-dashoffset .4s; }
.enter .ico { position: relative; width: 26px; height: 26px; fill: none; stroke: var(--text); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.enter .lbl { position: relative; font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase; padding-left: .3em; }
.enter:not(:disabled) .ring circle:first-child { animation: pulse 2.6s ease-out infinite; }
@keyframes pulse { 0% { stroke: rgba(150, 185, 255, .5); } 100% { stroke: rgba(150, 185, 255, .14); } }
.gate-status { margin-top: 20px; font-size: 12px; letter-spacing: .12em; color: var(--dim); min-height: 1.4em; transition: opacity .6s; }
.gate-status.done { opacity: 0; }
.silent { margin-top: 14px; font-size: 12px; letter-spacing: .12em; color: rgba(143, 163, 207, .7); border-bottom: 1px solid rgba(143, 163, 207, .25); padding-bottom: 2px; }
.silent:hover { color: var(--text); }

/* ---------- Sân khấu chữ ---------- */
.stage { position: fixed; inset: 0; z-index: 5; pointer-events: none; transition: opacity 1.4s; }
body.is-gated .stage { opacity: 0; }
.scene { position: absolute; inset: 0; visibility: hidden; }
.scene.on { visibility: visible; }
.beat { position: absolute; visibility: hidden; --bo: 0; }
.beat.live { visibility: visible; }
.beat.live.act { pointer-events: auto; }
.beat > * { opacity: var(--o, 0); transform: translate3d(0, var(--y, 24px), 0); filter: blur(var(--b, 0px)); will-change: opacity, transform; }
.beat::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none; opacity: var(--bo);
  inset: -28% -30%; background: radial-gradient(closest-side, rgba(2, 5, 17, .7), rgba(2, 5, 17, .35) 55%, transparent);
}
.beat.left { left: var(--side); top: 50%; width: var(--col); translate: 0 -50%; }
.beat.right { right: calc(var(--side) + 30px); top: 50%; width: var(--col); translate: 0 -50%; }
.beat.center { left: 50%; top: 50%; width: min(86vw, 1040px); translate: -50% -50%; text-align: center; }
.beat.bottom { left: 50%; bottom: max(7vh, 36px); translate: -50% 0; text-align: center; width: min(86vw, 640px); }
.beat.center::before { inset: -10% -6%; }

.kicker { font-size: 11.5px; font-weight: 400; letter-spacing: .34em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; display: flex; align-items: center; gap: 14px; }
.kicker::before { content: ''; width: 34px; height: 1px; background: currentColor; opacity: .6; }
.center .kicker { justify-content: center; }
.center .kicker::after { content: ''; width: 34px; height: 1px; background: currentColor; opacity: .6; }
.title {
  font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -.012em;
  font-size: clamp(58px, 10vw, 168px); line-height: .95; color: #f1f5ff;
  text-shadow: 0 0 42px rgba(93, 147, 255, .55), 0 0 2px rgba(255, 255, 255, .3);
  padding: .06em 0 .1em;
}
.subtitle { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(20px, 2.1vw, 31px); color: var(--prose); margin-top: 10px; }
.ch-title { font-family: var(--serif); font-weight: 500; font-style: italic; font-size: clamp(46px, 6vw, 98px); line-height: 1; color: #f1f5ff; text-shadow: 0 0 36px rgba(93, 147, 255, .45); padding-bottom: .08em; }
.split .char, .split .word { display: inline-block; }
.beat p { font-size: clamp(15.5px, 1.13vw, 18.5px); line-height: 1.85; color: var(--prose); text-shadow: 0 1px 18px rgba(2, 4, 13, .9); }
.beat p + p { margin-top: 14px; }
.beat p.big { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(27px, 2.75vw, 44px); line-height: 1.22; color: var(--text); text-shadow: 0 0 30px rgba(2, 4, 13, .95); }
.beat.center p.big { font-size: clamp(28px, 3.2vw, 52px); }
.dropcap::first-letter { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 3.6em; float: left; line-height: .82; margin: .08em .12em 0 0; color: var(--accent); }
.hint { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hint > span { display: block; }
.mouse { width: 22px; height: 34px; border-radius: 12px; border: 1px solid rgba(150, 185, 255, .45); position: relative; }
.mouse::after { content: ''; position: absolute; left: 50%; top: 7px; width: 2px; height: 7px; margin-left: -1px; border-radius: 1px; background: var(--accent); animation: wheel 2.2s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(-3px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(9px); } }

.litany p.big { font-size: clamp(30px, 3.1vw, 50px); }
.timeline p { display: grid; grid-template-columns: 64px 1fr; gap: 6px 14px; align-items: baseline; }
.timeline p + p { margin-top: 12px; }
.timeline time { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 22px; color: var(--accent); letter-spacing: .02em; }
.statement p { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(26px, 3vw, 48px); line-height: 1.25; color: var(--dim); }
.statement p.em { color: #f3f6ff; font-weight: 500; font-size: clamp(30px, 3.6vw, 58px); text-shadow: 0 0 34px rgba(93, 147, 255, .5); }
.statement p:nth-child(3) { margin-top: .6em; }
.caption p { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2vw, 30px); color: var(--text); }

.feature .num { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 58px; line-height: 1; color: var(--accent); opacity: .7; margin-bottom: 6px; }
.feature h3 { font-family: var(--serif); font-weight: 500; font-style: italic; font-size: clamp(32px, 3.1vw, 50px); line-height: 1.08; margin-bottom: 14px; color: #f1f5ff; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chips li { font-size: 12px; letter-spacing: .04em; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(150, 185, 255, .2); background: rgba(10, 20, 50, .4); color: var(--prose); }

/* Thẻ tải app */
.dl-card {
  position: relative; width: min(440px, 100%); padding: 26px 24px 22px; border-radius: 24px;
  background: linear-gradient(160deg, rgba(14, 26, 64, .72), rgba(5, 10, 28, .78));
  border: 1px solid rgba(150, 185, 255, .2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 60px rgba(60, 110, 255, .16), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.dl-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.dl-head > img:first-child { width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 0 22px var(--glow); }
.dl-head b { display: block; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 27px; line-height: 1.1; }
.dl-head span { font-size: 12.5px; color: var(--dim); letter-spacing: .04em; }
.btn {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 18px; border-radius: 14px; text-decoration: none;
  border: 1px solid rgba(150, 185, 255, .2); background: rgba(14, 26, 62, .55); margin-top: 10px;
  transition: transform .35s var(--ease), box-shadow .35s, border-color .35s, background .35s;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(150, 185, 255, .45); box-shadow: 0 10px 30px rgba(40, 90, 255, .25); }
.btn svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn > span { display: flex; flex-direction: column; line-height: 1.25; }
.btn b { font-weight: 500; font-size: 15.5px; }
.btn small { font-size: 12px; color: var(--dim); }
.btn.primary { background: linear-gradient(135deg, #3f78ff, #6ea6ff); border-color: rgba(190, 215, 255, .5); color: #fff; box-shadow: 0 10px 34px rgba(60, 120, 255, .4); }
.btn.primary small { color: rgba(235, 242, 255, .85); }
.btn.primary:hover { box-shadow: 0 14px 44px rgba(60, 120, 255, .6); }
.cmd { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 10px 10px 14px; border-radius: 12px; background: rgba(1, 4, 14, .7); border: 1px solid rgba(150, 185, 255, .12); }
.cmd code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: #b9cdf7; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.cmd code::-webkit-scrollbar { display: none; }
.copy { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; color: var(--dim); transition: color .3s, background .3s; }
.copy:hover { color: var(--text); background: rgba(150, 185, 255, .1); }
.copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.copy.ok { color: #8ff0c0; }
.dl-card .note { font-size: 12.5px; line-height: 1.6; color: var(--dim); margin-top: 14px; text-shadow: none; }
.more { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(140, 184, 255, .3); }
.more:hover { color: var(--text); }
.card-beat::before { display: none; }

.btn.bread { width: auto; display: inline-flex; margin-top: 26px; padding: 14px 22px 14px 18px; color: #2a1606; background: linear-gradient(135deg, #ffe0ad, #ffb877); border-color: rgba(255, 228, 190, .7); box-shadow: 0 12px 40px rgba(255, 170, 90, .35); }
.btn.bread small { color: rgba(60, 32, 10, .7); }
.btn.bread:hover { box-shadow: 0 16px 50px rgba(255, 170, 90, .55); }

.coda .night { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(58px, 10vw, 164px); line-height: 1; color: #f3f6ff; text-shadow: 0 0 50px rgba(93, 147, 255, .6); }
.coda .sub { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2vw, 30px); color: var(--prose); margin-top: 18px; }
.credits { display: flex; flex-direction: column; align-items: center; }
.beat.bottom.credits { width: min(86vw, 760px); bottom: max(5vh, 24px); }
.credits > * + * { margin-top: 8px; }
.beat.credits p { font-size: 13.5px; color: var(--dim); line-height: 1.6; }
.beat.credits p.music { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--prose); }
.beat.credits p.legal { font-size: 11.5px; max-width: 560px; color: rgba(143, 163, 207, .7); }
.links { display: flex; gap: 22px; justify-content: center; margin-top: 12px !important; }
.links a, .links button { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.links a:hover, .links button:hover { color: var(--text); }

/* Chiều dài cuộn */
.track { position: relative; z-index: 0; pointer-events: none; }
.track > section { height: 260vh; }
.tail { height: 100vh; }

/* ---------- Màn hình dọc / điện thoại ---------- */
@media (max-aspect-ratio: 10/11), (max-width: 720px) {
  :root { --side: 20px; }
  .stage::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(to bottom, transparent, rgba(2, 4, 13, .82) 55%); z-index: -1; }
  .beat.left, .beat.right { left: var(--side); right: var(--side); width: auto; top: auto; bottom: max(6vh, 28px); translate: 0 0; }
  .beat.center { width: calc(100vw - 40px); }
  .beat::before { inset: -14% -10%; }
  .chapters { display: none; }
  .brand span { font-size: 18px; }
  .pill { height: 32px; padding: 0 11px; letter-spacing: .12em; }
  .timeline p { grid-template-columns: 50px 1fr; }
  .timeline p { font-size: 14px; line-height: 1.6; }
  .timeline p + p { margin-top: 6px; }
  .timeline time { font-size: 18px; }
    .gate-inner .kicker { flex-wrap: wrap; justify-content: center; letter-spacing: .26em; }
  .gate-inner .kicker::before { display: none; }
    .dl-card { padding: 20px 18px 18px; }
  .feature .num { font-size: 40px; }
  .beat p.big { font-size: clamp(24px, 6.6vw, 34px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* Bản đọc tĩnh khi JS không khởi động được (xem watchdog trong index.html) */
body.static #gate, body.static .chapters, body.static .hud .sound, body.static .hud .lang, body.static #gl { display: none !important; }
body.static .stage { opacity: 1; }
body.static .stage { position: static; pointer-events: auto; }
body.static .scene, body.static .beat, body.static .beat > * { position: relative !important; opacity: 1 !important; transform: none !important; filter: none !important; visibility: visible !important; inset: auto !important; translate: none !important; }
body.static .scene { padding: 10vh var(--side); }
body.static .track { display: none; }
html:has(body.static) { overflow: auto !important; }
