/* TradeMax — Apple HIG Web Design System
 * Inspired by apple.com + iOS 26 Liquid Glass
 * Brand color: iOS Indigo (#5856D6) — premium AI + trading
 * Layout & component patterns aligned with sister site heycc.fun
 */

:root {
  /* Brand */
  --brand: #5856D6;
  --brand-hover: #4845c0;
  --brand-bg: rgba(88, 86, 214, 0.08);

  /* Semantic — trading */
  --up: #34C759;
  --down: #FF3B30;

  /* 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(94, 92, 230, 0.18);
    --brand: #5E5CE6;
    --brand-hover: #7d7be8;
    --up: #30D158;
    --down: #FF453A;
  }
}

/* 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; align-items: center; }
.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-lang {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--separator);
  color: var(--text-secondary) !important;
}
.nav-lang:hover {
  border-color: var(--brand);
  color: var(--brand) !important;
}

@media (max-width: 640px) {
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 13px; }
  .nav-lang { padding: 3px 8px; font-size: 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::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(88, 86, 214, 0.10), transparent 60%);
  z-index: -1;
  pointer-events: none;
}
.hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 27px;
  margin: 0 auto 32px;
  box-shadow: 0 18px 40px rgba(88, 86, 214, 0.28);
}
.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; }
.btn-disabled {
  background: var(--bg-section);
  color: var(--text-tertiary) !important;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-white { background: #fff; color: var(--brand) !important; }
.btn-white:hover { background: #f0f0f5; }
.btn-outline-white {
  background: transparent;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.6);
}
.btn-outline-white:hover { background: rgba(255,255,255,0.1); }

/* ===== 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; }
.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 section ===== */
.download-section { background: var(--bg); }
.download-card {
  background: linear-gradient(135deg, var(--brand), #7d7be8);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  text-align: center;
  color: #fff;
  box-shadow: 0 20px 50px rgba(88, 86, 214, 0.25);
}
.download-card h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.download-card p {
  font-size: 18px;
  opacity: 0.95;
  margin-bottom: 32px;
}
.download-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

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

/* ===== Doc pages (privacy/terms/support) ===== */
.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 22px 96px;
}
.doc h1 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.1;
}
.doc h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
}
.doc h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 8px;
}
.doc p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.doc ul { margin: 8px 0 16px 24px; }
.doc li { color: var(--text-secondary); margin-bottom: 6px; font-size: 16px; line-height: 1.55; }
.doc strong { color: var(--text-primary); font-weight: 600; }
.doc-meta {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--separator);
}

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

/* ===== Reduced motion ===== */
@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;
  }
}
