/* Homepage v2 — base: design tokens, reset, header, drawer, buttons, social dock, modals, section titles.
   Textures under ../img come from the Naruto-Tencent client (see img/CREDITS.txt). */
:root {
  --ink-900: #120a10;
  --ink-800: #1d1118;
  --ink-700: #2a1820;
  --ember: #ff7a1a;
  --gold: #ffcf5a;
  --gold-deep: #e39b22;
  --akatsuki: #c3262e;
  --paper: #f3e4c6;
  --paper-ink: #5a2e14;
  --text: #f7ecd9;
  --font-display: "Shojumaru", "Saira", Georgia, serif;
  --font-ui: "Saira", Arial, sans-serif;
  --header-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.4;
}
body.modal-open, body.drawer-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 clamp(16px, 3vw, 48px);
  background: linear-gradient(180deg, rgba(18, 10, 16, .88), rgba(18, 10, 16, .55));
  border-bottom: 1px solid rgba(255, 207, 90, .35);
  transition: background .3s ease, box-shadow .3s ease;
}
.site-header.is-scrolled { background: rgba(18, 10, 16, .96); box-shadow: 0 6px 24px rgba(0, 0, 0, .45); }
.brand { flex: 0 0 auto; align-self: flex-start; margin-top: 6px; }
.brand img { width: clamp(120px, 10vw, 170px); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
.main-nav { flex: 1; display: flex; justify-content: center; gap: clamp(18px, 4vw, 72px); }
.main-nav a {
  position: relative; padding: 8px 2px;
  font-weight: 800; font-size: clamp(16px, 1.25vw, 22px); letter-spacing: .06em;
  color: var(--text); text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
  transition: color .2s ease;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0); transition: transform .25s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--gold); }
.main-nav a:hover::after, .main-nav a.active::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* Small textured buttons (header + drawer) */
.btn-chip {
  display: inline-grid; place-items: center;
  min-width: 112px; height: 40px; padding: 0 16px;
  font-weight: 800; font-size: 15px; letter-spacing: .05em;
  border-radius: 6px;
  transition: transform .2s ease, filter .2s ease;
}
.btn-chip--gold { color: #4a1d00; background: url("../img/btn-gold.webp") center/100% 100% no-repeat; }
.btn-chip--red { color: #fff4e0; background: url("../img/btn-red.webp") center/100% 100% no-repeat; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.btn-chip:hover { transform: translateY(-2px); filter: brightness(1.12); }

.menu-toggle { display: none; width: 42px; height: 42px; position: relative; }
.menu-toggle span {
  position: absolute; left: 9px; right: 9px; height: 3px; border-radius: 2px; background: var(--gold);
  transition: transform .25s ease, opacity .25s ease;
}
.menu-toggle span:nth-child(1) { top: 12px; }
.menu-toggle span:nth-child(2) { top: 20px; }
.menu-toggle span:nth-child(3) { top: 28px; }
.menu-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-drawer {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 49;
  background: rgba(18, 10, 16, .97);
  border-bottom: 2px solid var(--gold-deep);
  animation: drawer-in .25s ease;
}
.mobile-drawer nav { display: flex; flex-direction: column; padding: 8px 16px 16px; }
.mobile-drawer a, .mobile-drawer button {
  padding: 14px 4px; text-align: left; font-weight: 800; letter-spacing: .06em;
  border-bottom: 1px solid rgba(255, 207, 90, .15);
}
.mobile-drawer a.active { color: var(--gold); }
@keyframes drawer-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Section shell + title plate ---------- */
.content-section { position: relative; padding: clamp(56px, 7vw, 110px) clamp(16px, 4vw, 64px); }
.section-title {
  display: flex; justify-content: center; margin: 0 auto clamp(28px, 4vw, 56px);
  font: 400 clamp(22px, 2.6vw, 44px)/1 var(--font-display);
  letter-spacing: .04em; color: var(--paper-ink);
}
.section-title span {
  display: inline-block; padding: .55em 2.4em .6em;
  border: 28px solid transparent;
  border-image: url("../img/title-plate.webp") 30 44 fill / 28px 44px / 0 stretch;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .55));
  white-space: nowrap;
}
.content-section .section-title { opacity: 0; transform: translateY(-14px) scale(.97); transition: opacity .6s ease, transform .6s ease; }
.content-section.in-view .section-title { opacity: 1; transform: none; }

