/* SHAMOONDA: a San Andreas style story mission about four masked cows */

:root {
  --sky: #2f7fe0;
  --sky-hi: #8cc8ff;
  --sky-deep: #163f86;
  --pasture: #86c84a;
  --wood: #6b4526;
  --wood-hi: #7d532f;
  --wood-dark: #22150b;
  --mask: #a8dcd6;
  --mask-deep: #4f9e98;
  --cream: #f6eedb;
  --ink: #120e0b;
  --tag: #b9dc3c;
  --tag-hi: #d3f15a;

  --display: "Grenze Gotisch", "Times New Roman", serif;
  --body: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --radius: 18px;
  --wrap: 1240px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  position: relative;
  margin: 0;
  background: linear-gradient(180deg, var(--sky-deep) 0, var(--sky) 900px, #4a95ea 100%);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Cow hide printed tone on tone over the sky, chunky texels like the renders */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("/img/hide.png") 0 0 / 720px repeat;
  image-rendering: pixelated;
  mix-blend-mode: multiply;
  opacity: .12;
  pointer-events: none;
}

img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
a, button, [role=button], summary, label { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--tag); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 60;
  padding: 10px 14px;
  background: var(--tag);
  color: var(--ink);
  font-weight: 800;
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus { top: 16px; }

/* San Andreas subtitle: bold white with a hard black outline */
.sub {
  font-family: var(--body);
  font-weight: 800;
  font-stretch: 88%;
  color: #fff;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  letter-spacing: .01em;
}

/* Header: the in game help box */
.help {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 20;
  width: min(calc(var(--wrap) - 48px), calc(100% - 28px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 8px 18px;
  background: rgba(12, 9, 6, .82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  color: #fff;
}
.help__name {
  font-family: var(--display);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  padding: 6px 0;
  margin-right: auto;
}
.help__name span { color: var(--mask); }
.help__nav { display: flex; gap: 2px; }
.help__nav a {
  font-weight: 700;
  font-stretch: 85%;
  font-size: 15px;
  color: #fff;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
  transition: color .2s, background-color .2s;
}
.help__nav a:hover { color: var(--mask); background: rgba(255, 255, 255, .06); }
.help__buy {
  font-weight: 800;
  font-stretch: 90%;
  font-size: 15px;
  color: var(--ink);
  background: var(--tag);
  text-decoration: none;
  padding: 11px 18px;
  border-radius: 8px;
  transition: background-color .2s;
}
.help__buy:hover { background: var(--tag-hi); }

/* Hero: a 3D stage. The farm sits in a frame, the cow breaks out of it, the name sits on the edge */
.hero {
  position: relative;
  padding: 150px 0 0;
}
.stage {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  perspective: 1400px;
}
.stage__inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .25s linear;
}
.stage__inner > * { transition: transform .35s var(--ease); }
.stage__panel {
  position: relative;
  aspect-ratio: 16 / 7;
  border: 8px solid var(--cream);
  border-radius: 34px;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(10, 30, 70, .35);
}
.stage__panel picture { height: 100%; }
.stage__panel img { width: 100%; height: 100%; object-fit: cover; }
.stage__line {
  position: absolute;
  top: 9%;
  left: 4%;
  max-width: 46%;
  font-size: clamp(22px, 2.3vw, 33px);
  line-height: 1.15;
}
.stage__cow {
  position: absolute;
  right: 3%;
  bottom: 8px;
  width: 50%;
  pointer-events: none;
}
.stage__cow img { width: 100%; filter: drop-shadow(0 24px 30px rgba(10, 25, 50, .35)); }

.name {
  position: absolute;
  left: 2.5%;
  bottom: -.34em;
  z-index: 2;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(54px, 12.4vw, 182px);
  line-height: .9;
  color: var(--cream);
  -webkit-text-stroke: .06em var(--ink);
  paint-order: stroke fill;
  text-shadow: .045em .05em 0 var(--ink);
  white-space: nowrap;
}
.name__moo { color: var(--mask); }

.hero__deck {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(80px, 9vw, 120px) 24px 90px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px 40px;
}
.hero__deadpan {
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 700;
  line-height: 1.3;
}
.hero__btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.ticker {
  font-family: var(--mono);
  font-size: 15px;
  background: var(--cream);
  padding: 13px 14px;
  border-radius: 10px;
  border: 2px solid rgba(18, 14, 11, .15);
}
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 800;
  font-stretch: 90%;
  font-size: 17px;
  text-decoration: none;
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background-color .2s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn--tag { background: var(--tag); }
.btn--tag:hover { background: var(--tag-hi); }
.btn--plain { background: #fff; }

/* CA block: a cattle ear tag */
.eartag {
  grid-column: 1 / -1;
  justify-self: center;
  position: relative;
  display: grid;
  gap: 4px;
  width: 100%;
  max-width: 620px;
  padding: 36px 24px 18px;
  text-align: center;
  font: inherit;
  color: var(--ink);
  background: var(--tag);
  border: 3px solid var(--ink);
  border-radius: 52px 52px 22px 22px;
  box-shadow: 5px 6px 0 var(--ink);
  transition: transform .2s var(--ease), background-color .2s;
}
.eartag[hidden] { display: none; }
.eartag:hover { transform: rotate(-1deg); }
.eartag__hole {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: var(--sky-hi);
  border: 3px solid var(--ink);
}
.eartag__label { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.eartag__ca {
  font-family: var(--mono);
  font-size: clamp(11px, 3.2vw, 17px);
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.eartag__status { font-weight: 700; font-size: 14px; }
.eartag.is-copied { background: var(--mask); }

/* Section headings */
.mission__head, .herd__head, .faces__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 32px; }
.mission__head h2, .herd__head h2, .faces__head h2, .faq__side h2 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(56px, 9vw, 124px);
  line-height: .9;
}
.mission__head p, .herd__head p, .faces__head p { font-size: clamp(18px, 1.8vw, 24px); max-width: 32ch; }

/* Mission: four cutscenes */
.mission {
  padding: 110px 0 120px;
}
.mission__head h2 {
  color: var(--mask);
  -webkit-text-stroke: .05em var(--ink);
  paint-order: stroke fill;
  text-shadow: .04em .05em 0 var(--ink);
}

.beats { display: grid; gap: 90px; margin-top: 64px; }
.beat { display: grid; grid-template-columns: repeat(12, 1fr); align-items: center; }
.beat__frame {
  grid-column: 1 / 9;
  grid-row: 1;
  background: #000;
  padding: 4.5% 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .45);
}
.beat__frame picture { aspect-ratio: 16 / 8; overflow: hidden; }
.beat__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.6s var(--ease);
}
.beat__img--car { object-position: 50% 46%; }
.beat__img--fence { object-position: 50% 12%; }

.beat__text {
  grid-column: 8 / 13;
  grid-row: 1;
  position: relative;
  z-index: 1;
  background: var(--cream);
  color: var(--ink);
  padding: 30px 30px 32px;
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--mask-deep);
}
.beat--flip .beat__frame { grid-column: 5 / 13; }
.beat--flip .beat__text { grid-column: 1 / 6; box-shadow: -10px 10px 0 var(--mask-deep); }
.beat__no {
  position: absolute;
  top: -50px;
  right: 20px;
  font-family: var(--display);
  font-weight: 900;
  font-size: 104px;
  line-height: 1;
  color: var(--mask);
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
}
.beat h3 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(36px, 3.6vw, 50px);
  line-height: 1;
  padding-right: 50px;
}
.beat p { margin-top: 12px; font-size: 18px; }

