/* ==========================================================================
   Alshoubaki — brand sheet
   Everything brandable lives in the tokens below.
   ========================================================================== */

:root {
  --bg:      #06080b;
  --bg-deep: #020304;
  --ink:     #e3e9ef;
  --ink-2:   #6d7884;
  --ink-3:   #2a323b;
  --accent:  #62e0ff;
  --tick:    rgba(227, 233, 239, 0.28);

  /* The Arabic: base tone, and the tone it turns where light hits it.
     site.js retunes these with the real sun over Shoubak. */
  --stone:   #7f8894;
  --lit:     #ffffff;

  --font:    "Martian Mono", "SF Mono", "Menlo", "Consolas", ui-monospace, monospace;
  --font-ar: "Reem Kufi", "Noto Kufi Arabic", "Geeza Pro", "Arial", sans-serif;

  --wm-weight: 500;
  --wm-width:  112.5;   /* Martian Mono wdth axis: 75 – 112.5 */
  --wm-track:  0.42em;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { color-scheme: dark; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }

/* Terrain: contour lines of the hill, drawn behind everything by site.js */
#terrain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(85% 85% at 50% 46%, #000 30%, transparent 100%);
          mask-image: radial-gradient(85% 85% at 50% 46%, #000 30%, transparent 100%);
}

main { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   Stage: a full-height frame with four pinned corners
   -------------------------------------------------------------------------- */

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1.4rem, 3.5vw, 3rem);
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "tl tr"
    "main main"
    "bl br";
}

/* Registration ticks */
.stage::before, .stage::after,
.tick::before, .tick::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--tick);
  border-style: solid;
  border-width: 0;
  opacity: 0;
  animation: fade 1s var(--ease-out) 1.6s forwards;
}
.stage::before { top: 12px; left: 12px;  border-width: 1px 0 0 1px; }
.stage::after  { top: 12px; right: 12px; border-width: 1px 1px 0 0; }
.tick::before  { bottom: 12px; left: 12px;  border-width: 0 0 1px 1px; }
.tick::after   { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }

.corner { display: flex; align-items: center; gap: 0.75rem; }
.corner--tl { grid-area: tl; }
.corner--tr { grid-area: tr; justify-content: flex-end; }
.corner--bl { grid-area: bl; }
.corner--br { grid-area: br; justify-content: flex-end; }

.meta {
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: 0;
  animation: fade 1s var(--ease-out) 1.5s forwards;
}
.meta b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.meta i { font-style: normal; color: var(--ink-3); }

.mark {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  opacity: 0;
  animation: fade 1s var(--ease-out) 1.3s forwards;
}
.mark i { font-style: normal; color: var(--ink-2); font-weight: 300; }
a.mark:hover i { color: var(--accent); }

/* --------------------------------------------------------------------------
   The inscription
   -------------------------------------------------------------------------- */

.inscription {
  grid-area: main;
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: 2rem;
  max-width: 100%;
}

@property --mx { syntax: "<percentage>"; inherits: false; initial-value: 34%; }
@property --my { syntax: "<percentage>"; inherits: false; initial-value: 45%; }

/* Arabic wordmark — Kufi, the script cut into stone. Lit by the sun; then by you. */
.ar {
  --mx: 34%;
  --my: 45%;
  font-family: var(--font-ar);
  font-weight: 600;
  font-size: clamp(4.4rem, 17vw, 15rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: transparent;
  background-image: radial-gradient(
    55% 120% at var(--mx) var(--my),
    var(--lit) 0%,
    var(--ink) 22%,
    var(--stone) 62%
  );
  -webkit-background-clip: text;
          background-clip: text;
  opacity: 0;
  animation: fade 1.4s var(--ease-out) 0.2s forwards;
  transition: --mx 2.4s var(--ease-out), --my 2.4s var(--ease-out);
  cursor: default;
  user-select: none;
}
.ar.is-lit { transition: --mx 0.25s ease-out, --my 0.25s ease-out; }
.ar--sm { font-size: clamp(3rem, 11vw, 8rem); }

/* Latin wordmark — small, wide, tracked; a caption cut later */
.wordmark {
  display: flex;
  margin-top: clamp(0.2rem, 1vw, 0.8rem);
  margin-right: calc(-1 * var(--wm-track));
  font-size: clamp(0.95rem, 2.4vw, 1.75rem);
  font-weight: var(--wm-weight);
  font-variation-settings: "wdth" var(--wm-width);
  letter-spacing: var(--wm-track);
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
}
.wordmark span {
  display: inline-block;
  opacity: 0;
  animation: fade 0.6s var(--ease-out) forwards;
  animation-delay: calc(0.7s + var(--i) * 0.05s);
}

.origin {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-top: clamp(1.8rem, 3.6vw, 3rem);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: 0;
  animation: rise 1s var(--ease-out) 1.4s forwards;
}
.origin i { font-style: normal; color: var(--ink-3); }
.rule { width: clamp(1.6rem, 4vw, 3.5rem); height: 1px; background: var(--ink-3); }

/* Contact — the only things on the site that turn cyan */
.contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 2.2rem;
  margin-top: clamp(1.2rem, 2.2vw, 1.8rem);
  font-size: clamp(0.82rem, 1.1vw, 0.98rem);
  letter-spacing: 0.02em;
  opacity: 0;
  animation: rise 1s var(--ease-out) 1.65s forwards;
}
.contact a {
  color: var(--ink);
  padding-bottom: 0.15em;
  border-bottom: 1px solid var(--ink-3);
  transition: color 0.25s ease, border-color 0.25s ease;
}
.contact a:hover, .contact a:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.contact a span { color: var(--ink-2); transition: color 0.25s ease; }
.contact a:hover span { color: var(--accent); }

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@keyframes fade   { to { opacity: 1; } }
@keyframes rise   { from { transform: translateY(0.5em); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ar, .wordmark span, .origin, .contact, .meta, .mark,
  .stage::before, .stage::after, .tick::before, .tick::after { animation: none; opacity: 1; transform: none; }
  .ar { transition: none; }
}

@media (max-width: 480px) {
  .stage { padding: 1.2rem; }
  .ar { font-size: clamp(3.6rem, 22vw, 6rem); }
  .wordmark { font-size: 0.9rem; --wm-track: 0.3em; }
  .contact { gap: 0.6rem 1.4rem; }
  .corner--br .meta { display: none; }
}
