/* ============================================================
   MIFTAH — private concierge
   Paper and ink. Hairlines only. No shadows, no radii, no glass.
   ============================================================ */

/* ---------- tokens ---------------------------------------- */

:root {
  color-scheme: light;

  --paper:       #FBF8F3;
  --paper-warm:  #FAF6EF;
  --ink:         #121212;
  --gold:        #C5A97A;

  --ink-70: rgba(18, 18, 18, 0.70);
  --ink-55: rgba(18, 18, 18, 0.55);
  --ink-40: rgba(18, 18, 18, 0.40);
  --ink-28: rgba(18, 18, 18, 0.28);

  --hair:        rgba(18, 18, 18, 0.09);
  --hair-strong: rgba(18, 18, 18, 0.18);
  --hair-gold:   rgba(197, 169, 122, 0.50);
  --flag:        #8A3A32;

  --serif:  "Playfair Display", "Iowan Old Style", "Times New Roman", Times, serif;
  --sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --script: "Cormorant Garamond", "Playfair Display", Georgia, serif;

  --shell:  1440px;
  --gutter: clamp(1.375rem, 5vw, 4rem);
  --rule:   1px;
  --ease:   cubic-bezier(0.16, 1, 0.3, 1);

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* The house is paper. It does not invert. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: light;
    --paper: #FBF8F3;
    --paper-warm: #FAF6EF;
    --ink: #121212;
    --gold: #C5A97A;
  }
}

:root[data-theme="dark"] {
  color-scheme: light;
  --paper: #FBF8F3;
  --paper-warm: #FAF6EF;
  --ink: #121212;
  --gold: #C5A97A;
}

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

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px));
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }

h1, h2, h3, p, figure { margin: 0; }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; }

a {
  color: inherit;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.42em;
  text-decoration-color: var(--ink-28);
  transition: text-decoration-color 0.4s var(--ease);
}
a:hover { text-decoration-color: var(--ink); }

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 5px;
}

/* ---------- paper grain ----------------------------------- */

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 60;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- shared ---------------------------------------- */

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

.band + .band { border-top: var(--rule) solid var(--hair); }

.band__inner { padding-block: clamp(5rem, 11vw, 10.5rem); }

/* A chapter mark, set in the margin like a printed book. */
.chapter {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--ink-28);
  letter-spacing: 0.02em;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.021em;
  text-wrap: balance;
}
.display em { font-style: italic; }

.lede {
  font-size: clamp(0.875rem, 1.05vw, 0.9375rem);
  line-height: 1.75;
  color: var(--ink-70);
  max-width: 38ch;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.875rem;
  padding-inline: 1.875rem;
  border: var(--rule) solid var(--hair-strong);
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease),
              border-color 0.5s var(--ease);
}
.mark:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

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

.masthead {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: rgba(251, 248, 243, 0.86);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--rule) solid var(--hair);
}

.masthead__inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.wordmark__logo {
  display: block;
  width: auto;
  height: 48px;
  object-fit: contain;
}

.masthead__link {
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.5em;
  cursor: pointer;
}

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

.hero {
  position: relative;
  min-height: calc(100svh - 72px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding-block: clamp(4rem, 10vh, 7rem) clamp(5rem, 12vh, 7rem);
}

.hero__arch {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: min(126vw, calc((100svh - 72px) * 0.56), 600px);
  height: auto;
  pointer-events: none;
}

.hero__arch path { fill: none; stroke-linecap: round; }
.hero__arch .arch-outer { stroke: var(--ink); stroke-width: 0.9; opacity: 0.16; }
.hero__arch .arch-inner { stroke: var(--ink); stroke-width: 0.7; opacity: 0.10; }
.hero__arch .arch-axis  { stroke: var(--gold); stroke-width: 0.8; stroke-dasharray: 2 9; opacity: 0.6; }

.hero__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* The Arabic is the display. Set once, large — it is the one
   concrete object on the page. Geeza Pro catches iOS if Amiri is
   slow to arrive; never let it fall through to a Latin face. */
.hero__arabic {
  font-family: "Amiri", "Geeza Pro", "Noto Naskh Arabic", "Traditional Arabic", serif;
  font-weight: 400;
  font-size: clamp(4.25rem, 15vw, 8.5rem);
  line-height: 1.3;
  margin: 0 0 clamp(0.5rem, 1.5vw, 1rem);
  color: var(--ink);
}

.hero__title {
  font-size: clamp(1.375rem, 3.4vw, 2.375rem);
  line-height: 1.14;
  max-width: none;
}
.hero__title span { display: block; }

.hero__lede {
  margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
  max-width: 36ch;
  text-align: center;
}

.hero__cta { margin-top: clamp(2.25rem, 4.5vw, 3rem); }

.hero__whisper {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  font-family: var(--script);
  font-style: italic;
  font-weight: 300;
  font-size: 1.0625rem;
  color: var(--ink-40);
}

/* ---------- manifesto ------------------------------------- */

.manifesto__inner {
  display: flex;
  justify-content: center;
  text-align: center;
}

.manifesto__col { max-width: 33rem; }

.manifesto .chapter { display: block; margin-bottom: clamp(2rem, 4vw, 3rem); }

.manifesto__text {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.05vw, 1.625rem);
  line-height: 1.58;
  letter-spacing: -0.012em;
}

