:root {
  --ink: #14372d;
  --leaf: #05784a;
  --deep: #031a13;
  --forest: #08271d;
  --cream: #fbf4e4;
  --warm: #fffdf8;
  --gold: #f2c451;
  --ghee: #f4b72e;
  --butter: #fff0a8;
  --clay: #a54d30;
  --line: rgba(20, 55, 45, 0.16);
  --display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --body: "Avenir Next", Avenir, "Gill Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--warm);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #8c6508;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 12px 16px;
  color: #fff;
  background: var(--deep);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.journey-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 3px;
  pointer-events: none;
}

.journey-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.game-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 80px);
  color: #fff;
  background: rgba(3, 26, 19, 0.92);
  border-bottom: 1px solid rgba(242, 196, 81, 0.2);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  min-height: 44px;
  text-decoration: none;
}

.brand__name {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  font-weight: 800;
}

.brand__tagline,
.eyebrow {
  color: #8c6508;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-hero .eyebrow,
.bilona-game .eyebrow,
.game-complete .eyebrow {
  color: #ffe69a;
}

.game-header nav,
.game-footer nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.game-header nav a,
.game-footer nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  text-decoration: none;
}

.game-hero {
  min-height: calc(100svh - 77px);
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
  color: #fff;
  background: var(--deep);
  overflow: hidden;
}

.game-hero__copy {
  align-self: center;
  padding: clamp(54px, 8vw, 122px) clamp(28px, 6vw, 96px);
}

.game-hero h1 {
  max-width: 10ch;
  margin: 16px 0 24px;
  font-family: var(--display);
  font-size: clamp(3.3rem, 6vw, 6.2rem);
  line-height: 0.92;
  text-wrap: balance;
}

.game-hero__copy > p:not(.eyebrow) {
  max-width: 36rem;
  margin: 0 0 34px;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(1rem, 1.35vw, 1.22rem);
  line-height: 1.7;
}

.button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button--gold {
  color: #251708;
  background: var(--gold);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.game-hero__visual {
  position: relative;
  min-height: 650px;
  overflow: hidden;
}

.game-hero__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--deep), transparent 32%, rgba(3, 26, 19, 0.1));
}

.game-hero__visual > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 50%;
  filter: saturate(0.82) contrast(1.08) brightness(0.68);
  animation: heroDrift 8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.game-hero__sun {
  position: absolute;
  z-index: 1;
  left: 12%;
  top: 13%;
  width: 9rem;
  aspect-ratio: 1;
  border: 1px solid rgba(242, 196, 81, 0.72);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(242, 196, 81, 0.06), 0 0 0 72px rgba(242, 196, 81, 0.03);
}

.game-hero__jar {
  position: absolute;
  z-index: 2;
  right: -3%;
  bottom: -7%;
  width: min(38vw, 34rem);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 38px 52px rgba(0, 0, 0, 0.46));
  animation: jarArrival 1000ms 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bilona-game {
  padding: clamp(64px, 8vw, 120px) clamp(20px, 6vw, 96px);
  background: var(--cream);
}

.bilona-game__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto 36px;
}

.bilona-game h2,
.process-notes h2 {
  max-width: 13ch;
  margin: 10px 0 0;
  font-family: var(--display);
  font-size: clamp(2.35rem, 4.2vw, 4.4rem);
  line-height: 1;
  text-wrap: balance;
}

.bilona-game__header > p {
  max-width: 23rem;
  margin: 0;
  color: #52665d;
  font-weight: 800;
  text-align: right;
}

.process-track {
  max-width: 1400px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  background: rgba(20, 55, 45, 0.14);
  border: 1px solid rgba(20, 55, 45, 0.14);
}

.process-track li {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px 18px;
  color: #6c7c74;
  background: #fffdf8;
  font-weight: 900;
  transition: color 240ms ease, background-color 240ms ease;
}

.process-track li span {
  font-family: var(--display);
  font-size: 1.18rem;
}

