:root {
  --bg: #f1f0ec;
  --ink: #141210;
  --muted: #5c5852;
  --field: #e4e2dc;

  --display: "Gambarino", "Times New Roman", serif;
  --text: "General Sans", system-ui, sans-serif;

  --step-small: 0.9375rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-head: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);
  --step-display: clamp(2.375rem, 1.2rem + 5.2vw, 6.25rem);

  --m: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-body)/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
}
/* Dot grid behind everything, fading out toward the bottom of the screen. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, rgb(20 18 16 / .18) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgb(0 0 0 / .35) 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgb(0 0 0 / .35) 70%, transparent 100%);
}
h1, h2, h3, p { margin: 0; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

h1, h2, .big, .name {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: .95;
}

.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 28px var(--m);
}
.name { font-size: 1.75rem; text-decoration: none; }
.bar nav { display: flex; gap: 28px; }
.bar nav a { text-decoration: none; }
.bar nav a:hover { text-decoration: underline; }

.intro {
  padding: clamp(64px, 9vw, 140px) var(--m) clamp(80px, 8vw, 120px);
}
h1 { font-size: var(--step-display); max-width: 14em; }
.intro { display: flex; justify-content: space-between; align-items: center; gap: 48px; }
.intro p { max-width: 40ch; margin-top: 40px; }

.work, .side { padding: 0 var(--m); }
.side { margin-top: clamp(140px, 14vw, 200px); }
.work > h2, .side > h2, .contact h2 { font-size: var(--step-head); }
.work-lead { max-width: 46ch; margin: 20px 0 56px; }

.areas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 48px 64px; }
.areas h3 { font: 500 1.25rem/1.3 var(--text); margin-bottom: 8px; }
.areas p { max-width: 44ch; }
.stack { margin-top: 10px; color: var(--muted); font-size: var(--step-small); }

.side-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.frame { aspect-ratio: 4 / 3; background: var(--field); display: flex; align-items: center; justify-content: center; padding: 20px; margin-bottom: 20px; overflow: hidden; }
.frame > * { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.side-list h3 { display: flex; align-items: center; gap: 10px; font: 500 1.125rem/1.2 var(--text); margin-bottom: 6px; }
.side-list h3 img { width: 28px; height: 28px; }
.side-list p { max-width: 32ch; }
.links { display: flex; gap: 20px; margin-top: 12px; }

.farm { flex: 0 0 clamp(270px, 22vw, 320px); }
.field {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  position: relative;
  padding: 10px;
  background: #a8865f;
  border-radius: 6px;
}
.tile {
  position: relative;
  aspect-ratio: 1;
  padding: 12%;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  background: repeating-linear-gradient(0deg, #7a5536 0 6px, #6c4a2e 6px 9px);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18);
  transition: transform .15s var(--ease);
}
.tile:hover { transform: translateY(-2px); }
.tile svg { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.tile.ready svg { animation: bob 1.4s ease-in-out infinite; }
.pop {
  position: absolute; left: 50%; top: 0;
  font: 500 .875rem/1 var(--text); color: #fff;
  pointer-events: none;
  animation: pop .7s var(--ease) forwards;
}
.taro {
  position: absolute; left: 0; top: 0;
  pointer-events: none;
  transition: transform .16s linear;
  z-index: 1;
}
.taro svg { display: block; width: 100%; height: 100%; }
.taro.left svg { transform: scaleX(-1); }
.taro.step svg { animation: step .16s steps(2); }
.taro-name {
  position: absolute; left: 50%; bottom: 100%;
  transform: translate(-50%, 2px);
  padding: 1px 6px;
  font: 500 .6875rem/1.4 var(--text);
  color: #fff; background: rgb(20 18 16 / .78);
  border-radius: 3px; white-space: nowrap;
}
.intro .farm-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; color: var(--muted); font-size: .8125rem; white-space: nowrap; max-width: none; }
.sound { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.sound:hover { color: var(--ink); }
.fireworks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
@keyframes step { 50% { translate: 0 -8%; } }
@keyframes bob { 50% { transform: translateY(-6%); } }
@keyframes pop { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -28px); } }

.contact { padding: clamp(140px, 16vw, 220px) var(--m) 120px; }
.contact h2 { margin-bottom: 24px; }
.big { font-size: clamp(2.5rem, 1rem + 6vw, 6.5rem); text-decoration: none; }
.big:hover { text-decoration: underline; text-decoration-thickness: 3px; }

.foot-plain {
  display: flex;
  justify-content: space-between;
  padding: 28px var(--m) 36px;
  color: var(--muted);
  font-size: var(--step-small);
}

/* Photo footer: off for now (commented out in index.html). */
.foot {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  color: #ecebe6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--m);
  background: #141210;
}
.foot-pic {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
  filter: brightness(.55);
  transform: scale(1.06);
  transition: transform 2.4s var(--ease);
}
.foot.in .foot-pic { transform: none; }
.foot-top { display: flex; justify-content: space-between; gap: 24px; }
.foot-top nav { display: flex; gap: 28px; flex-wrap: wrap; }
.foot-top a { text-decoration: none; }
.foot-top a:hover { text-decoration: underline; }
.foot-top p { text-align: right; }
.wordmark {
  font-family: var(--display);
  font-size: 30vw;
  line-height: .8;
  letter-spacing: -0.02em;
  white-space: nowrap;
  margin: 0 0 0 -0.04em;
}
.credits { font-size: var(--step-small); max-width: 90ch; margin-top: 7vw; }

.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 800px) {
  .intro { padding-top: 72px; }
  .intro { flex-direction: column; align-items: flex-start; }
  .intro p { margin-top: 28px; }
  .farm { flex: none; width: min(100%, 320px); }
  .hint { display: none; }
  .areas, .side-list { grid-template-columns: 1fr; gap: 36px; }
  .big { font-size: 10.5vw; }
  .foot { min-height: 80svh; }
  .foot-top { flex-direction: column; }
  .foot-top p { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .foot-pic { transform: none; transition: none; }
}
