/* ═══════════════════════════════════════════════════════════════
   Lens Pro Mockup · Shared Framework
   Used by: pro-mockup.html (index) + features/NN-*.html
═══════════════════════════════════════════════════════════════ */

:root {
  /* paper */
  --paper: #E4E7E5;
  --surface: #FFFFFD;
  --bezel: #EEEDEB;
  --void: #000000;
  --glass-edge: rgba(0,0,0,0.22);
  /* ink */
  --ink-1: rgba(0,0,0,0.90);
  --ink-2: rgba(0,0,0,0.58);
  --ink-3: rgba(0,0,0,0.45);
  --ink-4: rgba(0,0,0,0.14);
  --ink-5: rgba(0,0,0,0.06);
  /* font */
  --font-sans: "PingFang SC", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* doc-level */
  --doc-h2: 20px;
  --doc-body: 14px;
  --doc-meta: 12px;
  /* device-internal */
  --fs-display: 18px;
  --fs-h2: 14px;
  --fs-body: 13px;
  --fs-time: 13px;
  --fs-caption: 11px;
  --fs-micro: 10px;
  /* spacing */
  --sp-xs: 4px; --sp-sm: 8px; --sp-md: 12px;
  --sp-lg: 16px; --sp-xl: 24px; --sp-2xl: 32px;
  /* radius */
  --r-sheet: 16px;
  --r-card: 12px;
  --r-btn: 8px;
  --r-pill: 99px;
  /* motion */
  --ease-out: cubic-bezier(0.0,0.0,0.2,1);
  --ease-in:  cubic-bezier(0.4,0.0,1.0,1);
  --t-fast: 100ms;
  --t-mid: 150ms;
  --t-slow: 200ms;
  /* mini device */
  --mini-w: 320px;
  --mini-h: 480px;
}

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

html, body {
  background: var(--paper);
  font-family: var(--font-sans);
  color: var(--ink-1);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── standalone feature page (open /features/NN-*.html directly) ── */
body.feature-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-md) var(--sp-lg) var(--sp-sm);
}

/* ── index page (pro-mockup.html) ── */
body.index-page { padding: 0; }
body.index-page main {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: var(--sp-lg) var(--sp-lg) var(--sp-lg);
}

/* Feature section base ───────────────────────────── */
section.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-sm) 0;
}
section.feature > .card-header { order: 1; margin-bottom: var(--sp-xs); }
section.feature > .caption     { order: 2; margin-bottom: var(--sp-md); }
section.feature > .device      { order: 3; }
section.feature > .meta-line   { display: none; }

.card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  width: 100%;
  max-width: var(--mini-w);
}
.card-header .num { display: none; }
.card-header h2 {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-1);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.card-header .tag { display: none; }

/* ── Info button (injected by lens.js) ─────── */
.info-btn {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-3);
  background: transparent;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.info-btn:hover, .info-btn.active {
  background: var(--ink-5);
  border-color: var(--ink-1);
  color: var(--ink-1);
}

/* ── Screen info panel ─────────────────────── */
.screen-info {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border-radius: 22px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.screen-info[hidden] { display: none; }
.si-bar {
  flex-shrink: 0;
  height: 36px;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 6px var(--sp-md) 0;
  border-bottom: 1px solid var(--ink-4);
}
.si-back {
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color var(--t-fast);
}
.si-back:hover { color: var(--ink-1); }
.si-title {
  flex: 1;
  text-align: center;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--ink-1);
  letter-spacing: -0.01em;
  /* offset for back button so title looks centered */
  margin-right: 40px;
}
.si-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-md) var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}
.si-body p {
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink-2);
}
.si-body p b { color: var(--ink-1); font-weight: 600; }

/* Mini device frame ───────────────────────────────── */
.device {
  width: var(--mini-w);
  height: var(--mini-h);
  background: var(--bezel);
  border-radius: 28px;
  padding: 14px 16px 28px;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
  border: 1px solid rgba(0,0,0,0.08);
}
.screen {
  width: 100%;
  height: 100%;
  background: var(--paper);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Titlebar */
.titlebar {
  flex-shrink: 0;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-display);
  font-weight: 700;
  color: var(--ink-1);
  letter-spacing: -0.01em;
  padding-top: 6px;
}

/* Dock (3-tab, src icons, fill-based) ────────────── */
.tabbar {
  flex-shrink: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid var(--ink-4);
  padding: 0 var(--sp-xl);
  background: var(--paper);
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.tab svg {
  width: 22px;
  height: 22px;
  fill: var(--ink-3);
  stroke: none;
  transition: fill var(--t-mid) var(--ease-out);
}
.tab svg text { fill: var(--ink-3); }
.tab.on svg,
.tab.on svg text { fill: var(--ink-1); }

/* Caption = Apple-style headline (above device) ─── */
.caption {
  width: 100%;
  max-width: var(--mini-w);
  font-size: 22px;
  color: var(--ink-2);
  line-height: 1.18;
  font-weight: 400;
  letter-spacing: -0.022em;
  text-align: left;
  margin-top: 0;
}
/* subtle variation: italic muted closing fragment after a period */
.caption em {
  font-style: italic;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0;
}
.caption b { font-weight: 700; color: var(--ink-1); }
.meta-line {
  width: 100%;
  max-width: var(--mini-w);
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════
   Carousel (index only)
═══════════════════════════════════════════════════ */
.carousel { position: relative; }
.track {
  position: relative;
  height: 648px;
  overflow: hidden;
}
.track > .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-slow) var(--ease-out);
}
.track > .slide.active {
  opacity: 1;
  pointer-events: auto;
}
.track > .slide iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--paper);
}
/* ─── Bottom-of-track fade ──────────────────── */
.carousel::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: calc(648px - 56px); /* bottom 56px of track */
  height: 56px;
  background: linear-gradient(to bottom, transparent 0%, var(--paper) 72%);
  pointer-events: none;
  z-index: 2;
}

