:root {
  color-scheme: light;
  --bg-1: #f5efdf;
  --bg-2: #ece1c8;
  --surface: rgba(255, 250, 240, 0.88);
  --surface-strong: rgba(255, 250, 240, 0.96);
  --surface-border: rgba(38, 84, 63, 0.14);
  --ink: #183229;
  --ink-soft: #3a5348;
  --accent: #1f5b45;
  --accent-strong: #174434;
  --accent-soft: rgba(31, 91, 69, 0.08);
  --gold: #b88f38;
  --shadow: 0 18px 40px rgba(16, 44, 34, 0.12);
  --radius-lg: 32px;
  --radius-md: 26px;
  --radius-sm: 20px;
  --font-latin: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-arabic: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --font-ui: "Segoe UI", Tahoma, Arial, sans-serif;
  --page-width: 1120px;
}

html[data-color-scheme="dark"] {
  color-scheme: dark;
  --bg-1: #141b18;
  --bg-2: #0e1512;
  --surface: rgba(32, 44, 39, 0.94);
  --surface-strong: rgba(38, 52, 46, 0.98);
  --surface-border: rgba(130, 175, 155, 0.22);
  --ink: #e8f0eb;
  --ink-soft: #b8d4c4;
  --accent: #8bc4a4;
  --accent-strong: #dff7ea;
  --accent-soft: rgba(122, 171, 140, 0.14);
  --gold: #e8d18a;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-latin);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 244, 217, 0.9), transparent 36%),
    radial-gradient(circle at bottom right, rgba(67, 119, 94, 0.18), transparent 32%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  transition: background 180ms ease, color 180ms ease;
  overflow-x: hidden;
}

html[data-site-locale="ar"] body {
  font-family: var(--font-arabic);
}

html[data-site-font="ui"] body {
  font-family: var(--font-ui);
}

html[data-color-scheme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(72, 110, 92, 0.28), transparent 42%),
    radial-gradient(circle at bottom right, rgba(28, 52, 42, 0.55), transparent 38%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.26), transparent 36%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.1) 0,
      rgba(255, 255, 255, 0.1) 1px,
      transparent 1px,
      transparent 36px
    );
  pointer-events: none;
}

html[data-color-scheme="dark"] body::before {
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.05), transparent 42%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 36px
    );
}

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

a,
button {
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(31, 91, 69, 0.48);
  outline-offset: 3px;
}

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

.page {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 32px), var(--page-width));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  flex: 1 1 auto;
}

.brand div {
  min-width: 0;
}

.brand-logo {
  position: relative;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
}

.brand-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 18px rgba(184, 143, 56, 0.24));
  transition: opacity 160ms ease;
}

.logo-image-dark {
  opacity: 0;
}

html[data-color-scheme="dark"] .logo-image-light {
  opacity: 0;
}

html[data-color-scheme="dark"] .logo-image-dark {
  opacity: 1;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 0.95;
}

.brand p {
  color: var(--ink-soft);
  font-size: 1rem;
  margin-top: 6px;
}

.brand h1,
.brand p,
.card p,
.card li,
.footer,
.footer a,
.panel p,
.panel li,
.nav a,
.button {
  overflow-wrap: anywhere;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  /* gap: 10px; */
  align-items: center;
  justify-content: flex-end;
}

.locale-switcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(245, 238, 223, 0.76));
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