/* Scroll reveal: the camera pushes in. Only active with JS. */
.js .beat .beat__img { transform: scale(1.12); }
.js .beat .beat__text { transform: translateY(32px); opacity: 0; transition: transform .8s var(--ease) .15s, opacity .8s var(--ease) .15s; }
.js .beat.is-in .beat__img { transform: none; }
.js .beat.is-in .beat__text { transform: none; opacity: 1; }

/* Herd: four cutouts standing on their cards */
.herd {
  padding: 100px 0 110px;
}
.herd__head h2 {
  color: var(--cream);
  -webkit-text-stroke: .05em var(--ink);
  paint-order: stroke fill;
  text-shadow: .04em .05em 0 var(--ink);
}
.herd__head p { font-weight: 700; }

.herd__row {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  align-items: end;
}
.cow { position: relative; display: flex; flex-direction: column; }
.cow__art {
  position: relative;
  z-index: 1;
  width: 104%;
  margin: 0 -2% -26%;
  transition: transform .35s var(--ease);
}
.cow__art img { width: 100%; filter: drop-shadow(0 16px 18px rgba(20, 50, 10, .35)); }
.cow:hover .cow__art { transform: translateY(-10px) rotate(-2deg); }
.cow__card {
  position: relative;
  z-index: 2;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 20px 20px 22px;
  box-shadow: 6px 6px 0 var(--ink);
  min-height: 172px;
}
.cow h3 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(28px, 2.4vw, 36px);
  line-height: 1;
}
.cow p { margin-top: 8px; font-size: 16px; }
.cow--bw .cow__card { background: #fff; }
.cow--blue .cow__card { box-shadow: 6px 6px 0 #3e5a86; }
.cow--green .cow__card { box-shadow: 6px 6px 0 #7f8f1c; }
.cow--brown .cow__card { box-shadow: 6px 6px 0 #a35a1c; }

/* Faces: reaction images on the barn table */
.faces {
  padding: 100px 0 110px;
  overflow: hidden;
}
.faces__head h2 {
  color: var(--mask);
  -webkit-text-stroke: .05em var(--ink);
  paint-order: stroke fill;
}
.faces__head p { font-weight: 600; }

/* Default (touch, no JS): a swipe row */
.pile {
  margin: 40px -24px 0;
  padding: 10px 24px 26px;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.pile::-webkit-scrollbar { display: none; }
.snap {
  flex: 0 0 min(72vw, 280px);
  scroll-snap-align: center;
  background: #fff;
  color: var(--ink);
  padding: 10px 10px 0;
  border-radius: 6px;
  box-shadow: 0 18px 30px rgba(0, 0, 0, .35);
  transform: rotate(calc(var(--r, 0) * 1deg));
}
.snap:nth-child(odd) { --r: -2; }
.snap:nth-child(even) { --r: 2; }
.snap img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; user-select: none; -webkit-user-select: none; }
.snap a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  font-weight: 800;
  font-stretch: 90%;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  transition: color .2s;
}
.snap a::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-right: 8px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E") center / contain no-repeat;
}
.snap a:hover { color: var(--mask-deep); }

/* Desktop with JS: a loose pile you can drag around */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .pile.is-draggable {
    position: relative;
    display: block;
    height: 460px;
    margin: 36px 0 0;
    padding: 0;
    overflow: visible;
  }
  .pile.is-draggable .snap {
    position: absolute;
    width: 16.5%;
    cursor: grab;
    touch-action: none;
    transition: box-shadow .2s;
    will-change: transform;
  }
  .pile.is-draggable .snap.is-held { cursor: grabbing; box-shadow: 0 34px 50px rgba(0, 0, 0, .45); }
  .pile.is-draggable .snap:nth-child(1) { --r: -4; left: 0.5%; top: 40px; }
  .pile.is-draggable .snap:nth-child(2) { --r: 3; left: 21%; top: 120px; }
  .pile.is-draggable .snap:nth-child(3) { --r: -2; left: 41.5%; top: 20px; }
  .pile.is-draggable .snap:nth-child(4) { --r: 4; left: 62%; top: 130px; }
  .pile.is-draggable .snap:nth-child(5) { --r: -3; left: 82.5%; top: 50px; }
}

/* FAQ */
.faq { padding: 100px 0 110px; }
.faq__wrap { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: start; }
.faq__side h2 { font-size: clamp(52px, 7vw, 100px); }
.faq__mask { width: min(340px, 80%); margin-top: 18px; transform: rotate(-12deg); }
.faq__mask img { filter: drop-shadow(0 18px 22px rgba(18, 14, 11, .22)); }
.faq__list details { border-top: 3px solid var(--ink); }
.faq__list details:last-child { border-bottom: 3px solid var(--ink); }
.faq__list summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  font-weight: 800;
  font-stretch: 90%;
  font-size: 21px;
  transition: color .2s;
}
.faq__list summary:hover { color: var(--mask-deep); }
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--mask);
  border: 2px solid var(--ink);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  transition: transform .25s var(--ease), background-color .2s;
}
.faq__list details[open] summary::after { transform: rotate(45deg); background: var(--tag); }
.faq__list details p { padding: 0 0 22px; font-size: 18px; max-width: 46ch; }

