/*! minireset.css v0.0.6 | MIT License | github.com/jgthms/minireset.css */
html,
body,
p,
ol,
ul,
li,
dl,
dt,
dd,
blockquote,
figure,
fieldset,
legend,
textarea,
pre,
iframe,
hr,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 100%;
  font-weight: normal;
}

ul {
  list-style: none;
}

button,
input,
select {
  margin: 0;
}

html {
  box-sizing: border-box;
}

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

img,
video {
  height: auto;
  max-width: 100%;
}

iframe {
  border: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

td,
th {
  padding: 0;
}

/* Colours from the app's src/theme.ts */
:root {
  --dark-green: #1e3328;
  --green: #8da05c;
  --yellow: #e8a33d;
  --text: #8fa38a;
  --white: #fff;
  --paper: #f4f3ee; /* Polaroid paper */
  --pen: #2b3446; /* handwritten captions */
  --ink: #edefe6;
  --line: #5c7366; /* outlined buttons */
  --line-dark: #33493d;
  --ink-2: #c9d3cb; /* secondary text */
  --label: #a9b8ac;
  --fern: #6e8b57; /* trail-cam labels */
  --raised: #2a4335;
  --deep: #15241c;
  --bad: #f0a99a; /* mistakes */

  /* Fonts from the app's src/theme.ts */
  --font-display: "Fraunces", Georgia, serif;
  --font-body:
    "Instrument Sans", "Inter Variable", Inter, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --font-hand: "Caveat", "Bradley Hand", cursive; /* handwritten captions */
}

html {
  background-color: var(--dark-green);
  font-size: 1em;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-width: 300px;
  overflow-x: hidden;
  overflow-y: scroll;
  text-align: start;
  text-rendering: optimizeLegibility;
  text-size-adjust: 100%;
}

body {
  font-size: 1em;
  font-weight: 400;
  line-height: 1.5;
}

body,
button,
input,
optgroup,
select,
textarea {
  color: var(--text);
  font-family: var(--font-body);
}

a {
  transition-duration: 300ms;
  transition-property: color, opacity;
}

a {
  text-decoration: none;
  color: inherit;
}

strong,
h1,
h2,
h3,
h4 {
  font-weight: 600;
}

/* The opening screen: the header centred in the viewport */
.intro {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  padding: 1.5em;
  place-items: center;
  position: relative;
}

/* Fades in once the header has landed, then bobs to invite a scroll */
.scroll-cue {
  bottom: 1.5em;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  left: 50%;
  letter-spacing: 1.5px;
  position: absolute;
  text-transform: uppercase;
  transition:
    opacity 0.3s ease-out,
    visibility 0.3s;
  translate: -50% 0;

  svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
  }

  &:hover {
    color: var(--white);
  }

  /* Set by the script once the page has scrolled */
  &.is-hidden {
    opacity: 0;
    visibility: hidden;
  }
}

