/* Frend — download page. Dark plank, raw timber, stencilled crates. No scripts. */

@font-face {
  font-family: "Ultra";
  src: url("fonts/ultra-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Saira Stencil One";
  src: url("fonts/saira-stencil-one-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("fonts/alegreya-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("fonts/alegreya-sans-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("fonts/alegreya-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --char: #110c08;
  --bark: #1b130d;
  --bark-2: #261b12;
  --pine: #d9a865;
  --pine-deep: #a8743c;
  --bone: #efe5d2;
  --ash: #b9ab93;
  --ash-dim: #8a7c6b;
  --blood: #b0221c;
  --line: rgba(239, 229, 210, 0.14);
  --display: "Ultra", "Rockwell Extra Bold", "Rockwell", Georgia, serif;
  --stencil: "Saira Stencil One", "Impact", sans-serif;
  --body: "Alegreya Sans", "Segoe UI", "Helvetica Neue", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1160px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--char);
  background-image:
    linear-gradient(rgba(17, 12, 8, 0.86), rgba(17, 12, 8, 0.93)),
    url("img/plank.webp");
  background-size: auto, 1120px auto;
  color: var(--bone);
  font: 400 1.125rem/1.6 var(--body);
  overflow-x: hidden;
}

/* Film grain over everything, very faint. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--pine);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--bone);
}
:focus-visible {
  outline: 3px solid var(--bone);
  outline-offset: 4px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
}

h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 1.3rem + 3vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: 1.15;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 60;
  padding: 8px 14px;
  background: var(--bone);
  color: var(--char);
  font-weight: 700;
}
.skip:focus {
  top: 16px;
}

.kicker {
  margin: 0 0 0.9rem;
  font-family: var(--stencil);
  font-size: 1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pine);
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 2.2em;
  height: 2px;
  margin-right: 0.8em;
  vertical-align: 0.3em;
  background: var(--blood);
}

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.hero__shot {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 40%;
  animation: settle 26s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(17, 12, 8, 0.62), rgba(17, 12, 8, 0.2) 100%),
    linear-gradient(to top, var(--char) 0%, rgba(17, 12, 8, 0) 28%),
    linear-gradient(to bottom, rgba(17, 12, 8, 0.45) 0%, rgba(17, 12, 8, 0) 22%);
}

/* The player portal is its own site; this is the way there. */
.signin {
  position: absolute;
  top: clamp(14px, 3vw, 28px);
  right: var(--gutter);
  z-index: 2;
  padding: 0.3em 0.9em 0.2em;
  border: 1px solid rgba(217, 168, 101, 0.55);
  background: rgba(17, 12, 8, 0.55);
  font-family: var(--stencil);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--pine);
}
.signin:hover {
  color: var(--bone);
  border-color: var(--bone);
}

.hero__inner {
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(48px, 8vh, 96px);
  text-align: center;
}

.tag {
  display: inline-block;
  margin: 0 0 1.2rem;
  padding: 0.15em 0.75em 0.1em;
  border: 2px solid currentColor;
  font-family: var(--stencil);
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pine);
  transform: rotate(-2deg);
  animation: rise 0.7s 0.1s ease-out both;
}

.hero__title {
  margin: 0 0 1.4rem;
}

.wordmark {
  width: min(680px, 92vw);
  margin-inline: auto;
  transform: rotate(-2deg);
  transform-origin: 50% 0;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.65));
  animation: hang 1.1s 0.2s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

