/*
 * flowcal 落地页
 *
 * 版式骨架参考 minical（https://minical.app/）：
 *   吸顶的细导航 → 居中的大标题 → 一张实拍图 → 左右交替的功能段 → 一张 CTA 卡。
 *
 * 两条硬规矩：
 *
 *   1. **页面上没有一行日历是前端画的。** 每一张日历都是 App 的真实截图 ——
 *      由 `tools/capture_site_shots.py` 把 flowcal.app 跑起来、真的滚、真的拖、
 *      真的截出来，落在 `assets/shots/`。前端只负责摆它们。
 *   2. **文字尽可能短。** 每一段说明都只说一件事。
 */

/* ---- Base ---------------------------------------------------------------- */

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body.site {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* 段落与链接归零 —— 用**类型选择器**而不是 `.site p` / `.site a`：
   后者（0,1,1）会盖掉组件自己的规则（0,1,0），于是按钮的白字被
   「继承父级颜色」吃掉、首屏标题的 `margin: … auto` 也失效。
   类型选择器权重最低，谁都能盖过它。 */
p { margin: 0; }
a { color: inherit; text-decoration: none; }
.site img { max-width: 100%; }
.site .wrap { width: min(var(--wrap), 100% - 40px); margin: 0 auto; }

/* ---- Navigation ---------------------------------------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}
.site-nav.is-scrolled { box-shadow: 0 1px 0 var(--border); }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 22.5%;
  overflow: hidden;
  background: var(--surface-dim);
  box-shadow: 0 1px 2px #18181B14, 0 4px 10px #18181B1F;
}
.brand-mark img { display: block; width: 100%; height: 100%; }
.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-ink);
}

.nav-tools { position: relative; display: flex; align-items: center; gap: 6px; }

/* 语言：一枚胶囊，点开是一张两行的单选单。 */
.lang-wrap { position: relative; }
.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lang:hover { background: var(--surface-dim); border-color: var(--border-strong); }
.lang svg { width: 16px; height: 16px; flex: 0 0 auto; }
.lang:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  min-width: 148px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 12px 32px #18181B1F;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.lang-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-primary);
}
.lang-menu a:hover { background: var(--surface-dim); }
.lang-menu a[aria-current="true"] { font-weight: 700; color: var(--accent); }
.lang-menu a[aria-current="true"]::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.nav-sep { width: 1px; height: 20px; background: var(--border); }

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-chip);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.menu-btn:hover { background: var(--surface-dim); }
.menu-btn svg { width: 20px; height: 20px; }

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 12px 32px #18181B1F;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.nav-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.nav-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-primary);
}
.nav-menu a:hover { background: var(--surface-dim); }

/* ---- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 28px;
  border: 0;
  border-radius: 12px;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.btn-primary { background: var(--accent); color: #FFFFFF; box-shadow: 0 6px 18px #006D8726; }
.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* 苹果标：白字，跟着按钮走 */
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

.note { font-size: 14px; color: var(--text-tertiary); }

/* ---- Hero（版式参考 minical：图标 → 大字标 → 粗标题 → 灰副文） ------------- */

.hero { padding: 56px 20px 84px; text-align: center; }

.hero-icon {
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 auto;
  border-radius: 22.5%;
  box-shadow: 0 1px 2px #18181B0F, 0 10px 26px -6px #18181B29;
}

/* 字标：**不加字距**。DIN Alternate 自带的字面就够宽了，
   再撑开只会显得散。 */
.hero-name {
  margin: 28px 0 0;
  font-size: clamp(42px, 7.5vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  color: #3F3F46;
}

.hero-tagline {
  margin: 56px auto 0;
  max-width: 17em;
  font-size: clamp(26px, 4.4vw, 40px);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-ink);
  text-wrap: pretty;
}

