/* Biiiiiiily portfolio — shared design tokens (黑黄品牌) */
:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6db;
  --paper-3: #e2dccd;
  --ink: #1a1a1a;
  --ink-2: #2a2a26;
  --ink-soft: rgba(26, 26, 26, 0.55);
  --ink-faint: rgba(26, 26, 26, 0.32);
  --rule: rgba(26, 26, 26, 0.18);
  --rule-soft: rgba(26, 26, 26, 0.08);
  /* 黑黄主色 — 黄色在亮底上识别度天然弱，所以三档明确分工：
     hot      = #facc15  大字 / 大色块 / chip 底色
     hot-deep = #a16207  亮底场景下的「小字 accent」必须用这个 (5.6:1 AA)
     hot-soft = #fde68a  装饰 / 副标题 / 装饰描边
     一切「亮底 + 小字 hot」的地方都自动 fallback 到 hot-deep（见下方覆盖）。 */
  --hot: #facc15;
  --hot-deep: #a16207;
  --hot-soft: #fde68a;

  --serif: "Instrument Serif", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "Times New Roman", serif;
  --sans: "Space Grotesk", "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

.bly-artboard {
  width: 100%;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  position: relative;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.bly-artboard, .bly-artboard * { box-sizing: border-box; }

/* small "刊号" badge style used on most artboards */
.bly-stamp {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* On the (default) light theme `--hot` 黄色对暖白底对比只有 1.49:1,
   小字会糊。这里强制 stamp 里的小字用 `--hot-deep` 深芥末 (5.6:1 AA)。
   暗色模式下 site-tweaks 会把 --hot-deep 重写为 --hot, 自然恢复亮黄。 */
.bly-stamp b { color: var(--hot-deep); font-weight: 500; }

.bly-rule { height: 1px; background: var(--rule); }
.bly-rule-thick { height: 2px; background: var(--ink); }

/* serif italic shorthand */
.bly-serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; }
.bly-it { font-family: var(--serif); font-style: italic; font-weight: 400; }

/* press-style number stamps */
.bly-num {
  font-family: var(--serif);
  font-style: italic;
  font-feature-settings: "lnum";
}

/* grain overlay – subtle paper texture via SVG noise */
.bly-grain::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.12 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.55;
  z-index: 50;
}

/* Top header masthead used on all artboards */
.bly-masthead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 36px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.bly-masthead .lhs, .bly-masthead .rhs { display: flex; gap: 22px; }
.bly-masthead .center {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Image placeholder — diagonal stripes with caption */
.bly-img {
  position: relative;
  background:
    repeating-linear-gradient(135deg, rgba(26,26,26,0.06) 0 8px, transparent 8px 16px),
    var(--paper-2);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.bly-img.dark {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 8px, transparent 8px 16px),
    #15140f;
  color: #d5cfbf;
}
.bly-img.hot {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.14) 0 8px, transparent 8px 16px),
    var(--hot);
  color: #fff;
}
.bly-img .cap {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 8px;
  background: rgba(244,241,234,0.8);
  border: 1px solid var(--ink-soft);
  backdrop-filter: blur(2px);
}
.bly-img.dark .cap { color: #d5cfbf; background: rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.4); }
.bly-img.hot .cap { color: #fff; background: rgba(0,0,0,0.25); border-color: rgba(255,255,255,0.6); }

/* tag chip */
.bly-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
}
.bly-tag.solid { background: var(--ink); color: var(--paper); }
.bly-tag.hot { background: var(--hot); color: #fff; border-color: var(--hot); }

/* button base */
.bly-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  border-radius: 999px;
  transition: all .18s ease;
}
.bly-btn:hover { background: var(--ink); color: var(--paper); }
.bly-btn.solid { background: var(--ink); color: var(--paper); }
.bly-btn.solid:hover { background: var(--hot); border-color: var(--hot); }
.bly-btn.hot { background: var(--hot); color: #fff; border-color: var(--hot); }
/* Touch feedback — runs on any pointer, but hover-only styles guard
   themselves with `(hover: hover)` so they don't stick on mobile after tap. */
.bly-btn:active { transform: scale(0.97); transition: transform .08s ease; }
@media (hover: none) {
  .bly-btn:hover { background: transparent; color: var(--ink); }
  .bly-btn.solid:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .bly-btn.hot:hover { background: var(--hot); color: #fff; border-color: var(--hot); }
}

/* small dot */
.bly-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hot); display: inline-block; }

/* marquee */
@keyframes bly-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.bly-marquee {
  display: flex; gap: 48px; white-space: nowrap;
  animation: bly-marquee 40s linear infinite;
}

/* ─────────────── Entrance / scroll-reveal animations ─────────────── */

/* Rise: opacity + translateY */
@keyframes bly-rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Drop: from -20px down (used by hero title letters) */
@keyframes bly-drop {
  0%   { opacity: 0; transform: translateY(-40px) rotate(-2deg); filter: blur(6px); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) rotate(0); filter: blur(0); }
}

/* Fade with desaturation easing into color */
@keyframes bly-color-in {
  from { opacity: 0; filter: saturate(0) brightness(1.1); transform: scale(1.04); }
  to   { opacity: 1; filter: saturate(1) brightness(1); transform: scale(1); }
}

/* Reveal: clip from left (for wipe-style typography) */
@keyframes bly-wipe {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

/* Mask-from-center tear open used by the detail overlay */
@keyframes bly-tear {
  from { clip-path: inset(45% 45% 45% 45% round 12px); opacity: 0.4; }
  to   { clip-path: inset(0 0 0 0 round 0); opacity: 1; }
}

/* Initial state for elements waiting to be revealed by IntersectionObserver. */
.bly-pending { opacity: 0; transform: translateY(28px); transition: none; }
.bly-revealed { animation: bly-rise .8s cubic-bezier(.2,.7,.3,1) both; }

/* Stagger helper — set --i on children and they wait .08s × i */
.bly-stagger > * { animation-delay: calc(var(--i, 0) * 80ms); }

/* Reduced motion: turn animations off entirely */
@media (prefers-reduced-motion: reduce) {
  .bly-pending { opacity: 1; transform: none; }
  .bly-revealed, .bly-stagger > * { animation: none !important; }
}

/* ─────────────── Touch-aware feedback ─────────────── */
/* Cards in the feed get a subtle press-state on touch. The desktop hover
   variant (scale up + shadow) is set inline via JS; this CSS is the
   touch-side complement and never fires on a mouse pointer that hovers. */
@media (hover: none) {
  article:active {
    transform: scale(0.985);
    transition: transform .12s ease;
  }
}

/* Hide native scrollbars inside horizontally-snapped carousels */
.bly-snap-x { -ms-overflow-style: none; scrollbar-width: none; }
.bly-snap-x::-webkit-scrollbar { display: none; }
