@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/bricolage-grotesque.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #dce7cf;
  --ink: #263625;
  --muted-ink: #3f503a;
  --brand-green: #536b47;
  --rule: #536b4761;
  --espresso: #402c1e;
  --side: clamp(1.125rem, 3.65vw, 4.25rem);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  font-family: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body,
h1,
p,
figure {
  margin: 0;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

.page {
  max-inline-size: 106rem;
  min-block-size: 100svh;
  margin-inline: auto;
  padding-inline: var(--side);
  padding-block-end: clamp(1.5rem, 4.2vh, 3.5rem);
  display: grid;
  grid-template-rows: auto 1fr;
}

.masthead {
  position: relative;
  min-block-size: clamp(4.375rem, 9.45vh, 6.375rem);
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  align-items: center;
}

.masthead::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  block-size: 1px;
  background: var(--rule);
  transform-origin: left;
  animation: rule-in 1s var(--ease-out) both;
}

.brand-name {
  display: grid;
  gap: .3rem;
  animation: copy-in 650ms var(--ease-out) both;
}

.brand-wordmark {
  display: block;
  inline-size: clamp(7.5rem, 11vw, 10rem);
  block-size: auto;
}

.brand-descriptor {
  color: var(--muted-ink);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .09em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.motion-controls:not([hidden]) {
  display: flex;
  gap: .2rem;
}

.motion-controls button {
  min-block-size: 2.75rem;
  padding-inline: .55rem;
  border: 0;
  border-radius: .25rem;
  background: transparent;
  color: var(--muted-ink);
  font: 600 .875rem/1 "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  cursor: pointer;
}

.motion-controls button:hover {
  background: #536b471a;
}

.motion-controls button:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: -2px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.25rem, 3vw, 3.5rem);
  min-block-size: 32rem;
  padding-block-start: clamp(1rem, 2.55vh, 1.75rem);
}

.hero-copy {
  container-type: inline-size;
  display: grid;
  align-content: center;
  padding-block: 2rem 2.7rem;
}

.headline {
  font-size: clamp(2rem, 15cqi, 8rem);
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: .94;
}

.headline-line {
  display: block;
  overflow: clip;
  padding: .05em .13em .14em 0;
  margin-block: -.05em -.14em;
}

.headline-line > span {
  display: block;
  animation: rise-in 900ms 100ms var(--ease-out) both;
}

.headline-line + .headline-line > span {
  animation-delay: 245ms;
}

.intro {
  margin-block-start: clamp(1.6rem, 4.5vh, 3rem);
  color: var(--muted-ink);
  font-size: clamp(1.0625rem, 1.55vw, 1.375rem);
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.4;
  animation: copy-in 750ms 400ms var(--ease-out) both;
}

.hero-media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--espresso);
  animation: photo-in 1.05s 90ms var(--ease-out) both;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--brand-green);
  transform: scaleY(0);
  transform-origin: bottom;
  animation: curtain-out 1s 255ms var(--ease-out) both;
}

.hero-media img {
  display: block;
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: 64% 55%;
  transform-origin: 77% 57%;
  animation: settle 2.2s 90ms var(--ease-out) both, var(--photo-motion, none);
  animation-play-state: running, var(--ambient-state, running);
}

@keyframes rule-in {
  from { transform: scaleX(0); }
}

@keyframes rise-in {
  from { transform: translateY(110%); }
}

@keyframes copy-in {
  from {
    opacity: 0;
    transform: translateY(.65rem);
  }
}

@keyframes photo-in {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}

@keyframes curtain-out {
  from { transform: scaleY(1); }
}

@keyframes settle {
  from { scale: 1.055; }
  to { scale: 1; }
}

@keyframes coffee-drift {
  from, to { transform: scale(1); }
  50% { transform: translateX(-1.25%) scale(1.085); }
}

@keyframes line-glide {
  0% { background-position: 0% center; opacity: 0; }
  11%, 77% { opacity: 1; }
  88%, 100% { background-position: 100% center; opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .page[data-motion] {
    --photo-motion: coffee-drift 7s 1.25s ease-in-out infinite both;
  }

  .page[data-motion="paused"] {
    --ambient-state: paused;
  }

  .page[data-motion] .masthead::before {
    content: "";
    position: absolute;
    inset: auto 0 1px;
    block-size: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--brand-green), transparent) no-repeat;
    background-size: 23% 100%;
    animation: line-glide 5.5s 1.2s linear infinite both;
    animation-play-state: var(--ambient-state, running);
  }
}

@media (max-width: 52rem), (max-aspect-ratio: 6/5) {
  .page {
    max-inline-size: 52rem;
    padding-block-end: var(--side);
  }

  .masthead {
    min-block-size: 4.25rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 0;
    min-block-size: auto;
    padding-block-start: 0;
  }

  .hero-copy {
    padding-block: clamp(2rem, 8.7vw, 4rem) clamp(1.85rem, 7vw, 3.25rem);
  }

  .intro {
    margin-block-start: 1.2rem;
  }

  .hero-media {
    min-block-size: clamp(18rem, 95vw, 31rem);
    max-block-size: min(122vw, 54rem);
  }

  .hero-media img {
    object-position: 64% 69%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .masthead::after,
  .brand-name,
  .headline-line > span,
  .intro,
  .hero-media,
  .hero-media::after,
  .hero-media img {
    animation: none;
  }
}
