/* ==========================================================================
   Khami Kuwait — stylesheet
   Palette and type drawn from the tailoring trade: pattern paper, chalk,
   walnut tools, brass pins, the ticked edge of a measuring tape.
   ========================================================================== */

:root {
  --ink:    #17130F;
  --cream:  #F7F2E9;
  --sand:   #E7DCC8;
  --walnut: #6B452A;
  --brass:  #B08542;
  --paper:  #FFFFFF;
  --muted:  #7C6F60;
  --line:   #DBCEB6;

  --display: "Fraunces", Georgia, serif;
  --body:    "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  --wrap: 1140px;
  --gutter: 20px;
  --radius: 2px;
}

html[lang="ar"] {
  --display: "Amiri", Georgia, serif;
  --body:    "IBM Plex Sans Arabic", system-ui, sans-serif;
}

/* --- reset ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body {
  font-size: 1.06rem;
  line-height: 1.85;
}

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

a { color: var(--walnut); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

/* --- typography ----------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .6em;
  letter-spacing: -0.015em;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4 { line-height: 1.4; letter-spacing: 0; }

h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.125rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + .7vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--walnut);
  margin: 0 0 1rem;
}

html[lang="ar"] .eyebrow { letter-spacing: 0; font-family: var(--body); font-weight: 600; }

.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }

.small { font-size: .875rem; color: var(--muted); }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--sand { background: var(--sand); }
.section--tight { padding-block: clamp(2rem, 4vw, 3rem); }

.grid { display: grid; gap: 1.5rem; }
@media (min-width: 720px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.narrow { max-width: 68ch; }

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

.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: .75rem 1.25rem;
  z-index: 200;
}
.skip:focus { inset-inline-start: 0; color: var(--cream); }

/* --- measure rule (signature) --------------------------------------------- */

.rule {
  position: relative;
  height: 14px;
  margin-block: 2rem;
  border-top: 1px solid var(--walnut);
  overflow: hidden;
}

.rule::after {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 7px;
  background-image: repeating-linear-gradient(
    to right,
    var(--brass) 0, var(--brass) 1px,
    transparent 1px, transparent 8px
  );
  opacity: .85;
  transform-origin: left center;
  animation: draw .7s cubic-bezier(.2,.7,.3,1) both;
}

html[dir="rtl"] .rule::after { transform-origin: right center; }

@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.rule--short { max-width: 220px; }

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

.btn {
  display: inline-block;
  font-family: var(--body);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1;
  padding: .95rem 1.6rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.btn:hover { background: var(--walnut); border-color: var(--walnut); color: var(--cream); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--cream); }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--ink);
}
.logo img { height: 30px; width: auto; }
@media (min-width: 640px) { .logo img { height: 34px; } }
.logo__ar {
  font-family: "Amiri", serif;
  font-size: 1.2rem;
  color: var(--walnut);
  padding-inline-start: .6rem;
  border-inline-start: 1px solid var(--line);
  line-height: 1;
}
@media (max-width: 420px) { .logo__ar { display: none; } }

.nav { display: none; gap: 1.6rem; align-items: center; }
@media (min-width: 1000px) { .nav { display: flex; } }

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: .93rem;
  padding-block: .4rem;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--walnut); color: var(--walnut); }

.masthead__end { display: flex; align-items: center; gap: .75rem; }

.lang {
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: .5rem .7rem;
  border-radius: var(--radius);
}
.lang:hover { border-color: var(--walnut); color: var(--walnut); }

.btn--sm { padding: .6rem 1rem; font-size: .85rem; }
@media (max-width: 999px) { .masthead .btn--sm { display: none; } }

.burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--ink);
}
@media (min-width: 1000px) { .burger { display: none; } }

.burger svg { width: 20px; height: 20px; }

/* mobile sheet */
.sheet {
  position: fixed;
  inset: 0;
  background: var(--cream);
  z-index: 150;
  display: none;
  flex-direction: column;
  padding: var(--gutter);
  overflow-y: auto;
}
.sheet[data-open="true"] { display: flex; }

.sheet__top { display: flex; justify-content: space-between; align-items: center; min-height: 68px; }
.sheet__nav { display: flex; flex-direction: column; gap: .25rem; margin-top: 1.5rem; }
.sheet__nav a {
  font-family: var(--display);
  font-size: 1.4rem;
  color: var(--ink);
  text-decoration: none;
  padding-block: .7rem;
  border-bottom: 1px solid var(--line);
}
.sheet__foot { margin-top: auto; padding-top: 2rem; display: flex; gap: .75rem; align-items: center; }

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

.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { max-width: 16ch; font-size: clamp(2.2rem, 1.2rem + 4.2vw, 4rem); }
.hero .lead { margin-top: 1.5rem; font-size: 1.2rem; }

.hero__note {
  margin-top: 2rem;
  font-size: .9rem;
  color: var(--muted);
  padding-inline-start: 1rem;
  border-inline-start: 2px solid var(--brass);
}

