/* Colors, radii and spacing from the app's design tokens:
   docs/redesign/v1.1/smogi-redesign-handoff/tokens/tokens.json (root repo). */

:root {
  --ground: #edf0f3;
  --card: #ffffff;
  --inset: #edf0f3;
  --text: #15202b;
  --muted: #4a5866;
  --line: #e3e8ed;
  --good: #2f6b0e;
  --brand: #9bdb5e;
  --on-accent: #15202b;
  --chip-on: #15202b;
  --chip-on-text: #ffffff;
  --shadow: 0 1px 2px rgb(21 32 43 / 0.04), 0 8px 24px rgb(21 32 43 / 0.06);

  --radius-hero: 32px;
  --radius-card: 28px;
  --radius-tile: 18px;
  --gap: 14px;
  --pad: 16px;
  --screen: 16px;

  /* Google Universal AQI ramp, 0 (worst) → 100 (best). Decorative only. */
  --aqi-ramp: linear-gradient(90deg, #800000 0%, #ff3800 18%, #ff8500 29%, #ffbf00 39%, #ffff00 50%, #c1e719 60%,
      #84cf33 70%, #58be35 80%, #27ac37 91%, #009e3a 100%);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #0b0f13;
    --card: #161c22;
    --inset: #232b33;
    --text: #eef2f5;
    --muted: #a3aeb9;
    --line: #26303a;
    --good: #9bdb5e;
    --chip-on: #eef2f5;
    --chip-on-text: #0b0f13;
    --shadow: none;
  }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: ui-rounded, 'SF Pro Rounded', 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

a {
  color: inherit;
}

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

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 max(var(--screen), env(safe-area-inset-right)) 40px max(var(--screen), env(safe-area-inset-left));
}

main {
  display: grid;
  gap: var(--gap);
}

/* Grid items default to min-width: auto, which lets the scrolling gallery widen the page. */
main > *,
.features > * {
  min-width: 0;
}

.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
}

.card p,
.card ul {
  margin: 0;
}

.card ul {
  padding-inline-start: 1.15em;
}

.card li + li {
  margin-top: 6px;
}

.card li::marker {
  color: var(--good);
}

/* Top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding-top: env(safe-area-inset-top);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.topbar-language {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--card);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
}

/* Hero */

.hero {
  background: var(--card);
  border-radius: var(--radius-hero);
  box-shadow: var(--shadow);
  padding: 36px 22px 32px;
  text-align: center;
}

.hero-text {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 640px;
  margin: 0 auto;
}

.hero-icon {
  border-radius: 20px;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.12);
}

.hero h1 {
  margin: 4px 0 0;
  font-size: clamp(30px, 7.5vw, 52px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0;
  font-size: clamp(19px, 4.4vw, 24px);
  font-weight: 800;
  color: var(--muted);
}

/* The app's AQI scale bar: ramp with a white knob. */
.scale {
  position: relative;
  width: min(320px, 100%);
  height: 10px;
  margin: 6px 0;
  border-radius: 999px;
  background: var(--aqi-ramp);
}

.scale span {
  position: absolute;
  top: 50%;
  /* Physical, not logical: in RTL the whole bar is mirrored with scaleX(-1). */
  left: 74%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--text);
  transform: translate(-50%, -50%);
}

[dir='rtl'] .scale {
  transform: scaleX(-1);
}

.promo {
  margin: 0;
  font-size: 17px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  line-height: 0;
  margin-top: 6px;
}

.badge img {
  height: 50px;
  width: auto;
}

.badge-large img {
  height: 56px;
}

/* Screenshots */

.gallery ul {
  list-style: none;
  margin: 0 calc(-1 * var(--screen));
  padding: 4px var(--screen) 12px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--screen);
  scrollbar-width: none;
}

.gallery ul::-webkit-scrollbar {
  display: none;
}

.gallery li {
  flex: 0 0 62vw;
  max-width: 240px;
  scroll-snap-align: start;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

/* Features */

.intro {
  margin: 10px 6px;
  font-size: clamp(18px, 3.6vw, 22px);
  font-weight: 800;
  line-height: 1.4;
  max-width: 46em;
}

.features {
  display: grid;
  gap: var(--gap);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--brand);
  color: var(--on-accent);
}

/* PRO */

.pro {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: start;
  gap: 4px;
}

.pro::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--aqi-ramp);
}

.pro-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.pro p {
  max-width: 46em;
  color: var(--muted);
}

.pro .badge {
  margin-top: 16px;
}

/* Footer */

.footer {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 14px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
}

.links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
}

.languages h2 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}

.languages ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0 12px;
}

.languages a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  text-decoration: none;
}

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

.languages a[aria-current] {
  color: var(--text);
  font-weight: 900;
}

.copyright {
  margin: 0;
}

/* Wider screens */

@media (min-width: 720px) {
  .page {
    padding-inline: 32px;
  }

  .hero {
    padding: 56px 40px 48px;
  }

  .gallery ul {
    margin: 0;
    padding-inline: 0;
    justify-content: safe center;
  }

  .gallery li {
    flex-basis: 240px;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .pro {
    padding: 32px;
  }
}

@media (min-width: 1000px) {
  /* All six screenshots fit in one row, so no hidden scrolling on desktop. */
  .gallery li {
    flex: 1 1 0;
    min-width: 0;
  }

  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Privacy policy */

.legal-page {
  max-width: 820px;
}

.back {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  min-height: 64px;
  align-items: center;
  font-weight: 800;
}

.legal h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 900;
}

.legal h2 {
  margin-top: 28px;
}

.legal h3 {
  margin: 20px 0 6px;
  font-size: 17px;
  font-weight: 900;
}

.legal p,
.legal ul {
  margin: 0 0 12px;
}

.legal hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

.legal table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
  margin: 0 0 12px;
}

.legal th,
.legal td {
  text-align: start;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.legal th {
  font-weight: 900;
}

/* Not found */

.not-found {
  margin-top: 16px;
}
