/* HeyCC — Apple HIG Web Design System
 * Inspired by apple.com + iOS 26 Liquid Glass
 * Brand color: #007AFF (matches app icon)
 */

:root {
  /* Brand */
  --brand: #007AFF;
  --brand-hover: #0066d6;
  --brand-bg: rgba(0, 122, 255, 0.08);

  /* Light theme */
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --bg-section: #f5f5f7;
  --text-primary: #1d1d1f;
  --text-secondary: #424245;
  --text-tertiary: #6e6e73;
  --separator: rgba(0, 0, 0, 0.08);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);

  /* Layout */
  --max-content: 980px;
  --max-wide: 1440px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 980px;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Monaco, "Roboto Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --bg-section: #1a1a1a;
    --text-primary: #f5f5f7;
    --text-secondary: #d1d1d6;
    --text-tertiary: #8e8e93;
    --separator: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(22, 22, 23, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --brand-bg: rgba(10, 132, 255, 0.15);
    --brand: #0a84ff;
    --brand-hover: #409cff;
  }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.47;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--brand-hover); }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }

/* ===== Nav (Frosted glass) ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
}
.nav-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 22px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 19px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.nav-brand img { width: 24px; height: 24px; border-radius: 6px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
}
.nav-links a:hover { color: var(--text-primary); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-section);
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
}
.lang-switch a {
  padding: 4px 10px;
  border-radius: 980px;
  color: var(--text-tertiary);
  transition: all 0.2s ease;
}
.lang-switch a.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.lang-switch a:not(.active):hover {
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13px; }
  .nav-right { gap: 12px; }
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 22px;
}
.section {
  padding: 96px 0;
}
.section-narrow {
  padding: 64px 0;
}
@media (max-width: 640px) {
  .section { padding: 64px 0; }
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 80px 22px 64px;
  max-width: var(--max-wide);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}
.hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 27px;
  margin: 0 auto 32px;
  box-shadow: 0 18px 40px rgba(0, 122, 255, 0.25);
}
.hero-title {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.07;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-tagline {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 40px;
  line-height: 1.3;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.hero-meta {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* ===== Buttons (Apple pill) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand);
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  color: var(--brand) !important;
  border: 1px solid var(--brand);
}
.btn-secondary:hover {
  background: var(--brand-bg);
}
.btn-ghost {
  color: var(--text-primary) !important;
  background: var(--bg-section);
}
.btn-ghost:hover { opacity: 0.8; }

/* ===== Features grid ===== */
.features {
  background: var(--bg-section);
}
.section-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.1;
}
.section-subtitle {
  font-size: clamp(18px, 2vw, 21px);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 64px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--separator);
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--brand-bg);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.feature-icon svg { width: 26px; height: 26px; }
.heart-icon {
  display: inline-block;
  vertical-align: -2px;
  width: 14px;
  height: 14px;
  color: #FF3B30;
}
.feature-card h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.feature-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Download CTA section ===== */
.download-section {
  text-align: center;
}
.download-card {
  background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  color: #fff;
  max-width: 720px;
  margin: 0 auto;
}
.download-card h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.download-card p {
  font-size: 17px;
  opacity: 0.9;
  margin-bottom: 32px;
}
.download-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-white {
  background: #fff;
  color: var(--brand) !important;
}
.btn-white:hover { transform: translateY(-1px); }
.btn-outline-white {
  background: transparent;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.btn-outline-white:hover { background: rgba(255, 255, 255, 0.12); }

/* ===== Doc page (Privacy / Terms / Support) ===== */
.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 22px 96px;
}
.doc h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  line-height: 1.1;
}
.doc h2 {
  font-size: 24px;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.doc p, .doc li {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}
.doc ul, .doc ol {
  padding-left: 24px;
  margin-bottom: 14px;
}
.doc strong { color: var(--text-primary); font-weight: 600; }
.doc-meta {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--separator);
}

/* ===== Contact tiles (Support page) ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.contact-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  color: var(--text-primary) !important;
  transition: all 0.2s ease;
}
.contact-tile:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}
.contact-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.contact-tile-label {
  font-size: 13px;
  color: var(--text-tertiary);
}
.contact-tile-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-section);
  border-top: 1px solid var(--separator);
  padding: 32px 0 24px;
  margin-top: 64px;
}
.footer-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-tertiary);
  font-size: 13px;
}
.footer-links a:hover { color: var(--text-primary); }
.footer-copy {
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ===== Accessibility ===== */
/* Skip-to-content link (visually hidden until focused) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  background: var(--brand);
  color: #fff !important;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 12px;
}

/* Keyboard-visible focus ring (Apple HIG: high-contrast 3px ring with 2px offset) */
*:focus { outline: none; }
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.contact-tile:focus-visible,
.lang-switch a:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 8px;
}
.btn:focus-visible,
.lang-switch a:focus-visible,
.contact-tile:focus-visible {
  border-radius: var(--radius-pill);
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .feature-card:hover,
  .btn:hover,
  .btn-white:hover,
  .contact-tile:hover {
    transform: none !important;
  }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.mt-4 { margin-top: 32px; }