.process-track li.is-current {
  color: #fff;
  background: var(--forest);
}

.process-track li.is-complete {
  color: #173c30;
  background: #f2c451;
}

.game-scenes {
  position: relative;
  max-width: 1400px;
  min-height: 680px;
  margin: 0 auto;
  overflow: hidden;
  color: #fff;
  background: var(--deep);
  border: 1px solid rgba(242, 196, 81, 0.18);
}

.game-scene {
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  opacity: 0;
  transform: translate3d(0, 24px, 0);
}

.game-scene.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  animation: sceneIn 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.scene-copy {
  position: relative;
  z-index: 3;
  align-self: center;
  padding: clamp(38px, 6vw, 88px);
}

.scene-number {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scene-copy h3,
.game-complete h3 {
  max-width: 11ch;
  margin: 0 0 20px;
  font-family: var(--display);
  font-size: clamp(2.5rem, 4.2vw, 4.8rem);
  line-height: 0.98;
  text-wrap: balance;
}

.scene-copy > p:not(.scene-number),
.game-complete p:not(.eyebrow) {
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.74);
  font-size: 1.04rem;
  line-height: 1.7;
}

.scene-meter {
  width: min(100%, 25rem);
  height: 8px;
  margin-top: 30px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
}

.scene-meter span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.milk-station {
  position: relative;
  min-height: 680px;
  overflow: hidden;
}

.milk-station__cow {
  position: absolute;
  inset: 0;
}

.milk-station__cow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--deep), transparent 34%, rgba(3, 26, 19, 0.2));
}

.milk-station__cow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 50%;
  filter: saturate(0.82) brightness(0.7);
}

.milk-control {
  position: absolute;
  z-index: 4;
  left: 55%;
  top: 50%;
  width: 76px;
  height: 176px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 38px;
  cursor: grab;
  touch-action: none;
  transform: translate(-50%, -50%);
}

.milk-control:active {
  cursor: grabbing;
}