/* ─── Nav bar ─────────────────────────────────── */
.nav-bar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--sp-lg);
  padding-top: var(--sp-md);
  padding-bottom: 4px;
}
.nav {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--ink-4);
  color: var(--ink-1);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  padding: 0 0 2px;
  flex-shrink: 0;
  transition: background var(--t-mid) var(--ease-out),
              border-color var(--t-mid) var(--ease-out),
              opacity var(--t-mid) var(--ease-out);
}
.nav:hover { background: var(--ink-5); border-color: var(--ink-2); }
.nav:disabled { opacity: 0.25; cursor: default; }

/* Grouped nav */
.nav-groups {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}
.nav-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-1);
  font-weight: 700;
  line-height: 1;
}
.group-dots {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

/* Individual dot */
.dot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 3px 2px;
}
.dot-num {
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1;
  transition: color var(--t-mid) var(--ease-out);
}
.dot-pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-4);
  display: block;
  transition: background var(--t-mid) var(--ease-out),
              transform var(--t-mid) var(--ease-out);
}
.dot.on .dot-pip { background: var(--ink-1); transform: scale(1.5); }
.dot.on .dot-num { color: var(--ink-1); }
.dot:hover .dot-pip { background: var(--ink-2); transform: scale(2); }
.dot:hover .dot-num { color: var(--ink-1); }

/* Tooltip */
.dot-tooltip {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-1);
  color: var(--paper);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out);
  letter-spacing: 0.01em;
  z-index: 10;
}
.dot:hover .dot-tooltip { opacity: 1; }

/* Keyboard hint (fades on first interaction) ── 小巧思 */
.kbd-hint {
  text-align: center;
  font-size: var(--fs-micro);
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: var(--sp-sm);
  transition: opacity var(--t-slow) var(--ease-out);
}
.kbd-hint kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  border: 1px solid var(--ink-4);
  border-radius: 4px;
  padding: 1px 4px;
  margin: 0 2px;
  font-size: 9px;
}
.used .kbd-hint { opacity: 0; }

/* ── Shared recording bar ──────────────────────── */
@keyframes rec-blink { 0%,100%{opacity:1} 50%{opacity:0.2} }
.rec-bar {
  position: absolute;
  bottom: 48px; left: var(--sp-md); right: var(--sp-md);
  background: var(--ink-1); color: var(--paper);
  border-radius: var(--r-btn);
  padding: var(--sp-sm) var(--sp-md);
  display: flex; align-items: center; gap: var(--sp-sm);
  font-size: var(--fs-caption); font-weight: 600;
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
  z-index: 4;
}
[data-state="recording"] .rec-bar { opacity: 1; transform: none; }
.rec-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--paper); flex-shrink: 0;
  animation: rec-blink 900ms ease-in-out infinite;
}
.rec-time { flex: 1; font-variant-numeric: tabular-nums; }
.rec-label { font-size: var(--fs-micro); opacity: 0.7; letter-spacing: 0.08em; text-transform: uppercase; }

/* ── Shared octopus (AI hub) ───────────────────── */
@keyframes oct-breathe { 0%,100%{opacity:.45} 50%{opacity:1} }
@keyframes oct-pulse-dot { 0%,100%{opacity:.35} 50%{opacity:1} }
.oct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.oct svg {
  stroke: var(--ink-1); fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.oct svg circle { fill: var(--ink-1); stroke: none; }
.oct-sm  { width: 14px; height: 14px; }
.oct-md  { width: 18px; height: 18px; }
.oct-lg  { width: 26px; height: 26px; }
.oct-breathe { animation: oct-breathe 1200ms ease-in-out infinite; }
.oct-dot {
  display: inline-block; width: 4px; height: 4px;
  border-radius: 50%; background: var(--ink-1);
  margin-left: 4px; flex-shrink: 0;
  animation: oct-pulse-dot 1200ms ease-in-out infinite;
}
/* AI row: oct icon + label + optional pulse dot */
.oct-row {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--fs-caption); font-weight: 600; color: var(--ink-1);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile */
@media (max-width: 480px) {
  body.index-page main { padding: var(--sp-xs) var(--sp-md) var(--sp-sm); }
  /* track fills viewport minus nav-bar */
  .track { height: calc(100dvh - 80px); }
  .carousel::after { top: calc(100dvh - 80px - 56px); }
  /* feature page: tighter, hide caption */
  body.feature-page { padding: var(--sp-xs) var(--sp-md) 0; }
  section.feature { gap: 2px; padding: var(--sp-xs) 0 0; }
  section.feature > .caption { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: var(--mini-w); margin-bottom: var(--sp-xs); }
  section.feature > .card-header { margin-bottom: 2px; }
  /* nav groups scrollable */
  .nav-groups { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav-groups::-webkit-scrollbar { display: none; }
  .group-label { font-size: 9px; }
}