/* ---------- Floating social dock ---------- */
.social-dock {
  position: fixed; right: 0; top: 50%; z-index: 40; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 8px;
  background: linear-gradient(180deg, rgba(195, 38, 46, .95), rgba(120, 18, 26, .95));
  border: 1px solid rgba(255, 207, 90, .5); border-right: 0;
  border-radius: 12px 0 0 12px;
  box-shadow: -4px 6px 18px rgba(0, 0, 0, .45);
}
.social-dock__label { writing-mode: vertical-rl; font-weight: 800; font-size: 12px; letter-spacing: .2em; color: var(--gold); }
.social-dock a, .social-dock button, .social-dock span.is-disabled { display: block; width: 36px; transition: transform .2s ease; }
.social-dock a:hover, .social-dock button:hover { transform: scale(1.12); }
.social-dock .is-disabled { opacity: .5; filter: grayscale(1); cursor: not-allowed; }

/* ---------- Modals ---------- */
.modal {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: rgba(8, 4, 8, .72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.modal[hidden] { display: none; }
.modal__box {
  position: relative; width: min(420px, 100%); padding: 34px 28px 28px;
  text-align: center; color: var(--paper-ink);
  background: url("../img/scroll-paper.webp") center/cover, var(--paper);
  border: 3px solid var(--gold-deep); border-radius: 12px;
  box-shadow: 0 0 0 4px rgba(18, 10, 16, .8), 0 20px 50px rgba(0, 0, 0, .6);
  animation: modal-in .25s ease;
}
.modal__box h3 { margin: 0 0 10px; font: 400 26px/1.1 var(--font-display); color: var(--akatsuki); }
.modal__box p { margin: 0 0 20px; font-weight: 600; font-size: 17px; }
.modal__close { position: absolute; top: 6px; right: 12px; font-size: 30px; line-height: 1; color: var(--paper-ink); }
.modal__cta {
  display: inline-grid; place-items: center; min-width: 220px; height: 54px; padding: 0 26px;
  font-weight: 800; letter-spacing: .05em; color: #4a1d00;
  background: url("../img/btn-gold.webp") center/100% 100% no-repeat;
}
@keyframes modal-in { from { opacity: 0; transform: scale(.94); } }

/* ---------- Responsive (header / dock) ---------- */
@media (max-width: 1024px) {
  :root { --header-h: 64px; }
  .main-nav { display: none; }
  .menu-toggle { display: block; }
  .header-actions { margin-left: auto; gap: 6px; }
  .brand { margin-top: 4px; }
  .brand img { width: 88px; }
}
@media (max-width: 767px) {
  .section-title span { /* wrap long titles instead of overflowing narrow phones */
    white-space: normal; max-width: 100%; padding: .45em 1.1em .5em;
    border-width: 18px; border-image-width: 18px 26px;
  }
  .social-dock { display: none; } /* Fanpage / Group / Support live in the mobile drawer */
}
@media (max-width: 400px) {
  .site-header { gap: 8px; padding: 0 10px; }
  .header-actions { gap: 4px; }
}
@media (max-width: 480px) {
  .btn-chip { min-width: 0; height: 34px; padding: 0 10px; font-size: 12px; }
  .brand img { width: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  /* decorative motion only; the hero idle/action WebP clips are images and keep playing */
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* product owner: download button + selected-avatar ring effects stay on regardless (class beats `*`) */
  .btn-download-main { animation: download-pulse 2.6s ease-in-out infinite !important; }
  .btn-download-main::after { animation: download-shine 2.8s ease-in-out infinite !important; }
  .btn-download-main svg { animation: arrow-bob 1.3s ease-in-out infinite !important; }
  .avatar-btn.selected { animation: avatar-glow 2.4s ease-in-out infinite !important; }
  .avatar-btn.selected::before { animation: ring-spin 9s linear infinite !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