.milk-control__handle {
  position: absolute;
  left: 50%;
  top: 14px;
  width: 48px;
  height: 74px;
  border-radius: 24px;
  background: var(--gold);
  box-shadow: 0 15px 24px rgba(0, 0, 0, 0.24);
  transform: translate3d(-50%, var(--milk-pull, 0), 0);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.milk-pail {
  position: absolute;
  z-index: 3;
  right: 9%;
  bottom: 7%;
  width: min(24vw, 180px);
  color: #e4e5df;
}

.milk-pail svg {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
}

.milk-pail__fill {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 10%;
  height: 68%;
  background: #fffdf1;
  transform: scaleY(var(--milk-level, 0));
  transform-origin: 50% 100%;
  transition: transform 260ms ease;
}

.game-scene--culture,
.game-scene--churn,
.game-scene--clarify {
  align-items: center;
}

.culture-bowl,
.churn-pot {
  position: relative;
  justify-self: center;
  width: min(54vw, 490px);
  aspect-ratio: 1;
  padding: 0;
  color: #9c4d31;
  background: transparent;
  border: 0;
  cursor: pointer;
  touch-action: none;
}

.culture-bowl__rim {
  position: absolute;
  inset: 19% 7% 22%;
  border: 22px solid #9c4d31;
  border-radius: 50%;
  background: #fff9df;
  box-shadow: 0 36px 60px rgba(0, 0, 0, 0.34);
}

.culture-bowl__curd {
  position: absolute;
  inset: 31% 19% 34%;
  border-radius: 50%;
  background: #fffdf2;
  box-shadow: inset 0 -22px 40px rgba(242, 196, 81, 0.2);
}

.culture-bowl__spoon {
  position: absolute;
  z-index: 3;
  left: 49%;
  top: 8%;
  width: 15px;
  height: 58%;
  border-radius: 8px;
  background: #d5b780;
  transform: rotate(var(--stir-angle, -18deg));
  transform-origin: 50% 88%;
  transition: transform 220ms ease;
}

.churn-pot {
  width: min(50vw, 430px);
  color: #9c4d31;
}

.churn-pot svg {
  position: absolute;
  inset: 20% 0 0;
  width: 100%;
  filter: drop-shadow(0 34px 42px rgba(0, 0, 0, 0.34));
}

.churn-pot__stick {
  position: absolute;
  z-index: 4;
  left: calc(50% - 9px);
  top: 2%;
  width: 18px;
  height: 75%;
  border-radius: 9px;
  background: #d9b46f;
  transform: rotate(var(--churn-angle, 0deg));
  transform-origin: 50% 78%;
  transition: transform 180ms ease;
}

.churn-pot__rope {
  position: absolute;
  z-index: 5;
  top: 30%;
  width: 39%;
  height: 3px;
  background: #f0d08d;
}

.churn-pot__rope--left {
  left: 12%;
  transform: rotate(var(--rope-left, 4deg));
}

.churn-pot__rope--right {
  right: 12%;
  transform: rotate(var(--rope-right, -4deg));
}

.churn-pot__butter {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 20%;
  width: 35%;
  aspect-ratio: 1.35;
  border-radius: 50%;
  background: var(--butter);
  opacity: var(--butter-opacity, 0);
  transform: translateX(-50%) scale(var(--butter-scale, 0.4));
  transition: opacity 220ms ease, transform 220ms ease;
}

.clarify-station {
  display: grid;
  place-items: center;
  gap: 34px;
  padding: 40px;
}

.clarify-pot {
  position: relative;
  width: min(48vw, 470px);
  aspect-ratio: 1.25;
  overflow: hidden;
  border: 20px solid #a26b3f;
  border-radius: 50%;
  background: #47311f;
  box-shadow: 0 36px 70px rgba(0, 0, 0, 0.38);
}

.clarify-pot__ghee {
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  background: #f4b72e;
  box-shadow: inset 0 -35px 54px rgba(160, 78, 25, 0.3);
}

.clarify-pot__shine {
  position: absolute;
  inset: 17% 22% auto;
  height: 17%;
  border-top: 4px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  opacity: var(--clarify-shine, 0.25);
  transform: rotate(-12deg);
}

.heat-control {
  position: relative;
  width: min(100%, 490px);
  display: grid;
  gap: 14px;
  color: #fff;
  font-weight: 900;
}

.heat-control input {
  position: relative;
  z-index: 2;
  width: 100%;
  accent-color: var(--gold);
}

.heat-control__zone {
  position: absolute;
  left: 38%;
  top: 42px;
  width: 44%;
  height: 8px;
  border-radius: 999px;
  background: rgba(242, 196, 81, 0.48);
  box-shadow: 0 0 20px rgba(242, 196, 81, 0.2);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.heat-control__state {
  min-height: 1.35em;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.9rem;
  font-weight: 750;
}

.heat-control.is-ready .heat-control__zone {
  background: var(--gold);
  box-shadow: 0 0 26px rgba(242, 196, 81, 0.5);
}

.heat-control.is-ready .heat-control__state {
  color: #fff0b2;
}

.game-complete {
  position: relative;
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  align-items: center;
  gap: clamp(24px, 5vw, 82px);
  padding: clamp(40px, 7vw, 104px);
  overflow: hidden;
  background: var(--deep);
}

.game-complete img {
  position: relative;
  z-index: 2;
  width: min(44vw, 480px);
  height: auto;
  justify-self: center;
  filter: drop-shadow(0 44px 54px rgba(0, 0, 0, 0.44));
  animation: finalJar 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.game-complete__halo {
  position: absolute;
  left: 8%;
  top: 12%;
  width: min(45vw, 42rem);
  aspect-ratio: 1;
  border: 1px solid rgba(242, 196, 81, 0.54);
  border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(242, 196, 81, 0.04), 0 0 0 100px rgba(242, 196, 81, 0.02);
}

.restart-button {
  min-height: 48px;
  margin-left: 16px;
  padding: 12px 6px;
  color: #fff;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.44);
  font-weight: 900;
  cursor: pointer;
}

.process-notes {
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(40px, 8vw, 130px);
  padding: clamp(72px, 10vw, 150px) clamp(24px, 7vw, 110px);
  background: #fffdf8;
}

.process-notes__copy {
  align-self: center;
  max-width: 48rem;
  color: #4f645b;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.8;
}

.game-footer {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr 0.6fr;
  align-items: start;
  gap: 28px;
  padding: 48px clamp(24px, 6vw, 96px);
  color: #fff;
  background: #031710;
  border-top: 1px solid rgba(242, 196, 81, 0.2);
}

.game-footer strong {
  font-family: var(--display);
  font-size: 1.45rem;
}

.game-footer span {
  text-align: right;
}

[hidden] {
  display: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 46px rgba(0, 0, 0, 0.3);
  }

  .game-header a:hover,
  .game-footer a:hover {
    color: var(--gold);
  }
}

@media (max-width: 980px) {
  .game-hero,
  .game-scene,
  .game-complete,
  .process-notes,
  .game-footer {
    grid-template-columns: 1fr;
  }

  .game-hero__visual {
    min-height: 620px;
  }

  .game-hero__visual::after {
    background: linear-gradient(180deg, var(--deep), transparent 26%, rgba(3, 26, 19, 0.14));
  }

  .game-hero__jar {
    width: min(62vw, 32rem);
  }

  .bilona-game__header {
    align-items: start;
    flex-direction: column;
  }

  .bilona-game__header > p {
    text-align: left;
  }

  .game-scenes,
  .game-scene {
    min-height: auto;
  }

  .milk-station {
    min-height: 620px;
  }

  .culture-bowl,
  .churn-pot {
    width: min(78vw, 480px);
    margin: 30px auto 70px;
  }

  .clarify-station {
    padding-bottom: 80px;
  }

  .game-complete {
    padding-block: 70px;
  }

  .game-complete img {
    width: min(70vw, 430px);
  }

  .game-footer span {
    text-align: left;
  }
}

@media (max-width: 680px) {
  .game-header {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .game-header nav {
    width: 100%;
    justify-content: space-between;
  }

  .game-hero {
    min-height: auto;
  }

  .game-hero h1 {
    font-size: clamp(3rem, 15vw, 4.8rem);
  }

  .game-hero__visual {
    min-height: auto;
    aspect-ratio: 4 / 5;
  }

  .game-hero__visual > img:first-child {
    object-position: 47% 50%;
  }

  .game-hero__jar {
    right: -10%;
    width: min(82vw, 28rem);
  }

  .button {
    width: 100%;
  }

  .process-track {
    grid-template-columns: 1fr 1fr;
  }

  .scene-copy {
    padding: 42px 24px;
  }

  .scene-copy h3,
  .game-complete h3 {
    font-size: clamp(2.35rem, 12vw, 3.8rem);
  }

  .milk-station {
    min-height: 520px;
  }

  .milk-control {
    left: 50%;
    top: 44%;
  }

  .milk-pail {
    right: 6%;
    width: 140px;
  }

  .culture-bowl,
  .churn-pot,
  .clarify-pot {
    width: min(88vw, 390px);
  }

  .game-complete {
    padding: 54px 24px 70px;
  }

  .restart-button {
    width: 100%;
    margin: 12px 0 0;
  }

  .game-footer nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes heroDrift {
  from { transform: scale(1.06) translate3d(1.5%, 0, 0); }
  to { transform: scale(1.01) translate3d(0, 0, 0); }
}

@keyframes jarArrival {
  from { opacity: 0; transform: translate3d(80px, 30px, 0) rotate(7deg) scale(0.9); }
  to { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
}

@keyframes sceneIn {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes finalJar {
  from { opacity: 0; transform: translate3d(0, 36px, 0) rotate(-5deg) scale(0.86); }
  to { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
}
