/* El Mouhami design tokens. The only place these values are defined:
   deploy/coming-soon/build.py puts this file ahead of the page's own CSS.
   Rules for using them: docs/design/DESIGN.md. */

:root {
  /* Paper and ink */
  --paper: #f5efe4;
  --paper-edge: #e9dfcc;
  --ink: #15120f;
  --ink-soft: #4b443c;
  --ink-faint: #6c6256;
  --rule: rgb(21 18 15 / 0.14);
  --ruling: rgb(21 18 15 / 0.045);
  /* the logo's red; --red-text is the same hue dark enough for small text */
  --red: #f50a0a;
  --red-text: #b3121b;

  /* How ink sits on the paper */
  --stamp-blend: multiply;
  --grain-blend: multiply;

  /* Type */
  --font-display: "Aref Ruqaa", "Noto Naskh Arabic", serif;
  --font-text: "Noto Naskh Arabic", "Geeza Pro", "Times New Roman", serif;
  --font-label: "Readex Pro", system-ui, sans-serif;

  /* Layout */
  --gutter: clamp(16px, 4.5vw, 64px);
  --margin-line: clamp(8px, 2.2vw, 30px);
  --ruling-pitch: 2.25rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13110f;
    --paper-edge: #0b0a09;
    --ink: #f1ebdf;
    --ink-soft: #bdb4a6;
    --ink-faint: #8f877b;
    --rule: rgb(241 235 223 / 0.14);
    --ruling: rgb(241 235 223 / 0.035);
    --red: #ff3b30;
    --red-text: #ff6b5e;
    --stamp-blend: normal;
    --grain-blend: soft-light;
    color-scheme: dark;
  }
}

@font-face {
  font-family: "Noto Naskh Arabic";
  src: url("/assets/naskh.a47208f872.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Aref Ruqaa";
  src: url("/assets/ruqaa.b72abf4507.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Readex Pro";
  src: url("/assets/sans.e875148f19.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(120% 90% at 70% 35%, transparent 55%, var(--paper-edge) 100%),
    var(--paper);
  color: var(--ink);
  font: 400 1rem/1.9 var(--font-text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("/assets/grain.09026b7be4.webp") repeat;
  background-size: 180px;
  mix-blend-mode: var(--grain-blend);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.sheet {
  position: relative;
  z-index: 1;
  overflow-x: clip;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding:
    max(env(safe-area-inset-top), clamp(14px, 3vw, 34px))
    max(env(safe-area-inset-right), var(--gutter))
    max(env(safe-area-inset-bottom), clamp(14px, 3vw, 30px))
    max(env(safe-area-inset-left), var(--gutter));
  padding-inline-start: calc(var(--margin-line) + clamp(18px, 4vw, 64px));
}

/* the ruled lines and double red margin of a legal pad */
.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--ruling-pitch) - 1px), var(--ruling) calc(var(--ruling-pitch) - 1px) var(--ruling-pitch));
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 70%, transparent);
  pointer-events: none;
  z-index: -1;
}
.sheet::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: var(--margin-line);
  width: 5px;
  border-inline: 1px solid var(--red);
  opacity: 0.55;
  pointer-events: none;
  transform-origin: top;
  animation: rule 1.2s cubic-bezier(0.65, 0, 0.35, 1) both;
}

/* the logo's two red diamonds */
.mark {
  position: relative;
  display: inline-block;
  width: 1.35em;
  height: 1em;
  flex: none;
}
.mark i {
  position: absolute;
  width: 0.58em;
  height: 0.58em;
  background: var(--red);
  transform: rotate(45deg);
}
.mark i:first-child { inset-inline-start: 0.08em; top: 0.3em; }
.mark i:last-child { inset-inline-start: 0.62em; top: 0.02em; }

.masthead {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-block-end: 0.85rem;
  border-block-end: 3px double var(--ink);
  font: 500 0.92rem/1.4 var(--font-label);
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.05s both;
}
.domain { letter-spacing: 0.06em; }
.ref { margin-inline-start: auto; color: var(--ink-faint); }

