/* ==========================================================================
   oscarzhou.com — shared stylesheet
   One file, no build step, no dependencies. Light + dark via prefers-color-scheme.
   ========================================================================== */

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --ink: #0b0b0f;
  --ink-soft: #3a3a40;
  --muted: #64646e;
  --line: rgba(11, 11, 15, 0.09);
  --line-strong: rgba(11, 11, 15, 0.16);
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --accent-ink: #4338ca;
  --gold: #b8860b;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 1px 2px rgba(11, 11, 15, 0.04), 0 12px 32px -16px rgba(11, 11, 15, 0.18);
  --shadow-lg: 0 2px 4px rgba(11, 11, 15, 0.05), 0 32px 64px -32px rgba(11, 11, 15, 0.35);
  --max: 1040px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08080a;
    --surface: #121216;
    --surface-2: #17171c;
    --ink: #f4f4f6;
    --ink-soft: #d6d6dc;
    --muted: #9a9aa4;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --accent: #8b87ff;
    --accent-soft: rgba(139, 135, 255, 0.14);
    --accent-ink: #b3afff;
    --gold: #e6c46a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -20px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.5), 0 40px 80px -40px rgba(0, 0, 0, 0.9);
  }
}

/* ---- Reset ------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter,
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

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

::selection {
  background: var(--accent-soft);
}

/* ---- Layout helpers ---------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ---- Header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand img,
.brand .monogram {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

/* 头像：个人站首页 / 404 用它，CamMicLink 页面用 App 图标（直角圆角方块）。
   照片裁成圆形更像头像，也给一圈细边，免得在白底上糊掉。 */
.brand .avatar {
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
}

.brand .monogram {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  font-size: 15px;
}