.manifesto__note {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--ink-55);
}

.manifesto__stem {
  width: 1px;
  height: 3rem;
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  background: var(--hair-gold);
}

/* ---------- pillars --------------------------------------- */

.circle__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4rem);
}

@media (min-width: 62rem) {
  .circle__inner { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(3rem, 7vw, 7rem); }
  .circle__aside { position: sticky; top: 8.5rem; align-self: start; }
}

.circle .chapter { display: block; margin-bottom: 1.5rem; }

.circle__title {
  font-size: clamp(1.9rem, 3.6vw, 2.625rem);
  line-height: 1;
  max-width: 11ch;
}
.circle__title span { display: block; }

.circle__note { margin-top: 1.5rem; max-width: 30ch; }

.pillars { border-top: var(--rule) solid var(--hair); }

.pillar { position: relative; border-bottom: var(--rule) solid var(--hair); }

.pillar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.pillar.is-open::before { opacity: 0.7; }

.pillar__head {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 2.6vw, 2.125rem) 0 clamp(1.5rem, 2.6vw, 2.125rem) clamp(0.75rem, 1.5vw, 1.25rem);
  text-align: left;
  cursor: pointer;
}

.pillar__num {
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  color: var(--ink-28);
  font-variant-numeric: tabular-nums;
  flex: none;
  transition: color 0.5s var(--ease);
}
.pillar.is-open .pillar__num { color: var(--ink-55); }

.pillar__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.375rem, 2.6vw, 1.875rem);
  line-height: 1;
  letter-spacing: -0.012em;
  transition: font-style 0.3s var(--ease);
}
.pillar.is-open .pillar__name { font-style: italic; }

.pillar__body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.7s var(--ease), opacity 0.55s var(--ease);
}
.pillar.is-open .pillar__body { grid-template-rows: 1fr; opacity: 1; }

.pillar__body > div { overflow: hidden; }

.pillar__desc {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--ink-55);
  max-width: 46ch;
  padding: 0 1.5rem clamp(1.5rem, 2.6vw, 2.125rem) calc(clamp(0.75rem, 1.5vw, 1.25rem) + clamp(1.25rem, 3vw, 2.5rem) + 1.5rem);
}

/* ---------- invitation ------------------------------------ */

.invitation { background: var(--paper-warm); }

.invitation__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}

@media (min-width: 62rem) {
  .invitation__inner { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(3rem, 7vw, 7rem); }
}

.invitation .chapter { display: block; margin-bottom: 1.5rem; }

.invitation__title {
  font-size: clamp(1.9rem, 3.6vw, 2.625rem);
  line-height: 1.04;
  max-width: 15ch;
}

.invitation__note { margin-top: 1.75rem; max-width: 34ch; }

.invitation__aside {
  margin-top: clamp(2rem, 4vw, 3rem);
  font-size: 0.6875rem;
  line-height: 1.7;
  color: var(--ink-40);
  max-width: 28ch;
}

/* ---------- form ------------------------------------------ */

.card {
  background: var(--paper);
  border: var(--rule) solid var(--hair);
  padding: clamp(1.75rem, 4vw, 2.75rem);
}

.field + .field { margin-top: 2.25rem; }

