/* ========================================
   KANZ — Base
   Reset, typography, global elements.
   Sibling of Path to Water & The Current.
   ======================================== */

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

html {
  font-size: 17px;  /* matching Path to Water */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--line-height-body);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Dawn/dusk transition — smooth mode switch */
  transition: background-color 400ms ease, color 300ms ease;
}

/* Dawn/dusk wash overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 400ms ease;
}

body.mode-transitioning::after {
  opacity: 1;
}

body.mode-transitioning.light-mode::after {
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 215, 180, 0.15) 0%, transparent 60%);
}

body.mode-transitioning:not(.light-mode)::after {
  background: radial-gradient(ellipse at 50% 70%, rgba(20, 30, 60, 0.2) 0%, transparent 60%);
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--line-height-heading);
  color: var(--text);
}

/* ---- Links ---- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  text-decoration: underline;
}

/* ---- Button reset ---- */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---- Selection ---- */
::selection {
  background: rgba(212, 168, 75, 0.25);
  color: var(--text);
}

/* ---- Focus ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-lighter); border-radius: 3px; }

/* ---- Arabic text ---- */
[lang="ar"], .arabic {
  direction: rtl;
  font-family: var(--font-arabic);
  line-height: 2;
}

/* ---- SR only ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
