/*
  Shared layer for w9w6.com and rent.w9w6.com: fonts, tokens, page frame, header,
  footer, buttons. Each site adds one stylesheet of its own (hub.css, rent.css).

  Rules kept from the original site:
  - animate transform and opacity only;
  - logical properties (inline/block), so the Arabic pages mirror with no extra CSS;
  - no client-side JavaScript: the language switch is a link, and the cross-page
    fade is a CSS view transition.
*/

@font-face {
  font-family: "Alexandria";
  src: url("/fonts/alexandria-var.v1.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "W9 Text";
  src: url("/fonts/w9-text-400.v1.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "W9 Text";
  src: url("/fonts/w9-text-600.v1.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* Switching language, or moving between pages of one site, cross-fades instead of
   flashing white. Browsers without support simply navigate. */
@view-transition {
  navigation: auto;
}

:root {
  color-scheme: light dark;

  --ground: #f3f6f5;
  --surface: #ffffff;
  --ink: #0e1a26;
  --ink-2: #4a5866;
  --rule: #d3dbd9;
  --brand: #2e52d0;
  --teal: #0a7f72;
  --line-rent: #11764b;
  --line-next: #8a97a3;
  --warn: #8f4a00;
  --warn-bg: #fff1dc;

  --font-display: "Alexandria", "W9 Text", "Segoe UI", system-ui, sans-serif;
  --font-body: "W9 Text", "Segoe UI", "Noto Sans Arabic", system-ui, sans-serif;

  /* One scale, ratio about 1.25, fluid only at the top. */
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.25rem, 1.15rem + 0.45vw, 1.45rem);
  --step-3: clamp(1.5rem, 1.25rem + 1vw, 2.2rem);
  --step-4: clamp(2rem, 1.45rem + 2.4vw, 3.4rem);
  --step-5: clamp(2.35rem, 1.4rem + 4.2vw, 4.3rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 74rem;
  --radius: 0.75rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0c1520;
    --surface: #121e2b;
    --ink: #e8eef0;
    --ink-2: #a6b4be;
    --rule: #263544;
    --brand: #8ea4ff;
    --teal: #45cdb9;
    --line-rent: #4fc48c;
    --line-next: #6b7885;
    --warn: #ffc27a;
    --warn-bg: #3a2a12;
  }
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--step-0) / 1.65 var(--font-body);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* Arabic sits a size step up and needs more line height to sit level with the
   Latin beside it. Never letter-spaced, never slanted. */
:lang(ar) body,
body:lang(ar) {
  font-size: 1.0625rem;
  line-height: 1.85;
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}
:lang(ar) :is(h1, h2, h3) {
  line-height: 1.4;
}
:lang(en) :is(h1, h2) {
  letter-spacing: -0.015em;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--brand);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--ground);
}
.skip:focus {
  inset-block-start: 1rem;
}

/* ---------- header ---------- */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
}

.home {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
}
.home svg {
  display: block;
}
.home .mark {
  inline-size: 2.25rem;
  block-size: 2.25rem;
}
.home .word {
  block-size: 1.4rem;
  inline-size: auto;
}

/* The wordmark always reads left to right, in both languages: it is a name. */
.word,
.mark {
  direction: ltr;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.crumb .sep {
  inline-size: 1px;
  block-size: 1.4rem;
  background: var(--rule);
}
.crumb .here {
  font-family: var(--font-display);
  font-weight: 600;
  white-space: nowrap;
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-block-size: 2.75rem;
  padding-inline: 1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out);
}
.lang:hover {
  border-color: var(--ink-2);
  transform: translateY(-1px);
}
.lang .code {
  color: var(--ink-2);
  font-size: var(--step--1);
  font-weight: 400;
}

/* Shared SVG glyphs and the small W9W6 mark. */

.defs {
  position: absolute;
  inline-size: 0;
  block-size: 0;
  overflow: hidden;
}

/* ---------- header mark ---------- */

.mark-tile {
  fill: #0e1a26;
}
.mark-glyph {
  fill: none;
  stroke: url(#mark-stroke);
  stroke-width: 7;
  stroke-linecap: round;
}
.word-glyphs {
  fill: none;
  stroke: currentColor;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-color-scheme: dark) {
  .mark-tile {
    fill: var(--surface);
    stroke: var(--rule);
    stroke-width: 2;
  }
}

/* ---------- shared pieces ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-block-size: 3rem;
  padding-inline: 1.35rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--ground);
  font: 600 var(--step-0) / 1.2 var(--font-body);
  text-decoration: none;
  transition: transform 0.2s var(--ease-out);
}
a.btn:hover {
  transform: translateY(-2px);
}

.soon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.soon::before {
  content: "";
  inline-size: 0.45rem;
  block-size: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.section {
  padding-block: clamp(3rem, 7vw, 6rem);
}
.section > .wrap > h2,
.section-title {
  font-size: var(--step-3);
  margin-block-end: clamp(1.5rem, 3vw, 2.5rem);
}

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

.site-foot {
  border-block-start: 1px solid var(--rule);
  padding-block: 2rem 2.5rem;
  color: var(--ink-2);
  font-size: var(--step--1);
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.site-foot a {
  color: var(--ink);
}
.motto {
  font-family: var(--font-display);
  color: var(--ink-2);
}

@media (prefers-reduced-motion: reduce) {
  .lang,
  .btn {
    transition: none;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0.01s;
  }
}
