:root {
  --ink: #0d0c12;
  --ink-2: #16141f;
  --line: rgba(255, 255, 255, .12);
  --paper: #f5efe4;
  --paper-2: #fffaf1;
  --text: #ece8f1;
  --muted: #a9a3b8;
  --dark-text: #221d2b;
  --dark-muted: #62596c;
  --red: #ff5a5f;
  --amber: #ffc56b;
  --green: #4fe3a1;
  --serif: "Playfair Display", "Times New Roman", serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font: 400 16px/1.7 var(--sans); overflow-x: hidden; }
img, video, iframe { display: block; max-width: 100%; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }

.skip { position: fixed; left: 8px; top: -60px; z-index: 100; background: var(--amber); color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }
.data-error, .noscript { background: var(--red); color: #17040a; padding: 90px 24px 24px; font-weight: 600; }

/* ───── Navbar ───── */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(16px, 4vw, 40px); transition: background .3s; }
.nav.scrolled, .nav.open { background: rgba(13, 12, 18, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--red), var(--amber), var(--green)); }
.brand { font: italic 700 1.35rem var(--serif); text-decoration: none; color: #fff; }
.brand span { color: var(--amber); }
.nav nav { display: flex; gap: 4px; }
.nav nav a { text-decoration: none; font-size: .9rem; padding: 6px 13px; border-radius: 99px; color: #d6d1e0; transition: background .2s, color .2s; }
.nav nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav nav a.active { background: var(--amber); color: var(--ink); }
.menu-btn { display: none; font: 500 .9rem var(--sans); color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); border-radius: 99px; padding: 7px 16px; cursor: pointer; }

/* ───── Nút ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 24px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 99px; background: transparent; color: #fff; font: 600 .92rem var(--sans); text-decoration: none; cursor: pointer; transition: transform .2s, background .2s, border-color .2s; }
.btn:hover { transform: translateY(-2px); border-color: #fff; }
.btn-solid { background: var(--amber); border-color: var(--amber); color: var(--ink); }

/* ───── Hero ───── */
.hero { --glow: var(--red); --mx: 70%; --my: 35%; position: relative; min-height: 100vh; min-height: 100svh; display: grid; align-items: center; padding: 110px 0 80px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(60% 55% at 78% 50%, color-mix(in srgb, var(--glow) 26%, transparent), transparent 70%),
    radial-gradient(50% 50% at 5% 100%, rgba(98, 71, 170, .28), transparent 70%),
    var(--ink); }
.hero.solved { --glow: var(--green); }
.hero-code { position: absolute; inset: 0; z-index: -1; overflow: hidden; font: 400 15px/2.6 var(--mono); color: rgba(255, 226, 180, .55); padding: 20px; pointer-events: none;
  -webkit-mask-image: radial-gradient(240px circle at var(--mx) var(--my), #000, transparent 75%);
  mask-image: radial-gradient(240px circle at var(--mx) var(--my), #000, transparent 75%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 48px; align-items: center; }
.kicker, .eyebrow { font: 600 .76rem var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.kicker { color: var(--amber); margin-bottom: 18px; }
h1 { font-family: var(--serif); line-height: 1; color: #fff; }
h1 span { display: block; }
.h1-main { font-size: clamp(3.4rem, 10.4vw, 8rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; padding-bottom: .1em; margin-bottom: -.1em;
  background: linear-gradient(100deg, #fff 35%, rgba(255, 255, 255, .22) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise .9s both; }
.h1-sub { font-size: clamp(1.7rem, 4.2vw, 3.1rem); font-weight: 600; margin-top: 6px; animation: rise .9s .15s both; }
.h1-how { font-size: clamp(3rem, 8vw, 6rem); font-style: italic; font-weight: 700; color: var(--amber); line-height: 1.15; animation: rise .9s .3s both; }
.tagline { max-width: 34em; margin-top: 18px; color: var(--muted); font-size: 1.08rem; animation: rise .9s .45s both; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; animation: rise .9s .6s both; }

.terminal { background: rgba(10, 9, 14, .82); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 30px 90px color-mix(in srgb, var(--glow) 28%, transparent); overflow: hidden; transition: box-shadow .6s; animation: rise 1s .5s both; }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 400 .72rem var(--mono); color: var(--muted); }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: #403c4e; flex: none; }
.terminal-bar span { margin-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.terminal-body { padding: 22px; }
.fixes { min-height: 132px; font: 400 .8rem/1.6 var(--mono); }
.fixes li { margin-bottom: 7px; }
.fixes .past { color: #6f697f; text-decoration: line-through; }
.fixes .current { color: #e6e1ef; }
.verdict { font: 600 .92rem var(--mono); color: var(--glow); min-height: 3.4em; padding: 12px 0 8px; border-top: 1px dashed var(--line); }
.btn-run { width: 100%; font-family: var(--mono); font-size: .82rem; border-radius: 10px; }
.scroll-hint { position: absolute; bottom: 22px; left: 50%; translate: -50% 0; font: 400 .72rem var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); text-decoration: none; animation: bob 2.4s ease-in-out infinite; }

@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ───── Khung chung ───── */
.section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.head { margin-bottom: 48px; }
.eyebrow { color: var(--amber); margin-bottom: 14px; }
h2 { font: 800 clamp(2.2rem, 5.6vw, 4rem)/1.18 var(--serif); }
h2 em { font-weight: 500; color: var(--amber); }
.lead { margin-top: 12px; color: var(--muted); max-width: 40em; }
.red { color: var(--red); }
.green { color: var(--green); }
.sub { font: 700 1.7rem var(--serif); margin: 64px 0 22px; display: flex; align-items: center; gap: 16px; }
.sub::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .18; }

/* ───── Giới thiệu (nền giấy) ───── */
.about, .team { background: radial-gradient(70% 40% at 100% 0, rgba(255, 197, 107, .3), transparent 70%), var(--paper); color: var(--dark-text); }
.about .eyebrow, .team .eyebrow { color: #9a4b12; }
.about h2 em, .team h2 em { color: #b4561a; }
.about .lead, .team .lead { color: var(--dark-muted); }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.about-text { font-size: 1.1rem; }
.about-text p + p { margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.chips li { border: 1px solid rgba(34, 29, 43, .25); border-radius: 99px; padding: 5px 16px; font-size: .86rem; font-weight: 500; }
.message { background: var(--ink); color: #fff; border-radius: var(--radius); padding: clamp(24px, 3.4vw, 42px); transform: rotate(.8deg); box-shadow: 0 24px 50px rgba(34, 29, 43, .22); }
.message-label { font: 600 .72rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.message p { margin-top: 14px; font: italic 500 clamp(1.1rem, 1.7vw, 1.35rem)/1.7 var(--serif); }

.goals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.goal, .aud { background: var(--paper-2); border: 1px solid rgba(34, 29, 43, .1); border-radius: var(--radius); padding: 24px; }
.goal .num { font: 600 .8rem var(--mono); color: #b4561a; }
.goal h4, .aud h4 { font-size: 1.04rem; line-height: 1.45; margin: 8px 0; }
.goal p, .aud p { color: var(--dark-muted); font-size: .93rem; }
.audience { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; }
.aud:first-child { background: #ffe3ac; }
.aud:first-child p { color: #4d3b26; }

/* ───── Câu chuyện ───── */
.story { background: linear-gradient(180deg, var(--ink), #1c1420 55%, #14201d); }
.scenes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.scene { --tone: var(--amber); background: rgba(255, 255, 255, .045); border: 1px solid var(--line); border-top: 4px solid var(--tone); border-radius: var(--radius); padding: 22px; }
.scene.tle { --tone: var(--red); }
.scene.ac { --tone: var(--green); }
.scene-top { display: flex; justify-content: space-between; align-items: center; }
.scene-label { font: 700 1.5rem var(--serif); }
.tag { font: 600 .74rem var(--mono); color: var(--tone); border: 1px solid var(--tone); border-radius: 6px; padding: 1px 9px; }
.scene-meta { font: 400 .74rem var(--mono); color: var(--muted); margin: 8px 0 18px; }
.scene h3 { font-size: 1.05rem; line-height: 1.45; margin-bottom: 10px; }
.scene > p:last-child { color: #c9c4d5; font-size: .92rem; }

/* ───── How? ───── */
.how { background: radial-gradient(80% 60% at 50% 0, #ffe2a8, transparent 75%), linear-gradient(180deg, #ffc56b, #ffab6e); color: #2b1608; }
.how .head { text-align: center; }
.how .eyebrow { color: #7a3a0c; }
.how-title { font-size: clamp(5rem, 18vw, 12rem); font-style: italic; line-height: 1.1; }
.answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: answer; }
.answers li { counter-increment: answer; border-top: 2px solid #2b1608; padding-top: 18px; }
.answers li::before { content: "0" counter(answer); font: 600 .85rem var(--mono); }
.answers h3 { font: 700 1.5rem/1.35 var(--serif); margin: 8px 0 10px; }
.quote { margin-top: 80px; text-align: center; }
.quote blockquote { font: italic 600 clamp(1.5rem, 3.4vw, 2.4rem)/1.5 var(--serif); max-width: 24em; margin-inline: auto; }
.quote figcaption { margin-top: 16px; font: 400 .78rem var(--mono); }

/* ───── Thành viên ───── */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 22px; }
.member { --accent: var(--amber); display: grid; grid-template-columns: 136px minmax(0, 1fr); grid-template-areas: "chibi id" "more more"; column-gap: 18px; row-gap: 18px; align-content: start; background: var(--paper-2); border: 1px solid rgba(34, 29, 43, .1); border-bottom: 6px solid var(--accent); border-radius: 24px; padding: 18px; transition: translate .3s, box-shadow .3s, opacity .7s, transform .7s; }
.member:hover { translate: 0 -8px; box-shadow: 0 24px 44px color-mix(in srgb, var(--accent) 38%, transparent); }
.chibi { grid-area: chibi; aspect-ratio: 3 / 4; border-radius: 16px; background: radial-gradient(circle at 50% 38%, #fff 30%, color-mix(in srgb, var(--accent) 32%, #fff)); padding: 6px; overflow: hidden; }
.chibi img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.member:hover .chibi img { transform: scale(1.08) rotate(-4deg); }
.member-id { grid-area: id; align-self: center; }
.member-id h3 { font: 800 1.3rem/1.4 var(--serif); text-wrap: balance; }
.role { display: inline-block; margin-top: 10px; padding: 3px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 30%, #fff); font-size: .8rem; font-weight: 600; line-height: 1.6; }
.member-more { grid-area: more; font-size: .9rem; color: var(--dark-muted); }
.member-more li { position: relative; padding-left: 18px; margin-top: 5px; }
.member-more li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.bio { margin-top: 12px; font-style: italic; }

/* ───── Placeholder ───── */
.ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 10px; border: 2px dashed; border-radius: 12px; line-height: 1.45; }
.ph svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ph-chibi { color: #6f6679; border-color: color-mix(in srgb, var(--accent) 75%, #6f6679); font-size: .76rem; font-weight: 600; }
.ph-photo { color: var(--muted); border-color: rgba(255, 255, 255, .22); background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 14px, transparent 14px 28px); font-size: .76rem; }
.ph-photo strong { font-size: .86rem; color: var(--text); }
.ph-video { color: var(--muted); border-color: rgba(255, 255, 255, .24); border-radius: 0; background: radial-gradient(circle at 50% 45%, #332a47, #14121c 70%); font-size: .8rem; }
.ph-video strong { color: #fff; font-size: clamp(.92rem, 1.8vw, 1.1rem); }
.play { display: grid; place-items: center; width: clamp(48px, 7vw, 76px); aspect-ratio: 1; margin-bottom: 6px; border-radius: 50%; background: var(--amber); color: var(--ink); box-shadow: 0 0 0 10px rgba(255, 197, 107, .14); }
.play svg { width: 46%; height: 46%; fill: currentColor; stroke: none; margin-left: 6%; }

/* ───── Hành trình ───── */
.journey { background: radial-gradient(50% 30% at 0 20%, rgba(98, 71, 170, .22), transparent 70%), var(--ink); }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 210px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--red), var(--amber), var(--green)); }
.step { display: grid; grid-template-columns: 190px minmax(0, 1fr); column-gap: 52px; position: relative; padding-bottom: 52px; }
.step:last-child { padding-bottom: 0; }
.step::after { content: ""; position: absolute; left: 203px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--amber); border: 3px solid var(--ink); box-shadow: 0 0 0 2px var(--amber); }
.step.plan::after { background: var(--ink); }
.step-meta { text-align: right; }
.step-meta time { display: block; font: 600 .86rem var(--mono); }
.status { display: inline-block; margin-top: 8px; font-size: .72rem; padding: 1px 10px; border-radius: 99px; background: rgba(79, 227, 161, .14); color: var(--green); }
.plan .status { background: rgba(255, 197, 107, .12); color: var(--amber); }
.step h3 { font: 700 1.55rem/1.35 var(--serif); }
.place { font: 400 .78rem var(--mono); color: var(--amber); margin-top: 4px; }
.step-body > p:not(.place) { color: #c3bed0; max-width: 46em; margin-top: 8px; }
.step-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.step-photos.n1 { grid-template-columns: minmax(0, 300px); }
.step-photos.n2 { grid-template-columns: repeat(2, minmax(0, 300px)); }

.photo { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--ink-2); }
.photo-btn { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.photo-btn:focus-visible { outline-offset: -4px; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.photo:hover img { transform: scale(1.06); }
.photo figcaption { position: absolute; inset: auto 0 0; padding: 28px 14px 10px; font-size: .8rem; background: linear-gradient(transparent, rgba(8, 7, 12, .88)); pointer-events: none; }

/* ───── Phòng chiếu ───── */
.cinema { background: radial-gradient(60% 45% at 50% 0, rgba(255, 197, 107, .16), transparent 70%), #08070b; }
.videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
.video-card { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .3s, box-shadow .3s, opacity .7s, transform .7s; }
.video-card:hover { border-color: rgba(255, 197, 107, .6); box-shadow: 0 22px 60px rgba(255, 197, 107, .12); }
.video-card.featured { grid-column: 1 / -1; width: 100%; max-width: 980px; justify-self: center; }
.screen { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.screen > * { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.screen video { object-fit: contain; }
.video-info { padding: 18px 22px 22px; }
.video-info h3 { font: 700 1.22rem/1.45 var(--serif); }
.video-info p { color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* ───── Album ───── */
.album { background: var(--ink); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.lightbox { border: 0; padding: 0; background: transparent; color: #fff; max-width: min(1100px, 94vw); max-height: 92vh; overflow: visible; text-align: center; }
.lightbox::backdrop { background: rgba(5, 4, 8, .92); }
.lightbox img { max-height: 80vh; margin-inline: auto; border-radius: 10px; }
.lightbox p { margin-top: 10px; font-size: .88rem; }
.lightbox-close { display: block; margin: 0 0 10px auto; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #1d1a28; color: #fff; cursor: pointer; }

.footer { text-align: center; padding: 56px 20px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.footer-title { font: 700 1.5rem/1.5 var(--serif); color: #fff; margin-bottom: 8px; }
.footer-title em { color: var(--amber); }
.footer a { display: inline-block; margin-top: 18px; }

/* ───── Hiệu ứng cuộn ───── */
.animate .reveal:not(.in) { opacity: 0; transform: translateY(32px); }
.reveal { transition: opacity .7s, transform .7s; }

/* ───── Responsive ───── */
@media (max-width: 1000px) {
  .hero-grid, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .terminal { max-width: 520px; }
  .goals, .scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audience, .answers { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav nav { display: none; position: absolute; inset: 100% 0 auto; flex-direction: column; padding: 10px 16px 18px; background: rgba(13, 12, 18, .97); max-height: calc(100svh - 62px); overflow-y: auto; }
  .nav.open nav { display: flex; }
  .nav nav a { padding: 10px 16px; font-size: 1rem; }
}
@media (max-width: 720px) {
  .videos { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .timeline::before { left: 7px; }
  .step { grid-template-columns: minmax(0, 1fr); padding-left: 34px; row-gap: 8px; }
  .step::after { left: 0; }
  .step-meta { text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .status { margin-top: 0; }
  .step-photos, .step-photos.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-photos.n1 { grid-template-columns: minmax(0, 1fr); }
  .step-photos.n3 > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .goals, .scenes { grid-template-columns: minmax(0, 1fr); }
  .member { grid-template-columns: 112px minmax(0, 1fr); column-gap: 14px; padding: 14px; }
  .member-id h3 { font-size: 1.2rem; }
  .video-info { padding: 14px 16px 18px; }
  .ph-video { gap: 3px; }
  .play { margin-bottom: 4px; box-shadow: 0 0 0 7px rgba(255, 197, 107, .14); }
  .scroll-hint { display: none; }
}

@media (hover: none), (max-width: 860px) {
  .hero-code { opacity: .3; }
}
@media (max-width: 860px) {
  .nav nav { background: var(--ink); box-shadow: 0 20px 40px rgba(0, 0, 0, .5); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
