/* Trang giới thiệu theo kit toy-v1 (ADR-057, docs/ui-theme-toy/style-guide.md).
   Màu chỉ lấy từ biến --sky-* (kit/palette.css sinh từ SkyPalette); khung, nút, dải tiêu đề là art nine-slice
   của kit qua border-image (lề texture: panel/header 31, nút 28), không vẽ hình bằng CSS. Không loop chuyển động. */

@font-face {
  font-family: "Nunito";
  src: url("/kit/fonts/nunito.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.55;
  color: var(--sky-ink);
  background: var(--sky-bootsky);
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky-blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--sky-muted); }
h1, h2, h3 { font-weight: 900; line-height: 1.15; margin: 0; }
p { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---- vật liệu của kit ---- */
.panel {
  border: 22px solid transparent;
  border-image: url("/kit/nine/panel.png") 31 fill / 22px stretch;
  padding: 4px;
}
.raised {
  border: 18px solid transparent;
  border-image: url("/kit/nine/panel-raised.png") 31 fill / 18px stretch;
  padding: 2px;
}
.strip {
  display: inline-block;
  color: var(--sky-paper);
  font-size: clamp(24px, 4vw, 32px);
  border: 20px solid transparent;
  border-image: url("/kit/nine/header.png") 31 fill / 20px stretch;
  padding: 0 14px;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 10px;
  border: 26px solid transparent;
  border-block-width: 0;
  border-image-slice: 28 fill;
  border-image-width: 28px 26px;
  border-image-repeat: stretch;
  color: var(--sky-ink);
  font-weight: 900;
  font-size: 19px;
  text-decoration: none;
  text-align: center;
  line-height: 1.15;
  transition: transform .12s ease;
}
.btn.primary { border-image-source: url("/kit/nine/button-primary-normal.png"); }
.btn.primary:hover { border-image-source: url("/kit/nine/button-primary-hover.png"); color: var(--sky-ink); }
.btn.primary:active { border-image-source: url("/kit/nine/button-primary-pressed.png"); }
.btn.secondary { border-image-source: url("/kit/nine/button-secondary-normal.png"); color: var(--sky-ink); }
.btn.secondary:hover { border-image-source: url("/kit/nine/button-secondary-hover.png"); color: var(--sky-ink); }
.btn.secondary:active { border-image-source: url("/kit/nine/button-secondary-pressed.png"); }
.btn:active { transform: translateY(2px); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--sky-blue); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }

.tag {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--sky-muted);
  margin-bottom: 2px;
}

/* ---- đầu trang ---- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  color: var(--sky-paper);
  border-bottom: 14px solid transparent;
  border-image: url("/kit/nine/header.png") 0 31 31 fill / 0 0 14px stretch;
}
.top .wrap { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 8px 0 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--sky-paper); text-decoration: none; font-weight: 900; font-size: 20px; line-height: 1; }
.brand:hover { color: var(--sky-paper); }
.brand small { display: block; font-size: 13px; color: var(--sky-citron); letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; }
.top nav { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-left: auto; }
.top nav a { color: var(--sky-paper); text-decoration: none; font-size: 16px; padding: 6px 0; }
.top nav a:hover, .top nav a[aria-current] { color: var(--sky-citron); }

/* ---- hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  background: url("/kit/bg-harbor.webp") center 62% / cover no-repeat, var(--sky-bootsky);
  padding: 36px 0 0;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.hero .wrap { position: relative; z-index: 1; padding-bottom: 28px; }
.hero-card { max-width: 560px; }
.kicker { font-weight: 900; color: var(--sky-muted); font-size: 15px; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 4px; }
.hero h1 { font-size: clamp(44px, 8vw, 76px); color: var(--sky-blue); }
.hero h1 em { display: block; font-style: normal; color: var(--sky-sky); font-size: .62em; }
.lead { font-size: 18px; margin-top: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px 12px; margin: 16px 0 12px; }
.status { font-size: 14px; color: var(--sky-muted); }
.mascot {
  position: absolute;
  right: max(0px, calc(50% - 600px));
  bottom: 0;
  width: min(560px, 46vw);
  pointer-events: none;
}

.facts { list-style: none; padding: 0; margin: 22px auto 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.facts li { text-align: center; }
.facts b { display: block; font-weight: 900; font-size: 22px; color: var(--sky-blue); }
.facts span { font-size: 14px; color: var(--sky-muted); }

/* ---- khối nội dung ---- */
.block { padding: 36px 0 8px; }
.intro { max-width: 760px; }
.sub { font-size: 24px; color: var(--sky-blue); margin: 28px 0 12px; }

