/* H5：开机落墨、毛笔指针、底栏与动效。延续 style.css。 */

:root {
  --dock-h: calc(64px + env(safe-area-inset-bottom, 0px));
}

html, body {
  min-height: 100%;
  min-height: 100dvh;
}

body {
  padding-bottom: var(--dock-h);
  overflow-x: hidden;
}

body.is-booting { overflow: hidden; }

header, main, footer, .dock {
  position: relative;
  z-index: 3;
}
header.site-header { z-index: 10; }

/* ---------- 毛笔指针：热点在笔尖。触控与粗指针回退为系统指针。 ---------- */
@media (hover: hover) and (pointer: fine) {
  html, body {
    cursor: url("../img/cursor-brush.png") 1 62, auto;
  }
  a, button, .filter, summary, [role="button"],
  a *, button * {
    cursor: url("../img/cursor-brush-press.png") 1 58, pointer;
  }
}

/* ---------- 开机：落墨展开 ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: #f4efe4;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
body.is-ready .boot {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-bloom {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(circle at 50% 46%, rgba(26, 23, 20, 0.32) 0 6%, rgba(26, 23, 20, 0.12) 16%, rgba(26, 23, 20, 0.04) 28%, transparent 52%),
    radial-gradient(circle at 46% 50%, rgba(26, 23, 20, 0.1) 0 10%, transparent 30%),
    radial-gradient(circle at 56% 42%, rgba(26, 23, 20, 0.08) 0 8%, transparent 26%);
  transform: scale(0.2);
  opacity: 0;
  animation: inkBloom 1.45s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  filter: blur(1px);
}

.boot-inner {
  position: relative;
  text-align: center;
  width: min(86vw, 420px);
  z-index: 1;
}

.boot-seal {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto 0.6rem;
  opacity: 0;
  animation: inkWrite 0.9s ease 0.25s forwards;
}

.boot-word {
  margin: 0;
  font-family: "Ma Shan Zheng", "Noto Serif SC", cursive;
  font-size: clamp(3.4rem, 14vw, 5.2rem);
  letter-spacing: 0.18em;
  line-height: 1;
  color: #1a1714;
  opacity: 0;
  animation: inkWrite 1s ease 0.35s forwards;
}

.boot-line {
  margin: 0.9rem 0 0;
  font-family: "Noto Serif SC", serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: #4a453e;
  opacity: 0;
  animation: inkWrite 0.8s ease 0.7s forwards;
}

@keyframes inkBloom {
  0% { opacity: 0; transform: scale(0.15); }
  35% { opacity: 1; transform: scale(0.85); }
  100% { opacity: 0.55; transform: scale(1.15); }
}

@keyframes inkWrite {
  from { opacity: 0; filter: blur(8px); transform: translateY(8px); }
  to { opacity: 1; filter: none; transform: none; }
}

/* ---------- 入场 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: riseIn 0.65s ease forwards;
}
@keyframes riseIn {
  to { opacity: 1; transform: none; }
}

.view.is-enter {
  animation: viewWash 0.5s ease both;
}
@keyframes viewWash {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 底栏 ---------- */
.dock {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  border-radius: 4px;
  background: rgba(244, 239, 228, 0.92);
  border: 1px solid rgba(26, 23, 20, 0.16);
  box-shadow: 0 8px 28px rgba(26, 23, 20, 0.1);
  backdrop-filter: blur(16px);
}

.dock a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px 6px;
  color: #4a453e;
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.dock-ico {
  width: 18px;
  height: 8px;
  border-radius: 1px 8px 2px 8px / 1px 4px 2px 6px;
  background: #1a1714;
  opacity: 0.55;
  display: block;
}
.dock-ico-hall {
  background: #9b1c1c;
  opacity: 0.7;
  border-radius: 8px 1px 8px 2px / 5px 1px 6px 2px;
}
.dock-ico-digest {
  width: 16px;
  height: 12px;
  border-radius: 0;
  background:
    linear-gradient(#1a1714, #1a1714) 0 0 / 100% 2px no-repeat,
    linear-gradient(#1a1714, #1a1714) 0 5px / 100% 2px no-repeat,
    linear-gradient(#1a1714, #1a1714) 0 10px / 72% 2px no-repeat;
  opacity: 0.65;
}

.dock a[aria-current="page"] {
  color: #1a1714;
  background: rgba(155, 28, 28, 0.08);
}
.dock a[aria-current="page"] .dock-ico { opacity: 1; }

@media (max-width: 820px) {
  .dock { display: grid; }
  .site-nav { display: none; }
  .header-inner { grid-template-columns: 1fr auto; }
}

@media (hover: hover) and (pointer: fine) {
  .camp:hover,
  .news-card:hover,
  .stat:hover,
  .venue-list li:hover,
  .task-card:hover,
  .digest-list li:hover {
    border-color: rgba(26, 23, 20, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boot, .boot-bloom, .boot-seal, .boot-word, .boot-line,
  .reveal, .view.is-enter, .ticker-track {
    animation: none !important;
    transition: none !important;
  }
  body.is-booting { overflow: auto; }
  .boot { display: none; }
  .reveal { opacity: 1; transform: none; }
  .fx-canvas { display: none; }
}
