/* SpareCam marketing site — Apple product-page inspired tokens */
:root {
  color-scheme: light dark;

  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-subtle: #e8e8ed;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --focus: #0071e3;
  --success: #248a3d;
  --hero-glow: rgba(0, 113, 227, 0.18);
  --phone-frame: #1d1d1f;
  --phone-screen: #0a0a0a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --nav-h: 3.25rem;
  --max: 980px;
  --content: 680px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "PingFang HK", "PingFang TC", "Noto Sans TC",
    "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --bg-subtle: #2c2c2e;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #6e6e73;
    --border: rgba(255, 255, 255, 0.12);
    --accent: #2997ff;
    --accent-hover: #4aa3ff;
    --accent-soft: rgba(41, 151, 255, 0.16);
    --hero-glow: rgba(41, 151, 255, 0.22);
    --phone-frame: #f5f5f7;
    --phone-screen: #111113;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* —— Site chrome —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  opacity: 0.8;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 520px) {
  .nav {
    gap: 0.35rem 0.75rem;
  }

  .brand {
    font-size: 0.95rem;
  }
}

.nav a {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 400;
  text-decoration: none;
}

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

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  line-height: 1.2;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

.lang-switch button:focus-visible {
  outline-offset: 1px;
}

/* —— Layout —— */
main {
  overflow-x: clip;
}

.section {
  padding: clamp(4rem, 10vw, 7rem) var(--pad);
}

.section--tight {
  padding-top: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.section--elevated {
  background: var(--bg-elevated);
}

.section__inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section__inner--narrow {
  max-width: var(--content);
}

.eyebrow {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.display {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.125rem, 2.4vw, 1.375rem);
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  margin: 0 0 2rem;
  max-width: 36rem;
  text-wrap: pretty;
}

.h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.subhead {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin: 0 0 2.5rem;
  max-width: 34rem;
  text-wrap: pretty;
}

.meta {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin: 0 0 1.5rem;
}

/* —— Hero —— */
.hero {
  position: relative;
  padding: clamp(3.5rem, 12vw, 6.5rem) var(--pad) clamp(3rem, 8vw, 5rem);
  text-align: center;
  overflow: hidden;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  justify-items: center;
}

.hero__copy {
  max-width: 44rem;
}

.hero .display {
  margin-left: auto;
  margin-right: auto;
}

.hero .lede {
  margin-left: auto;
  margin-right: auto;
}

.hero__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.cta-note {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin: 0;
}

/* App Store badge — clear space ≈ ¼ height; min 40px */
.app-store-badge {
  display: inline-block;
  /* Clear space: ¼ of 40px min height → 10px; use 12px for comfort */
  padding: 12px;
  line-height: 0;
  text-decoration: none;
  border-radius: 8px;
}

.app-store-badge:hover {
  text-decoration: none;
  opacity: 0.92;
}

.app-store-badge:focus-visible {
  outline-offset: 4px;
}

.app-store-badge img {
  height: 40px;
  width: auto;
}

@media (min-width: 480px) {
  .app-store-badge img {
    height: 48px;
  }

  .app-store-badge {
    padding: 12px; /* ≥ ¼ of 48px */
  }
}

.app-store-badge img[hidden] {
  display: none !important;
}

.app-store-badge__light {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .app-store-badge__dark {
    display: none;
  }

  .app-store-badge__light:not([hidden]) {
    display: block;
  }
}

/* Coming-soon still uses official badge artwork; href is placeholder */
.app-store-badge[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.85;
}

/* —— Signature: motion rings + phone frame —— */
.hero-stage {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 9 / 19.5;
  margin: 0 auto;
}

.motion-rings {
  position: absolute;
  inset: -18%;
  pointer-events: none;
  z-index: 0;
}

.motion-rings span {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  opacity: 0;
  animation: ring-pulse 4.8s var(--ease) infinite;
}

.motion-rings span:nth-child(2) {
  animation-delay: 1.2s;
}

.motion-rings span:nth-child(3) {
  animation-delay: 2.4s;
}

@keyframes ring-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0;
  }
  25% {
    opacity: 0.55;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.phone {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 2.4rem;
  background: var(--phone-frame);
  padding: 0.55rem;
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: no-preference) {
  .phone {
    transform: translateY(12px);
    opacity: 0;
    animation: phone-rise 1.1s var(--ease-out) 0.15s forwards;
  }
}

.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 1.9rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% 35%, var(--hero-glow), transparent 70%),
    var(--phone-screen);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  text-align: center;
  padding: 1.5rem;
}

