/* Bee Rust site — base tokens, shell, header, footer, shared controls */
:root {
  --ink: #1f1a17;
  --ink-2: #3a3126;
  --muted: #756754;
  --faint: #8a7a63;
  --cream: #fffdf6;
  --cream-2: #fff6de;
  --cream-3: #ffedbd;
  --amber: #f5b301;
  --amber-2: #ffc62e;
  --rust: #b7410e;
  --rust-deep: #8a320a;
  --wing: #cfe8f5;
  --dark: #12100d;
  --dark-2: #1f1a17;
  --line: rgba(31, 26, 23, 0.12);
  --line-strong: rgba(31, 26, 23, 0.22);
  --line-dark: rgba(255, 243, 214, 0.14);
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --wrap: 1200px;
  --header-h: 72px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 0 rgba(31, 26, 23, 0.04), 0 10px 26px -18px rgba(31, 26, 23, 0.28);
  --shadow-md: 0 24px 60px -34px rgba(31, 26, 23, 0.4);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
code, pre, kbd { font-family: var(--mono); }
::selection { background: var(--amber); color: var(--ink); }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; border-radius: 4px; }
@supports (scrollbar-width: thin) {
  html { scrollbar-width: thin; scrollbar-color: var(--amber) var(--cream-2); }
}

.wrap { width: min(100%, var(--wrap)); margin-inline: auto; padding-inline: clamp(20px, 5vw, 56px); }
.section { position: relative; padding-block: clamp(68px, 9vw, 124px); }
.section--tint { background: linear-gradient(180deg, var(--cream-2), #fffaf0); }
.section--honey {
  background-color: var(--cream-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath d='M28 0 56 16v32L28 64 0 48V16zm0 64 28 16v32L28 128 0 112V80z' fill='none' stroke='%23b7410e' stroke-opacity='.07' stroke-width='1.2'/%3E%3C/svg%3E");
  background-size: 56px 98px;
}

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
  color: var(--rust);
  font-family: var(--mono);
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
}
.eyebrow-line { width: 30px; height: 2px; background: var(--amber); flex: none; }
.eyebrow--dark { color: var(--amber); }
.section-head { max-width: 820px; margin-bottom: clamp(34px, 5vw, 58px); }
.section-head h2 {
  font-size: clamp(2rem, 4.6vw, 4.1rem);
  font-weight: 900; line-height: 1.06; letter-spacing: -0.045em;
  color: var(--ink);
}
.section-lede {
  max-width: 64ch; margin-top: 20px;
  color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.16rem); line-height: 1.8;
}
h3 { font-weight: 800; letter-spacing: -0.02em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 0.95rem; font-weight: 700; white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--amber-2), var(--amber));
  color: var(--ink); box-shadow: 0 14px 30px -18px rgba(245, 179, 1, 0.85);
}
.btn-primary:hover { box-shadow: 0 20px 38px -18px rgba(245, 179, 1, 0.9); }
.btn-arrow { transition: transform 0.25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn-ghost { border-color: rgba(255, 243, 214, 0.28); color: var(--cream); background: rgba(255, 255, 255, 0.04); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn-text { color: var(--cream); padding-inline: 8px; }
.btn-text:hover { color: var(--amber); }
.text-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--rust); font-weight: 700; font-size: 0.92rem;
  border-bottom: 1px solid rgba(183, 65, 14, 0.3); padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.text-link:hover { color: var(--rust-deep); border-color: var(--rust-deep); }
.pulse {
  display: inline-block; width: 8px; height: 8px; flex: none;
  border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 0 0 rgba(245, 179, 1, 0.65);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 179, 1, 0.55); }
  55% { box-shadow: 0 0 0 9px rgba(245, 179, 1, 0); }
}

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 60;
  height: var(--header-h);
  color: var(--cream);
  transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(255, 253, 246, 0.86);
  color: var(--ink);
  border-bottom-color: var(--line);
  box-shadow: 0 12px 40px -30px rgba(31, 26, 23, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
}
.header-inner { display: flex; align-items: center; gap: 26px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 9px; flex: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(245, 179, 1, 0.12); overflow: hidden; }
.brand-mark img { width: 38px; height: 38px; }
.brand-name { font-size: 1.14rem; font-weight: 900; letter-spacing: -0.035em; }
.brand-ver {
  padding: 2px 8px; border: 1px solid currentColor; border-radius: 999px;
  font-family: var(--mono); font-size: 0.58rem; font-weight: 700; letter-spacing: 0.04em;
  opacity: 0.72;
}
.site-nav { display: flex; align-items: center; gap: clamp(12px, 1.8vw, 26px); margin-left: auto; }
.site-nav a {
  position: relative; padding: 6px 0;
  font-size: 0.88rem; font-weight: 600; opacity: 0.82;
  transition: opacity 0.2s, color 0.2s;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--amber); transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.site-nav a:hover, .site-nav a.is-active { opacity: 1; }
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); }
.site-header.is-scrolled .site-nav a.is-active { color: var(--rust); }
.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.lang-btn {
  min-width: 44px; height: 34px; padding: 0 10px;
  border: 1px solid currentColor; border-radius: 999px;
  background: transparent; color: inherit;
  font-family: var(--mono); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em;
  cursor: pointer; opacity: 0.82; transition: opacity 0.2s, background 0.2s, color 0.2s;
}
.lang-btn:hover { opacity: 1; background: var(--amber); color: var(--ink); border-color: var(--amber); }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; opacity: 0.82; transition: opacity 0.2s, background 0.2s; }
.icon-btn:hover { opacity: 1; background: rgba(245, 179, 1, 0.18); }
.icon-btn svg { width: 19px; height: 19px; fill: currentColor; }
.menu-btn { display: none; width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; }
.menu-btn span { display: block; width: 20px; height: 2px; margin: 5px auto; background: currentColor; transition: transform 0.25s, opacity 0.25s; }
.nav-open .menu-btn span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-open .menu-btn span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* Footer */
.site-footer { background: var(--dark); color: var(--cream); padding-top: clamp(48px, 7vw, 80px); }
.footer-main { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: clamp(28px, 5vw, 64px); padding-bottom: 46px; }
.footer-brand p { max-width: 32ch; margin-top: 14px; color: rgba(255, 243, 214, 0.58); font-size: 0.88rem; line-height: 1.8; }
.brand--footer .brand-mark { background: rgba(245, 179, 1, 0.2); }
.footer-stripes { display: flex; gap: 6px; margin-top: 20px; }
.footer-stripes i { display: block; width: 34px; height: 5px; border-radius: 4px; }
.footer-stripes i:nth-child(1) { background: var(--amber); }
.footer-stripes i:nth-child(2) { background: var(--cream); }
.footer-stripes i:nth-child(3) { background: var(--rust); }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { margin-bottom: 6px; color: var(--amber); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; }
.footer-col a { width: fit-content; color: rgba(255, 243, 214, 0.72); font-size: 0.88rem; transition: color 0.2s, transform 0.2s; }
.footer-col a:hover { color: var(--amber); transform: translateX(2px); }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding-block: 20px 96px;
  border-top: 1px solid var(--line-dark);
  color: rgba(255, 243, 214, 0.52);
  font-size: 0.76rem;
}
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.footer-legal a { color: rgba(255, 243, 214, 0.72); transition: color 0.2s; }
.footer-legal a:hover { color: var(--amber); }
.footer-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.74rem; color: rgba(255, 243, 214, 0.5); }
.footer-info b { color: var(--amber); font-family: var(--mono); font-weight: 700; }
.footer-info .dot { opacity: 0.5; }