.locale-switcher label {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.locale-switcher select {
  appearance: none;
  min-height: 40px;
  min-width: 184px;
  padding: 0 42px 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(31, 91, 69, 0.18);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='%23174434' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M3 5.25 7 9l4-3.75'/%3E%3C/svg%3E")
      no-repeat right 14px center / 14px 14px,
    rgba(255, 250, 240, 0.96);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

html[data-color-scheme="dark"] .locale-switcher {
  background: rgba(22, 33, 28, 0.8);
}

html[data-color-scheme="dark"] .locale-switcher select {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='%23dff7ea' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M3 5.25 7 9l4-3.75'/%3E%3C/svg%3E")
      no-repeat right 14px center / 14px 14px,
    rgba(18, 29, 25, 0.96);
  color: var(--ink);
  border-color: rgba(130, 175, 155, 0.24);
}

html[dir="rtl"] .locale-switcher {
  padding-right: 16px;
  padding-left: 10px;
}

html[dir="rtl"] .locale-switcher select {
  padding-right: 16px;
  padding-left: 42px;
  background-position: left 14px center, center;
}

.nav a,
.button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(31, 91, 69, 0.18);
  background: rgba(31, 91, 69, 0.08);
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.nav a:hover,
.button:hover,
.theme-switcher button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: linear-gradient(135deg, #2b6f58, #163d30);
  color: #fffaf1;
  border-color: rgba(23, 68, 52, 0.55);
}

html[data-color-scheme="dark"] .button--primary {
  background: linear-gradient(135deg, #8bc4a4, #255842);
  color: #08120e;
}

.theme-switcher {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 253, 248, 0.7);
}

html[data-color-scheme="dark"] .theme-switcher {
  background: rgba(22, 33, 28, 0.8);
}

.theme-switcher button {
  border: 0;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.theme-switcher button[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(31, 91, 69, 0.16), rgba(31, 91, 69, 0.04));
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(31, 91, 69, 0.22);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  margin-top: 28px;
  align-items: center;
}

.hero--single {
  grid-template-columns: 1fr;
}

.hero--single .panel {
  max-width: none;
}

.panel {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(8px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(31, 91, 69, 0.08);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.94rem;
}

.hero h2 {
  margin: 16px 0 14px;
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  line-height: 1.5;
}

.hero p,
.section p,
.section li {
  color: var(--ink-soft);
  line-height: 1.75;
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.section {
  margin-top: 28px;
}

.section h3 {
  margin: 0 0 12px;
  font-size: 1.7rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading p {
  max-width: 560px;
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

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

.card {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.9);
  padding: 22px;
  min-width: 0;
}

.card h4 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: var(--ink);
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.mini-list {
  margin: 12px 0 0;
  padding-left: 18px;
}

.mini-list li + li {
  margin-top: 8px;
}

.footer {
  margin-top: 28px;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  background: rgba(255, 253, 248, 0.88);
  color: var(--ink-soft);
}

html[data-color-scheme="dark"] .card {
  background: rgba(18, 29, 25, 0.96);
  border-color: rgba(130, 175, 155, 0.24);
}

html[data-color-scheme="dark"] .footer {
  background: rgba(20, 31, 27, 0.94);
  border-color: rgba(130, 175, 155, 0.24);
}

.support-stack {
  display: grid;
  gap: 14px;
}

.section-title-xl {
  margin: 16px 0 8px;
  font-size: clamp(2.4rem, 5vw, 4rem);
}

.footer strong {
  color: var(--ink);
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.policy-list {
  margin: 0;
  padding-left: 22px;
}

.policy-list li + li {
  margin-top: 10px;
}

html[dir="rtl"] .policy-list,
html[dir="rtl"] .mini-list {
  padding-right: 22px;
  padding-left: 0;
}

.locale-note {
  margin-top: 14px;
}

.language-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.language-chip {
  flex: 0 0 156px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: normal;
  word-break: keep-all;
}

html[data-color-scheme="dark"] .language-chip {
  background: rgba(18, 29, 25, 0.96);
  border-color: rgba(130, 175, 155, 0.24);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-badges span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(184, 143, 56, 0.12);
  color: var(--accent-strong);
  border: 1px solid rgba(184, 143, 56, 0.22);
  font-size: 0.92rem;
  font-weight: 700;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.logo-mark .brand-logo {
  width: 34px;
  height: 34px;
}

.logo-mark .brand-logo img {
  width: 34px;
  height: 34px;
}

.muted-note {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

@media (max-width: 1100px) {
  .page {
    width: min(calc(100% - 24px), var(--page-width));
  }

  .hero {
    grid-template-columns: 1fr;
  }
  
  .site-header {
    gap: 12px;
    padding: 14px 16px;
  }

  .brand {
    gap: 12px;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
  }

  .brand h1 {
    font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  }

  .brand p {
    font-size: 0.94rem;
    margin-top: 4px;
  }

  .nav {
    gap: 8px;
  }

  .nav a {
    min-height: 42px;
    padding: 0 14px;
    font-size: 0.95rem;
  }

  .theme-switcher {
    padding: 5px;
  }

  .theme-switcher button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.9rem;
  }

  .locale-switcher {
    gap: 8px;
    padding: 6px 8px 6px 12px;
  }

  .locale-switcher label {
    display: none;
  }

  .locale-switcher select {
    min-width: 112px;
    min-height: 38px;
    padding: 0 34px 0 14px;
    font-size: 0.9rem;
    background-position: right 12px center, center;
  }

  html[dir="rtl"] .locale-switcher select {
    padding-right: 14px;
    padding-left: 34px;
    background-position: left 12px center, center;
  }
}

@media (max-width: 900px) {
  .hero,
  .grid,
  .grid--two {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    align-items: stretch;
    border-radius: 26px;
    padding: 18px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
  }

  .nav {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 1 auto;
    min-height: 42px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .locale-switcher {
    width: auto;
    flex: 0 0 auto;
    justify-content: space-between;
    white-space: nowrap;
  }

  .locale-switcher select {
    flex: 0 1 auto;
    min-width: 108px;
    padding-right: 36px;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .theme-switcher {
    width: auto;
    flex: 0 1 auto;
    justify-content: space-between;
  }

  .theme-switcher button {
    flex: 0 1 auto;
    min-height: 34px;
    padding: 0 11px;
    white-space: nowrap;
  }

  .logo-mark {
    flex-wrap: wrap;
  }

  .panel,
  .footer {
    padding: 22px;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(calc(100% - 18px), var(--page-width));
    padding: 16px 0 48px;
  }

  .site-header {
    padding: 16px;
    gap: 14px;
  }

  .brand {
    gap: 12px;
  }

  .brand h1 {
    font-size: 1.85rem;
  }

  .brand p {
    font-size: 0.95rem;
  }

  .nav {
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: visible;
  }

  .nav a,
  .button {
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
  }

  .locale-switcher {
    width: 100%;
    flex: 1 1 100%;
    padding: 6px 10px;
  }

  .locale-switcher label {
    font-size: 0.9rem;
  }

  .locale-switcher select {
    min-width: 0;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.92rem;
  }

  html[dir="rtl"] .locale-switcher select {
    padding-right: 12px;
    padding-left: 38px;
  }

  .theme-switcher {
    width: 100%;
    flex: 1 1 100%;
    padding: 5px;
  }

  .theme-switcher button {
    flex: 1 1 0;
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.92rem;
  }

  .nav a {
    flex: 1 1 calc(33.333% - 6px);
    width: auto;
    min-width: 0;
    white-space: nowrap;
  }

  .hero h2,
  .section-title-xl {
    line-height: 1.02;
  }

  .hero-actions {
    flex-direction: column;
  }

  .card {
    padding: 18px;
  }

  .hero-badges span {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .site-header,
  .panel,
  .footer {
    border-radius: 22px;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
  }

  .brand h1 {
    font-size: 1.65rem;
  }

  .hero h2 {
    font-size: 2.2rem;
  }

  .section h3 {
    font-size: 1.45rem;
  }

  .theme-switcher button {
    font-size: 0.88rem;
  }

  .nav a {
    flex: 1 1 calc(50% - 4px);
  }
}

@media (max-width: 360px) {
  .page {
    width: min(calc(100% - 12px), var(--page-width));
  }

  .site-header,
  .panel,
  .footer {
    padding: 16px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand h1 {
    font-size: 1.5rem;
  }

  .brand p {
    font-size: 0.9rem;
  }

  .theme-switcher {
    gap: 4px;
    padding: 4px;
  }

  .theme-switcher button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.8rem;
    letter-spacing: -0.01em;
  }

  .hero h2 {
    font-size: 1.95rem;
  }

  .section h3 {
    font-size: 1.32rem;
  }

  .card {
    padding: 16px;
  }
}

@media (max-width: 320px) {
  .page {
    width: min(calc(100% - 10px), var(--page-width));
  }

  .site-header,
  .panel,
  .footer {
    padding: 14px;
    border-radius: 18px;
  }

  .site-header {
    gap: 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand h1 {
    font-size: 1.38rem;
  }

  .brand p {
    font-size: 0.84rem;
    margin-top: 3px;
  }

  .nav {
    gap: 6px;
  }

  .locale-switcher {
    padding: 5px 8px;
  }

  .locale-switcher select {
    min-height: 36px;
    min-width: 0;
    font-size: 0.84rem;
    padding: 0 30px 0 10px;
    background-position: right 10px center, center;
  }

  html[dir="rtl"] .locale-switcher select {
    padding-right: 10px;
    padding-left: 30px;
    background-position: left 10px center, center;
  }

  .theme-switcher {
    padding: 4px;
  }

  .theme-switcher button {
    min-height: 34px;
    font-size: 0.76rem;
    padding: 0 6px;
  }

  .nav a {
    flex: 1 1 100%;
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.84rem;
  }

  .hero h2,
  .section-title-xl {
    font-size: 1.8rem;
  }
}
