/* ==========================================================================
   Base and utilities
   Reset, document defaults, and the small helpers used across sections.

   Layout across all four stylesheets is written entirely in logical
   properties (inline-start/end, margin-inline, ...) so the Arabic RTL view
   mirrors without a second stylesheet. There is no `left` or `right`
   anywhere in this project's CSS.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: calc(var(--header-h) + 1rem);
}

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

body {
  min-block-size: 100svh;
  background-color: var(--sand-100);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Paper grain. Sits above the page, below the header, never interactive. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

a {
  color: inherit;
  text-decoration-color: var(--sand-400);
  text-underline-offset: 0.25em;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--copper);
  color: var(--sand-50);
}

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

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.shell {
  inline-size: 100%;
  max-inline-size: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Latin strings (handles, phone, email) held LTR inside Arabic paragraphs. */
.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

/* The mirror case: Arabic content (Instagram captions) held RTL regardless
   of the surrounding page's own direction. */
.rtl {
  direction: rtl;
  unicode-bidi: isolate;
}

.skip-link {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: var(--gutter);
  z-index: 200;
  transform: translateY(-120%);
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--sand-50);
  font-size: var(--text-sm);
  text-decoration: none;
  border-end-start-radius: var(--radius-sm);
  border-end-end-radius: var(--radius-sm);
  transition: transform var(--dur) var(--ease-out-soft);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-soft);
}

.label::before {
  content: "";
  inline-size: 2.25rem;
  block-size: 1px;
  background: var(--copper);
  flex: none;
}

html[lang="ar"] .label {
  text-transform: none;
  font-size: var(--text-sm);
}

.section {
  position: relative;
  z-index: 2;
  padding-block: var(--space-section);
}

.section__head {
  display: grid;
  gap: var(--space-sm);
  margin-block-end: var(--space-xl);
}

.section__title {
  font-size: var(--text-heading);
  letter-spacing: var(--tracking-display);
}
