/* =========================================================
   驯鸽鸽 · 个人作品集 / 设计系统
   base.css — tokens, typography, shell, header, footer, UI
   ========================================================= */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Sora";
  src: url("../fonts/sora.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --bg: #0a0908;
  --bg-soft: #0f0e0b;
  --surface: #14120f;
  --surface-2: #1a1713;
  --surface-3: #221e18;
  --line: rgba(255, 246, 230, 0.08);
  --line-2: rgba(255, 246, 230, 0.14);
  --text: #f3ede2;
  --text-2: #b6ad9f;
  --text-3: #7e7669;
  --amber: #f2a33c;
  --amber-2: #ffcb80;
  --amber-3: #c77d1e;
  --amber-soft: rgba(242, 163, 60, 0.12);
  --green: #63d29a;
  --violet: #b3a4ff;
  --sky: #6fc6f2;

  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans", system-ui, sans-serif;
  --font-display: "Noto Serif SC", "Songti SC", "SimSun", "Noto Serif", serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --font-latin: "Sora", "Noto Sans SC", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  --font-accent: "Instrument Serif", "Noto Serif SC", serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --gutter: clamp(20px, 5vw, 64px);
  --wrap: 1280px;
  --header-h: 74px;
  --radius: 20px;
  --radius-sm: 12px;
  --section-y: clamp(80px, 11vw, 150px);
}

/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: #3a332a #0a0908;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-leaving {
  opacity: 0;
  transition: opacity 0.28s ease;
}
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
code,
pre {
  font-family: var(--font-mono);
}
::selection {
  background: var(--amber);
  color: #17120b;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #0a0908;
}
::-webkit-scrollbar-thumb {
  background: #39322a;
  border-radius: 10px;
  border: 2px solid #0a0908;
}
::-webkit-scrollbar-thumb:hover {
  background: #5a4e3e;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  transform: translateY(-150%);
  background: var(--amber);
  color: #17120b;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus {
  transform: translateY(0);
}

