/* ============================================
   Thyco — 科技｜艺术 · Think Different
   极简 · 单色 · 排版驱动
   ============================================ */

@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: "Sense Font";
  src: url("../assets/fonts/SenseFont-Regular.ttf") format("truetype");
  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;
  /* 正文用字在首屏之下，用 swap 让系统字先渲染、到位后替换，避免 3s 隐形 */
  font-display: swap;
}

:root {
  --bg: #0b0b0b;
  --ink: #f2f0ec;
  --muted: rgba(242, 240, 236, 0.5);
  --faint: rgba(242, 240, 236, 0.28);
  --line: rgba(242, 240, 236, 0.12);

  --font: "Source Han Sans CN", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --font-brand: "Ms Madi", cursive;
  --font-display: "Sense Font", "Source Han Sans CN", sans-serif;

  --nav-h: 56px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1080px;
  --section-maxw: 1280px;
  --section-label-w: 180px;
  --section-gap: 48px;
  --sheet-bar-w: min(56vw, 280px);
  --sheet-bar-h: 40px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

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

.fonts-pending .logo,
.fonts-pending .hero-tagline-wrap,
.fonts-pending .brand {
  opacity: 0;
}

.fonts-ready .logo,
.fonts-ready .hero-tagline-wrap,
.fonts-ready .brand,
html:not(.fonts-pending) .logo,
html:not(.fonts-pending) .hero-tagline-wrap,
html:not(.fonts-pending) .brand {
  opacity: 1;
  transition: opacity 0.25s var(--ease);
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

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

/* ---------- Custom cursor（参考 Moonshot：圆环 + 中心点） ---------- */
.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;
  }
}

/* ---------- Reveal（唯一动效：轻微淡入） ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .cursor,
  .cursor-dot { display: none !important; }
}

/* ---------- Nav ---------- */
.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: var(--line);
}

.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));
}

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

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

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  transition: color 0.3s var(--ease);
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-work-menu {
  position: relative;
}

.nav-work-menu::before {
  content: "";
  position: absolute;
  top: 100%;
  right: -8px;
  left: -8px;
  height: 4px;
}

.nav-work-trigger::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.25s var(--ease);
}

.nav-work-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  display: grid;
  gap: 2px;
  width: max-content;
  padding: 6px;
  border: 1px solid rgba(242, 240, 236, 0.14);
  border-radius: 8px;background: rgba(11, 11, 11, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -5px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.nav-work-dropdown a {
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.nav-work-dropdown a:hover,
.nav-work-dropdown a:focus-visible {
  color: var(--ink);
}

.nav-work-menu:hover .nav-work-dropdown,
.nav-work-menu:focus-within .nav-work-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.nav-work-menu:hover .nav-work-trigger::after,
.nav-work-menu:focus-within .nav-work-trigger::after {
  transform: translateY(1px) rotate(225deg);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  z-index: 110;
}

.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 23px; }

.nav-toggle.open span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

/* ---------- Hero（固定不动，下方页面上滑覆盖） ---------- */
.hero {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

body.hero-covered .hero {
  visibility: hidden;
}

/* ---------- Sheet：「凸」字形拉条 + 下方页面，上滑覆盖首页 ---------- */
.sheet {
  position: relative;
  z-index: 2;
  margin-top: calc(100vh - var(--sheet-bar-h));
  margin-top: calc(100svh - var(--sheet-bar-h));
  background: transparent;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  filter: drop-shadow(0 -8px 22px rgba(0, 0, 0, 0.22));
}

.sheet-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--sheet-bar-w);
  height: var(--sheet-bar-h);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 14px 14px 0 0;background: rgba(11, 11, 11, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.sheet-bar-arrow {
  width: 20px;
  height: 20px;
  color: var(--faint);
  pointer-events: none;
}

/* 向下多铺一层同色，盖住与内容页的接缝 */
.sheet-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  height: 4px;
  background: rgba(11, 11, 11, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: none;
}

.sheet-bar:active {
  cursor: grabbing;
}

.sheet-bar:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 4px;
}

.sheet-body {
  position: relative;
  z-index: 1;
  margin-top: -1px;
  background: var(--bg);
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
}

/* 「凸」字两肩分割线 */
.sheet-body::before,
.sheet-body::after {
  content: "";
  position: absolute;
  top: 0;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}

.sheet-body::before {
  left: 0;
  width: calc(50% - var(--sheet-bar-w) / 2);
}

.sheet-body::after {
  right: 0;
  width: calc(50% - var(--sheet-bar-w) / 2);
}

.hero-tagline-wrap {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: min(116vw, 634px);
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.hero-tagline {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-tagline text {
  fill: rgba(242, 240, 236, 0.42);
  font-family: var(--font-display);
  font-size: 58px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Watch ---------- */
.watch {
  position: relative;
  z-index: 1;
  width: min(62vw, 340px);
  aspect-ratio: 1 / 1;
}

.watch-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter:
    drop-shadow(0 18px 38px rgba(0, 0, 0, 0.2))
    drop-shadow(0 2px 8px rgba(242, 240, 236, 0.04));
}

.watch-tick {
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.watch-tick--minute {
  stroke: #d7d0c5;
  stroke-width: 0.38;
  opacity: 0.82;
}

.watch-tick--hour {
  stroke: #4b4740;
  stroke-width: 0.82;
  opacity: 0.86;
}

.watch-tick--cardinal {
  stroke-width: 1.15;
  opacity: 0.92;
}

.dial-brand {
  font-family: var(--font-brand);
  font-size: 29px;
  font-weight: 400;
  letter-spacing: 0.02em;
  fill: #36332e;
}

.dial-sub {
  font-family: var(--font);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.28em;
  fill: #9a9588;
}

.dial-swiss {
  font-family: var(--font);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.26em;
  fill: #9d968b;
}

/* ---------- Blocks（关于 / 作品） ---------- */
#about .container,
#work .container {
  max-width: var(--section-maxw);
}

.block {
  padding: 140px 0;
}

#about.block {
  padding: 80px 0;
}

#work.block {
  padding: 80px 0;
}

.block-line {
  border-top: 1px solid var(--line);
}

.block-grid {
  display: grid;
  grid-template-columns: var(--section-label-w) 1fr;
  gap: var(--section-gap);
  align-items: start;
}

.block-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--faint);
  padding-top: 8px;
  text-align: center;
}

