/* Find My Bus - SG: Apple-inspired design: Clarity, Depth, Deference */

/* 8pt grid, Apple-like scale */
:root {
  --space-1: 0.5rem;   /* 8px */
  --space-2: 1rem;     /* 16px */
  --space-3: 1.5rem;   /* 24px */
  --space-4: 2rem;     /* 32px */
  --space-5: 3rem;     /* 48px */
  --space-6: 4rem;     /* 64px */
  --space-7: 6rem;     /* 96px */
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  /* System font: San Francisco on Apple, fallbacks elsewhere */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --container: min(980px, 100vw - var(--space-4));
}

/* Light theme (default, Apple-like) */
:root,
:root[data-theme="light"] {
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-secondary: #f5f5f7;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.08);
  --border: rgba(0, 0, 0, 0.06);
  --nav-bg: rgba(251, 251, 253, 0.82);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* Dark theme */
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --surface: #1c1c1e;
  --surface-secondary: #2c2c2e;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --accent: #2997ff;
  --accent-hover: #5eb0ff;
  --accent-soft: rgba(41, 151, 255, 0.12);
  --border: rgba(255, 255, 255, 0.08);
  --nav-bg: rgba(0, 0, 0, 0.72);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] .hero-subtitle,
:root[data-theme="dark"] .hero-subtitle [data-lang] {
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --surface: #1c1c1e;
    --surface-secondary: #2c2c2e;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #6e6e73;
    --accent: #2997ff;
    --accent-hover: #5eb0ff;
    --accent-soft: rgba(41, 151, 255, 0.12);
    --border: rgba(255, 255, 255, 0.08);
    --nav-bg: rgba(0, 0, 0, 0.72);
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  }

  :root:not([data-theme="light"]) .hero-subtitle,
  :root:not([data-theme="light"]) .hero-subtitle [data-lang] {
    color: #ffffff;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Depth: subtle gradient (deference, doesn’t compete with content) */
.hero-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--bg);
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 100% 80% at 50% -30%,
    var(--accent-soft) 0%,
    transparent 55%
  );
  opacity: 0.6;
}

/* Nav: clarity + depth (frosted) */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  max-width: 100%;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-lang {
  margin-left: auto;
  padding-left: var(--space-3);
  border-left: 1px solid var(--border);
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.016em;
  transition: color 0.2s ease;
}

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

/* Language selector: native feel, clarity */
.lang-select {
  padding: var(--space-1) var(--space-2);
  padding-right: 2rem;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: var(--surface-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2386868b' d='M6 7.5L1.5 3h9L6 7.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.lang-select:hover {
  border-color: var(--text-tertiary);
}

.lang-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Hero: deference to content, one clear message */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  min-height: calc(100vh - 57px);
}

/* Hero logo + “Why this?” link: clearly clickable, Apple-style */
.hero-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  margin-bottom: var(--space-5);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  margin-left: calc(-1 * var(--space-2));
  margin-right: calc(-1 * var(--space-2));
  transition: background 0.25s ease;
}
.hero-logo-wrap:hover {
  background: var(--accent-soft);
}
.hero-why-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin-top: var(--space-2);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.hero-why-link::after {
  content: "→";
  font-weight: 500;
  font-size: 0.95em;
}
.hero-logo-wrap:hover .hero-why-link {
  color: var(--accent-hover);
}
.hero-logo-wrap:active .hero-why-link {
  color: var(--accent);
  opacity: 0.9;
}

.hero-logo {
  width: min(280px, 72vw);
  max-width: 100%;
  height: auto;
  display: block;
  /* Subtle depth only */
}

.hero-tagline {
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
  max-width: 18ch;
  margin: 0 auto var(--space-1);
}

.hero-subtitle {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.016em;
  line-height: 1.3;
  color: var(--text);
  max-width: 28ch;
  margin: 0 auto var(--space-2);
}

.hero-sub {
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.016em;
  line-height: 1.38;
  color: var(--text-secondary);
  max-width: 24ch;
  margin: 0 auto var(--space-2);
}

.hero-free {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0 auto var(--space-5);
  background: linear-gradient(135deg, #86efac 0%, #22c55e 40%, #16a34a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.4));
}

.hero-badge-feature {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--text-tertiary);
  max-width: 32ch;
  margin: var(--space-3) auto 0;
}

/* App Store badge: Apple standard */
.app-store-badge {
  display: inline-block;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-store-badge:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.app-store-badge:active {
  transform: scale(0.98);
}

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

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

/* Dark theme: badge is black by default; invert for visibility */
:root[data-theme="dark"] .app-store-badge img {
  filter: invert(1) brightness(1.05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-store-badge img {
    filter: invert(1) brightness(1.05);
  }
}

/* Page (support): same design language */
.page {
  flex: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
}

.page-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 var(--space-2);
  color: var(--text);
}

.page-lead {
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.016em;
  line-height: 1.38;
  color: var(--text-secondary);
  margin: 0 0 var(--space-5);
}

.support-section {
  margin-bottom: var(--space-5);
}

.support-section h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--text);
  margin: 0 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.support-section h2 .icon {
  font-size: 1em;
  opacity: 0.9;
}

