/* ==========================================================================
   Tiki — Base
   Reset, document defaults, typography, layout primitives, utilities.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Offset in-page anchors so they clear the sticky navigation. */
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
  -moz-tab-size: 2;
  tab-size: 2;
}

body {
  min-height: 100svh;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Lock scroll while the mobile navigation drawer is open. */
body[data-nav-open="true"] {
  overflow: hidden;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

svg {
  fill: currentColor;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* ------------------------------------------------------------------ Links */

a {
  color: inherit;
  text-decoration: none;
}

/* Visible, on-brand focus for keyboard users only. */
:focus-visible {
  outline: 2px solid var(--tiki-green);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.on-dark :focus-visible,
.cta-band :focus-visible {
  outline-color: #ffffff;
}

::selection {
  background: var(--tiki-green);
  color: var(--white);
}

/* ------------------------------------------------------------- Typography */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-display);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
  letter-spacing: var(--ls-snug);
}

h4 {
  font-size: var(--fs-h4);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-snug);
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: var(--fw-semibold);
}

/* Arabic needs a touch more line-height and no negative tracking. */
[lang="ar"] {
  --lh-display: 1.18;
  --lh-tight: 1.3;
  --lh-body: 1.85;
  --ls-display: 0;
  --ls-tight: 0;
  --ls-body: 0;
  --fs-display: clamp(2.5rem, 1.3rem + 5.4vw, 5.25rem);
  --fs-h1: clamp(2.125rem, 1.3rem + 3.6vw, 3.75rem);
  --fs-h2: clamp(1.75rem, 1.3rem + 2.2vw, 2.875rem);
}

/* -------------------------------------------------------- Layout primitives */

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

.shell--narrow {
  max-width: var(--shell-narrow);
}

.shell--wide {
  max-width: var(--shell-wide);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: var(--section-y-tight);
}

.section--offwhite {
  background: var(--off-white);
}

.section--mist {
  background: var(--tiki-green-mist);
}

.section--ruled {
  border-top: 1px solid var(--border-soft);
}

/* --------------------------------------------------------------- Text bits */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  inline-size: 5px;
  block-size: 5px;
  border-radius: var(--r-pill);
  background: var(--tiki-green);
  flex: none;
}

.eyebrow--plain::before {
  display: none;
}

.lede {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
}

.lede--wide {
  max-width: 62ch;
}

.lede--center {
  margin-inline: auto;
}

.prose {
  color: var(--muted);
  max-width: 66ch;
}

.prose--narrow {
  max-width: 44ch;
}

.prose > * + * {
  margin-block-start: 1.1em;
}

.prose h2,
.prose h3 {
  color: var(--ink);
  margin-block-start: 2.2em;
}

.prose h3 {
  font-size: var(--fs-h4);
}

.prose a {
  color: var(--tiki-green);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.25em;
}

.prose li + li {
  margin-block-start: 0.5em;
}

/* Green highlight used sparingly inside headlines. */
.hl {
  color: var(--tiki-green);
}

/* Numerals inside mockups and metrics stay in a mono face for alignment. */
.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Fixed-size inline icons that need a size independent of their context. */
.icon-15 {
  inline-size: 15px;
  block-size: 15px;
  flex: none;
}

.icon-17 {
  inline-size: 17px;
  block-size: 17px;
  flex: none;
}

/* ------------------------------------------------------------- Utilities */

.u-hide {
  display: none !important;
}

@media (max-width: 767px) {
  .u-hide-mobile {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .u-hide-desktop {
    display: none !important;
  }
}

.visually-hidden:not(:focus):not(:active) {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: var(--z-skip);
  padding: 0.75rem 1.25rem;
  background: var(--tiki-green);
  color: var(--white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  border-end-end-radius: var(--r-sm);
  transform: translateY(-120%);
  transition: transform var(--dur-base) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ------------------------------------------------- Scroll-reveal contract */
/* Elements start hidden only when JS is present to reveal them, so the page
   is fully readable when scripting is unavailable.                          */

.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js [data-reveal="fade"] {
  transform: none;
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ----------------------------------------------------------------- Print */

@media print {
  .site-header,
  .site-footer,
  .cta-band,
  .nav-drawer {
    display: none !important;
  }

  body {
    color: #000;
    font-size: 12pt;
  }

  .section {
    padding-block: 1.5rem;
  }
}
