/* ============================================================
   SaltyPay — Base layer
   Fonts · reset · elements · nav · buttons · footer · utilities
   ============================================================ */

/* --- Fonts: XXIIAven (display, self-hosted, 4 shipping weights) --- */
@font-face { font-family: 'XXIIAven'; src: url('../assets/fonts/XXIIAven-Light.woff2') format('woff2'), url('../assets/fonts/XXIIAven-Light.ttf') format('truetype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'XXIIAven'; src: url('../assets/fonts/XXIIAven-Regular.woff2') format('woff2'), url('../assets/fonts/XXIIAven-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'XXIIAven'; src: url('../assets/fonts/XXIIAven-Medium.woff2') format('woff2'), url('../assets/fonts/XXIIAven-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'XXIIAven'; src: url('../assets/fonts/XXIIAven-Bold.woff2') format('woff2'), url('../assets/fonts/XXIIAven-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--shell);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--teal-600); text-decoration: none; transition: color 0.2s ease; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--coral-600); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
p { text-wrap: pretty; }

/* --- Layout helpers --- */
.container { width: var(--container); margin-inline: auto; }
.section { padding-block: var(--section); }
.measure { max-width: var(--measure); }
.center { text-align: center; }
.center .measure { margin-inline: auto; }

/* Eyebrow — used deliberately, NOT on every section */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--teal-600);
}
.eyebrow::before {
  content: ''; width: 1.6rem; height: 1.5px; background: var(--coral-500); border-radius: 2px;
}
.on-dark .eyebrow { color: var(--coral-300); }

.section-title { font-size: var(--display-md); }
.section-lead {
  font-size: var(--text-lg); line-height: 1.6; color: var(--ink-soft);
  margin-top: 1.1rem; max-width: 54ch;
}
.on-dark, .on-dark h1, .on-dark h2, .on-dark h3 { color: var(--on-dark); }
.on-dark .section-lead { color: var(--on-dark-soft); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm);
  letter-spacing: 0.01em; line-height: 1;
  padding: 0.95rem 1.6rem; border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  transition: transform 0.35s var(--ease-quint), box-shadow 0.35s var(--ease-quint),
              background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}
.btn svg { width: 1.1em; height: 1.1em; transition: transform 0.35s var(--ease-quint); }
.btn:hover svg.arrow { transform: translateX(3px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary { background: var(--coral-500); color: var(--ink); }
.btn-primary:hover { background: var(--coral-600); color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-coral); }
.btn-teal { background: var(--teal-600); color: var(--on-dark); }
.btn-teal:hover { background: var(--tide-800); color: var(--on-dark); transform: translateY(-2px); box-shadow: var(--shadow-teal); }
.btn-ghost { background: transparent; color: var(--teal-600); border-color: rgba(30, 101, 110, 0.30); }
.btn-ghost:hover { border-color: var(--teal-600); background: var(--teal-050); transform: translateY(-2px); }
.on-dark .btn-ghost { color: var(--on-dark); border-color: var(--hairline-dark); }
.on-dark .btn-ghost:hover { background: rgba(244, 248, 247, 0.08); border-color: var(--on-dark-soft); }
.btn-lg { padding: 1.05rem 2rem; font-size: var(--text-base); }

/* Text link with sliding arrow */
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 600; color: var(--teal-600);
}
.link-arrow svg { width: 1em; height: 1em; transition: transform 0.3s var(--ease-quint); }
.link-arrow:hover svg { transform: translateX(4px); }
.on-dark .link-arrow { color: var(--coral-300); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  padding-block: 1.1rem;
  transition: padding 0.35s var(--ease-quint), background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding-block: 0.6rem;
  background: rgba(251, 247, 241, 0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--hairline-light);
}
/* Over the dark hero, before scroll: light nav text */
.nav:not(.scrolled) .nav-link { color: var(--on-dark-soft); }
.nav:not(.scrolled) .nav-link:hover { color: var(--on-dark); }
.nav:not(.scrolled) .nav-logo .wordmark { fill: var(--on-dark); }

.nav-inner { width: var(--container); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.nav-logo { display: inline-flex; align-items: center; }
.nav-logo img { height: 34px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 1.9rem; list-style: none; }
.nav-link {
  position: relative; font-size: var(--text-sm); font-weight: 500; color: var(--ink-soft);
  padding-block: 0.25rem;
}
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  background: var(--coral-500); border-radius: 2px;
  transform: scaleX(0); transform-origin: left center; transition: transform 0.3s var(--ease-quint);
}
.nav-link:hover { color: var(--teal-600); }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-cta { margin-left: 0.4rem; }

