/* ========== HearAI - theme based on Flutter ColorScheme (updated for clearer hierarchy) ========== */

:root {
  --primary: #ff7a00;
  --on-primary: #ffffff;
  --primary-container: #ffe5cc;
  --on-primary-container: #4a2600;

  --secondary: #6f6f6f;
  --on-secondary: #ffffff;
  --secondary-container: #f2f2f2; /* page background */
  --on-secondary-container: #3b3b3b;

  --tertiary: #2e8b57;
  --on-tertiary: #ffffff;
  --tertiary-container: #cff6e3;
  --on-tertiary-container: #063421;

  --error: #e53935;
  --on-error: #ffffff;
  --error-container: #ffdad4;
  --on-error-container: #410001;

  --surface: #ffffff; /* card background */
  --on-surface: #1a1a1a; /* main text color */
  --surface-container-highest: #f5f5f5; /* alternate container */
  --on-surface-variant: #6c6c6c;

  --outline: #e0e0e0;
  --outline-variant: #f0efef;

  --shadow: rgba(0, 0, 0, 0.12); /* stronger shadow for cards */
  --scrim: rgba(0, 0, 0, 0.2);

  --inverse-surface: #2e2e2e;
  --on-inverse-surface: #f6f6f6;

  --inverse-primary: #ffb877;
  --list-highlight-text: #e0e0e0;
  --list-highlight: #ffb877;

  --radius-lg: 16px;
  --radius-pill: 30px;
  --gap-md: 20px;
  --shadow-elev: 0 12px 30px var(--shadow);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base */
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--on-surface);
  background-color: var(
    --secondary-container
  ); /* page background = warm light gray */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Navbar: TOP should be orange */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background-color: var(--primary); /* orange top */
  color: var(--on-primary);
  position: sticky;
  top: 0;
  z-index: 40;
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar .logo span {
  font-weight: 800;
  font-size: 20px;
  color: var(--on-primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--gap-md);
}

.nav-links a {
  color: rgba(255, 255, 255, 0.95); /* white-ish links on orange */
  text-decoration: none;
  font-weight: 600;
  transition: color 0.18s ease, transform 0.18s ease;
}

.nav-links a:hover {
  color: var(--primary-container); /* light contrast */
  transform: translateY(-1px);
}

/* Hero - keep strong brand gradient */
.hero {
  text-align: center;
  padding: 80px 20px;
  background: var(--primary);
  color: var(--on-primary);
  margin-bottom: 28px; /* separate hero from page content */
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 20px;
  margin-bottom: 30px;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.98;
}

.hero .btn {
  display: inline-block;
  padding: 12px 30px;
  background-color: var(--on-primary);
  color: var(--primary);
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
}

.hero .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
}

/* Main content container to create breathing room and consistent width */
.main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 80px 20px;
}

/* Features section sits on page background, cards are elevated */
.features {
  padding: 8px 0 40px 0;
  text-align: center;
  color: var(--on-surface);
}

.features h2 {
  font-size: 36px;
  margin-bottom: 36px;
  color: var(--primary);
}

/* Feature grid with spacing from page edges */
.feature-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

/* Card: make clearly float above page background */
.feature-card {
  background-color: var(--surface); /* white card */
  padding: 28px;
  border-radius: var(--radius-lg);
  width: 300px;
  box-shadow: var(--shadow-elev); /* stronger shadow */
  border: 1px solid var(--outline);
  transition: transform 0.24s ease, box-shadow 0.24s ease,
    border-color 0.18s ease;
  color: var(--on-surface);
}

/* Slight accent at the top of card to reinforce hierarchy */
.feature-card::before {
  content: "";
  display: block;
  height: 6px;
  width: 90px;
  margin: 0 auto 14px auto; /* 关键：auto 水平居中 */
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 122, 0, 0.95),
    rgba(255, 184, 119, 0.95)
  );
}

.feature-card h3 {
  margin-bottom: 10px;
  color: var(--on-surface);
}

.feature-card p {
  color: var(--on-surface-variant);
  font-size: 14px;
}

/* Hover lifts card and slightly intensifies border color to emphasize */
.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 48px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.06);
}

/* Download section: keep on page background but align inner container */
.download {
  padding: 40px 0 56px 0;
  text-align: center;
  color: var(--on-surface);
}

.download h2 {
  color: var(--primary);
  margin-bottom: 12px;
}

.download p {
  color: var(--on-surface-variant);
}

/* Buttons area — place inside main-container if needed */
.download-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Common store button base */
.store-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 25px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  border: 1px solid transparent;
  min-height: 48px;
}

/* SVG icons follow currentColor so they match button text color */
.store-btn svg path,
.store-btn svg rect,
.store-btn svg circle {
  fill: currentColor !important;
  stroke: none !important;
}

/* Google Play: primary colored */
.android-btn {
  background-color: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 12px 30px rgba(255, 122, 0, 0.12);
}

.android-btn:hover {
  background-color: #e96900;
  transform: translateY(-3px);
}

/* iOS: neutral, uses white card style but with subtle outline */
.ios-btn {
  background-color: var(--surface);
  color: var(--on-surface);
  border: 1px solid var(--outline);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

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

/* Chrome: light card style */
.chrome-btn {
  background-color: var(--surface);
  color: var(--on-surface);
  border: 1px solid var(--outline);
}

.chrome-btn:hover {
  background-color: var(--surface-container-highest);
  transform: translateY(-2px);
}

/* Contact area: place on surface-container-highest to visually separate */
.contact {
  padding: 48px 0;
  text-align: center;
  background-color: var(--surface-container-highest);
  color: var(--on-surface);
  margin-top: 18px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

/* Donate: same container treatment */
#donate {
  padding: 40px 0;
  margin-top: 18px;
}

/* Donate image: keep within white card style */
.donate-img {
  margin-top: 20px;
  width: 300px;
  max-width: 50%;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--outline);
}

/* Footer sits on page background but separated with top border */
footer {
  padding: 30px 20px;
  text-align: center;
  background-color: transparent;
  color: var(--on-surface-variant);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  margin-top: 36px;
}

/* Badge / small accents */
.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background-color: var(--tertiary-container);
  color: var(--on-tertiary-container);
  font-weight: 700;
  font-size: 13px;
}

/* Responsive tweaks */
@media (max-width: 820px) {
  .feature-grid {
    gap: 18px;
  }
  .hero h1 {
    font-size: 36px;
  }
  .hero p {
    font-size: 16px;
  }
  .nav-links {
    display: none;
  } /* replace with mobile nav as needed */
  .main-container {
    padding: 18px 16px 60px 16px;
  }
}

/* Accessibility focus */
a:focus,
button:focus {
  outline: 3px solid var(--primary-container);
  outline-offset: 2px;
}
