/* Pháo Đài Số – nhận diện: đêm xanh thẫm của tường thành, lửa cam FPT, ánh sáng số xanh ngọc */
:root {
  color-scheme: dark;
  --night: #0a1022;
  --wall: #10183a;
  --stone: #172150;
  --stone-2: #1d2a5e;
  --line: rgb(148 163 255 / .14);
  --text: #e8ecf8;
  --muted: #a3aed0;
  --fire: #f27125;
  --fire-2: #ff8a3d;
  --amber: #ffb547;
  --cyan: #33e1d4;
  --green: #4ade80;
  --red: #ff6b6b;
  --radius: 16px;
  --display: "Chakra Petch", "Be Vietnam Pro", system-ui, sans-serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--text); font: 400 1rem/1.65 var(--body); }
img, svg { max-width: 100%; }
a { color: var(--amber); text-underline-offset: 3px; }
a:hover { color: var(--fire-2); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-family: var(--display); font-size: clamp(1.7rem, 3.6vw, 2.5rem); letter-spacing: .01em; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
strong { color: #fff; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--fire); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 32px); }
code.pds { font-family: var(--mono); font-size: .92em; color: var(--cyan); background: rgb(51 225 212 / .1); border: 1px solid rgb(51 225 212 / .25); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }

/* ---------------- Nút */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 12px; font-weight: 700; text-decoration: none; border: 2px solid transparent; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-2px); }
.btn-fire { background: linear-gradient(135deg, var(--fire), var(--fire-2)); color: #fff; box-shadow: 0 10px 28px rgb(242 113 37 / .35); }
.btn-fire:hover { color: #fff; box-shadow: 0 14px 34px rgb(242 113 37 / .45); }
.btn-ghost { color: var(--text); border-color: rgb(255 255 255 / .22); }
.btn-ghost:hover { color: #fff; border-color: var(--cyan); }
.btn-dark { background: var(--night); color: #fff; }
.btn-dark:hover { color: var(--amber); }

/* ---------------- Đầu trang */
.top { position: sticky; top: 0; z-index: 50; background: rgb(10 16 34 / .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: .08em; }
.brand-name b { color: var(--fire); }
.menu { display: flex; gap: 2px; }
.menu a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; padding: 8px 12px; border-radius: 8px; }
.menu a:hover { color: #fff; background: rgb(255 255 255 / .06); }
.menu-btn { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.menu-btn span:not(.sr) { display: block; width: 22px; height: 2px; margin: 5px 0; background: var(--text); border-radius: 2px; }

/* ---------------- Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 84px;
  background: radial-gradient(900px 420px at 78% 30%, rgb(51 225 212 / .13), transparent 60%),
              radial-gradient(700px 380px at 10% 0%, rgb(242 113 37 / .16), transparent 60%), var(--night); }
.hero-grid { position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 75%); }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); border: 1px solid var(--line); background: rgb(255 255 255 / .03); padding: 6px 14px; border-radius: 999px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.hero-title { font-family: var(--display); font-size: clamp(3rem, 8vw, 5.6rem); letter-spacing: .04em; line-height: 1.08; margin: 22px 0 12px; }
.hero-title span { color: var(--fire); text-shadow: 0 0 40px rgb(242 113 37 / .45); }
.hero-slogan { font-family: var(--display); font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: var(--amber); margin-bottom: 18px; }
.hero-lead { color: #c9d1ea; font-size: 1.08rem; max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 34px; }
.hero-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 560px; }
.hero-facts li { border: 1px solid var(--line); background: rgb(255 255 255 / .03); border-radius: 12px; padding: 12px; }
.hero-facts b { display: block; font-family: var(--display); font-size: 1.7rem; color: var(--cyan); line-height: 1; }
.hero-facts span { font-size: .78rem; color: var(--muted); }
.hero-art { position: relative; }
.fortress { display: block; width: 100%; height: auto; filter: drop-shadow(0 20px 40px rgb(0 0 0 / .45)); }
.flag { transform-origin: 212px 34px; animation: wave 2.6s ease-in-out infinite; }
.win { animation: glow 3s ease-in-out infinite; }
@keyframes wave { 50% { transform: scaleX(.86) skewY(3deg); } }
@keyframes glow { 50% { opacity: .45; } }
.term { position: absolute; left: -6%; bottom: -14px; width: min(360px, 90%); background: #070c1b; border: 1px solid rgb(51 225 212 / .3); border-radius: 12px; box-shadow: 0 18px 40px rgb(0 0 0 / .5), 0 0 0 4px rgb(51 225 212 / .05); }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: #3a4b84; }
.term-bar i:first-child { background: var(--red); } .term-bar i:nth-child(2) { background: var(--amber); } .term-bar i:nth-child(3) { background: var(--green); }
.term-bar span { margin-left: 8px; font: 500 .75rem var(--mono); color: var(--muted); }
.term-body { margin: 0; padding: 12px 14px 14px; font: 500 .78rem/1.7 var(--mono); white-space: pre-wrap; color: var(--text); }
.term-body .c { color: var(--muted); } .term-body .ok { color: var(--green); }
.flagtxt { color: var(--cyan); font-weight: 700; }
.flagtxt.typing::after { content: "▌"; color: var(--cyan); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------------- Khung mục */
.sec { padding: 88px 0; }
.sec-alt { background: linear-gradient(180deg, var(--wall), #0c1430); border-block: 1px solid var(--line); }
.head { max-width: 760px; margin-bottom: 40px; }
.kicker { font: 700 .82rem var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--fire); margin-bottom: 10px; }
.sub { color: var(--muted); font-size: 1.05rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.split-tight { align-items: center; }

/* ---------------- Thẻ */
.cards { display: grid; gap: 16px; }
.cards-5 { grid-template-columns: repeat(5, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: linear-gradient(180deg, var(--stone), var(--wall)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: rgb(242 113 37 / .5); transform: translateY(-3px); }
.card p { color: var(--muted); font-size: .94rem; margin: 0; }
.ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; margin-bottom: 14px; }
.ico svg { width: 24px; height: 24px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-fire { background: rgb(242 113 37 / .14); } .i-fire svg { stroke: var(--fire-2); }
.i-cyan { background: rgb(51 225 212 / .12); } .i-cyan svg { stroke: var(--cyan); }
.i-amber { background: rgb(255 181 71 / .13); } .i-amber svg { stroke: var(--amber); }

/* ---------------- CTF là gì */
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.steps b { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; font-family: var(--display); font-size: 1.2rem; background: var(--fire); color: #fff; }
.steps h3 { margin: 2px 0 2px; }
.steps p { color: var(--muted); margin: 0; font-size: .95rem; }
.example { background: #0b1229; border: 1px solid rgb(51 225 212 / .3); border-radius: 20px; padding: 26px; box-shadow: 0 0 0 6px rgb(51 225 212 / .04); }
.ex-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.tag { font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag-green { color: var(--green); border-color: rgb(74 222 128 / .4); background: rgb(74 222 128 / .08); }
.pts { margin-left: auto; font: 700 .85rem var(--mono); color: var(--amber); }
.example h3 { font-family: var(--display); font-size: 1.35rem; }
.example > p { color: #c9d1ea; }
.mail { font: 500 .82rem/1.6 var(--mono); background: #060a17; border: 1px dashed rgb(148 163 255 / .25); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; overflow-wrap: anywhere; }
.mail p { margin: 0; } .mail span { color: var(--muted); }
.mail mark { background: rgb(255 107 107 / .18); color: #ffb4b4; border-radius: 4px; padding: 0 3px; }
.hint, .lesson { font-size: .93rem; color: var(--muted); }
.lesson { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.lesson b { color: var(--green); } .hint b { color: var(--text); }

/* ---------------- Chủ đề */
.topics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.topic { position: relative; background: linear-gradient(180deg, var(--stone), var(--wall)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px 20px; overflow: hidden; }
.topic::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--fire), var(--amber)); opacity: .8; }
.topic .no { font: 700 2rem var(--display); color: rgb(51 225 212 / .35); display: block; margin-bottom: 6px; }
.topic p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---------------- Cấp độ */
.ranks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.rank { border-radius: 20px; padding: 28px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--stone-2), var(--wall)); }
.emblem { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 16px; }
.emblem svg { width: 40px; height: 40px; fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.rank h3 { font-family: var(--display); font-size: 1.5rem; margin-bottom: 2px; }
.share { font: 700 .85rem var(--mono); margin-bottom: 12px; }
.rank p:last-child { color: var(--muted); margin: 0; }
.r1 .emblem { background: rgb(74 222 128 / .12); } .r1 .emblem svg { stroke: var(--green); } .r1 .share { color: var(--green); }
.r2 .emblem { background: rgb(255 181 71 / .13); } .r2 .emblem svg { stroke: var(--amber); } .r2 .share { color: var(--amber); }
.r3 { border-color: rgb(242 113 37 / .45); box-shadow: 0 0 40px rgb(242 113 37 / .12); }
.r3 .emblem { background: rgb(242 113 37 / .15); } .r3 .emblem svg { stroke: var(--fire-2); } .r3 .share { color: var(--fire-2); }

/* ---------------- Hành trình */
.journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; position: relative; }
.journey > li { position: relative; background: linear-gradient(180deg, var(--stone), var(--wall)); border: 1px solid var(--line); border-radius: 20px; padding: 26px; }
.journey > li:not(:last-child)::after { content: "→"; position: absolute; right: -16px; top: 30px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--fire); color: #fff; font-weight: 700; }
.stage { display: inline-block; font: 700 .78rem var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--cyan); margin-bottom: 8px; }
.journey h3 { font-family: var(--display); font-size: 1.3rem; }
.journey p { color: #c9d1ea; font-size: .95rem; }
.journey ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .9rem; }
.journey ul li { margin-bottom: 4px; }

/* ---------------- Thể lệ */
.rules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.rule { background: #0b1229; border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px; }
.rule h3 { display: flex; align-items: center; gap: 12px; font-size: 1.15rem; }
.rn { font: 700 .85rem var(--mono); color: var(--fire); border: 1px solid rgb(242 113 37 / .5); border-radius: 8px; padding: 3px 7px; }
.rule ul { margin: 0; padding-left: 20px; color: #c9d1ea; font-size: .95rem; }
.rule li { margin-bottom: 7px; }
.rule li::marker { color: var(--fire); }
.conduct { margin-top: 18px; background: #0b1229; border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.conduct > h3 { font-family: var(--display); font-size: 1.35rem; }
.conduct-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-bottom: 16px; }
.ok-box, .no-box { border-radius: 14px; padding: 18px 20px; }
.ok-box { background: rgb(74 222 128 / .07); border: 1px solid rgb(74 222 128 / .3); }
.no-box { background: rgb(255 107 107 / .07); border: 1px solid rgb(255 107 107 / .3); }
.ok-box h4 { color: var(--green); } .no-box h4 { color: var(--red); }
.ok-box ul, .no-box ul { margin: 0; padding-left: 20px; font-size: .94rem; color: #c9d1ea; }
.ok-box li, .no-box li { margin-bottom: 5px; }
.note { font-size: .93rem; color: var(--muted); margin: 0 0 10px; padding: 12px 16px; border-left: 3px solid var(--cyan); background: rgb(51 225 212 / .05); border-radius: 0 10px 10px 0; }
.note.warn { border-left-color: var(--amber); background: rgb(255 181 71 / .06); margin: 0; }
.note b { color: var(--text); }

/* ---------------- Giải thưởng */
.prizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.prize { text-align: center; border-radius: 20px; padding: 30px 22px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--stone-2), var(--wall)); }
.prize p { color: var(--muted); margin: 0; }
.prize h3 { font-family: var(--display); font-size: 1.4rem; }
.medal { display: inline-grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; font: 700 1.6rem var(--display); color: #1a1205; margin-bottom: 14px; }
.p-gold .medal { background: radial-gradient(circle at 35% 30%, #fff1b8, #f5b82e 60%, #b37a10); box-shadow: 0 0 30px rgb(245 184 46 / .45); }
.p-silver .medal { background: radial-gradient(circle at 35% 30%, #fff, #c8d0e0 60%, #7d879c); }
.p-bronze .medal { background: radial-gradient(circle at 35% 30%, #ffd9b8, #d98a4a 60%, #8a4a1c); }
.p-gold { border-color: rgb(245 184 46 / .45); }
.extra-prizes .card h3 { color: var(--amber); }
.honor { display: flex; align-items: center; gap: 20px; margin-top: 18px; padding: 20px 24px; border-radius: 18px; border: 1px solid rgb(242 113 37 / .35); background: rgb(242 113 37 / .06); }
.honor p { margin: 0; color: #c9d1ea; }

/* ---------------- Dữ liệu */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { position: relative; padding: 12px 16px 12px 46px; background: #0b1229; border: 1px solid var(--line); border-radius: 12px; color: #c9d1ea; font-size: .95rem; }
.checks li::before { content: ""; position: absolute; left: 16px; top: 16px; width: 16px; height: 9px; border-left: 3px solid var(--cyan); border-bottom: 3px solid var(--cyan); transform: rotate(-45deg); }

/* ---------------- Hỏi đáp */
.faq details { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, var(--stone), var(--wall)); margin-bottom: 10px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 54px 18px 20px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--fire); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 20px 18px; margin: 0; color: var(--muted); }

/* ---------------- CTA + chân trang */
.cta { background: linear-gradient(120deg, #c2410c, var(--fire) 45%, #f59e0b); padding: 52px 0; }
.cta-inner { display: flex; align-items: center; gap: 26px; }
.cta-inner > div { flex: 1; }
.cta h2 { color: #fff; margin-bottom: 6px; }
.cta p { margin: 0; color: rgb(255 255 255 / .92); }
.cta img { filter: drop-shadow(0 8px 20px rgb(0 0 0 / .3)); }
.foot { background: #070b18; padding: 48px 0 22px; border-top: 1px solid var(--line); }
.foot-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.foot-brand { margin-bottom: 8px; }
.foot-title { font: 700 .82rem var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--fire); margin-bottom: 8px; }
.foot p { color: var(--muted); font-size: .94rem; }
.muted { color: var(--muted); }
.foot-copy { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }

/* ---------------- Hiệu ứng xuất hiện (chỉ khi có JS) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------------- Màn hình nhỏ */
@media (max-width: 1080px) {
  .cards-5 { grid-template-columns: repeat(3, 1fr); }
  .topics { grid-template-columns: repeat(2, 1fr); }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .menu { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; padding: 10px 16px 16px; background: rgb(10 16 34 / .97); border-bottom: 1px solid var(--line); }
  .menu.open { display: flex; }
  .menu a { padding: 12px; }
  .hero { padding: 48px 0 64px; }
  .hero-inner, .split { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { max-width: 520px; margin-inline: auto; width: 100%; }
  .term { left: 0; }
  .ranks, .prizes, .journey, .rules { grid-template-columns: 1fr; }
  .journey > li:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -16px; transform: translateX(-50%); }
  .conduct-grid { grid-template-columns: 1fr; }
  .cta-inner { flex-direction: column; text-align: center; }
  .foot-inner { grid-template-columns: 1fr; }
  .sec { padding: 64px 0; }
}
@media (max-width: 560px) {
  .cards-5, .cards-4, .topics { grid-template-columns: 1fr; }
  .hero-facts { grid-template-columns: repeat(2, 1fr); }
  .term { position: relative; bottom: auto; margin-top: -10px; width: 100%; }
  .honor { flex-direction: column; text-align: center; }
  .brand-name { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