.site-nav a {
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav .nav-cta {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 14px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.site-nav .nav-cta:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

@media (max-width: 620px) {
  .site-nav {
    gap: 14px;
    font-size: 14px;
  }
  .site-nav .hide-sm {
    display: none;
  }
}

/* ---- Typography -------------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
}

h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
}

h3 {
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

p {
  margin: 0 0 1em;
}

.lead {
  font-size: clamp(1.06rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 34em;
  text-wrap: pretty;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 14px;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 550;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease), opacity 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--ink);
  color: var(--bg);
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--surface-2);
}

.btn--soon {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--line);
  cursor: default;
}

.btn--soon:hover {
  transform: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
}

/* ---- Hero (home) ------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(56px, 8vw, 96px) 0 clamp(24px, 3vw, 40px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(48% 62% at 20% 4%, var(--accent-soft), transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.hero h1 {
  max-width: 15em;
}

.hero .lead {
  margin-top: 22px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

/* ---- Sections ---------------------------------------------------------- */

.section {
  /* 只给纵向内边距：`.wrap.section` 同时带 .wrap 时，
     用 padding 简写会把左右 24px 内边距清掉 */
  padding-block: clamp(44px, 7vw, 76px);
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.section-head p {
  margin: 0;
  max-width: 26em;
}

@media (max-width: 720px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ---- Grid + cards ------------------------------------------------------ */

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.card--link:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.card .glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.card .glyph svg {
  width: 21px;
  height: 21px;
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

/* App card on the home page */
.app-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.app-card img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.app-card > div {
  min-width: 0;
}

.app-card .app-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-card .app-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.app-card .go {
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
  font-weight: 450;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .app-card .go {
    display: none;
  }
}

/* ---- Diagram card（产品页首屏示意图） ---------------------------------- */

.diagram-card {
  padding: clamp(14px, 2vw, 22px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.8);
}

.diagram-card svg {
  width: 100%;
  height: auto;
}

.split--hero {
  grid-template-columns: 1.04fr 0.96fr;
}

.split--hero h1 {
  font-size: clamp(2.1rem, 3.6vw, 3.25rem);
}

@media (max-width: 900px) {
  .split--hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- Dark showcase band ------------------------------------------------ */

.band-dark {
  position: relative;
  overflow: hidden;
  background: #08080a;
  color: #f4f4f6;
  border-block: 1px solid rgba(255, 255, 255, 0.08);
}

.band-dark::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 70%;
  background: radial-gradient(60% 60% at 50% 0%, rgba(99, 91, 255, 0.35), transparent 70%);
  pointer-events: none;
}

.band-dark .wrap {
  position: relative;
}

.band-dark .lead,
.band-dark .muted {
  color: #a9a9b6;
}

.band-dark .eyebrow {
  color: #b3afff;
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.split > * {
  /* 网格项默认 min-width:auto，SVG / 固定宽图会把整列撑破视口 */
  min-width: 0;
}

@media (max-width: 780px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- Steps ------------------------------------------------------------- */

.steps {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  counter-reset: step;
}

.step {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-ink);
}

/* ---- Pricing ----------------------------------------------------------- */

.price-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.plan--featured {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow);
}

.plan .plan-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
}

.plan .price {
  font-size: 1.9rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.plan .price small {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.plan ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 15px;
  color: var(--ink-soft);
}

.plan li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.plan li::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}

.plan .note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.tag--gold {
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  color: var(--gold);
}

/* ---- FAQ --------------------------------------------------------------- */

.faq {
  display: grid;
  gap: 10px;
  max-width: 46em;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 0 18px;
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  font-weight: 550;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.2s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
}

/* ---- Prose (legal pages) ----------------------------------------------- */

.prose {
  max-width: 44em;
  padding: clamp(40px, 6vw, 72px) 0 24px;
}

.prose h1 {
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  margin-bottom: 10px;
}

.prose h2 {
  font-size: 1.22rem;
  margin: 38px 0 10px;
  letter-spacing: -0.01em;
}

.prose p,
.prose li {
  color: var(--ink-soft);
}

.prose ul {
  padding-left: 1.1em;
  margin: 0 0 1em;
}

.prose li {
  margin-bottom: 0.45em;
}

.prose a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose .updated {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}

.prose .callout {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 15px;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 44px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---- Motion ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---- 语言选择（details/summary，不需要 JS） ---------------------------- */

.lang {
  position: relative;
  margin-left: 4px;
}

.lang summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  transition: color .15s var(--ease), background .15s var(--ease);
}

.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { color: var(--ink); background: var(--surface-2); }
.lang summary svg { width: 15px; height: 15px; flex: none; }

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(3, minmax(122px, 1fr));
  gap: 2px 6px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: min(64vh, 420px);
  overflow: auto;
  max-width: calc(100vw - 32px);
}

.lang-menu a {
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
}

.lang-menu a:hover { background: var(--surface-2); color: var(--ink); }
.lang-menu a[aria-current] { color: var(--ink); font-weight: 600; }

/* ---- 兼容软件条 -------------------------------------------------------- */

.works {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 8px 0 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .55);
  font-size: 13px;
}

.works-label {
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .34);
}

@media (max-width: 700px) {
  .lang-menu { grid-template-columns: repeat(2, minmax(112px, 1fr)); right: -6px; }
  .lang summary span { display: none; }
  .lang summary { padding: 6px; }
}

@media (max-width: 480px) {
  .site-nav .hide-xs { display: none; }
}

/* ---- 卡片里的文字链接 -------------------------------------------------- */

/* 卡片里的「Get the audio component →」之类：
   卡片正文是 --muted 灰，链接用强调色 + 下划线，保证一眼看出可点。
   下划线用 text-decoration 而不是 border-bottom，这样换行时每行都有线。 */
.card-link {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent-ink) 45%, transparent);
  transition: text-decoration-color .15s var(--ease), color .15s var(--ease);
}

.card-link:hover {
  text-decoration-color: currentColor;
  text-decoration-thickness: 1.5px;
}
