/* =========================================================
   NEXUS WAVE — shared design system
   Tokens, type, header, footer, buttons, shared sections.
   Page-specific layouts live in css/home.css and css/work.css.
   ========================================================= */

:root {
  /* Colour */
  --ink: #0c0c0b;
  --ink-2: #151513;
  --ink-3: #1f1f1c;
  --paper: #f1eee7;
  --paper-2: #e7e3da;
  --stone: #cfc9bd;
  --ash: #8b877e;
  --ash-dark: #5f5c55;
  --line-dark: rgba(241, 238, 231, 0.14);
  --line-light: rgba(12, 12, 11, 0.14);

  /* Project colours. Pak Care navy: from pakcaresurgicals.com. Zam Zam green/gold: from the business card.
     Funky lilac: an editorial accent sampled from a lookbook photo, NOT a confirmed Funky Wears brand colour. */
  --pak-care: #0d3f8f;
  --pak-care-tint: #eef1f4;
  --funky: #c7a6e6;
  --zam-green: #12291f;
  --zam-gold: #c8b23d;

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Inter", "Helvetica Neue", Arial, sans-serif;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.86rem);
  --step-0: clamp(1rem, 0.96rem + 0.18vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.45vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.25rem + 1.1vw, 2.2rem);
  --step-3: clamp(2rem, 1.5rem + 2.2vw, 3.4rem);
  --step-4: clamp(2.6rem, 1.7rem + 4vw, 5.6rem);
  --step-5: clamp(3.2rem, 1.6rem + 7.4vw, 9.5rem);

  /* Space and layout */
  --gutter: clamp(16px, 3.4vw, 48px);
  --section: clamp(88px, 12vw, 180px);
  --max: 1680px;
  --header-h: 72px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--paper); color: var(--ink); }
.surface-paper ::selection, .surface-paper::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 12px 16px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Surfaces ---------- */
.surface-ink { background: var(--ink); color: var(--paper); }
.surface-paper { background: var(--paper); color: var(--ink); }
.surface-stone { background: var(--paper-2); color: var(--ink); }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section); }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 2vw, 28px);
}

/* ---------- Type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 105%;
  letter-spacing: -0.035em;
  line-height: 0.95;
}
.h-xl { font-family: var(--font-display); font-size: var(--step-5); font-weight: 700; font-stretch: 108%; letter-spacing: -0.045em; line-height: 0.9; }
.h-lg { font-family: var(--font-display); font-size: var(--step-4); font-weight: 650; font-stretch: 104%; letter-spacing: -0.04em; line-height: 0.96; }
.h-md { font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; letter-spacing: -0.032em; line-height: 1.02; }
.h-sm { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.lede { font-size: var(--step-1); line-height: 1.45; letter-spacing: -0.012em; max-width: 34em; }
.muted { color: var(--ash); }
.surface-paper .muted, .surface-stone .muted { color: var(--ash-dark); }

.label {
  font-family: var(--font-text);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.3;
}
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-dark);
}
.surface-paper .label-row, .surface-stone .label-row { border-color: var(--line-light); }
.index-num { font-variant-numeric: tabular-nums; }

/* ---------- Links and buttons ---------- */
.link-line {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding-block: 4px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.5s var(--ease-out);
  font-weight: 500;
}
.link-line:hover { background-size: 0 1px; background-position: 100% 100%; }
.link-line .arrow { transition: transform 0.4s var(--ease-out); }
.link-line:hover .arrow { transform: translate(3px, -3px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.btn-solid { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-solid:hover { background: transparent; color: var(--paper); }
.surface-paper .btn-solid, .surface-stone .btn-solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.surface-paper .btn-solid:hover, .surface-stone .btn-solid:hover { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.surface-paper .btn-ghost:hover, .surface-stone .btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: progress; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  color: var(--paper);
  transition: transform 0.5s var(--ease-out), background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid {
  background: var(--ink);
  border-bottom-color: var(--line-dark);
}
.site-header.is-hidden { transform: translateY(-100%); }
body.menu-open .site-header { transform: none; background: transparent; border-color: transparent; }

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 110%;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-mark circle, .brand-mark ellipse, .brand-mark path { fill: none; stroke: currentColor; stroke-width: 1.3; }

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.6vw, 40px);
  font-size: 0.95rem;
}
.nav-list a { position: relative; padding-block: 6px; }
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}
.nav-list a:hover::after,
.nav-list a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px;
  font-size: 0.95rem;
  font-weight: 500;
}
.menu-toggle-lines { position: relative; width: 22px; height: 10px; }
.menu-toggle-lines::before, .menu-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.4s var(--ease-out), top 0.4s var(--ease-out);
}
.menu-toggle-lines::before { top: 0; }
.menu-toggle-lines::after { top: 8px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-lines::before { top: 4px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-lines::after { top: 4px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + 32px) var(--gutter) 32px;
  background: var(--ink);
  color: var(--paper);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.45s var(--ease-out), visibility 0s linear 0.45s;
}
.mobile-menu.is-open { visibility: visible; opacity: 1; transition: opacity 0.45s var(--ease-out); }
.mobile-menu nav a {
  display: block;
  padding: 6px 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 12vw, 4.4rem);
  font-weight: 650;
  font-stretch: 104%;
  letter-spacing: -0.04em;
  line-height: 1.02;
  transform: translateY(18px);
  opacity: 0;
  transition: transform 0.6s var(--ease-out), opacity 0.6s var(--ease-out);
}
.mobile-menu.is-open nav a { transform: none; opacity: 1; }
.mobile-menu.is-open nav li:nth-child(2) a { transition-delay: 0.04s; }
.mobile-menu.is-open nav li:nth-child(3) a { transition-delay: 0.08s; }
.mobile-menu.is-open nav li:nth-child(4) a { transition-delay: 0.12s; }
.mobile-menu.is-open nav li:nth-child(5) a { transition-delay: 0.16s; }
.mobile-menu.is-open nav li:nth-child(6) a { transition-delay: 0.2s; }
.mobile-menu-foot { display: grid; gap: 6px; color: var(--ash); font-size: 0.95rem; }
.mobile-menu-foot a { color: var(--paper); }
body.menu-open { overflow: hidden; }

