/* ============================================================
   Thyco 子页面共用样式
   gallery / projects / reviews 三页共享的基础样式
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Ms Madi";
  src: url("../assets/fonts/MsMadi-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Source Han Sans CN";
  src: url("../assets/fonts/SourceHanSansCN-Regular.woff2?v=20260730b") format("woff2");
  font-weight: 300 500;
  font-style: normal;
  font-display: block;
}

/* ---------- FOUT 防护 ---------- */
.fonts-pending .nav-logo,
.fonts-pending .nav-back,
.fonts-pending .hero,
.fonts-pending .footer {
  opacity: 0;
}

.fonts-ready .nav-logo,
.fonts-ready .nav-back,
.fonts-ready .hero,
.fonts-ready .footer,
html:not(.fonts-pending) .nav-logo,
html:not(.fonts-pending) .nav-back,
html:not(.fonts-pending) .hero,
html:not(.fonts-pending) .footer {
  opacity: 1;
  transition: opacity 0.25s var(--ease);
}

/* ---------- Reset & Base ---------- */
*,*::before,*::after{ margin:0; padding:0; box-sizing:border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color:inherit; text-decoration:none; }
button { font-family:inherit; color:inherit; cursor:pointer; background:none; border:none; }
::selection { background:var(--ink); color:var(--bg); }

a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 4px;
}

/* ---------- Nav（与首页 style.css 完全一致）---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(11, 11, 11, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: rgba(242, 240, 236, 0.12);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  max-width: none;
  margin: 0;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(32px, env(safe-area-inset-right));
}

.nav-logo {
  font-family: var(--font-brand);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
}

.nav-back {
  font-size: 13px;
  color: var(--muted);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  transition: color 0.3s;
}
.nav-back:hover { color: var(--ink); }

/* ---------- Custom Cursor ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 28px; height: 28px;
  margin-left: -14px; margin-top: -14px;
  border-radius: 50%;
  border: 1.5px solid rgba(242, 240, 236, 0.6);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  scale: 1;
  will-change: translate, opacity;
  transition:
    scale 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.35s ease,
    background-color 0.35s ease,
    opacity 0.3s ease;
}

.cursor.is-hover {
  scale: calc(36 / 28);
  border-color: rgba(242, 240, 236, 0.72);
  background-color: rgba(242, 240, 236, 0.04);
}

.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 5px; height: 5px;
  margin-left: -2.5px; margin-top: -2.5px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  will-change: translate, opacity;
  transition: opacity 0.3s ease;
}

@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-dot { display: none; }
}

/* ---------- Footer ---------- */
.footer {
  padding: 32px 36px 40px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1280px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.footer a { color: var(--muted); transition: color 0.3s; }
.footer a:hover { color: var(--ink); }

.footer .icp-record {
  flex: 0 0 100%;
  margin-top: 4px;
  text-align: center;
}

.footer .brand {
  font-family: var(--font-brand);
  font-weight: 400;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 100px 24px;
  font-size: 14px;
  color: var(--faint);
  grid-column: 1 / -1;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-inner {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }
  .nav-back { font-size: 12px; }

  .footer { padding: 28px 20px 32px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
