/* ==========================================================================
   Mohamed Al Ali — Advocates & Legal Consultancy
   Holding page. Palette per brand system:
   Burgundy #6A1E31 → #6D2333 · Charcoal #262223 · Gold #B18A4A (hairlines only)
   Warm Ivory #F7F3EC · White #FFFFFF · Stone #D7D1C7
   ========================================================================== */

:root{
  /* brand */
  --burgundy:      #6A1E31;
  --burgundy-2:    #6D2333;
  --gold:          #B18A4A;
  --ivory:         #F7F3EC;
  --white:         #FFFFFF;
  --stone:         #D7D1C7;
  --charcoal:      #262223;

  /* derived text tones — warm tints of charcoal, all ≥ 4.5:1 on ivory */
  --ink:           #262223;
  --ink-soft:      #54504F;
  --ink-label:     #6F6B69;

  /* lines */
  --hair:          #E6E0D5;
  --hair-strong:   #DBD4C7;
  --gold-soft:     rgba(177, 138, 74, .38);

  --brand-grad:    linear-gradient(122deg, var(--burgundy) 0%, var(--burgundy-2) 100%);

  /* type */
  --serif: "Cormorant Garamond", "Cormorant", Constantia, Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(.21, .6, .35, 1);
}

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

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

body{
  margin: 0;
  min-block-size: 100svh;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p{ margin: 0; }

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

a{ color: inherit; text-decoration: none; }

button{ font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

::selection{ background: var(--burgundy); color: var(--ivory); }

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

.skip{
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: 1rem;
  z-index: 10;
  padding: .7rem 1.1rem;
  background: var(--burgundy);
  color: var(--ivory);
  font-size: .8rem;
  letter-spacing: .06em;
  transition: inset-block-start .2s var(--ease);
}
.skip:focus{ inset-block-start: 1rem; }

/* ------------------------------------------------------------ page chrome - */
.ribbon{
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 3px;
  background: var(--brand-grad);
  z-index: 5;
}

/* barely-there paper tooth over the whole page */
.grain{
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: .04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- shell --- */
.shell{
  position: relative;
  z-index: 1;
  min-block-size: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(1.1rem, 2.5vh, 2rem);
  max-inline-size: 1120px;
  margin-inline: auto;
  padding: clamp(1rem, 2.6vh, 1.75rem) clamp(1.25rem, 5vw, 3rem) clamp(1.1rem, 2.4vh, 1.65rem);
}

/* --------------------------------------------------------------- topbar --- */
.topbar{
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-block-size: 1.5rem;
}

.lang{
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  animation: fade 1s var(--ease) .9s both;
}
/* An author `display` beats the UA's [hidden] rule, so restate it.
   main.js unhides the group; without JS the toggle never appears. */
.lang[hidden]{ display: none; }

.lang__sep{
  inline-size: 1px;
  block-size: 11px;
  background: var(--hair-strong);
}

.lang__btn{
  position: relative;
  padding: .3rem .1rem;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-label);
  transition: color .25s var(--ease);
}
.lang__btn[lang="ar"]{
  font-family: "IBM Plex Sans Arabic", var(--sans);
  letter-spacing: 0;
  font-size: .78rem;
  text-transform: none;
}
.lang__btn::after{
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  block-size: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform .3s var(--ease);
}
.lang__btn:hover{ color: var(--ink); }
.lang__btn.is-active{ color: var(--burgundy); }
.lang__btn.is-active::after{ transform: scaleX(1); }

/* ---------------------------------------------------------------- stage --- */
.stage{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* warm bloom behind the mark */
.glow{
  position: absolute;
  inset-block-start: -4%;
  inset-inline: 0;
  margin-inline: auto;
  inline-size: min(780px, 96vw);
  block-size: min(460px, 52vh);
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(106, 30, 49, .09), rgba(106, 30, 49, 0) 70%);
  animation: breathe 11s ease-in-out infinite alternate;
}

.mark{
  inline-size: clamp(94px, 12vw, 126px);
  block-size: auto;
  margin-block-end: clamp(1rem, 2.5vh, 1.5rem);
}

/* ------------------------------------------------------------- the name --- */
.lockup{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(.55rem, 1.3vh, .85rem);
  margin: 0;
  font-weight: 400;
}

.lockup__name{
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.95rem, 5.8vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: .085em;
  text-transform: uppercase;
  /* a tracked run carries one trailing letter-space; half of it re-centres the glyphs */
  text-indent: .0425em;
  color: var(--burgundy);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)){
  .lockup__name{
    background-image: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    /* The gradient only paints inside the box and the fill is transparent, so any
       ink outside the box disappears — Amiri's ي tail and dots sit well below it.
       Pad the box to enclose them; equal negative margins keep the layout still. */
    padding-block: .12em .45em;
    margin-block: -.12em -.45em;
  }
}

.lockup__sub{
  font-size: clamp(.63rem, 1.55vw, .8rem);
  font-weight: 400;
  letter-spacing: .335em;
  text-indent: .1675em;
  text-transform: uppercase;
  color: var(--ink-label);
}

/* ------------------------------------------------------ gold hair rule ---- */
.rule{
  position: relative;
  display: block;
  inline-size: min(230px, 54%);
  block-size: 1px;
  margin-block: clamp(1.15rem, 3vh, 1.85rem);
  background: linear-gradient(90deg, transparent, var(--gold) 14%, var(--gold) 86%, transparent);
  opacity: 1;
  transform-origin: center;
}
.rule::after{
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline: 0;
  inline-size: 5px;
  block-size: 5px;
  margin-inline: auto;
  background: var(--gold);
  transform: translateY(-50%) rotate(45deg);
}

/* ------------------------------------------------------------- message ---- */
.headline{
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.5rem, 3.9vw, 2.3rem);
  line-height: 1.26;
  letter-spacing: .012em;
  color: var(--ink);
  max-inline-size: 20ch;
  text-wrap: balance;
}

