/* 页面基础设置 */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Lato', serif;
  font-weight: 300;
  height: 100%;

  font-size: 5vh;
  z-index: 999;
  transition: opacity 1s ease;
}

.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgb(246, 246, 246);
  /* ✅ 你也可以用 rgba(255,255,255,1) */
  z-index: 11000;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s ease;
  /* ✅ 防止遮罩干扰点击 */
}
/* 开场 intro 容器 */
.intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
    /* ✅ 左对齐 */
  justify-content: flex-end;
  height: 100vh;
  /* 层级：遮罩 11000 < 轨道动画 11001 < 开场文字 11002 */
  z-index: 11002;
  padding-left: 5vw;
  padding-bottom: 5vh;
  position: relative;
  transition: opacity 0.6s ease;
}

/* 淡入动画类 */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.5s forwards;
}

.delay-0 { animation-delay: 0s; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

@keyframes fadeIn {
  to { opacity: 1; }
}

/* 字体样式 */
.name {
  position: relative;
  font-family: 'Lato', sans-serif;
  font-size: 20vh;
  font-weight: 100;
  color: black;
  margin-bottom: 0px;
  margin-left: 0vw;
  /* 背景色衬影，压在轨道线上时把字衬出来（与左下角项目名一致） */
  text-shadow: 0.012em 0.012em 0 #fff;
}

/* 开场轨道动画（intro-orbit.js） */
#intro-orbit {
  position: fixed !important;
  top: 0;
  left: 0;
  z-index: 11001;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#intro-orbit.visible {
  opacity: 1;
}

/* 分类目录阶段：在目录文字和预览图（z-index 5000）之下 */
#intro-orbit.layer-index {
  z-index: 4990;
}

/* 分类滚动界面：在图片画布（z-index 1）之下，并减淡，避免和图片、文字抢注意力 */
#intro-orbit.layer-category {
  z-index: 0;
}

#intro-orbit.layer-category.visible {
  opacity: 0.55;
}

/* 左上角的继续提示：开场即淡入，缓慢闪烁（与主页面 › Extra Links 同一位置） */
#intro-continue {
  position: fixed;
  top: 5vh;
  left: calc(5vw - 1ch);
  z-index: 11003;
  font-family: 'Cormorant Garamond', serif;
  font-size: 3vh;
  color: black;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
}

#intro-continue.visible {
  /* 先用 1s 淡入，再以 2s 为周期呼吸 */
  animation:
    introFadeIn 1s ease 0.6s forwards,
    introBlink 2s ease-in-out 1.6s infinite;
}

/* ===== 竖屏提示：全白覆盖在所有内容之上，点击关闭 ===== */
#portrait-notice {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #fff;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 6vw;
  font-family: 'Cormorant Garamond', serif;
  color: black;
  cursor: pointer;
  user-select: none;
}

#portrait-notice.show {
  display: flex;
}

#portrait-notice .pn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4vw;
}

#portrait-notice .pn-title {
  font-style: italic;
  font-size: 9vw;
  line-height: 1.15;
}

/* 标题两侧的圆弧箭头：细线与字体笔画一致，左侧指顺时针、右侧指逆时针（静止） */
#portrait-notice .pn-rot {
  width: 10vw;
  height: 10vw;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#portrait-notice .pn-sub {
  margin-top: 2vh;
  font-size: 4.2vw;
  color: #555;
}

#portrait-notice .pn-tap {
  margin-top: 6vh;
  font-size: 4.2vw;
  animation: introBlink 2s ease-in-out infinite;
}

#portrait-notice .accent {
  color: #8b1e1e;
}

/* 只有 Click 一词用暗红色（与轨道里的特殊球同色） */
#intro-continue .accent {
  color: #8b1e1e;
}

@keyframes introFadeIn {
  to { opacity: 1; }
}

@keyframes introBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.name .first-letter {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 24vh;
}

.title {
  position: relative;
  font-weight: 100;
  top: -32vh;
  left: 0.5vw;
  font-size: 5vh;
  color: black;
  
}

/* 年份数字容器 */
.year-container {
  position: absolute;
  bottom: 38vh;
  
  right: calc(95vw - 18em);;
  display: flex;
  height: 5vh;
  overflow: hidden;
}

/* 单个数字盒子 */
.digit {
  position: relative;
  width: 3vh;
  height: 5vh;
  margin: 0 2px;
}

/* 数字动画基础层 */
.digit span {
  position: absolute;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.4s ease-in-out;
}

/* 默认下一位在下方 */
.digit .next {
  transform: translateY(100%);
}

/* 添加 flip 后触发动画 */
.digit.flip .current {
  transform: translateY(-100%);
}

.digit.flip .next {
  transform: translateY(0);
}

/* 主页面内容样式 */
.main-content {
  display: none;
  height: 100vh;
  justify-content: center;
  align-items: center;
  font-size: 5vh;
  color: black;
}

.fade-out {
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* 竖屏开场：字号按屏宽计算，This is / 年份改为普通排版放在名字上方 */
@media (max-aspect-ratio: 3/4) {
  .intro {
    box-sizing: border-box;
    padding-bottom: 14vh;
  }

  .name {
    font-size: 17vw;
  }

  .name .first-letter {
    font-size: 20vw;
  }

  .title {
    position: static;
    order: -2;
    font-size: 6vw;
  }

  .year-container {
    position: static;
    order: -1;
    margin: 1vh 0 2vh 0.5vw;
  }
}
