/* ==========================================================================
   Afandina — opening-soon microsite (standalone; no css/site.css dependency)
   DESIGN-SPEC §6 · palette: --black #0B0906 / --gold #C9A227 / --gold-hi
   #E3C766 / --cream #EFE6D2 · Reem Kufi wordmark + Fraunces display.

   Identity translated from the client's signage rendering
   (assets/photos/afandina-signage.jpg):
   · near-black lacquer panel lit from above like the sign's lit box
   · thin DOUBLE gold hairline frame with cusped corner flourishes
   · girih star lattice (8-point star tessellation) at a whisper, edges only
   · cusped-arch cartouche rising behind the wordmark, fading like smoke
   · diamond (—◆—) divider from the sign's diamond ornaments
   · leaf-gold gradient + candle glow on the Arabic wordmark
   ========================================================================== */

:root {
  --black: #0B0906;
  --gold: #C9A227;
  --gold-hi: #E3C766;
  --gold-lo: #9A7A20;
  --cream: #EFE6D2;

  --ink-dim: rgba(239, 230, 210, 0.68);
  --ink-faint: rgba(239, 230, 210, 0.55);
  --line-gold: rgba(201, 162, 39, 0.34);
  --line-gold-soft: rgba(201, 162, 39, 0.15);
  --glow-gold: rgba(227, 199, 102, 0.28);
  --glow-gold-faint: rgba(227, 199, 102, 0.08);
  --gold-wash: rgba(201, 162, 39, 0.05);
  --veil: rgba(3, 2, 1, 0.62);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ar: "Aref Ruqaa", "Geeza Pro", serif;
}

/* ---- base ---------------------------------------------------------------- */

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

body,
h1,
p {
  margin: 0;
}

html {
  background: var(--black);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--black);
  color: var(--cream);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.6;
  text-align: center;
  overflow-x: hidden;
}

::selection {
  background: var(--gold);
  color: var(--black);
}

/* ---- backdrop: glow + girih lattice + vignette --------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(130% 82% at 50% 0%,
      var(--glow-gold-faint), rgba(227, 199, 102, 0.03) 30%, rgba(11, 9, 6, 0) 56%),
    var(--black);
}

/* girih star lattice — visible only toward the edges, never under the text */
.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='120'%20height='120'%20viewBox='0%200%20120%20120'%3E%3Cg%20fill='none'%20stroke='%23C9A227'%20stroke-width='1'%3E%3Cpath%20d='M60%2016%20104%2060%2060%20104%2016%2060Z'/%3E%3Crect%20x='34'%20y='34'%20width='52'%20height='52'/%3E%3Cpath%20d='M60%2048%2072%2060%2060%2072%2048%2060Z'/%3E%3Cpath%20d='M60%200V16M60%20104v16M0%2060h16M104%2060h16'/%3E%3Cpath%20d='M0%20-12%2012%200%200%2012%20-12%200ZM120%20-12%20132%200%20120%2012%20108%200ZM0%20108%2012%20120%200%20132%20-12%20120ZM120%20108%20132%20120%20120%20132%20108%20120Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
  opacity: 0.1;
  -webkit-mask-image: radial-gradient(76% 62% at 50% 42%, rgba(0, 0, 0, 0) 32%, rgb(0, 0, 0) 94%);
  mask-image: radial-gradient(76% 62% at 50% 42%, rgba(0, 0, 0, 0) 32%, rgb(0, 0, 0) 94%);
}

/* candle-light vignette: darkest in the corners of the room */
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 50% 42%,
    rgba(11, 9, 6, 0) 52%, var(--veil) 100%);
}

/* ---- double hairline frame + corner flourishes --------------------------- */

.frame {
  position: fixed;
  inset: clamp(12px, 2.4vw, 22px);
  z-index: -1;
  border: 1px solid var(--line-gold);
  pointer-events: none;
}

.frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--line-gold-soft);
}

.corner {
  position: absolute;
  width: 34px;
  height: 34px;
  color: var(--gold);
}

/* the L-arm */
.corner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
}

/* inner curved sweep (the cusp, from the cartouche's ogee corners) */
.corner i {
  position: absolute;
  inset: 7px;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
  border-top-left-radius: 130% 90%;
  opacity: 0.5;
}

/* diamond stud on the joint */
.corner::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  width: 8px;
  height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--glow-gold);
}

.corner.c1 { top: -1px; left: -1px; }
.corner.c2 { top: -1px; right: -1px; transform: scaleX(-1); }
.corner.c3 { bottom: -1px; right: -1px; transform: scale(-1, -1); }
.corner.c4 { bottom: -1px; left: -1px; transform: scaleY(-1); }

/* ---- page column ---------------------------------------------------------- */

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.4rem, 2.2vh, 2.2rem);
  width: 100%;
  max-width: 50rem;
  margin-inline: auto;
  padding:
    clamp(2.6rem, 4vh, 4.5rem)
    clamp(1.9rem, 6vw, 3rem)
    clamp(1.5rem, 3vh, 2.4rem);
}

/* eyebrow — tiny gold */

.eyebrow a {
  display: inline-block;
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--line-gold-soft);
  padding-bottom: 0.5em;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.eyebrow a:hover,
.eyebrow a:focus-visible {
  color: var(--gold-hi);
  border-color: var(--line-gold);
}

.eyebrow .arr {
  margin-left: 0.55em;
}

/* ---- the wordmark moment --------------------------------------------------- */