#about .block-grid {
  grid-template-columns: 1fr;
  gap: 32px;
}

#about .block-body {
  margin: 0 auto;
  max-width: 660px;
}

.block-body p {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 20px;
}

.block-body p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: 28px !important;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink) !important;
  letter-spacing: 0;
  margin-bottom: 32px !important;
}

/* ---------- Work cards ---------- */
#work {
  position: relative;
  overflow: hidden;
}

.work-space {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-space-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.work-space-vanish {
  position: relative;
  width: min(100%, var(--section-maxw));
  max-width: calc(100% - 64px);
  height: clamp(88px, 12vw, 156px);
  margin: 0 auto;
  pointer-events: none;
}

.work-space-vanish--top {
  margin-bottom: 12px;
}

.work-space-vanish--bottom {
  margin-top: 12px;
}

.work-space-vanish--top .work-space-svg {
  transform: scaleY(-1);
}

.work-space-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.work-space .container {
  position: relative;
  z-index: 1;
}

.work-layout {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: min(100%, var(--section-maxw));
  max-width: calc(100% - 64px);
  padding-left: 0;
  padding-right: 0;
}

#work .block-label {
  padding-top: 0;
  text-align: center;
}

.work-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  aspect-ratio: 3 / 2;
  padding: 30px 34px 32px;
  border: 1px solid var(--line);
  border-radius: 4px;background: rgba(242, 240, 236, 0.018);
  overflow: hidden;
}

.work-card.reveal {
  transition:
    opacity 0.9s var(--ease) var(--reveal-delay, 0s),
    transform 0.9s var(--ease) var(--reveal-delay, 0s),
    border-color 0.5s var(--ease),
    background-color 0.5s var(--ease);
}

.work-card:hover {
  border-color: rgba(242, 240, 236, 0.2);
  box-shadow: 0 0 0 1px rgba(242, 240, 236, 0.06);
}

.work-card--photo {
  padding: 0;
  background: var(--bg);
}

.work-card--photo:hover {
  background-color: var(--bg);
  border-color: rgba(242, 240, 236, 0.22);
}

.work-card-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
}

.work-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(11, 11, 11, 0.78) 0%,
    rgba(11, 11, 11, 0.28) 46%,
    rgba(11, 11, 11, 0.04) 100%
  );
}

.work-card-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding: 30px 34px 32px;
}

.work-card--photo .work-card-title {
  margin-top: 0;
}

.work-card--photo .work-card-desc {
  color: rgba(242, 240, 236, 0.72);
}

.work-card-title {
  margin: 0;
  margin-top: auto;
  padding-top: 0;
  font-size: 23px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: var(--ink);
}

.work-card-desc {
  margin: 0;
  max-width: 20em;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- 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 var(--ease);
}

.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;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .container { padding: 0 24px; }

  .nav-inner {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }

  .block { padding: 96px 0; }

  #about.block {
    padding: 56px 0;
  }

  #work.block {
    padding: 56px 0;
  }

  #about .container,
  #work .container {
    max-width: none;
  }

  .block-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .block-label {
    padding-top: 0;
  }

  .block-body {
    max-width: none;
  }

  .work-layout {
    gap: 24px;
    max-width: calc(100% - 48px);
  }

  .work-space-vanish {
    max-width: calc(100% - 48px);
    height: clamp(64px, 18vw, 108px);
  }

  .work-space {
    gap: 4px;
  }

  .work-space-vanish--top {
    margin-bottom: 8px;
  }

  .work-space-vanish--bottom {
    margin-top: 8px;
  }

  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 105;
    width: 100vw;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s;
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
  }

  .nav-links a { font-size: 24px; }

  .nav-work-menu {
    display: contents;
  }

  .nav-work-menu::before {
    display: none;
  }

  .nav-work-trigger::after {
    display: none;
  }

  .nav-work-dropdown {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav-work-menu:hover .nav-work-dropdown,
  .nav-work-menu:focus-within .nav-work-dropdown {
    transform: none;
  }

  .nav-work-dropdown a {
    min-height: auto;
    padding: 0;
    font-size: 17px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .work-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .work-card {
    padding: 24px 26px 26px;
  }

  .work-card--photo {
    padding: 0;
  }

  .work-card-copy {
    padding: 24px 26px 26px;
  }

  .lead {
    font-size: 20px !important;
  }

  #about .block-body p {
    font-size: 13px;
    line-height: 1.7;
  }

  .work-card-title {
    font-size: 21px;
  }

  .footer {
    padding: 28px 20px 32px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  :root {
    --sheet-bar-w: min(64vw, 220px);
    --sheet-bar-h: 36px;
  }
}