/* Back to top — Rusty */
.to-top {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 70;
  width: 76px; height: 76px; padding: 0; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fffdf6, #fff2c9 70%);
  box-shadow: 0 18px 40px -18px rgba(31, 26, 23, 0.55), 0 0 0 1px rgba(183, 65, 14, 0.2);
  cursor: pointer; overflow: visible;
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(0.88);
  transition: opacity 0.3s, visibility 0.3s, transform 0.35s var(--ease), box-shadow 0.3s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -18px rgba(31, 26, 23, 0.6), 0 0 0 2px var(--amber); }
.to-top img { position: absolute; inset: 2px; width: 72px; height: 72px; object-fit: cover; object-position: 50% 42%; border-radius: 50%; transform: scale(1.16); }
.to-top-ring { position: absolute; inset: -5px; border-radius: 50%; border: 1px dashed rgba(183, 65, 14, 0.42); animation: spin 24s linear infinite; }
.to-top-arrow {
  position: absolute; right: -3px; bottom: -2px;
  display: grid; place-items: center; width: 25px; height: 25px;
  border-radius: 50%; background: var(--rust); color: var(--cream);
  font-size: 0.8rem; font-weight: 800; box-shadow: 0 4px 12px rgba(31, 26, 23, 0.3);
}
.to-top.is-dancing img { animation: pet-dance 0.9s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pet-dance {
  0% { transform: scale(1.16) rotate(0); }
  25% { transform: scale(1.22) rotate(-9deg) translateY(-4px); }
  55% { transform: scale(1.18) rotate(8deg) translateY(-2px); }
  80% { transform: scale(1.2) rotate(-4deg); }
  100% { transform: scale(1.16) rotate(0); }
}

/* Reveal + motion */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.65s var(--ease), transform 0.65s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .to-top-ring, .pulse { animation: none; }
}

/* Responsive shell */
@media (max-width: 980px) {
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto;
    display: grid; gap: 0; margin: 0; padding: 12px clamp(20px, 5vw, 40px) 28px;
    max-height: calc(100svh - var(--header-h)); overflow-y: auto;
    background: var(--dark);
    border-bottom: 1px solid rgba(255, 243, 214, 0.12);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
  }
  .site-nav a { padding: 13px 0; color: var(--cream); font-size: 1rem; opacity: 1; border-bottom: 1px solid rgba(255, 243, 214, 0.08); }
  .site-nav a::after { display: none; }
  .site-nav a.is-active { color: var(--amber); }
  .nav-open .site-nav { transform: none; opacity: 1; visibility: visible; }
  .site-header.is-scrolled .site-nav a { color: var(--cream); }
  .site-header.is-scrolled .site-nav a.is-active { color: var(--amber); }
  .header-actions { margin-left: auto; }
  .menu-btn { display: block; }
  .site-nav a[href="changelog.html"] { display: block; }
}
@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .header-inner { gap: 12px; }
  .brand-ver { display: none; }
  .icon-btn { display: none; }
  .lang-btn { height: 40px; min-width: 48px; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .to-top { width: 56px; height: 56px; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .to-top img { width: 52px; height: 52px; inset: 2px; }
  .to-top-arrow { width: 21px; height: 21px; font-size: 0.68rem; }
}
@media (max-width: 420px) {
  .lang-btn { min-width: 38px; padding: 0 8px; }
  .brand-name { font-size: 1rem; }
}
@media print {
  .site-header, .to-top, .site-footer .footer-info { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 24px; }
}