@media (max-width: 860px) {
  .nav-list { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* ---------- Page hero (interior pages) ---------- */
.page-hero {
  padding-top: calc(var(--header-h) + clamp(64px, 10vw, 150px));
  padding-bottom: clamp(56px, 8vw, 110px);
}
.page-hero .label { margin-bottom: clamp(24px, 3vw, 40px); color: var(--ash); }
.page-hero h1 { max-width: 14em; }
.page-hero .lede { margin-top: clamp(24px, 3vw, 40px); color: var(--stone); }
.surface-paper .page-hero .lede { color: var(--ash-dark); }
.page-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* ---------- Reveal motion ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.js .reveal.is-in { opacity: 1; transform: none; }

.js .reveal-media { overflow: hidden; }
.js .reveal-media > * {
  clip-path: inset(12% 0 0 0);
  transform: scale(1.06);
  transition: clip-path 1.2s var(--ease-out), transform 1.4s var(--ease-out);
}
.js .reveal-media.is-in > * { clip-path: inset(0 0 0 0); transform: none; }
.js .reveal-media > figcaption { clip-path: none; transform: none; }

/* ---------- Media ---------- */
.media { position: relative; overflow: hidden; background: var(--ink-3); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  font-size: var(--step--1);
  color: var(--ash);
}
.surface-paper .caption, .surface-stone .caption { color: var(--ash-dark); }

/* Flat browser frame for website screenshots */
.frame {
  background: #fff;
  border: 1px solid rgba(12, 12, 11, 0.12);
  overflow: hidden;
}
.frame-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  background: #f4f4f2;
  border-bottom: 1px solid rgba(12, 12, 11, 0.08);
}
.frame-bar i { width: 7px; height: 7px; border-radius: 50%; background: #d4d2cc; }
.frame-bar span { margin-left: 10px; font-size: 11px; color: #8b877e; letter-spacing: 0.01em; }
.frame img { width: 100%; }

/* ---------- CTA ---------- */
.cta {
  padding-top: var(--section);
  padding-bottom: clamp(56px, 7vw, 96px);
  border-top: 1px solid var(--line-dark);
}
.cta-kicker { display: flex; justify-content: space-between; gap: 24px; color: var(--ash); }
.cta-big {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.15em;
  margin-top: clamp(24px, 4vw, 56px);
  font-family: var(--font-display);
  font-size: clamp(3rem, 11.6vw, 15rem);
  font-weight: 750;
  font-stretch: 112%;
  letter-spacing: -0.055em;
  line-height: 0.82;
  text-transform: uppercase;
  white-space: nowrap;
}
.cta-big .cta-text { position: relative; display: inline-block; }
.cta-big .cta-w { display: inline-block; }
/* Offset is 60% of the page margin, so the words never reach the screen edge or overlap. */
.cta-big .cta-w1 { translate: calc(var(--split, 0) * var(--gutter) * -0.6) 0; }
.cta-big .cta-w2, .cta-big .cta-arrow { translate: calc(var(--split, 0) * var(--gutter) * 0.6) 0; }
.cta-big .cta-text::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.04em;
  height: 0.035em;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.8s var(--ease-out);
}
.cta-big:hover .cta-text::after, .cta-big:focus-visible .cta-text::after { transform: scaleX(1); transform-origin: left; }
.cta-big .cta-arrow {
  display: inline-block;
  font-weight: 400;
  transition: transform 0.8s var(--ease-out);
}
.cta-big:hover .cta-arrow, .cta-big:focus-visible .cta-arrow { transform: rotate(45deg); }
.cta-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: clamp(48px, 6vw, 88px);
  padding-top: 24px;
  border-top: 1px solid var(--line-dark);
}
.cta-meta p { color: var(--ash); margin-bottom: 8px; }
.cta-meta a { display: inline-block; font-size: var(--step-1); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.cta-meta a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 760px) {
  .cta-meta { grid-template-columns: 1fr; }
  .cta-big { font-size: clamp(2.4rem, 12.5vw, 6rem); }
  .cta-kicker span + span { display: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 40px 28px;
  border-top: 1px solid var(--line-dark);
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-grid h2 { margin-bottom: 14px; color: var(--ash); font-size: var(--step--1); font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.footer-grid ul { display: grid; gap: 6px; }
.footer-grid a { transition: color 0.2s ease; }
.footer-grid a:hover { color: var(--ash); }
.footer-note { max-width: 22em; margin-top: 16px; color: var(--ash); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line-dark);
  color: var(--ash);
  font-size: var(--step--1);
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
.footer-signoff { color: var(--stone); }
@media (max-width: 760px) {
  .footer-bottom { flex-direction: column; }
}

/* ---------- "Seen in" proof link ---------- */
.seen-in {
  display: grid;
  grid-template-columns: clamp(88px, 8vw, 112px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  max-width: 30em;
  padding-top: 18px;
  border-top: 1px solid var(--line-dark);
}
.surface-paper .seen-in { border-color: var(--line-light); }
.seen-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ink-3); }
.seen-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease-out); }
.seen-in:hover .seen-media img { transform: scale(1.05); }
.seen-text { display: grid; gap: 3px; }
.seen-label { font-size: var(--step--1); font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ash); }
.seen-name { font-weight: 500; }
.seen-name .arrow { display: inline-block; transition: transform 0.4s var(--ease-out); }
.seen-in:hover .seen-name .arrow, .seen-in:focus-visible .seen-name .arrow { transform: translate(3px, -3px); }
.seen-in:hover .seen-name { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.seen-what { color: var(--ash); font-size: 0.92rem; line-height: 1.4; }
.surface-paper .seen-label, .surface-paper .seen-what { color: var(--ash-dark); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 10px; }
.field label, .field-label { font-size: var(--step--1); font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ash-dark); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 14px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(12, 12, 11, 0.28);
  border-radius: 0;
  color: var(--ink);
  font: inherit;
  font-size: var(--step-1);
  letter-spacing: -0.01em;
  transition: border-color 0.2s ease;
}
.field select { appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230c0c0b' stroke-width='1.4'/%3E%3C/svg%3E") right 4px center no-repeat; padding-right: 28px; }
.field textarea { min-height: 140px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #a39f96; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-bottom-color: #a1301f; }
.field-error { min-height: 1.2em; font-size: var(--step--1); color: #a1301f; }

/* ---------- WhatsApp shortcut ---------- */
.wa-float {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  transition: transform 0.4s var(--ease-out), opacity 0.3s ease;
}
.wa-float svg { width: 22px; height: 22px; fill: currentColor; }
.wa-float:hover { transform: translateY(-3px); }
.wa-float.is-hidden { opacity: 0; pointer-events: none; transform: translateY(12px); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal, .js .reveal-media > * { opacity: 1; transform: none; clip-path: none; }
  /* Fitted display type is measured by JS: it must never transition its font size, or the measurement
     reads a stale value and the fit lands on the wrong size. */
  .cta-big, .cta-big .cta-text, .cta-big .cta-w, .hero-wordmark, .hero-wordmark .hw-word, .hero-wordmark .hw-space { transition-property: none !important; }
}
