/* ============================================================
   letup.cn —— 清爽个人主页
   浅色 / 深色双主题，跟随系统
   ============================================================ */

:root {
  --bg: #fbfbf8;
  --surface: #ffffff;
  --fg: #151a18;
  --muted: #6d7773;
  --line: #e6e9e3;
  --accent: #2f8f7a;
  --accent-soft: rgba(47, 143, 122, 0.09);
  --glow: rgba(47, 143, 122, 0.14);

  --radius: 18px;
  --maxw: 700px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, "Times New Roman", serif;

  /* 顶栏高度：默认给个近似值，JS 起来后会写回精确值，用于锚点偏移 */
  --topbar-h: 56px;
  /* 触控目标底线 */
  --tap: 44px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b100e;
    --surface: #121917;
    --fg: #e8ede9;
    --muted: #8b968f;
    --line: #1f2724;
    --accent: #6fd0b4;
    --accent-soft: rgba(111, 208, 180, 0.1);
    --glow: rgba(111, 208, 180, 0.13);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* 顶栏是 sticky，锚点跳转时把标题从栏底下让出来 */
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景一团很淡的光，缓慢呼吸 —— 算是"松"的视觉隐喻 */
.glow {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 70vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(42% 55% at 30% 40%, var(--glow), transparent 70%),
    radial-gradient(36% 48% at 72% 22%, var(--accent-soft), transparent 72%);
  filter: blur(6px);
  animation: breathe 16s var(--ease) infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1) translateY(0); opacity: 0.9; }
  50%      { transform: scale(1.08) translateY(1.2%); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .glow { animation: none; }
  .reveal { transition: none !important; }
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px clamp(14px, 4.5vw, 40px);
  /* 刘海屏横屏时不让内容钻到圆角 / 摄像头下面 */
  padding-left: max(clamp(14px, 4.5vw, 40px), env(safe-area-inset-left));
  padding-right: max(clamp(14px, 4.5vw, 40px), env(safe-area-inset-right));
  font-size: 0.875rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

@supports not (backdrop-filter: blur(1px)) {
  .topbar { background: var(--bg); }
}

.topbar.is-stuck { border-bottom-color: var(--line); }

.brand {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
}
.brand span { color: var(--accent); }

.topbar nav {
  display: flex;
  align-items: center;
  gap: 2px;
  /* 手机上可横向滑动，不再挤压换行 */
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.topbar nav::-webkit-scrollbar { display: none; }

.topbar nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 10px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.topbar nav a:hover { color: var(--fg); }
.topbar nav a:active { color: var(--accent); }

/* ---------- 版面 ---------- */

.page {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 36px);
  padding-left: max(clamp(20px, 6vw, 36px), env(safe-area-inset-left));
  padding-right: max(clamp(20px, 6vw, 36px), env(safe-area-inset-right));
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.section {
  padding: clamp(56px, 11vw, 104px) 0 8px;
  border-top: 1px solid var(--line);
  margin-top: clamp(48px, 9vw, 84px);
  /* 目标本身也要有偏移，兼容不认 scroll-padding 的老浏览器 */
  scroll-margin-top: calc(var(--topbar-h) + 8px);
}
.section:first-of-type { border-top: 0; }

.title {
  margin: 0 0 24px;
  font-size: clamp(1.3rem, 4.4vw, 1.7rem);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.para {
  margin: 0 0 14px;
  color: var(--muted);
  max-width: 34em;
}
.para:last-child { margin-bottom: 0; }

/* ---------- Hero ---------- */

.hero {
  padding: clamp(48px, 12vh, 108px) 0 clamp(28px, 6vh, 56px);
}

.hero-title {
  margin: 0;
  font-size: clamp(3.2rem, 15vw, 5.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-en {
  margin: 14px 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  color: var(--muted);
}

.hero-slogan {
  margin: clamp(30px, 7vw, 48px) 0 0;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 3.6vw, 1.32rem);
  line-height: 1.85;
  color: var(--fg);
}

/* ---------- 诗句卡片 ---------- */

.quote-card {
  margin: 0 0 28px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px var(--radius) var(--radius) 4px;
}

.quote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  line-height: 1.9;
  letter-spacing: 0.04em;
}

/* ---------- 松一松的方式 ---------- */

.ways {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.way {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.35s var(--ease);
}
.way:hover { padding-left: 12px; }

.way .idx {
  flex: none;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.way-text { color: var(--fg); }

/* ---------- 收尾 ---------- */

.closing {
  padding-bottom: 0;
}

.closing-line {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4.2vw, 1.5rem);
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-wrap: balance;
}

/* ---------- 页脚 ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: clamp(64px, 12vw, 110px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.footer .sep { opacity: 0.5; }

/* ---------- 进场动效 ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   手机 / 触屏适配
   ============================================================ */

/* 触屏设备没有真正的 hover，别让 hover 样式"粘"在元素上 */
@media (hover: none) {
  .way:hover { padding-left: 4px; }
  .topbar nav a:hover { color: var(--muted); }
  .topbar nav a:active { color: var(--accent); }
}

/* 触摸时不要在整条链接上留下灰色高亮 */
a, li { -webkit-tap-highlight-color: transparent; }

/* 窄屏微调 */
@media (max-width: 480px) {
  .hero-en { letter-spacing: 0.24em; }

  .way {
    align-items: flex-start;
    gap: 14px;
    padding: 16px 2px;
  }
  /* 文本换行后序号对齐首行 */
  .way .idx { padding-top: 0.42em; }

  .quote-card { padding: 20px 18px; }

  .topbar nav a { padding: 0 8px; }

  /* 模糊的呼吸光在低端手机上比较费，缩小一点、少一层 */
  .glow {
    height: 55vh;
    filter: blur(4px);
  }
}

/* 很窄的老机型（320px 一档）再收一档字距与内边距 */
@media (max-width: 360px) {
  .topbar { font-size: 0.82rem; }
  .topbar nav a { padding: 0 6px; }
  .hero-en { letter-spacing: 0.18em; }
  .footer { font-size: 0.76rem; }
}

/* 视野极矮的横屏手机：Hero 别占满，留出内容 */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { padding-top: 40px; padding-bottom: 20px; }
  .hero-title { font-size: clamp(2.4rem, 9vw, 3.2rem); }
  .hero-slogan { margin-top: 20px; }
}
