/* Mashrab
 *
 * Palette is taken from the brand mark (assets/logo/mashrab-logo.svg).
 *
 * Direction: this stylesheet uses CSS logical properties throughout
 * (margin-inline, padding-block, text-align: start, inset-inline) so the
 * Arabic layout mirrors from the dir="rtl" attribute alone, with no
 * forked stylesheet. Physical left/right appears only where a thing is
 * visually anchored rather than flow-relative, and is commented as such.
 */

/* Amiri, self-hosted. The brand's Latin serif has no Arabic coverage.
 * Self-hosted rather than loaded from Google Fonts so the site makes no
 * third-party request. Arabic subset only — Latin text uses the brand
 * serif in every language. */
@font-face {
  font-family: Amiri;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/amiri-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891,
    U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41,
    U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: Amiri;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/amiri-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891,
    U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41,
    U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  --cream: #f6efe3;
  --cream-deep: #efe4d2;
  --walnut: #5a3a28;
  --brown: #3b2416;
  --ochre: #b8893b;
  --ochre-deep: #8f6a2c;

  --ink: var(--brown);
  --ink-soft: #6b5344;
  --rule: rgba(90, 58, 40, 0.18);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --measure: 34rem;
  --wide: 72rem;
  --gutter: clamp(1rem, 4vw, 3rem);

  --step: clamp(0.5rem, 2vw, 1rem);
  --section-gap: clamp(1.75rem, 4.5vw, 3.5rem);
}

:root[lang="ar"] {
  --serif: Amiri, "Noto Naskh Arabic", "Geeza Pro", serif;
  /* Arabic letterforms need more vertical room than Latin at the same
   * nominal size to stay comfortable. */
  --arabic-scale: 1.12;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: calc(1.0625rem * var(--arabic-scale, 1));
  line-height: 1.65;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
  margin-block: 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 5.5vw, 3.5rem);
}
h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
}
h3 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
}

p {
  margin-block: 0 1em;
  max-inline-size: var(--measure);
  text-wrap: pretty;
}

a {
  color: var(--ochre-deep);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--brown);
}

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

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

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

.wrap {
  inline-size: min(100% - (var(--gutter) * 2), var(--wide));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-gap);
}

.section-intro {
  max-inline-size: var(--measure);
  margin-block-end: 2.5rem;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ochre-deep);
  margin-block-end: 0.75rem;
}

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

.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: var(--gutter);
  z-index: 10;
  background: var(--brown);
  color: var(--cream);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.35rem 0.35rem;
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: 0;
  color: var(--cream);
}

main:focus {
  outline: none;
}

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

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem var(--gutter);
  inline-size: min(100% - (var(--gutter) * 2), var(--wide));
  margin-inline: auto;
  padding-block: 0.8rem;
}

.brand img {
  display: block;
  inline-size: clamp(80px, 12vw, 110px);
  block-size: auto;
}

.lang-switch ul {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.lang-switch a {
  text-decoration: none;
  color: var(--ink-soft);
}

.lang-switch a:hover {
  color: var(--brown);
  text-decoration: underline;
}

.lang-switch [aria-current] {
  color: var(--brown);
  font-weight: 600;
}

/* ---------- buttons ---------- */

.button {
  display: inline-block;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.9rem 1.9rem;
  border: 0;
  border-radius: 0.25rem;
  background: var(--ochre-deep);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.button:hover {
  background: var(--brown);
  color: #fff;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button-ghost {
  background: transparent;
  color: var(--cream);
  border: 2px solid rgba(246, 239, 227, 0.7);
}

.button-ghost:hover {
  background: rgba(246, 239, 227, 0.14);
  color: #fff;
}

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

/* A fixed height that fits under the header on a 720px-tall laptop, so
 * the headline and button are on screen without scrolling. The photo is
 * layered behind and cropped to whatever box that leaves; it no longer
 * decides the hero's height. */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  block-size: clamp(22rem, calc(100svh - 7rem), 34rem);
  overflow: hidden;
  isolation: isolate;
  /* If the photograph is blocked or fails to load, the scrim still sits
   * over a dark ground, so the hero text keeps its contrast. */
  background: #241408;
}

.hero-media,
.hero::after {
  position: absolute;
  inset: 0;
}

.hero-media img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  max-inline-size: none;
  object-fit: cover;
  object-position: center 40%;
}

/* Scrim. Dark behind the text, clear over the carving. Two layers: one
 * rising from the bottom, one from the side the text starts on. The side
 * layer follows reading direction via --scrim-from. */
.hero {
  --scrim-from: to right;
}
[dir="rtl"] .hero {
  --scrim-from: to left;
}
.hero::after {
  content: "";
  background:
    linear-gradient(
      var(--scrim-from),
      rgba(20, 11, 5, 0.82) 0%,
      rgba(20, 11, 5, 0.6) 40%,
      rgba(20, 11, 5, 0) 72%
    ),
    linear-gradient(
      to top,
      rgba(20, 11, 5, 0.85) 0%,
      rgba(20, 11, 5, 0.45) 55%,
      rgba(20, 11, 5, 0.15) 100%
    );
}

/* On a phone the text runs the full width and nearly the full height,
 * over the white wall at the top of the portrait crop, so the side layer
 * cannot help. A single stronger vertical scrim carries it instead. */