/* Footer: mission passed */
.passed {
  padding: 90px 0 44px;
}
.passed__inner { text-align: center; }
.passed__big {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(56px, 11vw, 156px);
  line-height: .9;
  color: var(--mask);
  -webkit-text-stroke: .05em var(--ink);
  paint-order: stroke fill;
  text-shadow: .04em .05em 0 #000;
}
.passed__sub { margin-top: 16px; font-size: clamp(20px, 2.2vw, 30px); }
.passed__links { margin-top: 30px; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.passed__links a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.passed__links a:hover { background: var(--mask); color: var(--ink); }
.passed__note { margin: 40px auto 0; max-width: 52ch; font-size: 14px; color: var(--ink); }

/* Intro: the mission title card */
.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 6, 4, .93);
  transition: opacity .45s var(--ease);
}
.intro.is-out { opacity: 0; pointer-events: none; }
.intro__card { text-align: center; max-width: 900px; }
.intro__name {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(54px, 13vw, 160px);
  line-height: .9;
  color: var(--cream);
  -webkit-text-stroke: .05em #000;
  paint-order: stroke fill;
  animation: titleIn .9s var(--ease) both;
}
.intro__name span { color: var(--mask); }
.intro__line { margin-top: 22px; min-height: 1.4em; font-size: clamp(20px, 3vw, 32px); }
.intro__line.is-swap { animation: lineIn .45s var(--ease) both; }
.intro__skip {
  margin-top: 26px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: rgba(255, 255, 255, .75);
  background: none;
  border: 0;
  min-height: 44px;
  padding: 0 14px;
}
@keyframes titleIn { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes lineIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Tablet */
@media (max-width: 1020px) {
  .hero__deck { grid-template-columns: 1fr; text-align: center; }
  .hero__btns { justify-content: center; }
  .beat__frame, .beat--flip .beat__frame { grid-column: 1 / 13; }
  .beat__text, .beat--flip .beat__text { grid-column: 2 / 12; grid-row: 2; margin-top: -44px; }
  .herd__row { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .faq__wrap { grid-template-columns: 1fr; gap: 28px; }
  .faq__side { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
  .faq__mask { width: 160px; margin: 0; }
}

/* Phone */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .help { top: 10px; gap: 6px; padding: 6px 6px 6px 12px; width: calc(100% - 20px); }
  .help__name { font-size: 23px; }
  .help__nav a { font-size: 14px; padding: 11px 7px; }
  .help__buy { padding: 11px 13px; font-size: 14px; }

  .hero { padding-top: 104px; }
  .stage { padding: 0 16px; }
  .stage__panel { aspect-ratio: 4 / 5; border-width: 6px; border-radius: 26px; }
  .stage__panel img { object-position: 40% 50%; }
  .stage__line { top: 5%; left: 6%; right: 6%; max-width: none; font-size: clamp(20px, 6vw, 26px); -webkit-text-stroke-width: 4px; text-align: center; }
  .stage__cow { right: 2%; left: 2%; width: auto; bottom: 6px; }
  .name { left: 0; right: 0; text-align: center; font-size: 14.2vw; bottom: -.4em; }
  .hero__deck { padding: 60px 16px 64px; }

  .mission { padding: 72px 0 76px; }
  .beats { gap: 56px; margin-top: 44px; }
  .beat__frame picture { aspect-ratio: 16 / 10; }
  .beat__text, .beat--flip .beat__text { grid-column: 1 / 13; margin: -28px 10px 0; padding: 24px 20px; }
  .beat__no { font-size: 66px; top: -30px; right: 14px; -webkit-text-stroke-width: 5px; }
  .beat h3 { padding-right: 40px; }
  .beat p { font-size: 17px; }

  .herd { padding: 72px 0 80px; }
  .herd__row { gap: 32px 14px; }
  .cow__card { padding: 14px 12px 16px; min-height: 0; box-shadow: 4px 4px 0 var(--ink); }
  .cow h3 { font-size: 24px; }
  .cow p { font-size: 14px; }

  .faces { padding: 72px 0 70px; }
  .pile { margin: 30px -16px 0; padding: 10px 16px 24px; }

  .faq { padding: 72px 0 80px; }
  .faq__list summary { font-size: 18px; }
  .faq__mask { width: 120px; }

  .passed { padding: 70px 0 36px; }
}

@media (max-width: 380px) {
  .help__nav { display: none; }
  .help__name { font-size: 24px; }
  .beat__no { font-size: 54px; top: -24px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hero { padding-top: 84px; }
  .stage__panel { aspect-ratio: 16 / 5.4; }
  .stage__cow { width: 40%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .beat .beat__img, .js .beat .beat__text { transform: none; opacity: 1; }
}