.hero-sub {
  margin: 22px auto 0;
  max-width: 34em;
  font-size: 17px;
  line-height: 1.95;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.hero-cta { margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ---- 实拍图 -------------------------------------------------------------- */

/* 一段「菜单栏 + 面板」的真实场景 */
.scene { padding: 0 20px 96px; }
/* 面板贴着菜单栏那一枚的右边 —— 真机就是这样 */
.scene-inner {
  width: min(400px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* 菜单栏那一条：近黑，日期项贴右 */
.menubar-strip {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 40px;
  border-radius: 12px 12px 0 0;
  background: var(--menubar);
  box-shadow: 0 2px 6px #00000014;
}
.menubar-strip img {
  position: absolute;
  right: 10px;
  top: 3px;
  height: 34px;
  width: auto;
}

/* 面板截图：页面自己加投影 —— 截图本身是透明的 */
.shot {
  display: block;
  width: 320px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 6px #00000014) drop-shadow(0 24px 56px #1A1A1826);
}
.shot--pinned {
  filter: drop-shadow(0 4px 10px #0000001F) drop-shadow(0 40px 96px #1A1A1845);
}

/* 「置顶」那一段：菜单栏 → 右键菜单 → 浮在上面的面板。三张都是实拍。 */
.pin-scene {
  position: relative;
  width: min(400px, 100%);
  margin: 0 auto;
}
.pin-scene .menubar-strip { width: 100%; }
.menu-pop {
  position: absolute;
  top: 30px;
  right: 2px;
  z-index: 3;
  width: 147px;
  filter: drop-shadow(0 10px 28px #0000003D);
}
.menu-pop img { display: block; width: 100%; height: auto; }

/* ---- Features ------------------------------------------------------------ */

.site section.feature { padding: 72px 20px; }

.feature-grid {
  width: min(var(--wrap), 100%);
  margin: 0 auto;
  display: grid;
  gap: 28px;
  align-items: center;
}
.feature-title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--text-ink);
  text-wrap: pretty;
}
.feature-copy {
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-secondary);
  text-wrap: pretty;
}
.feature-shot { justify-self: center; }

@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
    column-gap: 56px;
    align-items: center;
  }
  /* 交替：第二段把文字挪到右边 */
  .feature.is-flipped .feature-grid { direction: rtl; }
  .feature.is-flipped .feature-grid > * { direction: ltr; }
}

/* 「无限滚动」这一段要宽：两张面板并排 */
.feature--wide .feature-grid { grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .feature--wide .feature-grid { grid-template-columns: 320px 1fr; column-gap: 48px; }
}
.scroll-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
.scroll-pair .shot { width: 100%; }
.scroll-pair figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}
.scroll-pair figure { margin: 0; }

/* 「浅色 & 深色」：两档并排 */
.theme-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.theme-pair .shot { width: 100%; }

/* 菜单栏三种样式：一块深色板子，三行 */
.style-board {
  border-radius: 16px;
  background: var(--menubar);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.style-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.style-row span {
  font-size: 14px;
  color: #A1A1AA;
  letter-spacing: 0.02em;
}
.style-row img { height: 34px; width: auto; }

/* ---- Final CTA ----------------------------------------------------------- */

.site section.cta-final { padding: 88px 20px; }
.cta-card {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 56px 32px;
  border-radius: 28px;
  background: var(--surface-dim);
  text-align: center;
}
.cta-icon {
  display: block;
  width: 60px;
  height: 60px;
  margin: 0 auto;
  border-radius: 22.5%;
  box-shadow: 0 1px 2px #18181B0F, 0 8px 20px -6px #18181B29;
}
.cta-title {
  margin: 22px auto 0;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-ink);
}
.cta-sub {
  margin: 12px auto 28px;
  max-width: 26em;
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-secondary);
}
.cta-card .note { margin-top: 16px; }

/* ---- Footer -------------------------------------------------------------- */

.site footer {
  padding: 36px 20px 52px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}
.site footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}
.site footer .footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.site footer .footer-brand b {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-ink);
}
.site footer nav { display: flex; gap: 20px; }
.site footer a:hover { color: var(--text-ink); text-decoration: underline; text-underline-offset: 0.2em; }

/* ---- Narrow screens ------------------------------------------------------ */

@media (max-width: 767px) {
  .site-nav { height: 58px; padding: 0 16px; }
  .lang { height: 36px; padding: 0 10px; font-size: 13px; }
  .menu-btn { width: 36px; height: 36px; }
  .hero { padding: 36px 16px 56px; }
  .hero-icon { width: 76px; height: 76px; }
  .hero-name { font-size: 34px; }
  .hero-tagline { margin-top: 40px; }
  .hero-sub { font-size: 15px; }
  .note { font-size: 13px; }
  .scene { padding: 0 16px 64px; }
  .shot { width: min(280px, 100%); }
  .site section.feature { padding: 52px 16px; }
  .site section.cta-final { padding: 60px 16px; }
  .cta-card { padding: 40px 22px; border-radius: 20px; }
  .site footer { padding: 28px 16px 40px; }
}
