/* Automic — automicworld.com
   Monochrome, self-hosted fonts, no third-party resources.
   RTL is handled entirely with CSS logical properties; there is no separate RTL sheet. */

@font-face {
  font-family: "Alexandria";
  src: url("/fonts/alexandria.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Arabic";
  src: url("/fonts/plex-ar-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Arabic";
  src: url("/fonts/plex-ar-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #FCFCFA;
  --ink: #111110;
  --muted: #55554F;
  --line: #DEDED6;
  --line-strong: #111110;
  --focus: #1B54D6;
  --measure: 68ch;
  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.05rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.3rem);
  --font-latin: "Alexandria", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-arabic: "Plex Arabic", "Segoe UI", "Noto Naskh Arabic", Tahoma, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0D0D0C;
    --ink: #F5F5F1;
    --muted: #A6A69E;
    --line: #2B2B27;
    --line-strong: #F5F5F1;
    --focus: #8FB0FF;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-latin);
  font-size: var(--step-0);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body {
  font-family: var(--font-arabic);
  font-weight: 400;
  line-height: 1.9;
}

/* ---------- skip link ---------- */

.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip:focus { inset-inline-start: 0; }

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 3rem);
}

main { display: block; }

.prose { max-width: var(--measure); }

/* ---------- header ---------- */

.site-header {
  border-block-end: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}
.brand svg { display: block; inline-size: 2rem; block-size: auto; }
.brand-name {
  font-family: var(--font-latin);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  /* the wordmark's trailing tracking would otherwise push the mark off-centre */
  margin-inline-end: -0.38em;
}

.lang-switch {
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  border-block-end: 1px solid var(--line);
  padding-block-end: 2px;
}
.lang-switch:hover { color: var(--ink); border-color: var(--line-strong); }

/* ---------- hero ---------- */

.hero { padding-block: clamp(3.5rem, 10vw, 7.5rem) clamp(2.5rem, 6vw, 4.5rem); }

.hero h1 {
  margin: 0 0 1.5rem;
  font-size: var(--step-3);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
html[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.35; }

.hero p {
  margin: 0;
  max-width: 54ch;
  font-size: var(--step-1);
  color: var(--muted);
  line-height: 1.55;
}
html[lang="ar"] .hero p { line-height: 1.85; }

.eyebrow {
  font-size: var(--step--1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.75rem;
}
html[lang="ar"] .eyebrow { letter-spacing: 0; }

/* ---------- sections ---------- */

.section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  border-block-start: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 2.5rem;
  font-size: var(--step-2);
  font-weight: 300;
  letter-spacing: -0.01em;
}
html[lang="ar"] .section h2 { letter-spacing: 0; }

.grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.grid > div {
  background: var(--paper);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.grid h3 {
  margin: 0 0 0.75rem;
  font-size: var(--step-0);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.grid p { margin: 0; color: var(--muted); font-size: var(--step--1); line-height: 1.7; }
html[lang="ar"] .grid p { line-height: 1.95; }

.lede { font-size: var(--step-1); color: var(--muted); max-width: 52ch; margin: 0; line-height: 1.6; }
html[lang="ar"] .lede { line-height: 1.9; }

.note {
  border-inline-start: 2px solid var(--line-strong);
  padding-inline-start: 1.5rem;
  max-width: 52ch;
}
.note p { margin: 0 0 0.9rem; }
.note p:last-child { margin-bottom: 0; }

/* ---------- legal pages ---------- */

.page-head { padding-block: clamp(3rem, 7vw, 5rem) 2.5rem; }
.page-head h1 {
  margin: 0 0 1rem;
  font-size: var(--step-2);
  font-weight: 300;
  letter-spacing: -0.01em;
}
html[lang="ar"] .page-head h1 { letter-spacing: 0; }
.updated { margin: 0; color: var(--muted); font-size: var(--step--1); }

.legal { padding-block-end: clamp(3rem, 7vw, 5rem); }
.legal h2 {
  margin: 3rem 0 1rem;
  font-size: var(--step-1);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.legal h3 {
  margin: 2rem 0 0.75rem;
  font-size: var(--step-0);
  font-weight: 500;
}
.legal p { margin: 0 0 1.1rem; }
.legal ul { margin: 0 0 1.1rem; padding-inline-start: 1.25rem; }
.legal li { margin-bottom: 0.6rem; }
.legal strong { font-weight: 600; }

/* ---------- links ---------- */

a { color: inherit; }
.legal a, .note a, .hero a, .contact a {
  color: inherit;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}
.legal a:hover, .note a:hover, .contact a:hover { text-decoration-thickness: 2px; }

/* ---------- contact ---------- */

.contact p { margin: 0 0 0.75rem; }
.contact .addr {
  font-size: var(--step-1);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ---------- footer ---------- */

.site-footer {
  border-block-start: 1px solid var(--line);
  padding-block: 3rem 4rem;
  font-size: var(--step--1);
  color: var(--muted);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}
.footer-nav a { text-decoration: none; border-block-end: 1px solid transparent; padding-block-end: 2px; }
.footer-nav a:hover { border-color: var(--line-strong); color: var(--ink); }
.legalese { margin: 0 0 0.6rem; max-width: 62ch; line-height: 1.7; }

/* ---------- a11y ---------- */

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

a, button { min-height: 24px; }
.footer-nav a, .lang-switch, .brand { display: inline-flex; align-items: center; min-height: 44px; }
.footer-nav a { min-height: 32px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
