/* SBSVN team site - shared stylesheet (home en/vi + 404).
   Mobile first, light/dark via prefers-color-scheme, system fonts only, no JS. */

:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #141a2e;
  --text-muted: #5a6278;
  --border: #dfe3ee;
  --accent: #2f56e0;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecff;
  --warm: #ffb547;
  --shadow: 0 1px 2px rgba(20, 26, 46, 0.06), 0 4px 16px rgba(20, 26, 46, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --gutter: 16px;
  --maxw: 1040px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1120;
    --surface: #171b2e;
    --surface-2: #20263d;
    --text: #eef0f7;
    --text-muted: #a3aac0;
    --border: #2a3150;
    --accent: #7d9bff;
    --accent-ink: #0e1120;
    --accent-soft: #232c52;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--gutter);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.site-header__brand img,
.site-header__brand svg { width: 32px; height: 32px; border-radius: 8px; flex: none; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  margin: 0;
  list-style: none;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}
.lang-switch li { display: contents; }
.lang-switch a,
.lang-switch span,
.lang-switch strong {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch [aria-current],
.lang-switch .is-current,
.lang-switch strong {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px var(--gutter) 20px;
}
.hero__title {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 6vw, 2.75rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero__intro {
  margin: 0;
  max-width: 42rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
  text-wrap: pretty;
}

/* ---------- Product grid ---------- */
.products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px var(--gutter) 40px;
  list-style: none;
}

.product-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  grid-template-areas:
    "icon name"
    "icon tagline"
    "links links";
  column-gap: 14px;
  row-gap: 2px;
  align-content: start;
  padding: 16px;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.product-card__icon {
  grid-area: icon;
  width: 64px;
  height: 64px;
  border-radius: 15px;
  object-fit: cover;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.product-card__icon--mono {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b63f0, #1a2b86);
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}

.product-card__name {
  grid-area: name;
  align-self: end;
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.product-card__name a { color: inherit; text-decoration: none; }
.product-card__name a:hover { text-decoration: underline; }

.product-card__tagline {
  grid-area: tagline;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.product-card__links {
  grid-area: links;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.product-card__links li { display: contents; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn::before { font-size: 0.95em; line-height: 1; }

.btn--page {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--page:hover { filter: brightness(1.08); }
.btn--page::before { content: "\2192"; order: 2; }

/* Store / web buttons: small dot in the platform colour; the label text carries the meaning. */
.btn--web::before,
.btn--ios::before,
.btn--play::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.btn--web::before { background: #2fb3a0; }
.btn--ios::before { background: var(--text); }
.btn--play::before { background: #34a853; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:active { transform: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px var(--gutter) 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}
.site-footer p { margin: 0 0 4px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- 404 (standalone page) ---------- */
.notfound {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px var(--gutter) 56px;
  text-align: center;
}
.notfound__code {
  margin: 0;
  font-size: clamp(4rem, 22vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.notfound__block { margin: 28px 0 0; }
.notfound__block h1,
.notfound__block h2 { margin: 0 0 6px; font-size: 1.375rem; line-height: 1.3; }
.notfound__block p { margin: 0 0 14px; color: var(--text-muted); }
.notfound__divider {
  width: 48px; height: 4px; margin: 28px auto 0; border: 0;
  border-radius: 2px; background: var(--warm);
}

/* ---------- Wider screens ---------- */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .site-header { padding-top: 20px; padding-bottom: 20px; }
  .hero { padding-top: 48px; padding-bottom: 28px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .product-card { padding: 20px; }
}

@media (min-width: 960px) {
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding-top: 64px; }
}