/* The animations live on the inner span so the link's own opacity is free to fade out */
.scroll-cue-inner {
  align-items: center;
  animation:
    cue-in 0.6s ease-out 1.2s both,
    cue-bob 2s ease-in-out 1.8s infinite;
  display: flex;
  flex-direction: column;
  gap: 6px;

  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

@keyframes cue-in {
  from {
    opacity: 0;
  }
}

@keyframes cue-bob {
  50% {
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Viewfinder corners: two bars per corner, pushed in by --corner-inset */
.viewfinder {
  --corner: var(--white);
  --corner-length: 40px;
  --corner-width: 3px;
  --a: left var(--corner-inset) top var(--corner-inset);
  --b: right var(--corner-inset) top var(--corner-inset);
  --c: left var(--corner-inset) bottom var(--corner-inset);
  --d: right var(--corner-inset) bottom var(--corner-inset);
  --h: var(--corner-length) var(--corner-width);
  --v: var(--corner-width) var(--corner-length);
  background:
    linear-gradient(var(--corner) 0 0) var(--a) / var(--h),
    linear-gradient(var(--corner) 0 0) var(--a) / var(--v),
    linear-gradient(var(--corner) 0 0) var(--b) / var(--h),
    linear-gradient(var(--corner) 0 0) var(--b) / var(--v),
    linear-gradient(var(--corner) 0 0) var(--c) / var(--h),
    linear-gradient(var(--corner) 0 0) var(--c) / var(--v),
    linear-gradient(var(--corner) 0 0) var(--d) / var(--h),
    linear-gradient(var(--corner) 0 0) var(--d) / var(--v);
  background-repeat: no-repeat;
}

.header {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  max-width: 760px;
  padding: 3em 1.5em;
  text-align: center;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  animation: corner-focus 1s var(--ease-out) both;

  /* The contents grow in from their centre, one after another */
  > * {
    animation: content-in 0.8s var(--ease-out) both;
  }

  > :nth-child(2) {
    animation-delay: 0.1s;
  }

  > :nth-child(3) {
    animation-delay: 0.2s;
  }

  @media (prefers-reduced-motion: reduce) {
    &,
    > * {
      animation: none;
    }
  }

  h1 img {
    display: block;
  }
}

@keyframes content-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Registered so the corners can be animated */
@property --corner-inset {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

@property --corner {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}

/* The corners slide out from inside and settle on the frame */
@keyframes corner-focus {
  from {
    --corner-inset: 48px;
    --corner: transparent;
  }
}

.type {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;

  a {
    border-bottom: 1px solid transparent;

    &:hover {
      color: var(--yellow);
    }
  }
}

.frame {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.goal {
  color: var(--yellow);
  font-size: 1.5em;
  font-weight: 500;
}

.description {
  color: var(--ink-2);
  font-size: 1.125em;
  line-height: 1.6;
  margin-inline: auto;
  max-width: 36em;
  text-align: center;
  text-wrap: balance;
}

.store-buttons {
  display: flex;
  gap: 1em;
  justify-content: center;
  align-items: center;
}

.store-buttons img {
  display: block;
  width: auto;
  height: 40px;
}

.store-button-soon {
  position: relative;

  img {
    opacity: 0.2;
  }
}

.store-button-label {
  background-color: var(--yellow);
  border-radius: 999px;
  color: var(--deep);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  left: 50%;
  padding: 4px 7px;
  position: absolute;
  rotate: -12deg;
  text-transform: uppercase;
  top: 50%;
  translate: -50% -50%;
  white-space: nowrap;
}

.steps {
  overflow-x: hidden;
  padding: 6em 1.5em;
  text-align: center;
}

.steps-title {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(2em, 5vw, 3em);
  line-height: 1.1;
  text-wrap: balance;

  span {
    color: var(--yellow);
  }
}

.steps-description {
  margin-bottom: 9em;
}

.steps-list {
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 9em;
  list-style: none;
  margin-inline: auto;
  max-width: 960px;
  padding-inline: 1.5em;

  > li {
    align-items: center;
    counter-increment: step;
    display: flex;

    /* A green-to-yellow ramp, one colour per step */
    --step-color: var(--green);

    &:nth-child(2) {
      --step-color: color-mix(in oklch, var(--green), var(--yellow));
    }

    &:nth-child(3) {
      --step-color: var(--yellow);
    }
    flex-direction: column;
    gap: 2em;
  }
}

.step-text {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.75em;

  /* The step number, from the list's counter */
  &::before {
    align-items: center;
    background-color: var(--step-color);
    border-radius: 8px;
    color: var(--dark-green);
    content: counter(step);
    display: flex;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    height: 2.5em;
    justify-content: center;
    margin-bottom: 0.25em;
    width: 2.5em;
  }
}

.step-title {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(1.5em, 3vw, 2em);
  line-height: 1.15;
}

.step-description {
  color: var(--ink-2);
  font-size: 1.125em;
  line-height: 1.6;
  max-width: 24em;
  text-wrap: pretty;
}

@media (min-width: 768px) {
  .steps-list > li {
    display: grid;
    gap: 3em;
    grid-template-columns: 1fr 1fr;
  }

  .step-text {
    align-items: flex-start;
    text-align: left;
  }
}

/* Proportions from the app's Polaroid component; cqw is 1% of the photo width */
.polaroid {
  background-color: var(--paper);
  border-radius: 2px;
  box-shadow:
    0 1px 1px rgb(0 0 0 / 0.25),
    0 14px 30px rgb(6 14 10 / 0.45);
  --width: 260px;
  container-type: inline-size;
  margin-inline: auto;
  padding: calc(var(--width) * 0.05) calc(var(--width) * 0.05) 0;
  position: relative;
  width: var(--width);
}

.polaroid-photo {
  position: relative;

  img {
    display: block;
    width: 100%;
  }
}

/* Trail-cam data strip over the bottom tenth of the photo */
.polaroid-strip {
  align-items: center;
  background-color: #111611;
  bottom: 0;
  color: #e8ede4;
  display: flex;
  font-family: var(--font-mono);
  font-size: 4.17cqw;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  height: 10cqw;
  justify-content: space-between;
  left: 0;
  letter-spacing: 0.21cqw;
  line-height: 1;
  padding-inline: 4.17cqw;
  position: absolute;
  right: 0;
  text-transform: uppercase;
}

.polaroid-dot {
  background-color: var(--yellow);
  border-radius: 50%;
  height: 2.92cqw;
  width: 2.92cqw;
}

.polaroid-caption {
  align-items: center;
  color: var(--pen);
  display: flex;
  font-family: var(--font-hand);
  font-size: max(12px, 9.44cqw);
  font-weight: 600;
  height: 24.4cqw;
  justify-content: center;
}

/* From the app's results screen */
.results {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-inline: auto;
  max-width: 380px;
  text-align: left;
}

.eyebrow {
  color: var(--fern);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.money {
  align-items: center;
  display: inline-flex;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  gap: 0.25em;
  white-space: nowrap;
}

.coin {
  height: 0.82em;
  width: 0.82em;
}

.best {
  align-items: center;
  background-color: var(--raised);
  border-radius: 16px;
  display: flex;
  gap: 16px;
  padding: 14px;
}

.best-polaroid {
  --width: 92px;
  flex-shrink: 0;
  margin-inline: 0;
  transform: rotate(-4deg);
}

.best-text {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.best-title {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 22px;
}

.best-sold {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 18px;

  .money {
    color: var(--yellow);
  }
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  margin-top: 2px;
  padding: 4px 10px;
}

.ledger {
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  padding: 16px 16px 14px;

  .eyebrow {
    margin-bottom: 10px;
  }
}

.ledger-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-block: 7px;

  dt {
    color: var(--ink);
    font-size: 14px;
    line-height: 18px;
  }

  dd {
    color: var(--ink);
    flex-shrink: 0;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }

  &.is-muted dd {
    color: var(--ink-2);
  }

  &.is-bad :is(dt, dd) {
    color: var(--bad);
  }
}

.ledger-note {
  color: var(--label);
  display: block;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 2px;
}

.ledger-total {
  align-items: center;
  border-top: 1px solid var(--line-dark);
  color: var(--paper);
  display: flex;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;

  .money {
    color: var(--yellow);
    font-family: var(--font-body);
    font-size: 24px;
  }
}

/* All cards share one grid cell; later cards sit on top */
.polaroids {
  display: grid;
  margin-inline: auto;
  padding-block: 3em;
  place-items: center;
  position: relative;
  width: fit-content;

  > .polaroid {
    grid-area: 1 / 1;
  }
}

/* The app's sort buttons, straddling the edges of the pile */
.sort-label {
  align-items: center;
  border-radius: 16px;
  display: flex;
  font-weight: 600;
  gap: 10px;
  min-height: 52px;
  padding-inline: 1.25em;
  position: absolute;
  top: 50%;
  white-space: nowrap;

  svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2.2;
  }
}

.sort-bin {
  backdrop-filter: blur(6px);
  background-color: rgb(30 51 40 / 0.8);
  border: 1.5px solid var(--line);
  color: var(--ink);
  left: 0;
  transform: translate(-60%, -50%);
}

.sort-keep {
  background-color: var(--yellow);
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.3);
  color: var(--dark-green);
  right: 0;
  transform: translate(60%, -50%);
}

.polaroid-back {
  box-shadow:
    0 1px 1px rgb(0 0 0 / 0.25),
    0 3px 8px rgb(6 14 10 / 0.3);
  filter: brightness(0.85);

  &:nth-child(1) {
    transform: translate(-10%, 2%) rotate(-8deg);
  }

  &:nth-child(2) {
    transform: translate(9%, -2%) rotate(6deg);
  }
}

.places {
  display: grid;
  padding-block: 4em;
  place-items: center;

  > .place {
    grid-area: 1 / 1;
  }
}

.place-back {
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.3),
    0 4px 10px rgb(0 0 0 / 0.25);
  filter: brightness(0.7);

  &:nth-child(1) {
    transform: translate(-48%, -38%) rotate(-12deg) scale(0.7);
  }

  &:nth-child(2) {
    transform: translate(46%, -42%) rotate(9deg) scale(0.7);
  }

  &:nth-child(3) {
    transform: translate(-44%, 40%) rotate(7deg) scale(0.7);
  }

  &:nth-child(4) {
    transform: translate(48%, 36%) rotate(-10deg) scale(0.7);
  }
}

.place {
  border: 2px solid var(--yellow);
  position: relative;
  width: 280px;
  overflow: hidden;
  border-radius: 1em;
  box-shadow:
    0 4px 8px rgb(0 0 0 / 0.25),
    0 24px 48px rgb(0 0 0 / 0.5);
}

.place-image {
  aspect-ratio: 4 / 2;
  position: relative;
  overflow: hidden;

  img {
    height: 100%;
    inset: 0;
    object-fit: cover;
    object-position: center;
    position: absolute;
    width: 100%;
  }
}

.place-name {
  background-color: var(--dark-green);
  color: var(--white);
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.25em;
  padding: 0.5em 0.75em;
}

/* Album and field journal, from the app's screens */
.collection {
  margin-inline: auto;
  max-width: 1040px;
  padding: 9em 1.5em;
  text-align: center;
}

.collection-title {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(2em, 5vw, 3em);
  line-height: 1.1;
  text-wrap: balance;

  span {
    color: var(--yellow);
  }
}

.steps-description,
.collection-description {
  color: var(--ink-2);
  font-size: 1.125em;
  line-height: 1.6;
  margin-inline: auto;
  margin-top: 1.25em;
  max-width: 32em;
  text-wrap: balance;
}

.collection-grid {
  display: grid;
  gap: 1.5em;
  margin-top: 3em;
  text-align: left;

  @media (min-width: 768px) {
    align-items: start;
    grid-template-columns: 1fr 1fr;
  }
}

.panel {
  background-color: var(--deep);
  border-radius: 20px;
  padding: 20px;

  .money {
    color: var(--yellow);
    letter-spacing: 0;
  }
}

.panel-title {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 37px;
  margin-top: 4px;
}

.album {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;

  /* Each print fills its grid cell instead of the fixed width */
  .polaroid {
    margin: 0;
    padding: 5% 5% 0;
    width: 100%;
  }
}

.journal-bar {
  background-color: var(--line-dark);
  border-radius: 3px;
  height: 6px;
  margin-top: 14px;
  overflow: hidden;

  span {
    background-color: var(--yellow);
    display: block;
    height: 100%;
  }
}

/* The place with no animals, cropped to a band */
.journal-strip {
  background-color: var(--raised);
  border-radius: 14px;
  height: 96px;
  margin-top: 22px;
  overflow: hidden;

  img {
    height: 100%;
    object-fit: cover;
    object-position: center 48%;
    width: 100%;
  }
}

.journal-place {
  align-items: baseline;
  color: var(--label);
  display: flex;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  justify-content: space-between;
  margin-top: 10px;
}

.journal-place-name {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.journal-species {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.species {
  background-color: var(--raised);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;

  &.is-unseen {
    background-color: transparent;
    border: 1px dashed var(--line);

    .species-name {
      color: var(--label);
    }
  }
}

.species-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;

  .money {
    font-size: 12px;
  }
}

.species-name {
  color: var(--paper);
  font-size: 15px;
  font-weight: 600;
}

.species-note {
  color: var(--label);
  font-size: 12px;
  line-height: 16px;
}

/* The closing call to download, framed like the header */
.download {
  align-items: center;
  display: flex;
  gap: 1em;
  justify-content: center;
  text-align: center;
  padding: 9em 1.5em;
  min-height: 100vh;
  position: relative;

  .footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
  }
}

.download-body {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1em;
  max-width: 760px;
  padding: 4em 1.5em;

  .store-buttons {
    margin-top: 1em;
  }
}

.download-title {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: clamp(2em, 5vw, 3em);
  line-height: 1.1;
  text-wrap: balance;

  span {
    color: var(--yellow);
  }
}

.download-description {
  color: var(--ink-2);
  font-size: 1.125em;
}

.footer {
  display: flex;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  gap: 3em;
  justify-content: center;
  flex-direction: column;
  letter-spacing: 1.5px;
  padding: 3em 1.5em 6em;
  text-transform: uppercase;
  text-align: center;

  a:hover {
    color: var(--yellow);
  }

  p {
    display: flex;
    gap: 3em;
    justify-content: center;
  }
}

/* Privacy policy and terms of use */
.page {
  margin-inline: auto;
  max-width: 44em;
  padding: min(10vw, 4em) 1.5em;
}

.page-logo {
  display: block;
  max-width: 200px;
}

.content {
  color: var(--ink-2);
  line-height: 1.6;
  margin-top: min(10vw, 4em);

  > * + * {
    margin-top: 1em;
  }

  h1 {
    color: var(--paper);
    font-family: var(--font-display);
    font-size: clamp(2em, 5vw, 2.5em);
    line-height: 1.1;
  }

  h2 {
    color: var(--paper);
    font-family: var(--font-display);
    font-size: 1.375em;
    margin-top: 2em;
  }

  strong {
    color: var(--ink);
  }

  ul {
    list-style: disc;
    padding-left: 1.25em;
  }

  li + li {
    margin-top: 0.25em;
  }

  a {
    color: var(--yellow);
    text-decoration: underline;
  }
}