.phone__notch {
  position: absolute;
  top: 0.65rem;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 1.1rem;
  background: var(--phone-frame);
  border-radius: 999px;
  z-index: 2;
}

.screenshot-placeholder {
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #a1a1a6;
  max-width: 11rem;
}

.screenshot-placeholder strong {
  display: block;
  color: #f5f5f7;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

@keyframes phone-rise {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Spotlight follow (hero signature) */
.hero-spotlight {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, var(--hero-glow), transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  will-change: left, top;
}

.hero.is-lit .hero-spotlight {
  opacity: 1;
}

/* —— Feature grid —— */
.feature-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

.feature-card {
  padding: 1.75rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.45s var(--ease-out), border-color 0.3s var(--ease);
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.feature-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.feature-card .h3 {
  margin-bottom: 0.6rem;
}

/* —— Comparison table —— */
.compare-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.compare {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
  font-size: 0.9375rem;
}

.compare th,
.compare td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.compare thead th {
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
  background: var(--bg-subtle);
}

.compare tbody tr:last-child th,
.compare tbody tr:last-child td {
  border-bottom: 0;
}

.compare th[scope="row"] {
  font-weight: 500;
  color: var(--text);
}

.compare td {
  color: var(--text-secondary);
  text-align: center;
}

.compare thead th:not(:first-child) {
  text-align: center;
}

.compare .check {
  color: var(--success);
  font-weight: 600;
}

.compare .pro-col {
  color: var(--accent);
  font-weight: 600;
}

.price-note {
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  max-width: 40rem;
}

/* —— Privacy strip —— */
.privacy-strip {
  text-align: center;
}

.privacy-strip .lede {
  margin-left: auto;
  margin-right: auto;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0;
  list-style: none;
  padding: 0;
}

.pill-row li {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* —— FAQ —— */
.faq {
  display: grid;
  gap: 0.75rem;
}

.faq details {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

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

.faq summary::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease);
  flex-shrink: 0;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 0.25rem;
}

.faq .faq__body {
  padding: 0 1.25rem 1.2rem;
  color: var(--text-secondary);
  margin: 0;
}

/* —— Screenshot gallery placeholders —— */
.shot-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .shot-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.shot {
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px dashed color-mix(in srgb, var(--text-tertiary) 50%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.shot strong {
  display: block;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

/* —— Legal / prose pages —— */
.prose h2 {
  font-size: 1.375rem;
  letter-spacing: -0.025em;
  margin: 2.5rem 0 0.75rem;
}

.prose p,
.prose li {
  color: var(--text-secondary);
}

.prose ul {
  padding-left: 1.2rem;
}

.prose li {
  margin-bottom: 0.65rem;
}

.prose li strong {
  color: var(--text);
}

.contact-box {
  margin: 2rem 0;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.contact-box a {
  font-weight: 600;
  word-break: break-all;
}

/* —— Footer —— */
.site-footer {
  padding: 2.5rem var(--pad) 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer a {
  color: var(--text-secondary);
}

/* —— Reveal on scroll —— */
/* Scroll reveal: content stays visible without JS; motion users get a one-shot enter */
@media (prefers-reduced-motion: no-preference) {
  .reveal.is-visible {
    animation: reveal-in 0.7s var(--ease-out) both;
  }
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .phone,
  .feature-card {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .motion-rings span,
  .hero-spotlight {
    display: none !important;
  }

  .feature-card:hover {
    transform: none;
  }
}

/* —— i18n visibility —— */
[data-lang-panel] {
  display: none !important;
}

html[lang="zh-HK"] [data-lang-panel="zh-HK"],
html[lang="en"] [data-lang-panel="en"] {
  display: revert !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
