/* Latin subsets of the variable fonts in WOFF2 (the TTFs beside them are the sources).
   Merriweather is cut to the 400-700 weights the site uses, from 4.6 MB to 245 KB, so the
   headline font lands before first paint instead of swapping in seconds later */
@font-face {
  font-family: "Comfortaa";
  src: url("assets/fonts/comfortaa.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Merriweather";
  src: url("assets/fonts/merriweather.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("assets/fonts/dm-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Playfair Display";
  src: url("assets/fonts/playfair-display.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --orangish: #e98950;
  --creamish: #f0eee1;
  --grayish: #3e3935;
  /* Deeper warm tone for body text sitting on the orange field (6:1 against --orangish) */
  --ink-warm: #2a2320;
  --onboarding: #f3f1eb;
  --surface: #ffffff;
  --ink: #111318;
  --mute: rgba(62, 57, 53, 0.62);
  --line: rgba(62, 57, 53, 0.14);
  --wordmark: "Comfortaa", sans-serif;
  --serif: "Merriweather", "Palatino Linotype", Palatino, serif;
  --sans: "DM Sans", "Segoe UI", sans-serif;
  --episode: "Playfair Display", "Palatino Linotype", Palatino, serif;
  --ease: cubic-bezier(0.22, 0.7, 0.3, 1);
  --header-h: 64px;
}

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

html,
body {
  overflow-x: clip;
}

html {
  scroll-padding-top: var(--header-h);
  /* Mobile browsers flash a grey box over anything tappable; every control here has its own states */
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--grayish);
  background: var(--creamish);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--orangish);
  color: var(--creamish);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button {
  font: inherit;
  background: none;
  border: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.14;
  color: var(--grayish);
  letter-spacing: -0.02em;
}

.wrap {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

/* Film grain over the page. The noise is black with the grain in its alpha, so it darkens
   the page like the multiply blend it replaces, without mix-blend-mode: a blended layer
   over the whole viewport makes the browser re-blend everything beneath it on every frame
   that anything moves, and Safari flickers doing it. Sized to the largest viewport so it
   never resizes (and re-rasterizes) as mobile toolbars slide in and out */
.grain {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100lvh;
  z-index: 80;
  opacity: 0.045;
  will-change: transform;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.37 0 0 0 0.315'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--orangish);
  box-shadow: 0 1px 0 transparent;
  transition:
    background-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

header.scrolled {
  background: var(--creamish);
  box-shadow: 0 1px 0 var(--line);
}

.header-bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: inline-grid;
  align-items: center;
  text-decoration: none;
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease),
    visibility 0s linear 0s;
}

/* Landing page: the logo stays out of the topbar until the hero wordmark scrolls under it */
.brand-handoff header:not(.brand-in) .brand-link {
  opacity: 0;
  transform: translateY(6px);
  visibility: hidden;
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease),
    visibility 0s linear 0.22s;
}

@media (prefers-reduced-motion: reduce) {
  .brand-link,
  .brand-handoff header:not(.brand-in) .brand-link {
    transform: none;
    transition: none;
  }
}

/* Both marks stay rendered, stacked in one cell, and crossfade with the topbar colour.
   Toggling display instead left the incoming mark undecoded until the moment it showed */
.brand-logo {
  grid-area: 1 / 1;
  height: 48px;
  width: 48px;
  object-fit: contain;
  max-width: none;
  display: block;
  transition: opacity 0.35s var(--ease);
}

.brand-logo-orange-arcs,
header.scrolled .brand-logo-gray-arcs {
  opacity: 0;
}

header.scrolled .brand-logo-orange-arcs {
  opacity: 1;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  /* The column gap includes the 12px the Play badge's transparent padding used to add */
  gap: 12px 24px;
}

.store-badge {
  display: block;
  height: 48px;
  width: auto;
  transition: transform 0.22s var(--ease);
}

.store-badge-play-wrap {
  height: 48px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.store-badge-play {
  height: 72px;
  width: auto;
  /* The negative margins make the wrap narrower than the image, so the global cap would squash it */
  max-width: none;
  /* Trim the PNG's transparent padding so the badge lines up when the row wraps */
  margin: -12px;
}

/* Hover effects only where there's a real hover: on touch screens they stick after a tap */
@media (hover: hover) {
  .store-badge:hover {
    transform: translateY(-2px);
  }
}

.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;
}

/* Pre-launch: hide every store badge and show the waitlist form in the hero and CTA */
.waitlist-row {
  display: none;
}

.prelaunch .store-row {
  display: none;
}

.prelaunch .hero-copy > .waitlist-row,
.prelaunch .cta-action > .waitlist-row {
  display: block;
  max-width: 420px;
}

.waitlist-kicker {
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--ink-warm);
}