/* --- cards ---------------------------------------------------------------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
}
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .95rem; }
.card a { font-weight: 600; font-size: .92rem; }

.section--sand .card { background: var(--cream); }

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

.steps { counter-reset: step; display: grid; gap: 0; margin-top: 2rem; }

.step {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 1.2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }

.step__num {
  font-family: var(--mono);
  font-size: .95rem;
  color: var(--brass);
  padding-top: .2rem;
}
.step h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.step p { color: var(--muted); margin: 0; font-size: .96rem; }

/* --- notice / callout ----------------------------------------------------- */

.notice {
  background: var(--paper);
  border: 1px solid var(--walnut);
  border-inline-start-width: 3px;
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin-block: 2rem;
}
.notice h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.notice p { font-size: .96rem; margin-bottom: .8em; }
.notice strong { color: var(--ink); }

/* --- prose (legal pages) -------------------------------------------------- */

.prose { max-width: 74ch; }
.prose h2 {
  font-size: 1.45rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.prose h2:first-of-type { margin-top: 1.5rem; }
.prose h3 { font-size: 1.1rem; margin-top: 1.8rem; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-inline-start: 1.3rem; }
.prose li { margin-bottom: .5em; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 1.5rem;
  font-size: .93rem;
}
.prose th, .prose td {
  text-align: start;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  vertical-align: top;
}
.prose th { background: var(--sand); font-weight: 600; }

.meta-dates {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .04em;
}
html[lang="ar"] .meta-dates { font-family: var(--body); letter-spacing: 0; }

/* --- definition rows (contact) -------------------------------------------- */

.rows { border-top: 1px solid var(--line); margin-top: 1.5rem; }
.row {
  display: grid;
  gap: .2rem 1.5rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) { .row { grid-template-columns: 15rem 1fr; } }
.row dt { font-weight: 600; font-size: .95rem; }
.row dd { margin: 0; color: var(--muted); }
.row dd a { color: var(--walnut); }

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

.form { max-width: 40rem; margin-top: 2rem; }

.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .4rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .75rem .85rem;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--walnut); }

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

.check { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: 1.4rem; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; flex-shrink: 0; }
.check label { font-weight: 400; font-size: .92rem; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__note { font-size: .85rem; color: var(--muted); margin-top: 1rem; }

.fallback {
  background: var(--sand);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-top: 1.5rem;
  font-size: .92rem;
}

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

.foot {
  background: var(--ink);
  color: var(--cream);
  padding-block: 3.5rem 2rem;
  margin-top: 0;
}
.foot a { color: var(--sand); text-decoration: none; }
.foot a:hover { color: var(--paper); text-decoration: underline; }

.foot__grid { display: grid; gap: 2.5rem; }
@media (min-width: 760px)  { .foot__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }

.foot h4 {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 1rem;
  font-weight: 500;
}
html[lang="ar"] .foot h4 { font-family: var(--body); letter-spacing: 0; font-weight: 600; font-size: .8rem; }

.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: .55rem; font-size: .92rem; }

.foot__id { font-size: .9rem; line-height: 1.8; }
.foot__logo { height: 40px; width: auto; margin-bottom: .9rem; }
.foot__id .name { font-family: "Amiri", serif; font-size: 1.5rem; color: var(--brass); display: block; margin-bottom: .4rem; line-height: 1; }
.foot__id .legal { color: var(--sand); opacity: .85; display: block; margin-block: .6rem; }
.foot__id .cr { font-family: var(--mono); font-size: .78rem; opacity: .7; display: block; }
html[lang="ar"] .foot__id .cr { font-family: var(--body); }

.foot__base {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(247,242,233,.18);
  font-size: .82rem;
  opacity: .75;
}

.social { display: flex; gap: .8rem; margin-top: 1rem; }
.social a { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center;
            border: 1px solid rgba(247,242,233,.3); border-radius: var(--radius); }
.social svg { width: 17px; height: 17px; }

/* --- cookie banner -------------------------------------------------------- */

.cookies {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 180;
  background: var(--paper);
  border-top: 1px solid var(--walnut);
  padding: 1.2rem var(--gutter);
  display: none;
}
.cookies[data-show="true"] { display: block; }
.cookies__inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.cookies p { font-size: .9rem; margin: 0; max-width: 60ch; }
.cookies .btn-row { margin: 0; }

/* --- misc ----------------------------------------------------------------- */

.faq { margin-top: 1.5rem; }
.faq details { border-bottom: 1px solid var(--line); padding-block: 1.1rem; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; font-size: 1.02rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: inline-end; color: var(--walnut); font-family: var(--mono); }
.faq details[open] summary::after { content: "–"; }
.faq p { margin-top: .8rem; color: var(--muted); font-size: .96rem; }

.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.center { text-align: center; }
.center .lead { margin-inline: auto; }
.center .btn-row { justify-content: center; }
.center .rule { margin-inline: auto; }

/* --- reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