.main {
  flex: 1;
  display: grid;
  align-content: center;
  gap: clamp(1.5rem, 5vw, 3rem);
  padding-block: clamp(1.75rem, 5vw, 3.5rem);
}

.brand {
  position: relative;
  margin: 0 auto;
  width: min(72vw, 360px);
}
.logo {
  display: block;
  width: 100%;
  height: auto;
  animation: write 1.15s cubic-bezier(0.65, 0, 0.35, 1) 0.15s both;
}

.stamp {
  position: absolute;
  inset-block-start: -13%;
  inset-inline-end: -9%;
  width: clamp(104px, 28vw, 196px);
  height: auto;
  color: var(--red);
  mix-blend-mode: var(--stamp-blend);
  transform: rotate(-13deg);
  animation: stamp 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) 1.05s both;
  overflow: visible;
}
.stamp-line { fill: none; stroke: currentColor; }
.stamp-ring { font: 600 23.2px var(--font-label); fill: currentColor; }
.stamp-latin { font-size: 22px; letter-spacing: 0.22em; }
.stamp-dot { fill: currentColor; }
.stamp-word { font: 700 104px var(--font-display); fill: currentColor; }
.stamp-year { font: 600 24px var(--font-label); letter-spacing: 0.3em; fill: currentColor; }

.copy > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.copy > :nth-child(1) { animation-delay: 0.35s; }
.copy > :nth-child(2) { animation-delay: 0.45s; }
.copy > :nth-child(3) { animation-delay: 0.58s; }
.copy > :nth-child(4) { animation-delay: 0.7s; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.6rem;
  color: var(--red-text);
  font: 600 0.98rem/1.5 var(--font-label);
}
.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 2px;
  background: currentColor;
}

h1 {
  margin: 0;
  font: 700 clamp(2.2rem, 8.6vw, 4.6rem)/1.32 var(--font-display);
  text-wrap: balance;
}

.lede {
  margin: 1rem 0 0;
  max-width: 34em;
  color: var(--ink-soft);
  font-size: clamp(1.06rem, 1.5vw, 1.24rem);
  line-height: 2;
  text-wrap: pretty;
}

.docket {
  list-style: none;
  margin: clamp(1.6rem, 3.5vw, 2.4rem) 0 0;
  padding: 0;
  border-block-start: 1px solid var(--ink);
}
.docket li {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  column-gap: 0.75rem;
  align-items: baseline;
  padding-block: 0.7rem;
  border-block-end: 1px solid var(--rule);
}
.num {
  grid-row: span 2;
  color: var(--red-text);
  font: 600 0.85rem/1 var(--font-label);
  letter-spacing: 0.08em;
}
.docket b { font-weight: 700; font-size: 1.06rem; }
.docket li > span:last-child { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.8; }

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block-start: 0.85rem;
  border-block-start: 1px solid var(--rule);
  color: var(--ink-faint);
  font: 400 0.85rem/1.5 var(--font-label);
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.9s both;
}
.foot .mark { font-size: 0.8rem; }

@media (min-width: 600px) {
  .docket li { grid-template-columns: 2.6rem 6.5rem 1fr; }
  .num { grid-row: auto; }
}

@media (min-width: 960px) {
  .main {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: clamp(3rem, 7vw, 7.5rem);
    max-width: 1240px;
    width: 100%;
    margin-inline: auto;
  }
  .brand { width: min(100%, 440px); margin: 0; justify-self: center; }
  .stamp { inset-block-start: -10%; inset-inline-end: -20%; }
}

@media (min-width: 960px) and (max-height: 760px) {
  .brand { width: min(100%, 360px); }
  h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); }
  .docket li { padding-block: 0.5rem; }
}

@keyframes write {
  from { clip-path: inset(0 0 0 100%); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-4deg) scale(1.7); }
  70% { opacity: 1; }
  100% { opacity: 1; transform: rotate(-13deg) scale(1); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes rule {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
