/* ============================================================
   第二页：复刻 romaingranai.xyz 的 ONE 大字屏
   · 两侧留白（文字约占 64% 宽）
   · 5 条裁切带 + 大字
   · 两个居中小胶囊开关（悬停时中间“嘴巴”连接）
   · 切换用 .5s 贝塞尔 + 分带延迟
   · 滚动时平滑变形
   ============================================================ */

.mm-ref {
  --ty: 0px;
  --ty-center: 0px;
  --ty-mid: 0px;
  --ty-outer: 0px;
  --bg: #000000;
  --fg: #ffffff;
  position: relative;
  height: 150vh;
  background: var(--bg);
  color: var(--fg);
  transition: background .7s cubic-bezier(.5, .5, 0, 1), color .7s cubic-bezier(.5, .5, 0, 1);
}
.mm-ref.color-mode-dark { --bg: #000; --fg: #fff; }
.mm-ref.color-mode-light { --bg: #fff; --fg: #000; }

.mm-ref__screen {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mm-ref__strip { overflow: hidden; }
.mm-ref__strip--top-top { flex: 0 0 8.3333333333%; }
.mm-ref__strip--top-center { flex: 0 0 16.6666666667%; }
.mm-ref__strip--center { flex: 1 0 50%; }
.mm-ref__strip--bottom-center { flex: 0 0 16.6666666667%; }
.mm-ref__strip--bottom-bottom { flex: 0 0 8.3333333333%; }

.mm-ref__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 4rem;
  transform-origin: top center;
  backface-visibility: hidden;
  will-change: transform;
}
.mm-ref__strip--top-top .mm-ref__content { margin-top: -58.3vh; transform: translate3d(0, var(--ty-outer), 0) scaleY(4); }
.mm-ref__strip--top-center .mm-ref__content { margin-top: -33.33vh; transform: translate3d(0, var(--ty-mid), 0) scaleY(2); }
.mm-ref__strip--center .mm-ref__content { margin-top: -25vh; transform: translate3d(0, var(--ty-center), 0) scaleY(1); }
.mm-ref__strip--bottom-center .mm-ref__content { margin-top: -149.8vh; transform: translate3d(0, var(--ty-mid), 0) scaleY(2); }
.mm-ref__strip--bottom-bottom .mm-ref__content { margin-top: -333vh; transform: translate3d(0, var(--ty-outer), 0) scaleY(4); }

/* 拉伸开关：参考站 --opposit */
.mm-ref.is-opposit .mm-ref__strip--top-top .mm-ref__content { margin-top: -27.1vh; transform: translate3d(0, var(--ty-outer), 0) scaleY(1); }
.mm-ref.is-opposit .mm-ref__strip--top-center .mm-ref__content { margin-top: -70.8vh; transform: translate3d(0, var(--ty-mid), 0) scaleY(2); }
.mm-ref.is-opposit .mm-ref__strip--center .mm-ref__content { margin-top: -175vh; transform: translate3d(0, var(--ty-center), 0) scaleY(4); }
.mm-ref.is-opposit .mm-ref__strip--bottom-center .mm-ref__content { margin-top: -112.425vh; transform: translate3d(0, var(--ty-mid), 0) scaleY(2); }
.mm-ref.is-opposit .mm-ref__strip--bottom-bottom .mm-ref__content { margin-top: -64.5vh; transform: translate3d(0, var(--ty-outer), 0) scaleY(1); }

/* 丝滑过渡（参考站 .5s 贝塞尔 + 分带延迟） */
.mm-ref__content.transition { transition: all .5s cubic-bezier(.83, 0, .17, 1); }
.mm-ref__strip--top-center .mm-ref__content.transition,
.mm-ref__strip--bottom-center .mm-ref__content.transition { transition-delay: .1s; }
.mm-ref__strip--top-top .mm-ref__content.transition,
.mm-ref__strip--bottom-bottom .mm-ref__content.transition { transition-delay: .2s; }
.mm-ref.is-opposit .mm-ref__strip--top-top .mm-ref__content.transition,
.mm-ref.is-opposit .mm-ref__strip--bottom-bottom .mm-ref__content.transition { transition-delay: 0s; }
.mm-ref.is-opposit .mm-ref__strip--top-center .mm-ref__content.transition,
.mm-ref.is-opposit .mm-ref__strip--bottom-center .mm-ref__content.transition { transition-delay: .1s; }
.mm-ref.is-opposit .mm-ref__strip--center .mm-ref__content.transition { transition-delay: .2s; }

/* 大字：按参考站“文字约占 64% 宽”的比例缩放，保证两侧留白 */
.mm-big-letter {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100svh;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: calc(100vw / 5.74);
  line-height: .8;
  font-weight: 400;
  letter-spacing: -.05em;
  white-space: nowrap;
  user-select: none;
}

/* 顶部 UI：开关居中 + Explore 靠右 */
.mm-ref__ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  z-index: 130;
}
.mm-ref__switches {
  position: absolute;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
/* 悬停时中间出现“嘴巴”，把两个开关连起来 */
.mm-ref__switches::before {
  content: "";
  position: absolute;
  width: 1em;
  height: 4em;
  left: calc(50% - .5em - 1px);
  top: -4px;
  border-radius: 50px;
  border: 1px solid currentColor;
  background-color: transparent;
  clip-path: polygon(0 20%, 110% 20%, 110% 110%, 0% 110%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 10;
  transition: opacity .2s ease-in-out, visibility .2s ease-in-out;
}
.mm-ref__switches:hover::before { opacity: 1; visibility: visible; }

.mm-switch {
  position: relative;
  display: block;
  height: 11px;
  aspect-ratio: 2 / 1;
  border-radius: 20px;
  border: 1px solid currentColor;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.mm-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  height: calc(100% - 4px);
  aspect-ratio: 1;
  background: currentColor;
  border-radius: 50%;
  transition: transform .3s cubic-bezier(.68, -.55, .27, 1.55), background-color .3s ease-in-out;
}
.mm-switch.is-switched::after { transform: translate3d(160%, 0, 0); }

.mm-one__explore {
  position: absolute;
  right: 40px;
  top: 72px;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 12.5px;
  letter-spacing: .03em;
  cursor: pointer;
  transition: background .35s ease, color .35s ease, transform .35s ease;
}
.mm-one__explore svg { width: 11px; height: 11px; transition: transform .35s ease; }
.mm-one__explore:hover { transform: translateY(-2px); }
.mm-one__explore:hover svg { transform: translate(2px, -2px); }
.mm-ref.color-mode-dark .mm-one__explore:hover { background: #fff; color: #000; }
.mm-ref.color-mode-light .mm-one__explore:hover { background: #000; color: #fff; }

/* 固定导航在深色屏下适配 */
body.mm-one-active.mm-one-dark .nav { background: rgba(10, 10, 10, .82); backdrop-filter: blur(14px); }
body.mm-one-active.mm-one-dark .nav .logo-text,
body.mm-one-active.mm-one-dark .nav .tag,
body.mm-one-active.mm-one-dark .nav .nav-btn,
body.mm-one-active.mm-one-dark .nav .nav-btn .p1,
body.mm-one-active.mm-one-dark .nav .icon-btn,
body.mm-one-active.mm-one-dark .nav .icon-btn svg,
body.mm-one-active.mm-one-dark .nav .ai-chat__button-text { color: #f5f5f5; }
body.mm-one-active.mm-one-dark .nav .ai-chat__button { background: #f5f5f5; }
body.mm-one-active.mm-one-dark .nav .ai-chat__button .sidenav__button-label { color: #111; }

/* 进入 WORK 时：主内容虚化/去色 */
.main { transition: filter .6s ease, transform .6s ease; }
body.mm-exploring .main { filter: blur(16px) grayscale(1) brightness(.55); transform: scale(1.03); }
body.mm-exploring .nav { opacity: 0; pointer-events: none; transition: opacity .4s ease; }

/* WORK 过渡页：彩色 3D 笔记本 + 点阵换色背景 */
.mm-work {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: radial-gradient(circle at 50% 28%, rgba(18, 28, 78, .92), rgba(5, 5, 9, .97) 70%);
  backdrop-filter: blur(22px) saturate(1.25);
  color: #f5f5f5;
  display: flex;
  flex-direction: column;
  padding: 32px 40px 48px;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s ease, visibility .6s ease;
}
.mm-work.is-open { opacity: 1; visibility: visible; }
.mm-work__halftone {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at center, rgba(70, 130, 255, .6) 1px, transparent 1.2px);
  background-size: 3px 3px;
  opacity: 0;
  transition: opacity .9s ease;
  mix-blend-mode: screen;
}
.mm-work.is-open .mm-work__halftone { opacity: .5; }
.mm-work__head { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4vh; }
.mm-work__label { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; opacity: .6; }
.mm-work__close { background: none; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; color: #f5f5f5; padding: 9px 18px; font-size: 13px; cursor: pointer; transition: background .3s, color .3s, border-color .3s; }
.mm-work__close:hover { background: #fff; color: #000; border-color: #fff; }
.mm-work__grid {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  width: 100%;
  max-width: 1160px;
  margin: auto;
  perspective: 1600px;
}
.mm-laptop {
  display: block;
  text-decoration: none;
  color: #fff;
  transform-style: preserve-3d;
  opacity: 0;
  transform: translateY(40px) rotateX(12deg) scale(.96);
  transition: transform .5s cubic-bezier(.5, .5, 0, 1);
}
.mm-work.is-open .mm-laptop { animation: mmLaptopIn .8s cubic-bezier(.22, 1, .36, 1) forwards; }
.mm-work.is-open .mm-laptop:nth-child(2) { animation-delay: .1s; }
.mm-work.is-open .mm-laptop:nth-child(3) { animation-delay: .2s; }
@keyframes mmLaptopIn { to { opacity: 1; transform: translateY(0) rotateX(0) scale(1); } }
.mm-laptop:hover { transform: translateY(-10px) scale(1.03); }
.mm-laptop__lid {
  position: relative;
  padding: 10px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  transform: rotateX(-6deg);
  transform-origin: bottom;
  transition: transform .5s cubic-bezier(.5, .5, 0, 1);
  box-shadow: 0 40px 70px -34px rgba(0, 0, 0, .8);
}
.mm-laptop:hover .mm-laptop__lid { transform: rotateX(-1deg); }
.mm-laptop__display {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  background: linear-gradient(160deg, #101018, #06060a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
}
.mm-laptop__display::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.14), transparent 62%); }
.mm-laptop__name { position: relative; font-family: 'Inter', Arial, sans-serif; font-size: clamp(20px, 2.2vw, 30px); font-weight: 700; letter-spacing: -.02em; }
.mm-laptop__desc { position: relative; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .55; }
.mm-laptop__base {
  position: relative;
  height: 13px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  transform: rotateX(58deg);
  transform-origin: top;
  box-shadow: 0 24px 46px -24px rgba(0, 0, 0, .7);
}
.mm-laptop__base::after { content: ""; position: absolute; left: 50%; top: 0; width: 16%; height: 5px; transform: translateX(-50%); background: rgba(0, 0, 0, .3); border-radius: 0 0 6px 6px; }

@media (max-width: 900px) {
  .mm-work__grid { grid-template-columns: 1fr; gap: 36px; max-width: 460px; }
  .mm-work { padding: 24px 22px 40px; }
}
@media (max-width: 768px) {
  .mm-ref__switches { top: 54px; }
  .mm-one__explore { top: 62px; right: 20px; font-size: 11px; padding: 9px 14px; }
}

/* ==== WORK: 3D 笔记本（复用参考站设备结构） ==== */
.mm-work__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  width: 100%;
  max-width: 1150px;
  margin: auto;
  align-items: center;
}
.mm-work .mm-project {
  --scale: 1;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  container-type: inline-size;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1 !important;
}
.mm-project .device { --scale: .82; }
.mm-project__label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  text-align: center;
  z-index: 5;
  pointer-events: none;
  color: #f5f5f5;
}
.mm-project__label b { display: block; font-family: 'Inter', Arial, sans-serif; font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.mm-project__label span { display: block; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; opacity: .5; margin-top: 4px; }

/* 彩色屏幕（三台不同色） */
.mm-device--1 .device--laptop--screen--front { background: linear-gradient(135deg, #ff6b6b 0%, #ff9f43 45%, #ffd93d 100%); box-shadow: inset 0 0 18cqw rgba(255,255,255,.18); }
.mm-device--2 .device--laptop--screen--front { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 55%, #43e97b 100%); box-shadow: inset 0 0 18cqw rgba(255,255,255,.18); }
.mm-device--3 .device--laptop--screen--front { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 55%, #ffecd2 100%); box-shadow: inset 0 0 18cqw rgba(255,255,255,.2); }
.mm-project:hover .device--laptop--screen--front { filter: brightness(1.08) saturate(1.12); }

@media (max-width: 900px) {
  .mm-work__grid { grid-template-columns: 1fr; gap: 24px; max-width: 360px; }
}

/* ==== WORK 场景重做：浅紫背景 + 模糊蓝字 + 散落白色笔记本 ==== */
.mm-work { background: #c5c9f0; color: #111; overflow: hidden; }
.mm-work__ghost {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', Arial, sans-serif; font-size: 18vw; font-weight: 700; letter-spacing: -.06em;
  color: #2b2bd8; filter: blur(5px); opacity: .85; pointer-events: none; z-index: 0; white-space: nowrap;
  user-select: none;
}
.mm-work__head { position: relative; z-index: 7; }
.mm-work__label { color: #1b2ed0; }
.mm-work__close { color: #1b2ed0; border-color: rgba(27,46,208,.4); }
.mm-work__close:hover { background: #1b2ed0; color: #fff; border-color: #1b2ed0; }
.mm-work__info {
  position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%);
  text-align: center; font-size: clamp(18px, 2.1vw, 30px); letter-spacing: .06em;
  color: #1b2ed0; z-index: 5; pointer-events: none; padding: 0 6vw;
  font-family: 'ZCOOL QingKe HuangYou', 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  font-weight: 700;
  text-shadow: 0 0 22px rgba(255,255,255,.95), 0 2px 8px rgba(255,255,255,.9);
}

.mm-work .mm-project {
  position: absolute !important;
  aspect-ratio: 1 / 1;
  container-type: inline-size;
  display: flex; align-items: center; justify-content: center;
  opacity: 1 !important;
}
.mm-work .mm-project--1 { width: 50vw; right: 2vw; top: 18vh; transform: rotate(-8deg); z-index: 4; }
.mm-work .mm-project--2 { width: 34vw; left: 0; top: 30vh; transform: rotate(11deg); z-index: 3; }
.mm-work .mm-project--3 { width: 24vw; left: 36vw; top: 3vh; transform: rotate(-15deg); z-index: 2; opacity: .92 !important; }
.mm-work .mm-project .device { --scale: .82; }

/* 去掉 toy 屏幕的蓝色网点，保留彩色 */
.mm-work .device--laptop--screen--front::before { display: none !important; }
.mm-device--1 .device--laptop--screen--front { background: #111 url(assets/screens/p1.jpg) center / cover no-repeat !important; }
.mm-device--2 .device--laptop--screen--front { background: #111 url(assets/screens/p2.jpg) center / cover no-repeat !important; }
.mm-device--3 .device--laptop--screen--front { background: #111 url(assets/screens/p3.jpg) center / cover no-repeat !important; }

/* 悬停：翻开并转到正面（复刻参考站） */
.mm-work .mm-project .device,
.mm-work .mm-project .device--laptop--screen,
.mm-work .mm-project .device--laptop--keyboard {
  transition: transform .55s cubic-bezier(.5, .5, 0, 1);
}
.mm-work .mm-project:hover .device {
  --rotate-y: 0deg !important;
  --rotate-x: 30deg !important;
  --scale: 1 !important;
  animation-play-state: paused;
}
.mm-work .mm-project:hover .device--laptop {
  --screen-rotation-x: -40deg !important;
  --keyboard-rotation-x: 30deg !important;
}

/* 漂浮小卡片 */
.mm-card {
  position: absolute; margin: 0; background: #fff; padding: 1.1vw; border-radius: 8px;
  box-shadow: 0 20px 50px -22px rgba(20,30,120,.55); z-index: 1; overflow: hidden;
}
.mm-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; display: block; }
.mm-card--a { width: 9vw; aspect-ratio: 3/4; top: 5vh; left: 6vw; transform: rotate(-7deg); }
.mm-card--b { width: 7vw; aspect-ratio: 1/1; top: 4vh; left: 58vw; transform: rotate(9deg); border-radius: 50%; }
.mm-card--c { width: 10vw; aspect-ratio: 4/3; top: 63vh; left: 27vw; transform: rotate(6deg); }

@media (max-width: 900px) {
  .mm-work__ghost { font-size: 60vw; }
  .mm-work .mm-project--1 { width: 78vw; right: -6vw; top: 26vh; }
  .mm-work .mm-project--2 { width: 58vw; left: -10vw; top: 40vh; }
  .mm-work .mm-project--3 { width: 44vw; left: 40vw; top: 10vh; }
  .mm-card--a { width: 18vw; left: 8vw; top: 8vh; }
  .mm-card--b { width: 14vw; left: 66vw; top: 6vh; }
  .mm-card--c { width: 20vw; left: 20vw; top: 74vh; }
  .mm-work__info { top: 66%; font-size: 14px; }
}
