/* landing.css — mahchi.com single-page card. Mahchi brand: teal-black ground,
   sand type, brass rule. Nothing else. */

:root {
  --teal-black: #0C2A2B; /* ground */
  --sand:       #F3EDE1; /* display and body type on dark */
  --brass:      #C39A5F; /* rules and small labels on dark */

  --font-display: 'Bodoni Moda', serif;
  --font-body:    'Inter', sans-serif;
  --font-arabic:  'Noto Naskh Arabic', serif;

  --swap-fade: 600ms;
}

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

html { background: var(--teal-black); }

body {
  margin: 0;
  background: var(--teal-black);
  color: var(--sand);
  font-family: var(--font-body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ---- Card ----
   A fixed measure, centred in the viewport. It is also the query container:
   the contact block reads its width in cqw to cross to the right-hand edge. */

.card {
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px clamp(24px, 5vw, 64px);
}

/* ---- Name ---- */

.name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 6.4vw, 68px);
  line-height: 1.1;
  letter-spacing: 0.05em; /* the Latin wordmark is letter-spaced */
}

.name .lang-ar {
  font-family: var(--font-arabic);
  font-weight: 400;
  font-size: 0.78em;
  line-height: 1.45;
  letter-spacing: 0; /* Arabic is never letter-spaced */
  text-align: right;
}

/* ---- Rule ----
   40px tall so the wave has room to swell without moving anything below it.
   preserveAspectRatio="none" stretches the curve horizontally only, so the
   stroke keeps its true weight at every width. */

.rule {
  display: block;
  width: 100%;
  height: 40px;
  color: var(--brass);
  margin: 16px 0 24px;
}

/* ---- Contact ----
   Sized to its own content so it can cross to the right-hand edge of the card
   in the Arabic state: 100% is this block's width, 100cqw the card's. */

.contact {
  margin: 0;
  width: fit-content;
  transform: translateX(0);
  transition: transform var(--swap-fade) ease;
}

.js-rotate.is-ar .contact {
  transform: translateX(max(0px, calc(100cqw - 100%)));
}

/* One column, label above value, for both languages and every width — this
   is the layout that was already correct on mobile. Two side-by-side columns
   meant matching English and Arabic on the same line, which meant matching
   two different scripts' baselines, which is exactly what kept going wrong;
   stacking removes the problem instead of chasing it. */
.row {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 4px;
  margin-bottom: 24px;
}

.row:last-child { margin-bottom: 0; }

.label {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
}

.label .lang-ar {
  font-family: var(--font-arabic);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
}

.value {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
}

.value a {
  color: var(--sand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.value a:hover,
.value a:focus-visible {
  color: var(--brass);
  border-bottom-color: var(--brass);
}

/* ---- Language swap ----
   Default, and without JavaScript: both scripts are present and readable,
   stacked. JavaScript adds the rotation on top by setting .js-rotate. */

.lang-ar { display: block; }
.lang-carry { display: none; } /* only the rotation has a use for it */

.name .lang-ar { margin-top: 8px; }
.label .lang-ar { margin-top: 4px; }

.js-rotate .swap { display: grid; }

.js-rotate .swap .lang {
  grid-area: 1 / 1;
  justify-self: start;
  margin-top: 0;
  opacity: 1;
  transition: opacity var(--swap-fade) ease;
}

/* Arabic sets to the right of the same area it shares with the English. */
.js-rotate .name .lang-ar,
.js-rotate .label .lang-ar { justify-self: end; }
.js-rotate .label .lang-ar { text-align: right; }

.js-rotate .swap .lang-ar { opacity: 0; pointer-events: none; }

.js-rotate.is-ar .swap .lang-en { opacity: 0; pointer-events: none; }
.js-rotate.is-ar .swap .lang-ar { opacity: 1; pointer-events: auto; }

/* LinkedIn has no Arabic form. Its second copy is hidden until the rotation is
   running, then carries the word to the right of the column. */
.js-rotate .swap .lang-carry {
  display: block;
  justify-self: end;
  opacity: 0;
  pointer-events: none;
}

.js-rotate.is-ar .swap .lang-carry { opacity: 1; pointer-events: auto; }

/* ---- Small screens ---- */

@media (max-width: 560px) {
  .rule { margin: 8px 0 20px; }
}

/* ---- Reduced motion ----
   No rotation, no wave, no crossing. JavaScript leaves .js-rotate off, so both
   scripts stay stacked in their final state. This is the belt to that
   suspenders. */

@media (prefers-reduced-motion: reduce) {
  .contact,
  .js-rotate.is-ar .contact {
    transform: none;
    transition: none;
  }
  .js-rotate .swap { display: block; }
  .js-rotate .swap .lang,
  .js-rotate.is-ar .swap .lang {
    opacity: 1;
    transition: none;
    pointer-events: auto;
  }
  .js-rotate .name .lang-ar { margin-top: 8px; }
  .js-rotate .label .lang-ar { margin-top: 4px; }
}