@media (max-width: 43rem) {
  .hero::after {
    background: linear-gradient(
      to top,
      rgba(20, 11, 5, 0.9) 0%,
      rgba(20, 11, 5, 0.72) 50%,
      rgba(20, 11, 5, 0.58) 100%
    );
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  inline-size: min(100% - (var(--gutter) * 2), var(--wide));
  margin-inline: auto;
  padding-block: clamp(1.5rem, 4vw, 3rem);
  color: var(--cream);
  /* Insurance for the odd bright highlight the scrim leaves thin. */
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.hero-content h1 {
  color: #fff;
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  max-inline-size: 18ch;
  margin-block-end: 0.75rem;
}

.hero-content p {
  color: #f2e8db;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  max-inline-size: 46ch;
  margin-block-end: 1.25rem;
}

/* ---------- showcase ---------- */

.showcase-group + .showcase-group {
  margin-block-start: calc(var(--section-gap) * 0.25);
}

.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  /* `proximity`, not `mandatory`. A mandatory snap container sitting in
   * the page's vertical scroll path makes the browser resolve a snap
   * target continuously while the page scrolls past it, which reads as
   * a stutter. Proximity snaps when the gesture ends and leaves normal
   * scrolling alone. */
  scroll-snap-type: x proximity;
  /* Stop a horizontal fling from chaining into the page scroll. */
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--gutter);
  padding-block-end: 0.25rem;
  /* Trim the scrollbar without hiding the ability to scroll. */
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

/* Fixed height, natural width: the set mixes landscape and portrait
 * photographs, and a filmstrip of consistent height reads better than
 * cropping every portrait shot to a landscape box. */
.carousel-track > figure {
  flex: 0 0 auto;
  scroll-snap-align: center;
  margin: 0;
}

.carousel-track img {
  /* Deliberately no vh unit here. On mobile the URL bar collapsing
   * changes vh, which would resize all fourteen photographs and reflow
   * the page mid-scroll — the single worst source of scroll stutter on
   * this page. rem and vw are both stable during scroll. */
  block-size: clamp(13rem, 26vw, 22rem);
  inline-size: auto;
  max-inline-size: none;
  object-fit: cover;
  border-radius: 0.25rem;
  background: var(--cream-deep);
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.carousel-track figcaption {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  padding-block-start: 0.6rem;
}

.carousel-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-block-start: 0.2rem;
}

.carousel-controls button {
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--brown);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.carousel-controls button:hover:not(:disabled) {
  background: var(--cream-deep);
}

.carousel-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* No JavaScript: the controls cannot work, so they are not shown. The
 * track still scrolls natively. */
.no-js .carousel-controls {
  display: none;
}

/* ---------- process ---------- */

.process {
  background: var(--cream-deep);
}

.stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--rule);
  border-block: 1px solid var(--rule);
}

.stages li {
  background: var(--cream-deep);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.25rem;
  padding-block: 1.25rem;
}

.stage-name {
  font-size: 1.15rem;
  font-weight: 600;
  flex: 1 1 14rem;
}

.stage-range {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ochre-deep);
  font-weight: 600;
  white-space: nowrap;
}

/* The one stage the client carries out. Marked differently from a
 * duration so it does not read as another number in the schedule. */
.stage-by-you {
  color: var(--ink-soft);
  font-weight: 400;
  font-style: italic;
}

.stage-note {
  flex: 1 1 100%;
  color: var(--ink-soft);
  margin: 0;
  max-inline-size: var(--measure);
}

.process-total {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  padding-block-start: 2rem;
  max-inline-size: var(--measure);
}

.process-total strong {
  color: var(--ochre-deep);
}

/* ---------- forms ---------- */

.form-panel {
  max-inline-size: 38rem;
}

.field {
  margin-block-end: 1.25rem;
}

.field label {
  display: block;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  margin-block-end: 0.35rem;
}

.field .hint {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
  inline-size: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fffdf9;
  border: 1px solid var(--rule);
  border-radius: 0.25rem;
  padding: 0.7rem 0.85rem;
}

.field textarea {
  min-block-size: 8rem;
  resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--ochre-deep);
}

.field-error {
  display: block;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: #9a2f1c;
  padding-block-start: 0.3rem;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #9a2f1c;
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.trap {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-status {
  font-family: var(--sans);
  font-size: 0.9375rem;
  padding: 0.85rem 1rem;
  border-radius: 0.25rem;
  margin-block-end: 1.25rem;
}

.form-status[data-state="error"] {
  background: #fbe9e4;
  color: #7d2415;
  border: 1px solid #e0b5a9;
}

.confirmation {
  background: var(--cream-deep);
  border-inline-start: 4px solid var(--ochre);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 0.25rem;
}

.confirmation h2 {
  margin-block-start: 0;
}

.confirmation p:last-child {
  margin-block-end: 0;
}

[hidden] {
  display: none !important;
}

/* ---------- confirmation page ---------- */

.confirmation-page {
  inline-size: min(100% - (var(--gutter) * 2), var(--wide));
  margin-inline: auto;
  padding-block: var(--section-gap);
  max-inline-size: 46rem;
}

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

.site-footer {
  border-block-start: 1px solid var(--rule);
  padding-block: 1.5rem 2rem;
  inline-size: min(100% - (var(--gutter) * 2), var(--wide));
  margin-inline: auto;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.site-footer .social {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.social-pending {
  color: var(--ink-soft);
  opacity: 0.55;
  cursor: default;
}

.footer-contact,
.copyright {
  margin-block: 0 0.5rem;
  max-inline-size: none;
}
