@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-400.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-500.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-600.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-arabic-700.ttf") format("truetype"); }

:root {
  color-scheme: light;
  --surface: #f9f9f9;
  --surface-lowest: #ffffff;
  --surface-low: #f4f3f3;
  --surface-container: #eeeeee;
  --surface-high: #e8e8e8;
  --on-surface: #1a1c1c;
  --on-surface-subtle: #5a4136;
  --outline-variant: #ddc1b4;
  --primary: #7a3000;
  --primary-container: #a04100;
  --primary-bright: #ff6b00;
  --on-primary: #ffffff;
  --primary-fixed: #ffdbcc;
  --on-primary-fixed: #351000;
  --content: 1280px;
  --reading: 74ch;
  --shadow-sm: 0 2px 8px rgba(53, 16, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(53, 16, 0, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 104px; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--primary); text-underline-offset: 0.2em; }
a:hover { color: var(--primary-container); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--primary-bright); outline-offset: 3px; }

.skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 30;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--on-surface);
  color: var(--on-primary);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 20;
  border-block-end: 1px solid rgba(221, 193, 180, 0.72);
  background: rgba(249, 249, 249, 0.86);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  max-width: var(--content);
  min-height: 80px;
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--on-surface); font-weight: 700; text-decoration: none; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary-container);
  color: var(--on-primary);
  font-size: 17px;
  box-shadow: 0 4px 8px rgba(160, 65, 0, 0.2);
}

.language-link {
  min-height: 48px;
  padding: 9px 18px;
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  background: var(--surface-container);
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 180ms ease-out, color 180ms ease-out, transform 180ms ease-out;
}
.language-link:hover { background: var(--primary-container); color: var(--on-primary); transform: translateY(-1px); }

.hero {
  max-width: var(--content);
  margin: 40px auto;
  padding: clamp(48px, 7vw, 88px) clamp(24px, 5vw, 64px);
  border-radius: 16px;
  background: var(--primary-container);
  color: var(--on-primary);
  box-shadow: var(--shadow-md);
}
.hero p { max-width: var(--reading); margin: 16px 0 0; color: #fff3ee; font-size: 18px; line-height: 1.6; }

h1, h2, h3 { line-height: 1.4; text-wrap: balance; }
h1 { max-width: 18ch; margin: 0; font-size: clamp(2.25rem, 5vw, 3rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
h2 { margin: 0 0 18px; color: var(--primary); font-size: 24px; font-weight: 600; }
h3 { margin: 28px 0 10px; font-size: 20px; font-weight: 600; }

.meta { margin-block-start: 24px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 500; }
.meta span { padding: 6px 12px; border-radius: 9999px; background: rgba(255, 255, 255, 0.14); }

.layout {
  max-width: var(--content);
  margin-inline: auto;
  padding: 0 24px 96px;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.toc { position: sticky; inset-block-start: 104px; padding: 24px; border-radius: 16px; background: var(--surface-lowest); box-shadow: var(--shadow-sm); }
.toc strong { display: block; margin-block-end: 12px; color: var(--on-surface); font-size: 16px; font-weight: 600; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc a { display: block; min-height: 40px; padding: 8px 10px; border-radius: 8px; color: var(--on-surface-subtle); font-size: 14px; font-weight: 500; text-decoration: none; transition: background-color 180ms ease-out, color 180ms ease-out; }
.toc a:hover { background: var(--primary-fixed); color: var(--primary); }

.document { min-width: 0; overflow: hidden; border-radius: 16px; background: var(--surface-lowest); box-shadow: var(--shadow-sm); }
.section { max-width: var(--reading); padding: 40px clamp(24px, 5vw, 48px); border-block-end: 1px solid var(--surface-high); }
.section:last-child { border-block-end: 0; }
.section p, .section li { text-wrap: pretty; }
.section ul { padding-inline-start: 1.3rem; }

.notice { margin-block: 28px 0; padding: 18px 20px; border-radius: 12px; background: var(--primary-fixed); color: var(--on-primary-fixed); box-shadow: 0 4px 8px rgba(53, 16, 0, 0.1); }
.product-list { margin: 18px 0 0; padding: 0; list-style: none; }
.product-list li { padding: 20px 0; border-block-start: 1px solid var(--surface-high); }
.product-list strong { display: block; margin-block-end: 6px; color: var(--primary); }
.contact { padding: 24px; border-radius: 12px; background: var(--surface-low); }
.contact a { font-size: 18px; font-weight: 600; }
.footer { padding: 32px 24px; background: var(--on-surface); color: #f1f1f0; text-align: center; font-size: 14px; }

@media (max-width: 1328px) { .hero { margin-inline: 24px; } }

@media (max-width: 820px) {
  .hero { margin: 24px 16px 32px; }
  .layout { display: block; padding-inline: 16px; }
  .toc { position: static; margin-block-end: 24px; }
  .toc ul { columns: 2; column-gap: 24px; }
  .section { padding: 32px 24px; }
}

@media (max-width: 520px) {
  .topbar-inner { min-height: 72px; padding-inline: 16px; }
  .brand-mark { width: 32px; height: 32px; }
  .hero { padding: 40px 24px; }
  h1 { font-size: 2rem; }
  .toc ul { columns: 1; }
  .contact a { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