.moment {
  position: relative;
  padding:
    clamp(1.8rem, 4vh, 3.4rem)
    clamp(1.2rem, 4vw, 2rem)
    clamp(1.6rem, 3vh, 2.4rem);
}

/* cusped-arch cartouche behind the wordmark, stems fading like smoke.
   Explicit height (never `inset` bottom alone: an SVG is a replaced element
   and would grow to its intrinsic ratio, overflowing the document). */
.arch {
  position: absolute;
  top: -1rem;
  left: 0;
  right: 0;
  height: calc(100% + 1.7rem);
  width: 100%;
  color: var(--gold);
}

.wordmark-ar {
  font-family: var(--font-ar);
  font-weight: 500;
  font-size: clamp(3.9rem, 15.5vw, 8rem);
  line-height: 1.12;
  color: var(--gold); /* fallback if background-clip unsupported */
  background: linear-gradient(180deg,
    var(--gold-hi) 6%,
    var(--gold) 56%,
    var(--gold-lo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0.45rem 2.4rem var(--glow-gold));
}

.wordmark-en {
  margin-top: 0.95rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.02rem, 3.1vw, 1.45rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--cream);
}

.descriptor {
  margin-top: clamp(1.1rem, 2.4vh, 1.6rem);
  font-size: clamp(0.78rem, 2vw, 0.88rem);
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  text-transform: uppercase;
  color: var(--gold-hi);
}

.sub {
  margin-top: 0.9rem;
  max-width: 34ch;
  margin-inline: auto;
  font-size: clamp(1rem, 2.4vw, 1.12rem);
  line-height: 1.75;
  color: var(--ink-dim);
}

/* the ONE entrance: a slow rise of the wordmark, then stillness */
.moment {
  animation: af-rise 1s cubic-bezier(0.19, 0.62, 0.23, 1) both;
}

@keyframes af-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- divider: —◆— --------------------------------------------------------- */

.divider {
  position: relative;
  width: min(300px, 68%);
  height: 9px;
  margin-inline: auto;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 4px;
  height: 1px;
  width: calc(50% - 14px);
}

.divider::before {
  left: 0;
  background: linear-gradient(90deg, rgba(201, 162, 39, 0), var(--line-gold));
}

.divider::after {
  right: 0;
  background: linear-gradient(270deg, rgba(201, 162, 39, 0), var(--line-gold));
}

.divider .diamond {
  display: block;
  width: 7px;
  height: 7px;
  margin: 1px auto 0;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 12px var(--glow-gold);
}

/* ---- mood ------------------------------------------------------------------ */

.mood {
  max-width: 36ch;
  margin-inline: auto;
  font-style: italic;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 1.8;
  color: var(--cream);
  opacity: 0.92;
}

/* ---- email capture ---------------------------------------------------------- */

.capture {
  position: relative;
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
}

.capture-row {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

#notify-email {
  font-family: inherit;
  font-size: 1rem;
  color: var(--cream);
  background: var(--gold-wash);
  border: 1px solid var(--line-gold-soft);
  border-radius: 2px;
  padding: 0.88rem 1.1rem;
  letter-spacing: 0.02em;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

#notify-email::placeholder {
  color: var(--ink-dim);
  font-style: italic;
}

#notify-email:hover {
  border-color: var(--line-gold);
}

#notify-email:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.08);
  box-shadow: 0 0 0 1px var(--line-gold), 0 0 26px rgba(227, 199, 102, 0.14);
}

.capture button {
  font-family: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  text-transform: uppercase;
  color: var(--gold-hi);
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 2px;
  padding: 0.88rem 2rem;
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.capture button:hover {
  background: var(--gold);
  color: var(--black);
  box-shadow: 0 0 28px var(--glow-gold);
}

.capture button:focus-visible {
  outline: 1px solid var(--gold-hi);
  outline-offset: 3px;
}

.capture button:active {
  transform: translateY(1px);
}

.fineprint {
  margin-top: 1rem;
  max-width: 42ch;
  margin-inline: auto;
  font-size: 0.74rem;
  line-height: 1.55;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* honest fallback line (no js/forms.js): tel link to the mothership */
.status {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--gold-hi);
  transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

/* revealed by MY fallback (.is-visible) or by js/forms.js (.is-ok / .is-err) */
.status.is-visible,
.status.is-ok,
.status.is-err {
  max-height: 4.6em;
  opacity: 1;
  margin-top: 1.1rem;
}

.status a {
  color: var(--gold-hi);
  text-underline-offset: 3px;
}

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

.foot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.05rem clamp(1.9rem, 6vw, 3rem) calc(1rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, 76%);
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 162, 39, 0), var(--line-gold), rgba(201, 162, 39, 0));
}

.foot a {
  color: var(--gold);
  text-decoration: none;
}

.foot a:hover,
.foot a:focus-visible {
  color: var(--gold-hi);
}

/* ---- utilities ---------------------------------------------------------------- */

.vh,
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- wider viewports ----------------------------------------------------------- */

@media (min-width: 560px) {
  .capture-row {
    flex-direction: row;
    align-items: stretch;
  }

  .capture-row #notify-email {
    flex: 1 1 auto;
    min-width: 0;
  }

  .capture-row button {
    flex: 0 0 auto;
  }
}

@media (min-width: 640px) {
  .foot {
    flex-direction: row;
    justify-content: space-between;
    text-indent: 0;
  }
}

/* ---- calm: no motion when the visitor asks for none ------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .moment {
    animation: none;
  }

  .status {
    transition: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms;
  }
}
