/* =============================================================
   PicPocket website · shared design system
   Brand: deep navy + pocket gold (see public/brand/app-icon.svg)
   ============================================================= */

:root {
  --bg: #fbfaf7;
  --bg-raised: #ffffff;
  --bg-sunken: #f3f1ec;
  --line: #e7e3da;
  --line-strong: #d6d0c3;
  --ink: #10131c;
  --ink-2: #454a57;
  --ink-3: #7b8090;
  --gold: #e29a0f;
  --gold-bright: #f5b52e;
  --gold-soft: #fdf1d6;
  --gold-ink: #9a5b00;
  --navy: #0f1524;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --glow: rgba(245, 158, 11, 0.16);
  --shadow-1: 0 1px 2px rgba(16, 19, 28, 0.05);
  --shadow-2: 0 1px 2px rgba(16, 19, 28, 0.04), 0 8px 24px -8px rgba(16, 19, 28, 0.12);
  --shadow-3: 0 2px 4px rgba(16, 19, 28, 0.04), 0 30px 80px -20px rgba(16, 19, 28, 0.28);
  --header-bg: rgba(251, 250, 247, 0.78);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;

  --font: "Geist", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", "Songti SC", "Noto Serif SC", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1180px;
  --gutter: 24px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080b13;
    --bg-raised: #0f1422;
    --bg-sunken: #0b0f1a;
    --line: #1c2336;
    --line-strong: #2a3349;
    --ink: #f3f1ea;
    --ink-2: #b4b8c5;
    --ink-3: #7c8296;
    --gold: #f5b52e;
    --gold-bright: #fcd34d;
    --gold-soft: rgba(245, 181, 46, 0.12);
    --gold-ink: #fcd34d;
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.12);
    --glow: rgba(245, 158, 11, 0.14);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-3: 0 2px 4px rgba(0, 0, 0, 0.3), 0 40px 100px -24px rgba(0, 0, 0, 0.8);
    --header-bg: rgba(8, 11, 19, 0.72);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #080b13;
  --bg-raised: #0f1422;
  --bg-sunken: #0b0f1a;
  --line: #1c2336;
  --line-strong: #2a3349;
  --ink: #f3f1ea;
  --ink-2: #b4b8c5;
  --ink-3: #7c8296;
  --gold: #f5b52e;
  --gold-bright: #fcd34d;
  --gold-soft: rgba(245, 181, 46, 0.12);
  --gold-ink: #fcd34d;
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.12);
  --glow: rgba(245, 158, 11, 0.14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-3: 0 2px 4px rgba(0, 0, 0, 0.3), 0 40px 100px -24px rgba(0, 0, 0, 0.8);
  --header-bg: rgba(8, 11, 19, 0.72);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--gold-bright); color: #10131c; }

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: 14px;
}
.skip-link:focus { top: 12px; }

/* ---------- Language switching ---------- */
html[lang="zh"] [data-l="en"],
html:not([lang="zh"]) [data-l="zh"] { display: none !important; }

html[lang="zh"] body { letter-spacing: 0.01em; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.nav {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.brand-name {
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 2px;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  flex: 1;
}
.nav-links a {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-sunken); }
.nav-links a[aria-current="page"] { color: var(--ink); }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn svg { flex-shrink: 0; }

.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15px; }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover {
  border-color: var(--ink);
  box-shadow: 0 8px 24px -8px rgba(16, 19, 28, 0.45);
}

.btn-gold {
  background: linear-gradient(180deg, #fcd34d 0%, #f5a70b 100%);
  color: #1b1405;
  border-color: #e39a0a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 10px 30px -10px rgba(245, 158, 11, 0.7);
}
.btn-gold:hover {
  border-color: #c98506;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 14px 36px -10px rgba(245, 158, 11, 0.85);
}

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-sunken); border-color: transparent; }

.theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-dark { display: none; }
  :root:not([data-theme="light"]) .theme-icon-light { display: block; }
}

/* ---------- Common type ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.display {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
}
.display em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--gold);
}
html[lang="zh"] .display { letter-spacing: -0.01em; line-height: 1.18; }
html[lang="zh"] .display em { font-style: normal; font-weight: 600; font-family: var(--font); }

.lede {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-2);
}

.code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
}
.footer-about p {
  margin-top: 14px;
  font-size: 14px;
  color: var(--ink-3);
  max-width: 320px;
}
.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; display: grid; gap: 10px; }
.footer-col a {
  font-size: 14px;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 80;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .nav { gap: 12px; height: 60px; }
  .brand-tag { display: none; }
  .nav-actions .btn-cta-text { display: none; }
  .lede { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}
