
.page {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.page__main {
  flex: 1 1 auto;
  min-width: 0;
  padding-inline: var(--gutter);
}

.page__inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--content-max);
  min-height: 100vh;
  margin-inline: auto;
}

main {
  flex: 1 0 auto;
}

/* ------------------------------ Maze strip ------------------------------ */

.maze {
  position: sticky;
  top: 0;
  flex: 0 0 var(--maze-w);
  width: var(--maze-w);
  height: 100vh;
  background-repeat: repeat-y;
  background-size: var(--maze-bg-w) auto;
  background-position: center 0;
  animation: maze-drift 80s linear infinite;
  will-change: background-position;
}

:root[data-theme="light"] .maze {
  background-color: #090909;
  background-image: url("../assets/maze-dark.svg");
}

:root[data-theme="dark"] .maze {
  background-image: url("../assets/maze-dark.svg");
}

/* ------------------------------- Header -------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: clamp(26px, 4.4vw, 40px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand__word {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}

:root[data-theme="dark"] .brand__word {
  font-weight: 400;
}


.brand__tagline {
  font-family: "Cairo", sans-serif;
  font-size: clamp(1.15rem, 2.3vw, 1.5rem);
  font-weight: 500;
  line-height: 1;
}

:root[data-theme="dark"] .brand__tagline {
  font-weight: 400;
}

.brand__mark {
  height: 0.95em;
  width: auto;
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  fill: currentColor;
  stroke: none;
}

.brand__mark--light,
.brand__mark--dark {
  aspect-ratio: 1;
  height: 0.8em;
  opacity: 0.95;
}

:root[data-theme="light"] .brand__mark--dark,
:root[data-theme="dark"] .brand__mark--light {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 18px;
  color: var(--ink-soft);
  border-radius: 50%;
  transition: color 0.25s ease, background-color 0.25s ease, transform 0.4s var(--ease-back);
}

.icon-btn:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  transform: rotate(18deg);
}

:root[data-theme="light"] .theme-toggle .icon--sun,
:root[data-theme="dark"] .theme-toggle .icon--moon {
  display: none;
}

/* The crescent's own ink sits lower-left of its viewBox's geometric
   center (unlike the symmetric globe/sun icons), which reads as
   misaligned next to the language button even though both buttons'
   boxes are identical nudge the icon itself to compensate. */
.icon--moon {
  transform: translate(10%, -10%);
}

.lang {
  position: relative;
}

.lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: color 0.25s ease;
}

.lang__btn .icon {
  font-size: 22px;
  stroke-width: 1.4;
  color: var(--ink);
}

.lang__btn:hover {
  color: var(--ink);
}

.lang__menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-end: 0;
  z-index: 20;
  min-width: 170px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.35);

  forced-color-adjust: none;
}


.lang__menu:not([hidden]) {
  display: block;
}

.lang__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  font-size: 0.92rem;
  text-align: start;
  color: var(--ink);
}

.lang__item:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.lang__item.is-current::after {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--ink);
  border-radius: 50%;
}

/* ------------------------------- Footer -------------------------------- */

.site-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: clamp(24px, 4vw, 36px);
  padding: 18px 0 clamp(22px, 3vw, 30px);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.site-footer__domain {
  transition: color 0.2s ease;
}

.site-footer__domain:hover {
  color: var(--ink);
}

.site-footer__rule {
  display: none;
  flex: 1;
  height: 1px;
  background: var(--line);
}

.site-footer__tagline {
  margin-inline-start: auto;
  font-size: 0.72rem;
}

:root[data-theme="dark"] .site-footer {
  border-top-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .site-footer__rule {
  display: block;
}

:root[data-theme="dark"] .site-footer__tagline {
  margin-inline-start: 0;
  color: var(--ink-soft);
}

/* Scroll reveal */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ── Login button in the navbar: leads to the sign-in page ── */
.login-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 20px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}
.login-btn:hover { background: transparent; color: var(--ink); transform: translateY(-1px); box-shadow: 0 6px 0 color-mix(in srgb, var(--ink) 14%, transparent); }
.login-btn:active { transform: translateY(1px); box-shadow: none; }
.login-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
:root[lang="ar"] .login-btn { letter-spacing: 0; text-transform: none; font-size: 0.95rem; }