.field label {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.015em;
  color: var(--ink-40);
  margin-bottom: 0.375rem;
}

.field input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: var(--rule) solid var(--hair-strong);
  border-radius: 0;
  padding: 0.5rem 0 0.75rem;
  font-family: var(--serif);
  font-size: 1.0625rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.4s var(--ease);
}
.field input::placeholder { font-family: var(--sans); font-size: 0.8125rem; color: var(--ink-28); }
.field input:focus { border-bottom-color: var(--ink); }
.field input:focus-visible { outline: none; }

.field.is-invalid input { border-bottom-color: var(--flag); }

.field__error {
  min-height: 0;
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  color: var(--flag);
}
.field__error:empty { display: none; }

.form__submit { width: 100%; margin-top: 2.5rem; }

.form__terms {
  margin-top: 1.25rem;
  font-size: 0.625rem;
  line-height: 1.7;
  color: var(--ink-40);
}

.receipt {
  margin-top: 1.5rem;
  border: var(--rule) solid var(--hair-gold);
  background: var(--paper-warm);
  padding: 0.875rem 1rem;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--ink-70);
  animation: settle 0.5s var(--ease) both;
}
.receipt[hidden] { display: none; }

@keyframes settle {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

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

.colophon { border-top: var(--rule) solid var(--hair); }

.colophon__inner {
  min-height: 88px;
  padding-block: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.colophon__mark {
  font-family: var(--serif);
  font-size: 0.625rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-55);
}

.colophon__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.75rem;
}

.colophon__links a,
.colophon__links button {
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-55);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.4s var(--ease);
}
.colophon__links a:hover,
.colophon__links button:hover { color: var(--ink); }

.hem { height: 1px; background: rgba(197, 169, 122, 0.22); }

/* ---------- note overlay ---------------------------------- */

.note {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(251, 248, 243, 0.88);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: settle 0.4s var(--ease) both;
}
.note[hidden] { display: none; }

.note__sheet {
  width: min(28rem, 100%);
  background: var(--paper);
  border: var(--rule) solid var(--hair-strong);
  padding: clamp(1.75rem, 4vw, 2.5rem);
}

.note__title {
  font-family: var(--serif);
  font-size: 1.375rem;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}

.note__text { font-size: 0.8125rem; line-height: 1.75; color: var(--ink-70); }

.note__close {
  margin-top: 2rem;
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-55);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.5em;
}

/* ---------- the one orchestrated moment -------------------- */
/* On arrival the arch is drawn, then the words settle. Nothing
   else on the page moves unless someone asks it to.           */

.js .hero__arch path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.6s var(--ease) 0.15s forwards;
}
.js .hero__arch .arch-inner { animation-delay: 0.45s; }
.js .hero__arch .arch-axis  { animation-delay: 1.1s; animation-duration: 1.8s; }

.js .hero__arabic,
.js .hero__title,
.js .hero__lede,
.js .hero__cta,
.js .hero__whisper { animation: settle 1.1s var(--ease) both; }

.js .hero__arabic  { animation-delay: 0.45s; }
.js .hero__title   { animation-delay: 0.7s; }
.js .hero__lede    { animation-delay: 0.9s; }
.js .hero__cta     { animation-delay: 1.1s; }
.js .hero__whisper { animation-delay: 1.5s; }

@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .hero__arch path,
  .js .hero__arabic,
  .js .hero__title,
  .js .hero__lede,
  .js .hero__cta,
  .js .hero__whisper,
  .receipt,
  .note { animation: none; }
  .js .hero__arch path { stroke-dashoffset: 0; }
  .pillar__body { transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- invitation, second paragraph ------------------ */

.invitation__note + .invitation__note { margin-top: 1rem; }

/* ---------- the photograph (commented out in index.html) --- */

.plate { border-top: var(--rule) solid var(--hair); }

.plate__figure {
  margin: 0;
  padding-block: clamp(4rem, 9vw, 8rem);
  padding-inline: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.plate__figure img {
  display: block;
  width: min(88vw, 34rem);
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.plate__caption {
  margin-top: 1.25rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8125rem;
  color: var(--ink-40);
  text-align: center;
  max-width: 34ch;
}

/* ---------- the intro, set as three short paragraphs ------ */

.manifesto__text + .manifesto__text { margin-top: 1.1em; }