.lede{
  margin-block-start: clamp(.8rem, 1.9vh, 1.15rem);
  max-inline-size: 47ch;
  font-size: clamp(.95rem, 1.15vw, 1.0625rem);
  font-weight: 300;
  line-height: 1.72;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ------------------------------------------------------------- contact ---- */
.contact{
  inline-size: 100%;
  margin-block-start: clamp(1.85rem, 4.4vh, 3rem);
}

.eyebrow{
  margin-block-end: clamp(.8rem, 1.8vh, 1.1rem);
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .3em;
  text-indent: .15em;
  text-transform: uppercase;
  color: var(--ink-label);
}

.card{
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr;
  background: var(--white);
  border: 1px solid var(--hair);
  border-radius: 3px;
  box-shadow:
    0 1px 2px rgba(38, 34, 35, .028),
    0 26px 48px -34px rgba(106, 30, 49, .30);
  overflow: hidden;
}

.col{
  padding: clamp(1.25rem, 2.2vw, 1.7rem) clamp(1rem, 2vw, 1.7rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
}
.col + .col{ border-inline-start: 1px solid var(--hair); }

.col__label{
  font-size: .58rem;
  font-weight: 500;
  letter-spacing: .24em;
  text-indent: .12em;
  text-transform: uppercase;
  color: var(--ink-label);
}

.col__value{
  font-size: clamp(.95rem, 1.05vw, 1rem);
  font-weight: 400;
  line-height: 1.72;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}

/* understated gold underline that draws in on hover */
.link{
  position: relative;
  display: inline-block;
  transition: color .3s var(--ease);
}
.link::after{
  content: "";
  position: absolute;
  inset-block-end: -3px;
  inset-inline: 0;
  block-size: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: var(--origin, left);
  transition: transform .38s var(--ease);
}
.link:hover, .link:focus-visible{ color: var(--burgundy); }
.link:hover::after, .link:focus-visible::after{ transform: scaleX(1); }

.col__hint{
  display: block;
  margin-block-start: .55rem;
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--burgundy);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .32s var(--ease), transform .32s var(--ease);
}
.link:hover .col__hint,
.link:focus-visible .col__hint{ opacity: 1; transform: none; }

/* ---------------------------------------------------------------- foot ---- */
.foot{
  padding-block-start: clamp(.9rem, 2.2vh, 1.4rem);
  border-block-start: 1px solid var(--hair);
  text-align: center;
  font-size: .69rem;
  font-weight: 300;
  letter-spacing: .045em;
  color: var(--ink-label);
}

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 720px){
  .card{ grid-template-columns: 1fr; }
  .col + .col{
    border-inline-start: 0;
    border-block-start: 1px solid var(--hair);
  }
  .col__hint{ opacity: 1; transform: none; }   /* no hover on touch */
  .lockup__name{ letter-spacing: .06em; text-indent: .03em; }
  .lockup__sub{ letter-spacing: .26em; text-indent: .13em; }
}

