/**
 * Base styles: font-face declarations, reset, global defaults.
 */

/* ---- Fonts ----
 * TerminaTest-* files: local development visual-matching only.
 * NOT production-approved — see MISSING-ASSETS.md. Do not ship to production
 * without a confirmed purchased Termina license and the non-test files.
 */
@font-face {
  font-family: 'Haven Termina Temp';
  src: url('../fonts/TerminaTest-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Haven Termina Temp';
  src: url('../fonts/TerminaTest-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Haven Termina Temp';
  src: url('../fonts/TerminaTest-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Haven Termina Temp';
  src: url('../fonts/TerminaTest-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* TEMP stand-in for the missing headline serif (unidentified in any reference doc). Free Google Font, swap when confirmed. */
@font-face {
  font-family: 'Haven Display Temp';
  src: url('../fonts/playfair-600.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Haven Display Temp';
  src: url('../fonts/playfair-700.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Haven Montserrat';
  src: url('../fonts/Montserrat-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Haven Montserrat';
  src: url('../fonts/Montserrat-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Haven Roustel';
  src: url('../fonts/Roustel.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* CONFIRMED — client-supplied Arabic typeface (Simah Zaza Arabic W05), all
   weights provided. Used only where lang="ar" is set — see the
   :root[lang="ar"] override in tokens.css. Never applied to English copy. */
@font-face {
  font-family: 'Haven Simah Zaza Arabic';
  src: url('../fonts/SimahzazaarabicW05-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Haven Simah Zaza Arabic';
  src: url('../fonts/SimahzazaarabicW05-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Haven Simah Zaza Arabic';
  src: url('../fonts/SimahzazaarabicW05-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Haven Simah Zaza Arabic';
  src: url('../fonts/SimahzazaarabicW05-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Haven Simah Zaza Arabic';
  src: url('../fonts/SimahzazaarabicW05-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--color-cream);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--fs-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0; } /* no implicit UA margin anywhere — components opt into spacing explicitly via the layout, not a hidden default */
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; }

/* Visible focus state everywhere — required for the nav's keyboard support.
   Copper, not the Cherry/red accent — Cherry is reserved for CTAs/alerts,
   and Safari has a long-standing bug where :focus-visible fires on <button>
   for a plain touch tap, not just real keyboard navigation (confirmed on a
   real iPhone: tapping MENU left a red ring). A neutral tone alone doesn't
   fix the underlying mistrigger, so this is paired with the
   data-input-modality gate below, set by the tiny script in header.php —
   the outline is suppressed entirely after any touch/mouse interaction and
   restored the moment the visitor actually presses Tab, which is the real,
   root-cause fix rather than just a less alarming color. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-copper-temp);
  outline-offset: 2px;
}
html[data-input-modality="touch"] :focus-visible {
  outline: none;
}

.haven-container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* Hidden via an off-viewport transform (not left:-9999px): a large negative
   physical offset is a legitimate, reachable scroll region under dir="rtl"
   (RTL scrolls "start" at 0 going negative), which was found to make the
   whole page fail to paint in this project's dev sandbox — see
   ENVIRONMENT.md "RTL preview mode — skip-link paint bug". This pattern
   avoids creating any oversized layout region in either direction. */
.skip-link {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  z-index: var(--z-skip-link);
  background: var(--color-white);
  color: var(--color-ink);
  padding: var(--space-3) var(--space-5);
  /* -100% of the element's own (often fractional, e.g. 49.59375px) rendered
     height leaves its bottom edge sitting exactly on the viewport's top
     edge — at that exact fractional boundary the rasterizer can still
     paint a sub-pixel sliver of this element's white background (seen on
     mobile as a thin pale line above the header/mobile-menu). The extra
     -6px is a fixed, viewport-independent buffer that guarantees genuine
     clearance regardless of the element's own computed height. Found and
     verified during the Phase 10 mobile nav QA pass (reported as a thin
     red/pale line in the mobile header). */
  transform: translateY(calc(-100% - 6px));
  transition: transform var(--transition-fast);
}
.skip-link:focus {
  transform: translateY(0);
  inset-inline-start: var(--space-4);
  top: var(--space-4);
}

/* ---- Phase-0 placeholder page body (stub interior pages) ---- */
.haven-placeholder {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-9) var(--container-padding);
  text-align: center;
}
.haven-placeholder__eyebrow {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: var(--fs-00);
  color: var(--color-cherry-temp);
}
.haven-placeholder__title { font-size: var(--fs-4); margin-top: var(--space-3); }
.haven-placeholder__body { color: var(--color-ink-soft); margin-top: var(--space-3); }
.haven-placeholder__back { display: inline-block; margin-top: var(--space-5); font-family: var(--font-ui); text-transform: uppercase; font-size: var(--fs-00); letter-spacing: 0.08em; border-bottom: 1px solid currentColor; }

/* ---- Diagonal pattern texture ----
 * TEMP — the original pattern asset doesn't exist anywhere in the supplied
 * files (see MISSING-ASSETS.md). This is a hand-built tileable SVG approximating
 * the approved design's diagonal-dash motif, applied as a low-opacity overlay so
 * it reads correctly on both the Cherry and Ash backgrounds it appears on. */
.haven-pattern {
  position: relative;
  isolation: isolate;
}
.haven-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../images/pattern-dev.svg');
  background-repeat: repeat;
  background-size: 160px 160px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.haven-pattern > * {
  position: relative;
  z-index: 1;
}

.phase-note {
  padding-block: var(--space-9);
  text-align: center;
}
/* ---- RTL architecture preview banner ----
 * Only ever rendered when ?rtl_preview=1 has been visited (see inc/i18n.php).
 * Impossible to reach by normal browsing — exists purely so a screenshot or a
 * stray visit never gets mistaken for real, finished Arabic content. */
.haven-rtl-preview-banner {
  position: sticky;
  top: 0;
  z-index: var( --z-skip-link );
  background: var(--color-copper-temp);
  color: var(--color-noir-temp);
  font-family: var(--font-ui);
  font-size: var(--fs-000);
  letter-spacing: 0.04em;
  text-align: center;
  padding: var(--space-2) var(--space-4);
}
.haven-rtl-preview-banner a {
  text-decoration: underline;
  margin-inline-start: var(--space-3);
}

.phase-note p {
  margin: 0;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--fs-00);
  color: var(--color-ink-soft);
}

/* ---- Form security: honeypot ----
 * Positioned off-screen (not display:none/visibility:hidden) so simple bots
 * that skip visually-hidden fields still fill it in and get caught server-
 * side — see inc/forms/security.php haven_form_verify_request(). Real
 * visitors, keyboard and screen-reader users alike never encounter it:
 * aria-hidden + tabindex="-1" removes it from both the accessibility tree
 * and the tab order. */
.haven-hp {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Shared form-level banner (server error / rate-limit / generic
 * success) — reused by Contact, Corporate, and Newsletter. Careers and
 * Partner have their own dedicated success panels already. */
.haven-form-banner {
  display: none;
  font-size: var(--fs-00);
  line-height: 1.6;
  padding: var(--space-4) var(--space-5);
  margin-block-end: var(--space-5);
  border: 1px solid currentColor;
}
.haven-form-banner.is-visible {
  display: block;
}
.haven-form-banner--error {
  color: var(--color-cherry-temp);
}
.haven-form-banner--success {
  color: var(--color-copper-temp);
}