/* One pill holding the input and a dark button, echoing the black store badges it replaces */
.waitlist-field {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 5px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 10px 28px -14px rgba(42, 35, 32, 0.45);
  transition: box-shadow 0.22s var(--ease);
}

.waitlist-field:focus-within {
  box-shadow: 0 14px 34px -14px rgba(42, 35, 32, 0.6);
}

.waitlist-input {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
}

/* Chrome's email autofill draws the system arrow over the custom cursor while the
   pointer is on a focused email field, so on mouse devices the field sits under a
   transparent cover that takes the hover and forwards clicks (js/waitlist.js) */
.waitlist-input-cover {
  display: none;
}

@media (pointer: fine) {
  .waitlist-input-cover {
    display: block;
    position: absolute;
    inset: 0;
  }
}

.waitlist-field input {
  width: 100%;
  height: 100%;
  padding: 0 8px 0 18px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--ink-warm);
}

.waitlist-field input:focus {
  outline: none;
}

.waitlist-field input::placeholder {
  color: rgba(62, 57, 53, 0.5);
}

.waitlist-field button {
  flex-shrink: 0;
  height: 100%;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--grayish);
  color: var(--creamish);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition:
    background-color 0.22s var(--ease),
    opacity 0.22s var(--ease);
}

@media (hover: hover) {
  .waitlist-field button:hover {
    background: var(--ink);
  }
}

.waitlist-field button:focus-visible {
  outline: 2px solid var(--orangish);
  outline-offset: 2px;
}

.waitlist-field button:disabled {
  opacity: 0.6;
}

.waitlist-note {
  margin-top: 10px;
  padding-left: 18px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--mute);
  min-height: 1.4em;
}

.waitlist-note[data-state="ok"] {
  color: var(--grayish);
  font-weight: 600;
}

.waitlist-note[data-state="error"] {
  color: #a33a26;
  font-weight: 600;
}

/* On the orange hero, keep every message in the dark ink so it stays legible */
.hero-copy .waitlist-note,
.hero-copy .waitlist-note[data-state] {
  color: var(--ink-warm);
}

@media (max-width: 380px) {
  .waitlist-field button {
    padding: 0 16px;
  }
}

/* Topbar CTA: a smaller copy of the store badges */
.header-cta {
  /* Badge height; shrinks on narrow phones so the pair fits beside the logo (246px of row per 36px of height) */
  --cta-h: min(36px, calc((100vw - 100px) * 0.146));
  flex-wrap: nowrap;
  gap: calc(var(--cta-h) * 17 / 36);
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease),
    visibility 0s linear 0s;
}

.header-cta .store-badge,
.header-cta .store-badge-play-wrap {
  height: var(--cta-h);
}

.header-cta .store-badge-play {
  height: calc(var(--cta-h) * 1.5);
  margin: calc(var(--cta-h) * -0.25);
}

/* Landing page: the badges stay out of the topbar until the hero badges scroll under it */
.brand-handoff header:not(.cta-in) .header-cta {
  opacity: 0;
  transform: translateY(6px);
  visibility: hidden;
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease),
    visibility 0s linear 0.22s;
}

@media (prefers-reduced-motion: reduce) {
  .header-cta,
  .brand-handoff header:not(.cta-in) .header-cta {
    transform: none;
    transition: none;
  }
}

.legal-main {
  padding: calc(var(--header-h) + 72px) 0 96px;
  background: var(--creamish);
  min-height: 70vh;
}

.legal-main h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 28px;
}

.legal-lede {
  max-width: 62ch;
  margin-bottom: 36px;
  font-size: 1.08rem;
}

.legal-list {
  max-width: 62ch;
  display: grid;
  gap: 22px;
}

.legal-list h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--orangish);
}

