/* ==========================================================================
   My Water Walkers — base layer
   Tokens, reset, typography, buttons, layout primitives, motion utilities.
   ========================================================================== */

:root {
  /* Palette: deep water inks, brand sky (from the logo), product cobalt,
     a warm sunrise accent for investor actions, and sand neutrals that sit
     well next to the autumn river photography. */
  --ink-950: #051520;
  --ink-900: #08202f;
  --ink-800: #0e2e43;
  --ink-700: #1a4560;
  --sky-400: #30b4dd;
  --sky-300: #74d0ee;
  --sky-100: #e4f4fa;
  --cobalt-600: #1f4fc8;
  --sun-400: #ff9466;
  --sun-500: #ff7a45;
  --sun-ink: #2a0e02;
  --sand-50: #f8f5ef;
  --sand-100: #f1ece2;
  --sand-200: #e4dccd;
  --white: #ffffff;

  --text: #0b2232;
  --text-muted: #4b5c68;
  --text-on-dark: #eef4f7;
  --text-on-dark-muted: #a7bac6;
  --line: rgba(11, 34, 50, 0.12);
  --line-strong: #868f96; /* form control borders: >= 3:1 on white and sand */
  --line-on-dark: rgba(238, 244, 247, 0.14);

  /* Focus ring: cobalt on light surfaces, sky on dark ones (see below). */
  --focus: var(--cobalt-600);

  /* Type */
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --fs-hero: clamp(3.75rem, 1.6rem + 7.6vw, 8.75rem);
  --fs-h2: clamp(2.25rem, 1.35rem + 3.4vw, 4.25rem);
  --fs-h3: clamp(1.45rem, 1.15rem + 1vw, 2rem);
  --fs-lead: clamp(1.15rem, 1rem + 0.55vw, 1.4rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-eyebrow: 0.8125rem;

  /* Space */
  --gutter: clamp(1.25rem, 0.6rem + 3.2vw, 3rem);
  --container: 1240px;
  --space-section: clamp(5.5rem, 3.5rem + 8vw, 11rem);
  --space-block: clamp(3rem, 2rem + 4vw, 6rem);

  /* Shape */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: clamp(28px, 2vw + 16px, 44px);
  --r-pill: 999px;

  /* Depth */
  --shadow-soft: 0 1px 2px rgba(5, 21, 32, 0.06), 0 12px 32px -12px rgba(5, 21, 32, 0.18);
  --shadow-lift: 0 2px 4px rgba(5, 21, 32, 0.08), 0 28px 60px -24px rgba(5, 21, 32, 0.35);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 160ms;
  --dur-normal: 320ms;
  --dur-slow: 900ms;

  --header-h: 76px;
  --topbar-h: 40px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--sand-50);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body.is-locked {
  overflow: hidden;
}

img,
svg,
video,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.hero,
.site-header,
.mobile-menu,
.section--dark,
.on-dark,
.film-dialog {
  --focus: var(--sky-400);
}

main:focus {
  outline: none;
}

::selection {
  background: var(--sky-300);
  color: var(--ink-950);
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 0.75rem 1.1rem;
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink-950);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--dur-fast) ease;
}

.skip-link:focus-visible {
  transform: none;
}

/* ---------- Icons ---------- */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

/* ---------- Layout ---------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

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

.section--sand {
  background: var(--sand-50);
}

.section--sky {
  background: var(--sky-100);
}

.section--dark {
  background: var(--ink-900);
  color: var(--text-on-dark);
}

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cobalt-600);
}

.eyebrow__num {
  font-variant-numeric: tabular-nums;
}

.eyebrow__rule {
  width: 2.5rem;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.section--dark .eyebrow,
.on-dark .eyebrow {
  color: var(--sky-300);
}

.h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--text-muted);
  text-wrap: pretty;
}

.section--dark .lead,
.on-dark .lead {
  color: var(--text-on-dark-muted);
}

.muted {
  color: var(--text-muted);
}

.serif-accent {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.section-head {
  display: grid;
  gap: 1.5rem;
  max-width: 52rem;
  margin-bottom: var(--space-block);
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: currentColor;
  --btn-border: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.9rem 1.55rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-normal) var(--ease-out-expo),
    border-color var(--dur-normal) var(--ease-out-expo),
    color var(--dur-normal) var(--ease-out-expo),
    transform var(--dur-normal) var(--ease-out-expo),
    box-shadow var(--dur-normal) var(--ease-out-expo);
}

.btn .icon {
  transition: transform var(--dur-normal) var(--ease-out-expo);
}

.btn:hover .icon--arrow,
.btn:focus-visible .icon--arrow {
  transform: translateX(4px);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn:focus-visible {
  border-radius: var(--r-pill);
}

.btn--primary {
  --btn-bg: var(--sun-500);
  --btn-fg: var(--sun-ink);
  box-shadow: 0 10px 30px -12px rgba(255, 122, 69, 0.7);
}

.btn--primary:hover {
  --btn-bg: var(--sun-400);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -14px rgba(255, 122, 69, 0.85);
}

.btn--ghost-light {
  --btn-fg: var(--white);
  --btn-border: rgba(255, 255, 255, 0.45);
  --btn-bg: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn--ghost-light:hover {
  --btn-bg: rgba(255, 255, 255, 0.16);
  --btn-border: rgba(255, 255, 255, 0.8);
}

.btn--dark {
  --btn-bg: var(--ink-900);
  --btn-fg: var(--white);
}

.btn--dark:hover {
  --btn-bg: var(--ink-700);
  transform: translateY(-2px);
}

@media (max-width: 560px) {
  .btn {
    white-space: normal;
    text-align: center;
  }
}

.btn--sm {
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.9375rem;
}

/* Text link with animated underline */
.link {
  position: relative;
  font-weight: 600;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--dur-normal) var(--ease-out-expo);
}

.link:hover,
.link:focus-visible {
  background-size: 100% 1px;
}

/* ---------- Media ---------- */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--ink-800);
  isolation: isolate;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--r-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pill--sun {
  background: var(--sun-500);
  color: var(--sun-ink);
}

.pill--sky {
  background: rgba(116, 208, 238, 0.16);
  color: var(--sky-300);
  box-shadow: inset 0 0 0 1px rgba(116, 208, 238, 0.35);
}

.pill--cobalt {
  background: rgba(31, 79, 200, 0.1);
  color: var(--cobalt-600);
}

.pill--glass {
  background: rgba(5, 21, 32, 0.55);
  color: var(--white);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ---------- Reveal on scroll (only when JS is running) ---------- */
/* Uses the individual `translate` property so component hover `transform`s
   keep working; component transitions are listed so hover states stay smooth. */
.js [data-reveal] {
  opacity: 0;
  translate: 0 28px;
  transition:
    opacity var(--dur-slow) var(--ease-out-expo) calc(var(--reveal-step, 0) * 90ms),
    translate var(--dur-slow) var(--ease-out-expo) calc(var(--reveal-step, 0) * 90ms),
    transform var(--dur-normal) var(--ease-out-expo),
    background-color var(--dur-normal) ease,
    border-color var(--dur-normal) ease,
    box-shadow var(--dur-normal) ease;
}

.js [data-reveal].is-visible {
  opacity: 1;
  translate: none;
}

.reveal-1 { --reveal-step: 1; }
.reveal-2 { --reveal-step: 2; }
.reveal-3 { --reveal-step: 3; }

@media print {
  .js [data-reveal] {
    opacity: 1 !important;
    translate: none !important;
    transition: none !important;
  }
}

@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;
    transition-delay: 0ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    translate: none;
  }
}
