:root {
  --color-ground: #FFD000;
  --color-ink: #FFFFFF;

  --font-display: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: clamp(1rem, 0.4rem + 3vw, 3.5rem);
  /* Everything fits one viewport: sizes are bounded by both width and height */
  /* "Walking" is ~3.69em wide at 800 with -0.02em tracking; 3.9 leaves headroom */
  --text-wordmark: max(2.5rem, min(calc((100vw - 2 * var(--gutter)) / 3.9), 20svh));
  /* "Walking into" on one line is ~5.6em */
  --text-wordmark-line: max(2.5rem, min(calc((100vw - 2 * var(--gutter)) / 5.75), 19svh));
  --text-exit: clamp(1.0625rem, min(0.9rem + 1.6vw, 3.6svh), 2.5rem);
  --text-meta: clamp(0.9375rem, min(0.8rem + 0.8vw, 2.6svh), 1.625rem);
  --text-medium: clamp(0.875rem, min(0.8rem + 0.4vw, 2svh), 1.1875rem);
  --stage-gap: clamp(0.75rem, 4svh, 3rem);

  --rule: clamp(3px, 0.25vw, 4px);
  --color-mat: #FFFFFF;
  --color-image-wait: #E6BB00;
  --mat: clamp(0.5rem, min(0.3rem + 1.6vw, 2.6svh), 1.75rem);
  --shadow-hang: 0 1px 2px rgb(110 75 0 / 0.18), 0 22px 40px -24px rgb(110 75 0 / 0.55);
  --shadow-lift: 0 2px 4px rgb(110 75 0 / 0.16), 0 34px 54px -26px rgb(110 75 0 / 0.6);
  --duration-normal: 320ms;
  --duration-fast: 180ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--color-ground);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-ground);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-weight: 800;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.stage {
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  gap: var(--stage-gap);
  padding: var(--gutter);
}

.wordmark {
  flex: none;
  margin: 0;
  font-size: var(--text-wordmark);
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: -0.02em;
  /* keep side bearing from looking indented against the gutter */
  margin-left: -0.045em;
}

.wordmark__line {
  display: block;
}

/*
 * The wall: a size container that takes whatever height the wordmark leaves.
 * Each work is sized from that box so frames + labels never push past the fold.
 */
.exits {
  --cols: 1;
  --rows: 2;
  --col-gap: clamp(1.5rem, 4vw, 5rem);
  --row-gap: clamp(1rem, 3.5svh, 2.5rem);
  --work-gap: clamp(0.625rem, 1.6svh, 1.5rem);
  --label-pad: clamp(0.5rem, min(1.2vw, 1.4svh), 1.25rem);
  --img-floor: 4.5rem;

  --col-w: calc((100cqw - (var(--cols) - 1) * var(--col-gap)) / var(--cols));
  --row-h: calc((100cqh - (var(--rows) - 1) * var(--row-gap)) / var(--rows));
  --label-h: calc(var(--label-pad) + var(--rule) + 1.05 * var(--text-exit) + 0.3rem
    + 1.2 * var(--text-medium) + 0.5rem + 1.25 * var(--text-meta));
  --img-room: calc(var(--row-h) - var(--label-h) - var(--work-gap) - 2 * var(--mat));
  /* widest label line: "walkingintovangogh.com" + arrow, "Coming soon on Steam" */
  --label-min-w: max(10.6 * var(--text-exit), 12.8 * var(--text-meta));
  --card-w: min(var(--col-w), max(var(--label-min-w), var(--img-room) * 4 / 3 + 2 * var(--mat)));
  --img-h: max(var(--img-floor), min(var(--img-room), (var(--card-w) - 2 * var(--mat)) * 3 / 4));

  flex: 1 1 0;
  min-height: 0;
  container-type: size;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols), auto);
  justify-content: center;
  align-content: end;
  column-gap: var(--col-gap);
  row-gap: var(--row-gap);
}

.exits > li {
  width: var(--card-w);
  min-width: 0;
}

@media (min-width: 600px) {
  .exits {
    --cols: 2;
    --rows: 1;
  }
}

/* Wide screens: the wordmark runs on one line so the wall gets the height */
@media (min-width: 600px) and (min-aspect-ratio: 5 / 4) {
  .wordmark {
    font-size: var(--text-wordmark-line);
    /* line-height 0.84 lets the "g" descender hang into the gap; give it room */
    padding-bottom: 0.1em;
  }

  .wordmark__line {
    display: inline;
  }
}

/* A work hung on the wall: matted frame + wall label */
.work {
  display: flex;
  flex-direction: column;
  gap: var(--work-gap);
  margin: 0;
  color: inherit;
  text-decoration: none;
}

.work__frame {
  display: block;
  padding: var(--mat);
  background: var(--color-mat);
  box-shadow: var(--shadow-hang);
  transition: transform var(--duration-normal) var(--ease-out-expo),
    box-shadow var(--duration-normal) var(--ease-out-expo);
}

.work__image {
  display: block;
  width: 100%;
  height: var(--img-h);
  object-fit: cover;
  background: var(--color-image-wait);
}

.work__label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: var(--label-pad);
  border-top: var(--rule) solid var(--color-ink);
}

.work__title {
  font-size: var(--text-exit);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.work__medium {
  font-size: var(--text-medium);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  opacity: 0.9;
}

.work__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: 0.2rem;
  font-size: var(--text-meta);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.work__arrow {
  flex: none;
  width: 0.9em;
  height: 0.9em;
  transition: transform var(--duration-fast) var(--ease-out-expo);
}

.work--link .work__meta {
  text-decoration: underline;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.18em;
}

.work--link:hover .work__frame,
.work--link:focus-visible .work__frame {
  transform: translateY(-0.375rem);
  box-shadow: var(--shadow-lift);
}

.work--link:hover .work__arrow,
.work--link:focus-visible .work__arrow {
  transform: translate(0.15em, -0.15em);
}

.work--link:hover .work__meta {
  text-decoration-thickness: 0.14em;
}

.work--link:focus-visible {
  outline: var(--rule) solid var(--color-ink);
  outline-offset: 0.75rem;
}

.work--link:active .work__frame {
  transform: translateY(-0.125rem);
}

@media (prefers-reduced-motion: reduce) {
  .work__arrow,
  .work__frame {
    transition: none;
  }

  .work--link:hover .work__frame,
  .work--link:focus-visible .work__frame,
  .work--link:active .work__frame {
    transform: none;
  }
}
