/* =========================================================
   鲜睡品牌官网 — 新中式茶饮风格
   styles.css：基础 / 工具类 / 导航 / Hero
   ========================================================= */

:root {
  --color-bg: #FAFAF5;
  --color-bg-alt: #F0F0E8;
  --color-wash: #F3F1EA;          /* 图片完整展示时的衬底 */
  --color-surface: #FFFFFF;
  --color-primary: #2D5A27;
  --color-primary-dark: #1F3E1B;
  --color-primary-light: #4A7A42;
  --color-accent: #8B7355;
  --color-gold: #C9A96E;
  --color-gold-deep: #B8945A;
  --color-text: #1A1A1A;
  --color-text-secondary: #5A5A5A;
  --color-text-muted: #8A8A8A;
  --color-border: rgba(45, 90, 39, 0.12);
  --color-overlay: rgba(26, 38, 24, 0.55);
  --color-overlay-dark: rgba(26, 38, 24, 0.72);

  --font-serif: "Noto Serif SC", "STSong", "SimSun", "Songti SC", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;

  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);

  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-slow: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --header-height: 72px;
  --container: 1200px;
  --container-narrow: 960px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 12px);
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 纸张噪点纹理：全站铺一层极淡的宣纸质感 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: rgba(201, 169, 110, 0.35);
  color: var(--color-text);
}

/* WebKit 滚动条 */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-alt);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-gold));
  border-radius: 8px;
  border: 2px solid var(--color-bg-alt);
}

:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3, h4, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Utilities */
.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: clamp(88px, 11vw, 150px);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll progress ink line */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1200;
  height: 3px;
  pointer-events: none;
}

.scroll-progress-ink {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-gold));
  transition: width 0.1s linear;
}

/* Header & Nav */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--header-height);
  transition: background var(--transition), box-shadow var(--transition);
}

.site-header.is-scrolled {
  background: rgba(250, 250, 245, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 48px, var(--container));
  height: 100%;
  margin-inline: auto;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-gold);
  background: var(--color-primary);
  border-radius: 50%;
  letter-spacing: 2px;
  box-shadow: inset 0 0 0 2px rgba(201, 169, 110, 0.4);
  transition: transform var(--transition);
}

.logo:hover .logo-mark {
  transform: rotate(-6deg) scale(1.05);
}

.site-header.is-scrolled .logo-mark {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.nav-menu {
  display: flex;
  gap: clamp(18px, 3vw, 36px);
}

.nav-link {
  position: relative;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.5px;
  transition: color var(--transition);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 1px;
  background: var(--color-gold);
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #fff;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

/* 滚动高亮：当前所在章节 */
.nav-link.is-active {
  color: #fff;
}

.nav-link.is-active::after {
  width: 100%;
}

.site-header.is-scrolled .nav-link {
  color: var(--color-text);
}

.site-header.is-scrolled .nav-link:hover,
.site-header.is-scrolled .nav-link:focus-visible {
  color: var(--color-primary);
}

.site-header.is-scrolled .nav-link.is-active {
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: transform var(--transition), opacity var(--transition);
}

.site-header.is-scrolled .nav-toggle-bar {
  background: var(--color-primary);
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  /* 给固定导航栏与底部滚动提示留出安全区，避免内容撞上去 */
  padding-top: calc(var(--header-height) + 48px);
  padding-bottom: 152px;
  overflow: hidden;
  color: #fff;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url("assets/s1-scene-b.jpg") center center / cover no-repeat;
  transform: scale(1.05);
  transition: transform 1.2s ease-out;
}

.hero.is-loaded .hero-bg {
  transform: scale(1);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 38, 24, 0.45) 0%,
    rgba(26, 38, 24, 0.55) 50%,
    rgba(26, 38, 24, 0.72) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 24px;
}

.hero-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin-bottom: 32px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-gold);
  border: 2px solid var(--color-gold);
  border-radius: 50%;
  letter-spacing: 4px;
  background: rgba(45, 90, 39, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
}

.hero-title {
  margin-bottom: 24px;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
}

.hero-title-main {
  display: block;
  font-size: clamp(34px, 7vw, 68px);
  letter-spacing: 8px;
}

.hero-title-sub {
  display: block;
  margin-top: 8px;
  font-size: clamp(26px, 5.4vw, 52px);
  letter-spacing: 6px;
  color: var(--color-gold);
}

.hero-lead {
  margin-bottom: 16px;
  font-size: clamp(15px, 2.2vw, 19px);
  font-weight: 500;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.9);
}

.hero-desc {
  font-size: clamp(13px, 1.8vw, 16px);
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 2px;
}

.hero-vertical {
  position: absolute;
  right: 32px;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 8px;
  color: rgba(255, 255, 255, 0.55);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* Hero 底部关键词跑马灯 */
.hero-marquee {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  overflow: hidden;
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 30, 18, 0.3);
  backdrop-filter: blur(3px);
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: marquee-move 38s linear infinite;
}

.marquee-track span {
  flex-shrink: 0;
  padding: 0 20px;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 6px;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.78);
}

.hero-marquee:hover .marquee-track {
  animation-play-state: paused;
}

/* 回到顶部 */
.back-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 1100;
  width: 52px;
  height: 52px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-gold);
  background: var(--color-primary);
  border: 1px solid rgba(201, 169, 110, 0.5);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity var(--transition), transform var(--transition),
              visibility var(--transition), background var(--transition);
}

.back-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-4px);
}

.scroll-hint {
  position: absolute;
  bottom: 84px;
  left: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
}

.scroll-hint-text {
  font-size: 12px;
  letter-spacing: 4px;
  writing-mode: vertical-rl;
}

.scroll-hint-line {
  display: block;
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, currentColor, transparent);
  animation: scroll-line 1.8s ease-in-out infinite;
}

@keyframes scroll-line {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* 矮视口（笔记本 / 内置预览面板）：整体收紧，杜绝与导航、滚动提示重叠 */
@media (max-height: 860px) {
  .hero {
    padding-top: calc(var(--header-height) + 24px);
    padding-bottom: 120px;
  }

  .hero-seal {
    width: 60px;
    height: 60px;
    font-size: 20px;
    margin-bottom: 18px;
  }

  .hero-title {
    margin-bottom: 14px;
  }

  .hero-title-main {
    font-size: clamp(28px, 6vw, 52px);
    letter-spacing: 6px;
  }

  .hero-title-sub {
    font-size: clamp(22px, 4.6vw, 40px);
    letter-spacing: 5px;
  }

  .hero-lead {
    margin-bottom: 8px;
    letter-spacing: 3px;
  }

  .hero-desc {
    display: none;
  }

  .scroll-hint {
    bottom: 64px;
    gap: 8px;
  }

  .scroll-hint-line {
    height: 32px;
  }
}

@media (max-height: 640px) {
  .scroll-hint {
    display: none;
  }

  .hero {
    padding-bottom: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