.modes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.modes li { display: flex; gap: 14px; align-items: flex-start; }
.modes img { width: 72px; flex: none; }
.modes h3 { font-size: 21px; color: var(--sky-blue); margin-bottom: 4px; }
.modes p { font-size: 16px; }

.arc { margin-top: 16px; }
.arc h3 { font-size: 26px; color: var(--sky-blue); margin-bottom: 6px; }
details { margin-top: 10px; }
summary {
  cursor: pointer;
  display: inline-block;
  font-weight: 900;
  color: var(--sky-blue);
  border: 16px solid transparent;
  border-block-width: 0;
  border-image: url("/kit/nine/tab-selected.png") 20 fill / 20px 16px stretch;
  min-height: 44px;
  line-height: 44px;
  padding: 0 4px;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: 8px; }
.chapters { margin: 0; padding-left: 0; list-style: none; counter-reset: none; display: grid; gap: 10px; }
.chapters li { background: var(--sky-raised); border-radius: 14px; padding: 10px 14px 10px 64px; position: relative; }
.chapters li::before {
  content: counter(list-item);
  position: absolute;
  left: 12px;
  top: 10px;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-weight: 900;
  font-size: 20px;
  color: var(--sky-paper);
  background: var(--sky-blue);
  border-radius: 50%;
}
.chapters b { font-weight: 900; font-size: 18px; color: var(--sky-blue); }
.chapters span { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--sky-muted); }
.chapters p { font-size: 16px; margin-top: 4px; }

.people { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.people li { display: flex; gap: 12px; align-items: flex-start; }
.people img { width: 64px; flex: none; }
.people b { font-weight: 900; font-size: 18px; color: var(--sky-blue); display: block; }
.people span { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--sky-muted); }
.people p { font-size: 15px; margin-top: 2px; }

.classes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.classes li.panel { display: flex; gap: 14px; align-items: flex-start; }
.classes .pic { width: 104px; flex: none; }
.classes .body { flex: 1; min-width: 0; }
.classes h3 { font-size: 24px; color: var(--sky-blue); margin-bottom: 4px; }
.classes .body > p { font-size: 15px; }
.stats { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.stats li { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 8px; font-size: 13px; color: var(--sky-muted); }
/* thanh chỉ số: primitive chức năng, 10 nấc */
.stats i {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--sky-sky) calc(var(--v) * 10%), var(--sky-track) 0);
  box-shadow: inset 0 0 0 2px var(--sky-blue);
}
.how { font-size: 14px; color: var(--sky-ink); background: var(--sky-pale); border-radius: 10px; padding: 6px 10px; }
.coin, .gem { font-weight: 900; white-space: nowrap; padding-left: 22px; background: left center / 18px no-repeat; }
.coin { color: var(--sky-coinink); background-image: url("/kit/coin.webp"); }
.gem { color: var(--sky-diamondink); background-image: url("/kit/gem.webp"); }

.support { max-width: 760px; }

footer { margin-top: 40px; color: var(--sky-paper); border-top: 14px solid transparent; border-image: url("/kit/nine/header.png") 31 31 0 fill / 14px 0 0 stretch; }
footer .wrap { display: flex; align-items: center; gap: 12px; padding: 6px 0 22px; font-size: 14px; }
footer img { flex: none; }

/* ---- văn bản (chính sách, điều khoản) ---- */
.page-head { background: url("/kit/bg-harbor.webp") center 40% / cover no-repeat, var(--sky-bootsky); padding: 36px 0 28px; }
.page-head .panel { max-width: 760px; }
.page-head h1 { font-size: clamp(32px, 6vw, 48px); color: var(--sky-blue); }
.doc { width: min(860px, 100% - 32px); margin: 24px auto 0; }
.doc h2 { font-size: 24px; color: var(--sky-blue); margin: 24px 0 8px; }
.doc h3 { font-size: 19px; color: var(--sky-blue); margin: 16px 0 6px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 4px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.doc th, .doc td { border: 2px solid var(--sky-hairline); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc th { background: var(--sky-pale); }

/* ---- màn hẹp ---- */
@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: 0; padding-top: 220px; }
  .mascot { width: 300px; right: -20px; bottom: auto; top: 0; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .top .wrap { gap: 4px 12px; }
  .top nav { margin-left: 0; gap: 2px 14px; }
  .top nav a { font-size: 15px; }
  .hero { padding-top: 190px; }
  .mascot { width: 250px; right: -30px; }
  .modes, .classes, .people { grid-template-columns: 1fr; }
  .classes .pic { width: 76px; }
  .btn { width: 100%; font-size: 17px; white-space: nowrap; }
  .panel { border-width: 18px; border-image-width: 18px; }
  .top { position: relative; }
  .brand img { width: 36px; height: 36px; }
  .facts b { font-size: 19px; }
}
