:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --text: #1e2422;
  --muted: #66706c;
  --primary: #1f5f58;
  --primary-dark: #174742;
  --primary-soft: #e5f0ee;
  --border: #dfe7e4;
  --shadow: 0 18px 48px rgba(14, 44, 39, 0.12);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(31,95,88,.08), transparent 24%),
    linear-gradient(180deg, #f7f5ef 0%, #f0ede6 100%);
  color: var(--text);
}

.page-shell {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  width: min(100%, 740px);
  background: var(--card);
  border: 1px solid rgba(31,95,88,0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px 22px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #2f857b);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .04em;
  box-shadow: 0 10px 22px rgba(31,95,88,.22);
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: .14em;
  font-size: .82rem;
  text-transform: uppercase;
}

h1 {
  margin: 10px 0 10px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.03;
}

.intro {
  margin: 0 0 18px;
  font-size: 1.1rem;
  color: var(--text);
}
.intro span {
  display: block;
  margin-top: 6px;
  font-size: .98rem;
  color: var(--muted);
}

.helper-note {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: .96rem;
}

.detected-wrap {
  background: linear-gradient(180deg, #f2f8f7, #edf6f4);
  border: 1px solid #d6e7e4;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 18px;
}
.detected-text {
  margin: 0 0 12px;
  font-weight: 600;
}
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--primary);
  color: #fff;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(31,95,88,.18);
}
.primary-button:hover { background: var(--primary-dark); }

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.language-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 18px;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}
.language-card:hover,
.language-card:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(14,44,39,.08);
  border-color: #bfd5cf;
  background: #fbfdfc;
  outline: none;
}
.language-card.recommended {
  border-color: rgba(31,95,88,.35);
  background: var(--primary-soft);
}
.code {
  flex: 0 0 auto;
  min-width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.08);
}
.name {
  display: block;
  font-size: 1.04rem;
  font-weight: 700;
}
.badge {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: .74rem;
  font-weight: 700;
  color: var(--primary);
  background: #fff;
  border: 1px solid #cfe2dd;
  border-radius: 999px;
  padding: 6px 10px;
}

.footer-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #edf0ef;
  color: var(--muted);
  font-size: .92rem;
}

.noscript-note {
  margin-top: 14px;
  color: #7a4f00;
  background: #fff8df;
  border: 1px solid #f0dd9e;
  border-radius: 12px;
  padding: 12px 14px;
}

@media (max-width: 640px) {
  .page-shell { padding: 14px; }
  .card { padding: 20px 16px 16px; border-radius: 20px; }
  .language-grid { grid-template-columns: 1fr; }
  .brand-mark { width: 48px; height: 48px; font-size: 20px; }
  h1 { font-size: 2.2rem; }
}
