:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --surface: #141416;
  --line: #27272b;
  --text: #f2f2f0;
  --muted: #9b9ba1;
  --accent: #ffd400;
  --accent-ink: #0b0b0c;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --page: 68rem;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60rem 30rem at 50% -10rem, rgb(255 212 0 / 0.13), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.035) 1px, transparent 1px);
  background-size: 3.5rem 3.5rem;
  mask-image: radial-gradient(ellipse at 50% 0, #000 20%, transparent 75%);
  pointer-events: none;
}

a {
  color: inherit;
}

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

.top,
main,
.bottom {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.brand {
  direction: ltr;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-tld {
  color: var(--accent);
}

.top-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.top-link:hover {
  color: var(--text);
  border-color: var(--muted);
}

.top-link svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

/* Hero */

main {
  flex: 1;
}

.hero {
  padding-block: clamp(3.5rem, 12vh, 8rem) clamp(3rem, 8vh, 5rem);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.75rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgb(255 212 0 / 0.35);
  border-radius: 999px;
  background: rgb(255 212 0 / 0.08);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.5rem, 7.5vw, 5.25rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.accent {
  color: var(--accent);
}

.lead {
  max-width: 40rem;
  margin: 1.75rem 0 0;
  color: var(--muted);
  font-size: clamp(1.0625rem, 2vw, 1.3125rem);
  text-wrap: pretty;
}

.button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.3rem;
  border-radius: 0.6rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.08);
}

/* Languages */

.languages {
  padding-block: 2.5rem 4rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.languages > p {
  max-width: 40rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.lang-grid a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.lang-grid a:hover {
  border-color: var(--muted);
  transform: translateY(-1px);
}

.lang-grid a[aria-current] {
  border-color: var(--accent);
  background: rgb(255 212 0 / 0.07);
}

.lang-code {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-transform: uppercase;
}

.lang-grid a[aria-current] .lang-code {
  color: var(--accent);
}

.lang-name {
  font-weight: 600;
}

/* Footer */

.bottom {
  padding-block: 1.75rem 2.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.bottom p {
  margin: 0;
}

.bottom .disclaimer {
  max-width: 44rem;
  margin-top: 0.4rem;
}

.bottom .build {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  opacity: 0.65;
}

[dir="rtl"] .bottom .build {
  text-align: right;
}

/* Arabic script must not be letter-spaced: it breaks the joined letterforms. */
:lang(ar) h1,
:lang(ar) h2 {
  letter-spacing: 0;
  line-height: 1.3;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .badge-dot {
    animation: none;
  }

  .lang-grid a {
    transition: none;
  }
}