.legal-updated {
  margin: -16px 0 28px;
  color: var(--mute);
  font-size: 0.95rem;
}

.legal-list section > * + * {
  margin-top: 10px;
}

.legal-list h3 {
  font-size: 1rem;
  margin-top: 18px;
}

.legal-list ul,
.legal-list ol {
  padding-left: 1.25em;
}

.legal-list li + li {
  margin-top: 6px;
}

.legal-list a {
  text-underline-offset: 2px;
}

.leave-button {
  min-height: 52px;
  padding: 0 28px;
  border-radius: 16px;
  background: var(--orangish);
  color: #fff;
  font: 600 1.05rem var(--sans);
  cursor: pointer;
}

.leave-button:disabled {
  opacity: 0.6;
  cursor: default;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

footer {
  background: var(--creamish);
  color: var(--grayish);
  padding: 40px 0;
  position: relative;
  z-index: 10;
}

.footer-container {
  max-width: 1244px;
  margin: 0 auto;
  padding: 0;
}

.footer-card {
  background: var(--orangish);
  border-radius: 24px;
  padding: 64px 60px 16px;
  margin-left: auto;
  margin-right: auto;
  max-width: 1180px;
  width: calc(100% - 64px);
  box-shadow: 0 18px 44px -18px rgba(17, 19, 24, 0.28);
  border: 1px solid rgba(62, 57, 53, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (hover: hover) {
  .footer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 52px -18px rgba(17, 19, 24, 0.34);
  }
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 32px;
  align-items: start;
}

.footer-links-right {
  text-align: right;
}

.footer-wordmark-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.footer-wordmark {
  height: 66px;
  width: auto;
  max-width: none;
  display: block;
}

.footer-blurb {
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(62, 57, 53, 0.82);
  max-width: 280px;
  line-height: 1.5;
}

.footer-links h3 {
  font-family: var(--sans);
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--grayish);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: rgba(62, 57, 53, 0.78);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

@media (hover: hover) {
  .footer-links a:hover {
    color: var(--ink);
  }
}

.footer-bottom {
  border-top: 1px solid rgba(62, 57, 53, 0.2);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(62, 57, 53, 0.78);
  font-size: 0.84rem;
}

.footer-pawprint {
  display: inline-block;
  transition: transform 0.3s ease;
}

.footer-pawprint-logo {
  display: block;
  height: 32px;
  width: auto;
  /* Source SVG is white; render it in the dark brand tone */
  filter: brightness(0);
  opacity: 0.78;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

@media (hover: hover) {
  .footer-pawprint:hover .footer-pawprint-logo {
    opacity: 1;
    transform: scale(1.05) rotate(-5deg);
  }
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .wrap {
    width: min(1120px, calc(100% - 36px));
  }

  .footer-card {
    width: calc(100% - 32px);
    padding: 40px 24px 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-wordmark {
    height: 56px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-pawprint {
    align-self: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* About: a dialog opened from the footer's Company column (js/about.js) */
.about-dialog {
  margin: auto;
  border: 0;
  padding: 0;
  width: min(560px, calc(100% - 32px));
  border-radius: 24px;
  background: var(--creamish);
  color: var(--grayish);
  box-shadow: 0 24px 64px -20px rgba(17, 19, 24, 0.45);
}

.about-dialog::backdrop {
  background: rgba(62, 57, 53, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.about-dialog[open] {
  animation: about-in 0.3s var(--ease);
}

@keyframes about-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.about-body {
  position: relative;
  outline: none;
  padding: 48px 56px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.about-wordmark {
  height: 64px;
  width: auto;
  margin-bottom: 8px;
}

.about-body p {
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 42ch;
}

.about-built {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--mute);
}

.about-built img {
  height: 30px;
  width: auto;
  filter: brightness(0);
  opacity: 0.78;
}

.about-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(62, 57, 53, 0.08);
  color: var(--grayish);
  display: grid;
  place-items: center;
  cursor: pointer;
}

@media (hover: hover) {
  .about-close:hover {
    background: rgba(62, 57, 53, 0.14);
  }
}

@media (max-width: 600px) {
  .about-body {
    padding: 44px 24px 32px;
  }

  .about-wordmark {
    height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-dialog[open] {
    animation: none;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