.support-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-2);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.support-card h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0 0 var(--space-1);
  color: var(--text);
}

.support-card p {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.016em;
  line-height: 1.47;
  margin: 0;
  color: var(--text-secondary);
}

/* Contact & feedback (mailto links) */
.contact-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-2);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.contact-card p {
  font-size: 15px;
  letter-spacing: -0.016em;
  line-height: 1.47;
  margin: 0 0 var(--space-2);
  color: var(--text-secondary);
}

.contact-card .feedback-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.contact-card .feedback-link:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.contact-card .feedback-link:active {
  transform: scale(0.98);
}

.contact-card .feedback-link.secondary {
  background: var(--surface-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.contact-card .feedback-link.secondary:hover {
  background: var(--border);
  color: var(--text);
}

/* Footer: deference */
.footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

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

.footer a:hover {
  text-decoration: underline;
}

/* Language visibility */
[data-lang]:not([data-lang=""]) {
  display: none;
}

body.lang-en [data-lang="en"],
body.lang-zh [data-lang="zh"],
body.lang-ms [data-lang="ms"],
body.lang-ta [data-lang="ta"],
body.lang-sg [data-lang="sg"] {
  display: block;
}

.nav a [data-lang] {
  display: none;
}

body.lang-en .nav a [data-lang="en"],
body.lang-zh .nav a [data-lang="zh"],
body.lang-ms .nav a [data-lang="ms"],
body.lang-ta .nav a [data-lang="ta"],
body.lang-sg .nav a [data-lang="sg"] {
  display: inline;
}

.support-section h2 [data-lang] {
  display: none;
}

body.lang-en .support-section h2 [data-lang="en"],
body.lang-zh .support-section h2 [data-lang="zh"],
body.lang-ms .support-section h2 [data-lang="ms"],
body.lang-ta .support-section h2 [data-lang="ta"],
body.lang-sg .support-section h2 [data-lang="sg"] {
  display: inline;
}

.contact-card .feedback-link [data-lang] {
  display: none;
}
body.lang-en .contact-card .feedback-link [data-lang="en"],
body.lang-zh .contact-card .feedback-link [data-lang="zh"],
body.lang-ms .contact-card .feedback-link [data-lang="ms"],
body.lang-ta .contact-card .feedback-link [data-lang="ta"],
body.lang-sg .contact-card .feedback-link [data-lang="sg"] {
  display: inline;
}

/* Features page */
.features-page {
  flex: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
}

.features-hero {
  text-align: center;
  margin-bottom: var(--space-7);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.features-headline {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.06;
  color: var(--text);
  margin: 0 0 var(--space-3);
  max-width: 14em;
  margin-left: auto;
  margin-right: auto;
}

.features-lead {
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.016em;
  line-height: 1.38;
  color: var(--text-secondary);
  max-width: 42ch;
  margin: 0 auto;
}

.features-section {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border);
}

.features-section:last-of-type {
  border-bottom: none;
}

.features-section--highlight {
  background: var(--accent-soft);
  margin-left: calc(-1 * var(--space-4));
  margin-right: calc(-1 * var(--space-4));
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  border-radius: var(--radius-lg);
  border-bottom-color: transparent;
}

.features-section--challenge {
  background: var(--surface-secondary);
  margin-left: calc(-1 * var(--space-4));
  margin-right: calc(-1 * var(--space-4));
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  border-radius: var(--radius-lg);
  border-bottom-color: transparent;
}

.features-section-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.features-section-icon {
  font-size: 1.2em;
  opacity: 0.85;
  flex-shrink: 0;
}

.features-section-desc {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.016em;
  line-height: 1.47;
  color: var(--text-secondary);
  margin: 0;
  max-width: 52ch;
}

.features-cta {
  text-align: center;
  padding: var(--space-6) 0;
}

.features-cta .app-store-badge {
  display: inline-block;
}

/* Why this, not Google Maps? page */
.why-page {
  flex: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
}
.why-hero {
  text-align: center;
  margin-bottom: var(--space-7);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}
.why-headline {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text);
  max-width: 14em;
  margin: 0 auto var(--space-3);
}
.why-lead {
  font-size: 21px;
  font-weight: 400;
  letter-spacing: -0.016em;
  line-height: 1.38;
  color: var(--text-secondary);
  max-width: 36ch;
  margin: 0 auto;
}
.why-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-6);
  counter-reset: why;
}
.why-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  counter-increment: why;
}
.why-item:first-child {
  padding-top: 0;
}
.why-item--last {
  border-bottom: none;
  padding-bottom: 0;
}
.why-item-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  background: var(--surface-secondary);
  border-radius: 50%;
}
.why-item-text {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.016em;
  line-height: 1.47;
  color: var(--text);
  padding-top: 2px;
}
.why-cta-copy {
  text-align: center;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.016em;
  line-height: 1.4;
  color: var(--text-secondary);
  max-width: 32ch;
  margin: 0 auto var(--space-5);
}
.why-cta {
  text-align: center;
  padding-bottom: var(--space-4);
}
.why-cta .app-store-badge {
  display: inline-block;
}

