/* ============================================================
   优纳科技 UNA — styles.css
   1:1 手工移植自原 React + Tailwind + Framer Motion 站点。
   无任何外部依赖;所有字体/视频/图标均为本地文件。
   ============================================================ */

/* ---------- 全局基础 ---------- */
:root {
  --font-sans: "Space Mono", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", monospace;
  --font-serif: "Space Mono", monospace;
  --font-mono: "Space Mono", monospace;
}

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

html, body {
  background: #000;
  color: #fff;
  overflow: hidden;              /* 滚动容器为 #viewport */
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Space Mono", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", monospace;
  height: 100vh; height: 100dvh;
}

/* ---------- 整屏滚动视口(纯 CSS,零 JS 依赖) ---------- */
#viewport {
  position: fixed; inset: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;           /* 上滑/下滑自动悬停于整屏 */
  overscroll-behavior: contain;            /* 阻断滚动链,防止页面整体弹跳 */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
}
#viewport::-webkit-scrollbar { display: none; }

@media (prefers-reduced-motion: no-preference) {
  html.snap-ready #viewport {
    scroll-behavior: smooth;               /* 键盘/锚点导航的平滑补间 */
  }
}

::selection { background: rgba(255,255,255,.28); color: #fff; }

button { font: inherit; color: inherit; }

img, video { display: block; }

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

/* Lenis smooth-scroll utility classes (保留兼容) */
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overflow-y: auto; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

/* ---------- 通用布局 ---------- */
.section-hero { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; background: #000; scroll-snap-align: start; scroll-snap-stop: always; }
.section-full { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; background: #000; scroll-snap-align: start; scroll-snap-stop: always; }
.section-min  { position: relative; width: 100%; min-height: 100vh; overflow: hidden; background: #000; scroll-snap-align: start; }

.bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 50;
  height: 80px; background: transparent;
  opacity: 0; transition: opacity .8s ease;
}
.nav.entered { opacity: 1; }

.nav-desktop { display: none; align-items: center; justify-content: space-between; height: 100%; padding: 0 24px; }
@media (min-width: 640px) { .nav-desktop { display: flex; } }
@media (min-width: 768px) { .nav-desktop { padding: 0 32px; } }

.nav-left { display: flex; align-items: center; gap: 8px; }

.pill {
  display: flex; align-items: center;
  height: 48px; border-radius: 14px;
  background: rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 0; cursor: pointer;
}

.logo-pill {
  gap: 10px; padding: 0 20px;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), background-color .2s ease;
}
.logo-pill:hover { transform: scale(1.02); background: rgba(255,255,255,.22); }
.logo-pill:active { transform: scale(.98); }
.logo-pill .brand-img { width: 22px; height: 22px; object-fit: contain; }
.logo-pill .brand-name { font-size: 16px; font-weight: 500; letter-spacing: -.02em; color: #fff; white-space: nowrap; }

.menu-pill { overflow: hidden; width: 48px; }

.menu-toggle {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 14px;
  background: transparent; border: 0; cursor: pointer;
  transition: width .3s ease, height .3s ease, border-radius .3s ease,
              margin-left .3s ease, background-color .2s ease;
}
.menu-pill.open .menu-toggle {
  width: 36px; height: 36px; border-radius: 11px; margin-left: 6px;
  background: rgba(255,255,255,.10);
}
.menu-toggle:hover { background: rgba(255,255,255,.20); }

/* 汉堡 */
.hamburger { position: relative; width: 18px; height: 12px; }
.hamburger i {
  position: absolute; left: 0; display: block;
  width: 18px; height: 1.5px; background: #fff;
  transition: transform .5s cubic-bezier(.175,.685,.32,1.275), opacity .35s ease;
}
.hamburger i:nth-child(1) { top: 0; }
.hamburger i:nth-child(2) { top: 5.25px; }
.hamburger i:nth-child(3) { bottom: 0; }
.menu-pill.open .hamburger i:nth-child(1) { transform: translateY(5.25px) rotate(45deg); }
.menu-pill.open .hamburger i:nth-child(2) { opacity: 0; transform: scaleX(.3); }
.menu-pill.open .hamburger i:nth-child(3) { transform: translateY(-5.25px) rotate(-45deg); }

.nav-links {
  display: flex; align-items: center; gap: 24px; padding: 0 20px;
  white-space: nowrap; opacity: 0; transform: translateX(15px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.menu-pill.open .nav-links { opacity: 1; transform: translateX(0); pointer-events: auto; }

.nav-link {
  font-size: 16px; font-weight: 400; color: rgba(255,255,255,.85);
  background: transparent; border: 0; cursor: pointer; white-space: nowrap;
  transition: color .15s ease;
}
.nav-link:hover { color: #fff; }

.download-btn {
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 24px; border-radius: 9999px;
  background: #fff; color: #000; border: 0; cursor: pointer;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), background-color .2s ease;
}
.download-btn:hover { transform: scale(1.03); background: #e2e2e6; }
.download-btn:active { transform: scale(.97); }
.download-btn .bi { font-size: 17px; }
.download-btn .btn-label { font-size: 15px; font-weight: 500; }

/* 移动端导航 */
.nav-mobile { display: flex; align-items: center; justify-content: space-between; height: 100%; padding: 0 16px; gap: 8px; }
@media (min-width: 640px) { .nav-mobile { display: none; } }

.nav-m-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }

.logo-pill-m-wrap { overflow: hidden; transition: width .4s ease, opacity .3s ease; width: auto; }
.nav-m-left.menu-open .logo-pill-m-wrap { width: 0; opacity: 0; }
.logo-pill-m {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border-radius: 10px; background: rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 0; cursor: pointer; white-space: nowrap;
}
.logo-pill-m .brand-img { width: 16px; height: 16px; object-fit: contain; }
.logo-pill-m .brand-name { font-size: 13px; font-weight: 500; letter-spacing: -.02em; color: #fff; }

.menu-pill-m {
  display: flex; align-items: center; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  overflow: hidden; min-width: 0; width: 36px; flex-shrink: 0;
}
.nav-m-left.menu-open .menu-pill-m { flex: 1; width: 100%; }
.menu-toggle-m {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: transparent; border: 0; cursor: pointer;
}
.hamburger-m { position: relative; width: 15px; height: 10px; }
.hamburger-m i {
  position: absolute; left: 0; display: block;
  width: 15px; height: 1.2px; background: #fff;
  transition: transform .5s cubic-bezier(.175,.685,.32,1.275), opacity .35s ease;
}
.hamburger-m i:nth-child(1) { top: 0; }
.hamburger-m i:nth-child(2) { top: 4.4px; }
.hamburger-m i:nth-child(3) { bottom: 0; }
.nav-m-left.menu-open .hamburger-m i:nth-child(1) { transform: translateY(4.4px) rotate(45deg); }
.nav-m-left.menu-open .hamburger-m i:nth-child(2) { opacity: 0; transform: scaleX(.3); }
.nav-m-left.menu-open .hamburger-m i:nth-child(3) { transform: translateY(-4.4px) rotate(-45deg); }

.nav-links-m {
  display: flex; align-items: center; gap: 16px; padding: 0 8px 0 8px;
  white-space: nowrap; opacity: 0; transform: translateX(15px);
  transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
.nav-m-left.menu-open .nav-links-m { opacity: 1; transform: translateX(0); pointer-events: auto; }
.nav-link-m {
  font-size: 13px; font-weight: 400; color: rgba(255,255,255,.85);
  background: transparent; border: 0; cursor: pointer; white-space: nowrap;
}

.download-btn-m {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  height: 36px; padding: 0 14px; border-radius: 9999px;
  background: #fff; color: #000; border: 0; cursor: pointer;
}
.download-btn-m:active { transform: scale(.97); }
.download-btn-m .bi { font-size: 14px; }
.download-btn-m .btn-label { font-size: 13px; font-weight: 500; }

/* ---------- Hero ---------- */
.hero-content {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; height: 100%;
  padding: 80px 16px 32px;
  opacity: 0; transition: opacity 1s ease;
}
.hero-content.entered { opacity: 1; }
@media (min-width: 640px) { .hero-content { padding: 96px 24px 48px; } }
@media (min-width: 768px) { .hero-content { padding-left: 32px; padding-right: 32px; } }

.hero-spacer { flex: 1; }

.hero-bottom { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 768px) {
  .hero-bottom { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}

.hero-left { display: flex; flex-direction: column; gap: 16px; }

.hero-h1 {
  color: #fff; font-weight: 300; line-height: .95; letter-spacing: -.03em;
  font-size: clamp(40px, 10vw, 100px);
}
.hero-h1--right { text-align: left; }
@media (min-width: 768px) { .hero-h1--right { text-align: right; } }

.scramble-span { white-space: pre; }

.hero-desc {
  max-width: 24rem; font-size: 13px; color: rgba(255,255,255,.6); line-height: 1.7;
  transform: translateY(25px); opacity: 0;
  transition: transform .9s cubic-bezier(.215,.61,.355,1) .2s, opacity .9s cubic-bezier(.215,.61,.355,1) .2s;
}
@media (min-width: 640px) { .hero-desc { font-size: 15px; } }
.hero-content.entered .hero-desc { transform: translateY(0); opacity: 1; }

.dot-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background-image: radial-gradient(#ffffff 1px, transparent 1px);
  background-size: 24px 24px;
}

.watermark {
  position: absolute; left: 50%; top: 50%;
  pointer-events: none; user-select: none; white-space: nowrap;
  text-transform: uppercase;
  transform: translate(-50%, calc(-50% + 50px));
  font-family: "Anton SC", sans-serif;
  font-size: clamp(120px, 30vw, 521px);
  letter-spacing: -4px; line-height: 1; opacity: .1;
  background: radial-gradient(circle, rgba(142,127,148,0) 0%, #8E7F94 70%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

/* ---------- Cinematic 段落 ---------- */
.cine-gradient {
  position: absolute; top: 0; left: 0; width: 100%; height: 180px;
  z-index: 10; pointer-events: none;
  background: linear-gradient(to bottom, #010103, transparent);
}
.cine-wrap {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: center; height: 100%;
}
.cine-inner { max-width: 64rem; width: 100%; perspective: 400px; }
.cine-text {
  font-weight: 400; color: #fff; line-height: 1.35; letter-spacing: -.02em;
  user-select: none; padding: 0 24px; text-align: center;
  font-size: 22px;
  will-change: transform, opacity;
}
@media (min-width: 640px)  { .cine-text { font-size: 30px; padding: 0 48px; } }
@media (min-width: 768px)  { .cine-text { font-size: 36px; } }
@media (min-width: 1024px) { .cine-text { font-size: 42px; } }

/* ---------- Metrics ---------- */
.metrics-inner {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh; padding: 128px 24px;
}
.section-sub {
  color: rgba(255,255,255,.4); font-size: 13px; letter-spacing: .2em;
  text-transform: uppercase; margin-bottom: 80px; text-align: center;
}
@media (min-width: 640px) { .section-sub { font-size: 14px; } }

.metrics-grid {
  width: 100%; max-width: 72rem;
  display: grid; grid-template-columns: 1fr; gap: 64px;
}
@media (min-width: 768px) { .metrics-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; } }

.metric { text-align: center; }
.metric-value {
  color: #fff; font-weight: 300; letter-spacing: -.04em; line-height: 1;
  font-size: clamp(48px, 10vw, 96px);
}
.metric-label { color: rgba(255,255,255,.4); font-size: 13px; margin-top: 16px; letter-spacing: .02em; }
@media (min-width: 640px) { .metric-label { font-size: 15px; } }

/* ---------- Technology ---------- */
.tech-inner {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; height: 100%;
  padding: 48px 32px;
}
@media (min-width: 640px) { .tech-inner { padding: 64px 48px; } }
@media (min-width: 768px) { .tech-inner { padding: 64px; } }

.tech-top {
  display: flex; flex-direction: column; gap: 24px;
  padding-top: 48px;
}
@media (min-width: 640px) { .tech-top { padding-top: 64px; } }
@media (min-width: 768px) {
  .tech-top { flex-direction: row; justify-content: space-between; align-items: flex-start; }
}

.tech-h2 {
  color: #fff; font-weight: 300; letter-spacing: -.03em; line-height: .95;
  font-size: clamp(36px, 8vw, 72px);
}
.tech-desc {
  color: rgba(255,255,255,.5); font-size: 13px; line-height: 1.7; max-width: 20rem;
}
@media (min-width: 640px) { .tech-desc { font-size: 15px; } }
@media (min-width: 768px) { .tech-desc { text-align: right; padding-top: 8px; } }

.tech-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px;
  padding-bottom: 32px;
}
@media (min-width: 768px) { .tech-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; } }

.tech-item-title { color: #fff; font-size: 14px; font-weight: 400; margin-bottom: 8px; }
@media (min-width: 640px) { .tech-item-title { font-size: 16px; } }
.tech-item-desc { color: rgba(255,255,255,.4); font-size: 12px; line-height: 1.7; }
@media (min-width: 640px) { .tech-item-desc { font-size: 14px; } }

/* ---------- Architecture ---------- */
.arch-inner {
  position: relative; z-index: 10;
  max-width: 48rem; margin: 0 auto; padding: 128px 24px; text-align: center;
}
.arch-h2 {
  color: #fff; font-weight: 300; letter-spacing: -.02em; line-height: 1.15;
  font-size: clamp(28px, 6vw, 56px); margin-bottom: 40px;
}
.arch-desc {
  color: rgba(255,255,255,.45); font-size: 15px; line-height: 1.7;
  max-width: 36rem; margin: 0 auto;
}
@media (min-width: 640px) { .arch-desc { font-size: 17px; } }

.layer-stack { margin-top: 80px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.layer-card {
  width: 100%; max-width: 28rem; height: 72px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 8px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  background: rgba(255,255,255,0);
  transition: border-color .3s ease, background-color .3s ease;
}
.layer-card:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.03); }
.layer-num { color: rgba(255,255,255,.3); font-size: 12px; letter-spacing: .15em; text-transform: uppercase; }
.layer-name { color: #fff; font-weight: 300; font-size: 16px; }
@media (min-width: 640px) { .layer-name { font-size: 18px; } }

/* ---------- 短视口适配(保证每屏内容恰好一屏高) ---------- */
@media (max-height: 820px) {
  .arch-inner { padding: 72px 24px; }
  .arch-h2 { margin-bottom: 24px; }
  .layer-stack { margin-top: 48px; gap: 12px; }
  .layer-card { height: 60px; }
  .metrics-inner { padding: 80px 24px; }
  .section-sub { margin-bottom: 48px; }
}
@media (max-height: 660px) {
  .arch-inner { padding: 44px 24px; }
  .arch-h2 { font-size: clamp(24px, 5vw, 40px); margin-bottom: 16px; }
  .layer-stack { margin-top: 28px; }
  .layer-card { height: 50px; }
  .metrics-inner { padding: 56px 24px; }
  .section-sub { margin-bottom: 32px; }
  .tech-inner { padding: 32px 24px; }
  .tech-top { padding-top: 40px; gap: 16px; }
}

/* ---------- Footer ---------- */
.footer { position: relative; width: 100%; background: #000; overflow: hidden; scroll-snap-align: start; min-height: 100vh; min-height: 100dvh; }
.footer-row { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
@media (min-width: 768px) { .footer-row { flex-direction: row; } }

.footer-media { position: relative; width: 100%; height: 300px; overflow: hidden; }
@media (min-width: 768px) { .footer-media { width: 50%; height: auto; } }
.footer-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.footer-text {
  width: 100%; display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px;
}
@media (min-width: 640px) { .footer-text { padding: 64px; } }
@media (min-width: 768px) { .footer-text { width: 50%; } }

.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.footer-brand img { width: 18px; height: 18px; object-fit: contain; opacity: .7; }
.footer-brand span { font-size: 15px; font-weight: 500; color: rgba(255,255,255,.7); letter-spacing: -.02em; }
.footer-copy { color: rgba(255,255,255,.4); font-size: 14px; line-height: 1.7; max-width: 24rem; }
@media (min-width: 640px) { .footer-copy { font-size: 15px; } }

/* ---------- 业务联系(一键邮件/电话) ---------- */
.footer-contact { margin-top: 28px; }
.footer-contact-label {
  font-size: 11px; letter-spacing: .14em; color: rgba(255,255,255,.45);
  font-family: var(--font-mono); margin-bottom: 14px;
}
.footer-contact-row { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; letter-spacing: -.01em;
  text-decoration: none; color: #fff; white-space: nowrap;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.contact-btn svg { flex: none; opacity: .8; transition: opacity .2s ease, transform .25s ease; }
.contact-btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.12); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.contact-btn:hover svg { opacity: 1; transform: translateY(-1px); }
.contact-btn:active { transform: translateY(0) scale(.98); }
/* 邮件按钮:白底主操作,保持黑白单色体系 */
.contact-btn--primary { background: #fff; border-color: #fff; color: #000; }
.contact-btn--primary svg { opacity: .7; }
.contact-btn--primary:hover { background: #fff; border-color: #fff; color: #000; box-shadow: 0 8px 22px rgba(255,255,255,.22); }
.contact-btn--primary:hover svg { opacity: 1; }

.footer-legal { color: rgba(255,255,255,.85); font-size: 12px; margin-top: 48px; }
.footer-legal a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.35); transition: color .2s ease, border-color .2s ease; }
.footer-legal a:hover { color: #fff; border-color: rgba(255,255,255,.8); }

/* 短视口:压缩页脚,保证恰好一屏高(必须在 Footer 基础样式之后) */
/* 仅移动端竖排布局需要压缩;桌面左右分栏视频自然撑满,不压缩(避免左侧视频被压成窄条、下方留黑) */
@media (max-width: 767px) and (max-height: 760px) {
  .footer-media { height: 200px; }
  .footer-text { padding: 28px 24px; }
  .footer-brand { margin-bottom: 16px; }
  .footer-legal { margin-top: 16px; }
}

/* ---------- 滚动显现 (in-view) ---------- */
.reveal { opacity: 0; transform: translateY(var(--reveal-y, 30px)); }
.reveal.in-view {
  opacity: 1; transform: translateY(0);
  transition: opacity var(--reveal-dur, .8s) ease var(--reveal-delay, 0s),
              transform var(--reveal-dur, .8s) ease var(--reveal-delay, 0s);
}
.reveal--fade { transform: none; }

@media (prefers-reduced-motion: reduce) {
  #viewport { scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