/* ---------- layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  position: relative;
  padding-block: var(--section-y);
}
section[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.section--tight {
  padding-block: clamp(56px, 7vw, 92px);
}
.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
}
.serif {
  font-family: var(--font-display);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.65;
}
.eyebrow--center {
  justify-content: center;
}
.sec-head {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.sec-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  line-height: 1.28;
  letter-spacing: 0.005em;
  color: var(--text);
}
.sec-title em {
  font-style: normal;
  color: var(--amber);
}
.sec-desc {
  color: var(--text-2);
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.9;
  max-width: 46ch;
}
.sec-head__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
}
.hr {
  height: 1px;
  border: 0;
  background: linear-gradient(
    90deg,
    var(--line-2),
    rgba(255, 246, 230, 0.02)
  );
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 246, 230, 0.03);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}
.tag--game {
  color: #ffc078;
  border-color: rgba(242, 163, 60, 0.36);
  background: rgba(242, 163, 60, 0.09);
}
.tag--tool {
  color: #8ee7b4;
  border-color: rgba(99, 210, 154, 0.34);
  background: rgba(99, 210, 154, 0.08);
}
.tag--mod {
  color: #c3b8ff;
  border-color: rgba(179, 164, 255, 0.34);
  background: rgba(179, 164, 255, 0.08);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
  flex: none;
}

/* ---------- grain & ambience ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 120;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--amber-3), var(--amber), var(--amber-2));
  box-shadow: 0 0 16px rgba(242, 163, 60, 0.55);
}

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s var(--ease), background 0.4s var(--ease),
    border-color 0.4s var(--ease), color 0.4s var(--ease),
    box-shadow 0.5s var(--ease);
}
.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform 0.5s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:hover svg {
  transform: translate(2px, -2px);
}
.btn--primary {
  background: linear-gradient(135deg, var(--amber-2), var(--amber) 55%, #e08a20);
  color: #1a1208;
  box-shadow: 0 14px 40px -18px rgba(242, 163, 60, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(255, 255, 255, 0.55) 48%,
    transparent 62%
  );
  transform: translateX(-130%);
  transition: transform 0.9s var(--ease);
}
.btn--primary:hover::after {
  transform: translateX(130%);
}
.btn--primary:hover {
  box-shadow: 0 20px 50px -18px rgba(242, 163, 60, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn--ghost {
  border: 1px solid var(--line-2);
  color: var(--text);
  background: rgba(255, 246, 230, 0.02);
}
.btn--ghost:hover {
  border-color: rgba(242, 163, 60, 0.5);
  background: rgba(242, 163, 60, 0.07);
  color: var(--amber-2);
}
.btn--sm {
  height: 42px;
  padding: 0 18px;
  font-size: 13px;
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 1px solid transparent;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.link-arrow span {
  transition: transform 0.4s var(--ease);
}
.link-arrow:hover {
  color: var(--amber-2);
  border-color: rgba(242, 163, 60, 0.4);
}
.link-arrow:hover span {
  transform: translate(3px, -3px);
}

/* ---------- header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: var(--header-h);
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease),
    backdrop-filter 0.5s var(--ease), height 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  height: 62px;
  background: rgba(10, 9, 8, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.brand__mark {
  width: 26px;
  height: 26px;
  flex: none;
  filter: drop-shadow(0 3px 10px rgba(242, 163, 60, 0.35));
  transition: transform 0.6s var(--ease);
}
.brand:hover .brand__mark {
  transform: rotate(90deg) scale(1.06);
}
.brand__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.brand__en {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.26em;
  color: var(--text-3);
  padding-top: 1px;
  white-space: nowrap;
}
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.nav__link {
  position: relative;
  padding: 8px 14px;
  font-size: 13.5px;
  color: var(--text-2);
  border-radius: 999px;
  transition: color 0.35s var(--ease), background 0.35s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.5s var(--ease);
}
.nav__link:hover,
.nav__link.is-active {
  color: var(--text);
}
.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scaleX(1);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-2);
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease),
    background 0.35s var(--ease), transform 0.4s var(--ease);
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}
.icon-btn:hover {
  color: var(--amber-2);
  border-color: rgba(242, 163, 60, 0.4);
  background: rgba(242, 163, 60, 0.06);
  transform: translateY(-1px);
}
.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
  z-index: 101;
}
.menu-btn span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.45s var(--ease), opacity 0.3s var(--ease);
}
.menu-btn span:first-child {
  transform: translate(-50%, -4px);
}
.menu-btn span:last-child {
  transform: translate(-50%, 3.5px);
}
body.menu-open .menu-btn span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}
body.menu-open .menu-btn span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 9, 8, 0.96);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s var(--ease), visibility 0.45s;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 32px) var(--gutter) 40px;
}
body.menu-open .mobile-menu {
  opacity: 1;
  visibility: visible;
}
.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 3vh;
}
.mobile-menu__link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8vw, 2.7rem);
  font-weight: 600;
  color: var(--text);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
body.menu-open .mobile-menu__link {
  opacity: 1;
  transform: none;
}
.mobile-menu__link span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-3);
}
.mobile-menu__link:nth-child(1) {
  transition-delay: 0.06s;
}
.mobile-menu__link:nth-child(2) {
  transition-delay: 0.12s;
}
.mobile-menu__link:nth-child(3) {
  transition-delay: 0.18s;
}
.mobile-menu__link:nth-child(4) {
  transition-delay: 0.24s;
}
.mobile-menu__foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--text-3);
}

/* ---------- reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.95s var(--ease), transform 0.95s var(--ease);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
[data-reveal="fade"] {
  transform: none;
}
[data-reveal="left"] {
  transform: translateX(-26px);
}
[data-reveal="right"] {
  transform: translateX(26px);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 246, 230, 0.012), transparent 40%),
    var(--bg-soft);
  padding-top: clamp(48px, 6vw, 80px);
  overflow: hidden;
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
}
.footer__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
}
.footer__brand strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.footer__brand span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--text-3);
}
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
}
.footer__nav a {
  font-size: 13px;
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}
.footer__nav a:hover {
  color: var(--amber-2);
}
.footer__wordmark {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: clamp(3.4rem, 15.5vw, 15rem);
  line-height: 0.82;
  letter-spacing: -0.045em;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 246, 230, 0.1);
  user-select: none;
  padding-block: 18px 8px;
  white-space: nowrap;
}
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-block: 22px 26px;
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}
.footer__bottom a {
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}
.footer__bottom a:hover {
  color: var(--amber-2);
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(7, 6, 5, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
  padding: 22px clamp(16px, 4vw, 54px);
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-2);
}
.lightbox__count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-3);
}
.lightbox__close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  transition: border-color 0.3s, background 0.3s;
}
.lightbox__close:hover {
  border-color: var(--amber);
  background: rgba(242, 163, 60, 0.1);
}
.lightbox__close svg {
  width: 18px;
  height: 18px;
}
.lightbox__stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 18px 0;
}
.lightbox__img {
  max-width: min(1100px, 100%);
  max-height: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 120px -40px #000;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.45s var(--ease), transform 0.55s var(--ease);
}
.lightbox__img.is-ready {
  opacity: 1;
  transform: none;
}
.lightbox__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  min-height: 68px;
}
.lightbox__caption {
  font-size: 13px;
  color: var(--text-2);
}
.lightbox__nav {
  display: flex;
  gap: 8px;
}
.lightbox__nav button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  transition: border-color 0.3s, background 0.3s;
}
.lightbox__nav button:hover {
  border-color: var(--amber);
  background: rgba(242, 163, 60, 0.1);
}
.lightbox__nav svg {
  width: 16px;
  height: 16px;
}

/* ---------- page intro curtain ---------- */
.page-veil {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

/* ---------- responsive shell ---------- */
@media (max-width: 900px) {
  .nav {
    display: none;
  }
  .menu-btn {
    display: block;
  }
  .brand__en {
    display: none;
  }
  .site-header {
    height: 66px;
  }
  .site-header.is-scrolled {
    height: 58px;
  }
}
@media (max-width: 520px) {
  :root {
    --header-h: 62px;
  }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .footer__wordmark {
    padding-block: 10px 4px;
  }
}
