@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap");

:root {
  --ink: #152238;
  --muted: #68758a;
  --blue: #1968f2;
  --line: #e5eaf1;
  --surface: #fff;
  --bg: #f6f8fc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ========================================
   DESKTOP STYLES (default)
   ======================================== */

.page-shell {
  max-width: 1100px;
  margin: auto;
  padding: 0 24px 56px;
}

.site-nav {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 500;
}

.brand {
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 21px;
}

.language-switch {
  display: inline-flex;
  gap: 6px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.language-switch a {
  padding: 4px 6px;
  border-radius: 8px;
  text-decoration: none;
  line-height: 1;
}

.language-switch a.active {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

.breadcrumb, .eyebrow {
  color: var(--muted);
  font-size: 14px;
}

.hero-card, .info-card, article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  margin: 2px 0 12px;
  letter-spacing: -.04em;
}

h2 {
  font-size: 24px;
  line-height: 1.25;
  margin-top: 34px;
}

.rating {
  color: #f8b733;
  letter-spacing: 2px;
}

.rating strong {
  color: var(--ink);
  margin-right: 9px;
  letter-spacing: 0;
}

.button {
  display: inline-block;
  border-radius: 10px;
  padding: 12px 18px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.primary {
  background: var(--blue);
  color: #fff;
  margin-left: auto;
}

.secondary {
  border: 1px solid var(--blue);
  color: var(--blue);
}

.chrome-mark {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(#e94335 0 33%, #f8c24f 0 66%, #41a768 0);
  position: relative;
}

.app-detail-icon {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  border-radius: 18px;
  object-fit: cover;
}

.chrome-mark:before {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: #3187e5;
  border: 4px solid #eaf4ff;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  margin-top: 28px;
}

article, .info-card {
  padding: 30px;
}

.lead {
  font-size: 19px;
}

.info-card h2 {
  margin-top: 0;
}

.info-card dl {
  margin: 0 0 25px;
}

.info-card dt {
  color: var(--muted);
  font-size: 13px;
  margin-top: 16px;
}

.info-card dd {
  margin: 2px 0 0;
  font-weight: 700;
}

li {
  margin: 9px 0;
}

details {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

details p {
  color: var(--muted);
  margin-bottom: 0;
}

/* ========================================
   HOMEPAGE APP GRID (desktop + mobile)
   ======================================== */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.app-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s, transform .1s;
}

.app-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.app-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.app-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.app-icon.placeholder {
  background: linear-gradient(135deg, #e5eaf1, #f6f8fc);
}

.app-card h3 {
  font-size: 18px;
  margin: 0 0 4px;
  line-height: 1.25;
}

.app-meta {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
}

.app-excerpt {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.rating.small {
  font-size: 14px;
}

/* ========================================
   MOBILE STYLES (< 760px)
   ======================================== */

@media (max-width: 760px) {
  .page-shell {
    padding: 0 16px 40px;
  }

  .site-nav {
    height: 60px;
    gap: 16px;
    font-size: 15px;
  }

  .site-nav span {
    display: none;
  }

  .hero-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 20px;
  }

  .chrome-mark {
    width: 64px;
    height: 64px;
  }

  .app-detail-icon {
    width: 64px;
    height: 64px;
  }

  .chrome-mark:before {
    inset: 18px;
  }

  h1 {
    font-size: 26px;
  }

  .primary {
    margin-left: 0;
    width: 100%;
    text-align: center;
    padding: 14px 18px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .info-card {
    grid-row: 1;
    padding: 24px;
  }

  article {
    padding: 24px;
  }

  .lead {
    font-size: 17px;
  }

  h2 {
    font-size: 21px;
    margin-top: 28px;
  }

  details {
    padding: 14px 0;
  }
}

.brand-logo {
  display: block;
  width: auto;
  height: 42px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer-brand { color: var(--ink); font-weight: 700; margin-right: auto; }
.site-footer nav { display: flex; gap: 16px; }
.site-footer a, .legal-page a { color: var(--blue); }
.language-links { padding-left: 18px; border-left: 1px solid var(--line); }
.legal-page { max-width: 900px; }
.legal-page article { margin-bottom: 24px; }
.legal-page address { font-style: normal; }
.legal-updated { color: var(--muted); margin-top: 36px; }

@media (max-width: 760px) {
  .site-footer-inner { align-items: flex-start; flex-direction: column; gap: 10px; }
  .site-footer-brand, .site-footer-inner p { margin: 0; }
  .language-links { padding: 0; border: 0; }
}

.legal-page h3 {
  margin-top: 26px;
  font-size: 18px;
}

.legal-source-text {
  overflow-wrap: anywhere;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 36px;
}

.pagination a {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-decoration: none;
}