@media (max-width: 400px){
  .lockup__sub{ font-size: .64rem; letter-spacing: .2em; text-indent: .1em; }
}

/* Short, wide viewports (laptops) — tighten the vertical rhythm. */
@media (max-height: 880px) and (min-width: 721px){
  .mark{ inline-size: clamp(88px, 9vw, 104px); }
  .rule{ margin-block: 1rem; }
  .lede{ max-inline-size: 62ch; }
  .contact{ margin-block-start: 1.5rem; }
  .col{ padding-block: 1.15rem; }
}

/* ------------------------------------------------------------- Arabic ----- */
[dir="rtl"] body,
body[dir="rtl"]{ font-family: "IBM Plex Sans Arabic", var(--sans); }

[dir="rtl"] .lockup__name{
  font-family: "Amiri", var(--serif);
  letter-spacing: 0;
  text-indent: 0;
  text-transform: none;
  font-size: clamp(2.15rem, 6.8vw, 4.2rem);
  line-height: 1.3;
}
[dir="rtl"] .lockup__sub,
[dir="rtl"] .eyebrow,
[dir="rtl"] .col__label,
[dir="rtl"] .col__hint{
  letter-spacing: 0;
  text-indent: 0;
  text-transform: none;
}
[dir="rtl"] .lockup__sub{ font-size: clamp(.78rem, 1.7vw, .95rem); }
[dir="rtl"] .eyebrow{ font-size: .8rem; }
[dir="rtl"] .col__label{ font-size: .72rem; }
[dir="rtl"] .col__hint{ font-size: .72rem; }
[dir="rtl"] .headline{
  font-family: "Amiri", var(--serif);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  max-inline-size: 22ch;
}
[dir="rtl"] .lede{ font-weight: 400; line-height: 1.95; font-size: clamp(.93rem, 1.1vw, 1.02rem); }
[dir="rtl"] .col__value{ line-height: 1.9; }
[dir="rtl"] .foot{ font-weight: 400; letter-spacing: 0; }
[dir="rtl"] .link{ --origin: right; }

/* Latin fragments (phone, email) keep their own direction inside RTL. */
[dir="ltr" i]{ unicode-bidi: isolate; }

/* --------------------------------------------------------------- motion --- */
@keyframes rise{
  from{ opacity: 0; transform: translate3d(0, 16px, 0); }
  to  { opacity: 1; transform: none; }
}
@keyframes riseMark{
  from{ opacity: 0; transform: translate3d(0, 16px, 0) scale(.94); }
  to  { opacity: 1; transform: none; }
}
@keyframes draw{
  from{ opacity: 0; transform: scaleX(0); }
  to  { opacity: 1; transform: none; }
}
@keyframes fade{ from{ opacity: 0; } to{ opacity: 1; } }
@keyframes breathe{
  from{ opacity: .55; transform: scale(.94); }
  to  { opacity: 1;   transform: scale(1.04); }
}

.reveal{ animation: rise .95s var(--ease) var(--d, 0s) both; }
.mark.reveal{ animation-name: riseMark; animation-duration: 1.15s; }
.rule.reveal{ animation-name: draw; animation-duration: 1.1s; }

/* language switch re-plays the reveal without the long stagger */
.swap .reveal{ animation-duration: .5s; animation-delay: calc(var(--d, 0s) * .28); }

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal{ opacity: 1; transform: none; }
  .rule{ opacity: 1; }
}

/* ---------------------------------------------------------------- print --- */
@media print{
  .ribbon, .grain, .glow, .lang, .skip, .col__hint{ display: none; }
  body{ background: #fff; }
  .shell{ min-block-size: 0; }
  .card{ box-shadow: none; }
  .reveal{ animation: none; }
}