.lede {
  margin: 0 auto 2.4rem;
  font-family: var(--stencil);
  font-size: clamp(1.1rem, 0.9rem + 1vw, 1.65rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.35;
  text-wrap: balance;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  animation: rise 0.8s 0.6s ease-out both;
}

/* -------------------------------------------------------- the plank */

.download {
  animation: rise 0.8s 0.8s ease-out both;
}

/* clip-path cuts off box-shadow, so the plank's shadow comes from a filter
   on its unclipped wrapper. */
.download {
  --shadow: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.55)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

.plank {
  position: relative;
  display: inline-grid;
  justify-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 20px clamp(56px, 8vw, 84px) 16px;
  color: #2b1a0b;
  text-decoration: none;
  background:
    radial-gradient(ellipse 30px 9px at 63% 42%, rgba(80, 45, 15, 0.45), transparent 70%),
    repeating-linear-gradient(177deg, transparent 0 6px, rgba(95, 55, 20, 0.16) 6px 7px, transparent 7px 13px),
    repeating-linear-gradient(181deg, transparent 0 17px, rgba(255, 225, 170, 0.12) 17px 19px, transparent 19px 31px),
    linear-gradient(180deg, #e7bd80 0%, #cf9852 52%, #a96f36 100%);
  clip-path: polygon(0 9%, 4% 0, 38% 5%, 71% 0, 97% 3%, 100% 10%, 98% 52%, 100% 92%, 96% 100%, 61% 96%, 24% 100%, 3% 97%, 1% 60%);
  transform: rotate(-1.2deg);
  transition: transform 0.18s ease, background-color 0.18s;
}
.download {
  filter: var(--shadow);
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
.plank:hover {
  color: #1d1107;
  transform: rotate(-2.6deg) translateY(-3px);
}
.plank:active {
  transform: rotate(-0.4deg) translateY(1px);
}
.plank:focus-visible {
  outline: none;
}
.download:has(.plank:focus-visible) {
  outline: 3px solid var(--bone);
  outline-offset: 8px;
}

.plank__label {
  font-family: var(--display);
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem);
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 232, 190, 0.55), 0 -1px 0 rgba(60, 30, 5, 0.35);
}

.plank__sub {
  font-family: var(--stencil);
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(43, 26, 11, 0.82);
  white-space: nowrap;
}

.nail {
  position: absolute;
  top: 50%;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  translate: 0 -50%;
  background: radial-gradient(circle at 36% 30%, #f1efe9 0 10%, #a19c93 28%, #57524c 60%, #2b2826 100%);
  box-shadow: 0 2px 2px rgba(30, 15, 0, 0.55), inset 0 -1px 2px rgba(0, 0, 0, 0.5);
}
.nail--l {
  left: clamp(20px, 3vw, 30px);
}
.nail--r {
  right: clamp(20px, 3vw, 30px);
}

/* ---------------------------------------------------------------- arc */

/* Four words, stacked large. */
.arc {
  padding-block: clamp(72px, 11vw, 150px);
}

.arc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.beat {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  align-items: baseline;
  padding-block: 0.35rem 0.45rem;
  border-top: 1px solid var(--line);
}
.beat:last-child {
  border-bottom: 1px solid var(--line);
}
.beat__n {
  font-family: var(--stencil);
  font-size: 1rem;
  letter-spacing: 0.18em;
  color: var(--pine);
}
.beat h2 {
  font-size: clamp(2.2rem, 0.6rem + 6vw, 6rem);
  line-height: 1.08;
}

.beat--goal h2,
.beat--goal .beat__n {
  color: #e2493e;
}

@media (min-width: 760px) {
  .beat {
    grid-template-columns: 4.2rem 1fr;
  }
}

/* ---------------------------------------------------------------- war */

.war {
  padding-block: clamp(80px, 12vw, 160px);
  border-block: 1px solid var(--line);
  background:
    radial-gradient(ellipse 55% 75% at 82% 55%, rgba(176, 34, 28, 0.2), transparent 70%),
    linear-gradient(180deg, rgba(8, 5, 3, 0.55), rgba(8, 5, 3, 0.8));
}

/* Two statements: the threat, then why you still need others. */
.war__title {
  font-size: clamp(2.6rem, 1.4rem + 5vw, 5.6rem);
  line-height: 0.96;
}
.war__second {
  max-width: 22ch;
  margin: clamp(20px, 3vw, 36px) 0 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 1rem + 2.4vw, 3.2rem);
  line-height: 1.02;
  color: var(--pine);
}

/* ---------------------------------------- specs and the last download */

.closing {
  display: grid;
  gap: clamp(48px, 6vw, 64px);
  align-items: center;
  padding-block: clamp(72px, 10vw, 130px);
}
@media (min-width: 900px) {
  .closing {
    grid-template-columns: 6fr 5fr;
  }
}

.crate {
  padding: clamp(22px, 3vw, 34px);
  border: 3px solid rgba(217, 168, 101, 0.7);
  outline: 1px solid rgba(217, 168, 101, 0.3);
  outline-offset: 5px;
  background: rgba(27, 19, 13, 0.75);
}
.crate__title {
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid rgba(217, 168, 101, 0.45);
  font-family: var(--stencil);
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pine);
}
/* One grid for all rows, so the label column is as wide as its longest label. */
.crate__rows {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: baseline;
  margin: 0;
}
.crate__rows div {
  display: contents;
}
.crate__rows dt,
.crate__rows dd {
  padding-block: 0.55rem;
  border-bottom: 1px dashed var(--line);
}
.crate__rows div:last-child > * {
  border-bottom: 0;
}
.crate__rows dt {
  padding-right: 1.4rem;
  font-family: var(--stencil);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.92rem;
  color: var(--pine);
}
.crate__rows dd {
  margin: 0;
  color: var(--bone);
}
@media (max-width: 420px) {
  .crate__rows {
    grid-template-columns: 1fr;
  }
  .crate__rows dt {
    padding-bottom: 0;
    border-bottom: 0;
  }
  .crate__rows dd {
    padding-top: 0.1rem;
  }
}

.again {
  display: grid;
  justify-items: center;
  gap: 28px;
  text-align: center;
}
.again__line {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem);
  line-height: 1.05;
}
.download--small {
  animation: none;
}

/* ------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--line);
  background: rgba(10, 7, 5, 0.7);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding-block: 26px;
  font-size: 0.98rem;
  color: var(--ash);
}
.footer__inner p {
  margin: 0;
}
.footer__small {
  margin-left: auto !important;
  font-family: var(--stencil);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--ash-dim);
}

/* ---------------------------------------------------------- 404 page */

.lost {
  display: grid;
  place-content: center;
  justify-items: start;
  gap: 1rem;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--gutter);
}
.lost h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 1.6rem + 4vw, 4.4rem);
  line-height: 1;
}
.lost p {
  max-width: 40ch;
  color: var(--ash);
}

/* ------------------------------------------------------------- motion */

@keyframes hang {
  0% {
    opacity: 0;
    transform: translateY(-46px) rotate(-7deg);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(-2deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes settle {
  from {
    transform: scale(1.09);
  }
  to {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