.nav-toggle { display: none; width: 44px; height: 44px; background: none; border: none; align-items: center; justify-content: center; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: currentColor; color: var(--ink); border-radius: 2px; position: relative; transition: transform 0.3s var(--ease-quint), opacity 0.2s ease; }
.nav:not(.scrolled) .nav-toggle span { color: var(--on-dark); }
.nav-toggle span::before, .nav-toggle span::after { content: ''; position: absolute; left: 0; width: 24px; height: 2px; background: currentColor; border-radius: 2px; transition: transform 0.3s var(--ease-quint), opacity 0.2s ease; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--tide-950); color: var(--on-dark-soft); padding-block: clamp(3rem, 6vw, 4.5rem); position: relative; overflow: hidden; }
.site-footer::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: url('../assets/patterns/pattern.svg') repeat; background-size: 340px auto; opacity: 0.06; }
.site-footer .container { position: relative; z-index: 1; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--hairline-dark); }
.footer-brand img { height: 30px; width: auto; margin-bottom: 1.1rem; }
.footer-brand p { color: var(--on-dark-faint); font-size: var(--text-sm); max-width: 32ch; }
.footer-col h4 { font-family: var(--font-body); font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark-faint); margin-bottom: 1rem; font-weight: 600; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.footer-col a { display: inline-block; padding-block: 0.25rem; color: var(--on-dark-soft); font-size: var(--text-sm); }
.footer-col a:hover { color: var(--coral-300); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding-top: 1.75rem; font-size: var(--text-xs); color: var(--on-dark-faint); }
.footer-bottom a { color: var(--on-dark-soft); }
.footer-bottom a:hover { color: var(--coral-300); }

/* ============================================================
   MOTION — reveals enhance an already-visible default.
   Hidden state applies ONLY when JS is active AND motion allowed.
   ============================================================ */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease-expo), transform 0.7s var(--ease-expo); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal-stagger > * { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease-expo), transform 0.7s var(--ease-expo); }
.js .reveal-stagger.is-in > * { opacity: 1; transform: none; }
.js .reveal-stagger.is-in > *:nth-child(2) { transition-delay: 0.08s; }
.js .reveal-stagger.is-in > *:nth-child(3) { transition-delay: 0.16s; }
.js .reveal-stagger.is-in > *:nth-child(4) { transition-delay: 0.24s; }
.js .reveal-stagger.is-in > *:nth-child(5) { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal-stagger > * { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Client logo wall — color logos on uniform light tiles (shared across pages) */
.logo-wall { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: clamp(0.75rem, 1.5vw, 1.1rem); }
.logo-tile {
  flex: 1 1 150px; max-width: 220px;
  background: var(--paper); border: 1px solid var(--hairline-light); border-radius: var(--r-md);
  height: 116px; padding: 0 1.25rem; display: grid; place-items: center;
  box-shadow: var(--shadow-sm); transition: transform 0.3s var(--ease-quint), box-shadow 0.3s var(--ease-quint);
}
.logo-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.logo-tile img { max-height: 74px; max-width: 100%; width: auto; object-fit: contain; }

/* Skip link */
.skip-link { position: absolute; left: 0.75rem; top: -3rem; z-index: var(--z-menu); background: var(--coral-500); color: var(--ink); padding: 0.6rem 1rem; border-radius: var(--r-sm); font-weight: 600; transition: top 0.2s ease; }
.skip-link:focus { top: 0.75rem; }

/* ============================================================
   RESPONSIVE — nav
   ============================================================ */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; z-index: var(--z-menu); }
  .nav-links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center;
    gap: 1.75rem; background: var(--shell); z-index: var(--z-overlay);
    transform: translateX(100%); transition: transform 0.45s var(--ease-expo); visibility: hidden;
  }
  .nav-links.open { transform: none; visibility: visible; }
  .nav:not(.scrolled) .nav-links .nav-link { color: var(--ink-soft); }
  .nav-links .nav-link { font-size: 1.3rem; }
  .nav-cta { margin-left: 0; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer-top { grid-template-columns: 1fr; gap: 1.75rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Photo treatments — bridge real photography into the brand palette
   so photos and illustrations read as one family. Apply to a WRAPPER
   that holds a single <img>. People → .grade (keeps warmth);
   place / atmosphere → .duotone (locks tight to the illustrations).
   Rationale + comparison: _dev/photo-treatment.html
   ============================================================ */
.photo-fx { position: relative; isolation: isolate; overflow: hidden; }
.photo-fx > img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Subtle teal grade — desaturate + a soft teal wash. Keeps faces warm and human. */
.photo-fx.grade > img { filter: saturate(0.64) contrast(1.03) brightness(1.02); }
.photo-fx.grade::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--teal-600); mix-blend-mode: soft-light; opacity: 0.5;
}

/* Teal duotone — full tonal remap (deep-teal shadows → cream highlights) via an
   inline SVG filter (no markup needed). Cooler; for place / atmosphere shots. */
.photo-fx.duotone > img {
  filter: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter%20id='d'%20color-interpolation-filters='sRGB'%3E%3CfeColorMatrix%20type='matrix'%20values='0.2126%200.7152%200.0722%200%200%200.2126%200.7152%200.0722%200%200%200.2126%200.7152%200.0722%200%200%200%200%200%201%200'/%3E%3CfeComponentTransfer%3E%3CfeFuncR%20type='table'%20tableValues='0.059%200.984'/%3E%3CfeFuncG%20type='table'%20tableValues='0.227%200.969'/%3E%3CfeFuncB%20type='table'%20tableValues='0.255%200.945'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3C/svg%3E#d");
}
@media (prefers-reduced-motion: reduce) { .photo-fx > img { transition: none; } }