/* Why page: language visibility */
.why-headline [data-lang],
.why-lead [data-lang],
.why-item-text [data-lang],
.why-cta-copy [data-lang] {
  display: none;
}
body.lang-en .why-headline [data-lang="en"],
body.lang-en .why-lead [data-lang="en"],
body.lang-en .why-item-text [data-lang="en"],
body.lang-en .why-cta-copy [data-lang="en"],
body.lang-zh .why-headline [data-lang="zh"],
body.lang-zh .why-lead [data-lang="zh"],
body.lang-zh .why-item-text [data-lang="zh"],
body.lang-zh .why-cta-copy [data-lang="zh"],
body.lang-ms .why-headline [data-lang="ms"],
body.lang-ms .why-lead [data-lang="ms"],
body.lang-ms .why-item-text [data-lang="ms"],
body.lang-ms .why-cta-copy [data-lang="ms"],
body.lang-ta .why-headline [data-lang="ta"],
body.lang-ta .why-lead [data-lang="ta"],
body.lang-ta .why-item-text [data-lang="ta"],
body.lang-ta .why-cta-copy [data-lang="ta"],
body.lang-sg .why-headline [data-lang="sg"],
body.lang-sg .why-lead [data-lang="sg"],
body.lang-sg .why-item-text [data-lang="sg"],
body.lang-sg .why-cta-copy [data-lang="sg"] {
  display: inline;
}
body.lang-en .hero-why-link [data-lang="en"],
body.lang-zh .hero-why-link [data-lang="zh"],
body.lang-ms .hero-why-link [data-lang="ms"],
body.lang-ta .hero-why-link [data-lang="ta"],
body.lang-sg .hero-why-link [data-lang="sg"] {
  display: inline;
}
.hero-why-link [data-lang] {
  display: none;
}

/* Features: language visibility */
.features-headline [data-lang],
.features-lead [data-lang],
.features-section-title [data-lang],
.features-section-desc [data-lang] {
  display: none;
}

body.lang-en .features-headline [data-lang="en"],
body.lang-en .features-lead [data-lang="en"],
body.lang-en .features-section-title [data-lang="en"],
body.lang-en .features-section-desc [data-lang="en"],
body.lang-zh .features-headline [data-lang="zh"],
body.lang-zh .features-lead [data-lang="zh"],
body.lang-zh .features-section-title [data-lang="zh"],
body.lang-zh .features-section-desc [data-lang="zh"],
body.lang-ms .features-headline [data-lang="ms"],
body.lang-ms .features-lead [data-lang="ms"],
body.lang-ms .features-section-title [data-lang="ms"],
body.lang-ms .features-section-desc [data-lang="ms"],
body.lang-ta .features-headline [data-lang="ta"],
body.lang-ta .features-lead [data-lang="ta"],
body.lang-ta .features-section-title [data-lang="ta"],
body.lang-ta .features-section-desc [data-lang="ta"],
body.lang-sg .features-headline [data-lang="sg"],
body.lang-sg .features-lead [data-lang="sg"],
body.lang-sg .features-section-title [data-lang="sg"],
body.lang-sg .features-section-desc [data-lang="sg"] {
  display: inline;
}

/* Responsive: clarity at every size */
@media (max-width: 734px) {
  .nav {
    padding: var(--space-2);
    flex-wrap: wrap;
  }

  .nav-links {
    order: 2;
    width: 100%;
    justify-content: center;
  }

  .hero {
    padding: var(--space-5) var(--space-3);
    min-height: calc(100vh - 52px);
  }

  .hero-logo-wrap {
    margin-bottom: var(--space-4);
  }
  .hero-logo {
    width: min(220px, 68vw);
  }
  .hero-why-link {
    font-size: 14px;
  }

  .hero-tagline {
    font-size: 26px;
    max-width: none;
  }

  .hero-subtitle {
    font-size: 17px;
    max-width: none;
  }

  .hero-free {
    font-size: 20px;
  }

  .hero-badge-feature {
    font-size: 14px;
    max-width: none;
  }

  .hero-sub {
    font-size: 19px;
    max-width: none;
  }

  .page {
    padding: var(--space-4) var(--space-3);
  }

  .page-title {
    font-size: 28px;
  }

  .page-lead {
    font-size: 19px;
  }

  .support-card {
    padding: var(--space-3);
  }

  .features-page {
    padding: var(--space-4) var(--space-3);
  }

  .features-hero {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
  }

  .features-headline {
    font-size: 28px;
  }

  .features-lead {
    font-size: 19px;
  }

  .features-section--highlight,
  .features-section--challenge {
    margin-left: calc(-1 * var(--space-3));
    margin-right: calc(-1 * var(--space-3));
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .features-section-desc {
    font-size: 15px;
  }

  .why-page {
    padding: var(--space-4) var(--space-3);
  }
  .why-hero {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
  }
  .why-headline {
    font-size: 28px;
  }
  .why-lead {
    font-size: 19px;
  }
  .why-item-text {
    font-size: 15px;
  }
  .why-cta-copy {
    font-size: 17px;
  }
}
