/* Brand colors from BRIEF.md */
:root {
  --green: #43594A;
  --cream: #F0EDE4;
  --serif: "EB Garamond", "Times New Roman", serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--cream);
  color: var(--green);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

/* Watercolor river map behind everything. The scene drifts very slowly;
   rivers.js draws the flowing water on a canvas on top of the static map. */
.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--cream);
}

.map,
.rivers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: drift 90s ease-in-out infinite alternate;
}

.map {
  background: var(--cream) url("/assets/river-map.jpg") center / cover no-repeat;
}

.rivers {
  display: block;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.rivers.is-on {
  opacity: 1;
}

.js:not(.is-ready) .rivers {
  opacity: 0;
}

@keyframes drift {
  from { transform: scale(1.04) translate3d(-0.6%, 0.4%, 0); }
  to   { transform: scale(1.06) translate3d(0.6%, -0.4%, 0); }
}

/* Load sequence: map, then logo, then email */
.js .map,
.js .logo,
.js .contact {
  opacity: 0;
}

.js.is-ready .map {
  opacity: 1;
  transition: opacity 2.4s ease;
}

.js.is-ready .logo {
  opacity: 1;
  transition: opacity 1.6s ease 0.6s;
}

.js.is-ready .contact {
  opacity: 1;
  transition: opacity 1.4s ease 1.4s;
}

/* Logo, centered on screen */
.hero {
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
}

.logo {
  margin: 0;
  width: clamp(280px, 48vw, 820px);
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Email near the bottom edge, as on oxcart.vc */
.footer {
  padding: 0 1.5rem clamp(2rem, 6vh, 4rem);
  text-align: center;
}

/* Underline is drawn as a background so it can redraw itself on hover */
.contact {
  padding-bottom: 0.35em;
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
}

.contact:hover,
.contact:focus-visible {
  animation: redraw 0.9s ease-in-out;
}

.contact:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 0.5em;
}

@keyframes redraw {
  0%   { background-position: 100% 100%; background-size: 100% 1px; }
  45%  { background-position: 100% 100%; background-size: 0 1px; }
  55%  { background-position: 0 100%;    background-size: 0 1px; }
  100% { background-position: 0 100%;    background-size: 100% 1px; }
}

/* Visitors who turn off motion get the same page, completely still */
@media (prefers-reduced-motion: reduce) {
  .map,
  .rivers,
  .contact:hover,
  .contact:focus-visible {
    animation: none;
  }

  .js.is-ready .map,
  .js.is-ready .logo,
  .js.is-ready .contact {
    transition: none;
  }
}

/* Phones: stacked logo */
@media (max-width: 640px) {
  .logo {
    width: min(68vw, 300px);
  }

  .contact {
    font-size: 0.85rem;
  }
}
