/* Waive site base. Each direction sets the palette and font tokens on :root in its own theme.css.
   Spacing and type steps follow the landing-page-design skill (Elaya): only these values. */
:root {
  --s-25: 2px;
  --s-50: 4px;
  --s-75: 8px;
  --s-100: 12px;
  --s-200: 16px;
  --s-300: 24px;
  --s-400: 32px;
  --s-500: 40px;
  --s-600: 48px;
  --s-700: 64px;
  --s-800: 80px;
  --s-900: 96px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1280px;
  /* Directions override these. */
  --font-head: system-ui, sans-serif;
  --font-body: system-ui, sans-serif;
  --font-cap: var(--font-body);
  --font-em: Georgia, serif;
  --bg: #ffffff;
  --ink: #000000;
  --focus: currentColor;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img,
svg,
video {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}
p,
li,
dd {
  text-wrap: pretty;
}

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

/* Keyboard */
.skip {
  position: absolute;
  left: var(--s-200);
  top: var(--s-200);
  z-index: 100;
  padding: var(--s-75) var(--s-100);
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  transform: translateY(-200%);
  transition: transform 300ms var(--ease);
}
.skip:focus {
  transform: none;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

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

/* Apple's official badge. Never recolor or redraw it. Minimum height 40px. */
.store-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 8px;
  transition: transform 300ms var(--ease), opacity 300ms var(--ease);
}
.store-badge img {
  height: 48px;
  width: auto;
}
.store-badge:hover {
  transform: translateY(-2px);
}
.store-badge:active {
  transform: translateY(1px);
}

/* Logo images: the traced SVGs, recolored through CSS mask so the shape is the file's shape. */
.logo {
  display: block;
  background: currentColor;
  -webkit-mask: var(--logo-src) center / contain no-repeat;
  mask: var(--logo-src) center / contain no-repeat;
}
.logo--wordmark {
  --logo-src: url("logo/wordmark.svg");
  aspect-ratio: 1472.67 / 410.33;
}
.logo--w {
  --logo-src: url("logo/w-mark.svg");
  aspect-ratio: 683.67 / 421.67;
}

/* Scroll reveal: rises 32px and fades in once. Only hides when JS runs (pages set html.js in <head>). */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(var(--s-400));
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}
/* Tagline reveal: words go from muted to full ink in reading order. */
[data-words] .w {
  opacity: 0.3;
  transition: opacity 500ms var(--ease);
}
[data-words] .w.is-on {
  opacity: 1;
}

/* Placeholder content Cohen still owes. Visible on purpose. */
.placeholder {
  outline: 1px dashed currentColor;
  outline-offset: 4px;
}

/* The water (water.js): one fixed canvas under the whole page. Sections go clear over it; they keep their
   own grounds when it can't run. */
.water {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
html.has-water body,
html.has-water main > [data-tone]:not(.scene),
html.has-water body > footer[data-tone],
html.water-hero .scene {
  background: transparent;
}
html.water-hero .sea__img,
html.water-hero .sea__flash {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] {
    transform: none;
    transition: opacity 300ms linear;
  }
  [data-words] .w {
    opacity: 1;
    transition: none;
  }
}
