@font-face {
  font-family: "Reckless Neue";
  src: url("./fonts/RecklessNeue-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #141b1c;
  --ink: #efe7d5;
  --muted: #e8deca;
  --line: rgba(239, 231, 213, 0.24);
  --button-bg: #f5ecde;
  --button-ink: #151a1b;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  height: 100svh;
  min-height: 100svh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

a {
  color: inherit;
}

.shell {
  width: min(calc(100% - 48px), 1880px);
  height: calc(100svh - 48px);
  margin: 24px auto;
  border: 1px solid var(--line);
  border-radius: 44px;
  padding: clamp(24px, 3.2svh, 38px) clamp(24px, 5vw, 140px) clamp(22px, 2.8svh, 34px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.brand {
  position: relative;
  z-index: 3;
  justify-self: center;
  display: grid;
  place-items: center;
  min-width: 240px;
  min-height: 44px;
  color: var(--ink);
}

.brand__mark {
  display: block;
  width: clamp(154px, 12vw, 235px);
  max-height: 58px;
  object-fit: contain;
}

.brand__mark[src$=".svg"] {
  color: var(--ink);
}

.brand__mark[hidden],
.brand__mark:not([src]),
.brand__mark:is([src=""]) {
  display: none;
}

.brand__mark:not([hidden]) + .brand__fallback {
  display: none;
}

.brand__mark[hidden] + .brand__fallback {
  display: block;
}

.brand__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.hero {
  position: relative;
  align-self: center;
  --media-width: min(70vw, 1280px);
  --media-half: min(35vw, 640px);
  --media-height: min(42vw, calc(100svh - 380px), 720px);
  width: 100%;
  margin-top: clamp(24px, 5.2svh, 58px);
  height: calc(100svh - 48px - clamp(24px, 3.2svh, 38px) - clamp(22px, 2.8svh, 34px) - 58px - clamp(24px, 5.2svh, 58px));
  min-height: 0;
}

.hero__media {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--media-width);
  height: var(--media-height);
  transform: translateX(-50%);
  border-radius: 34px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(20, 27, 28, 0.1), rgba(20, 27, 28, 0) 22%, rgba(20, 27, 28, 0.16)),
    url("./assets/hero.png") center / cover no-repeat,
    radial-gradient(circle at 52% 38%, #8f7963, #263131 50%, #101718 100%);
}

.hero__title {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  color: var(--ink);
  font-family: "Reckless Neue", Georgia, "Times New Roman", serif;
  font-size: clamp(82px, 7.3vw, 154px);
  font-weight: 500;
  line-height: 0.86;
  letter-spacing: -0.06em;
}

.hero__word {
  display: block;
  position: absolute;
}

.hero__word--solving {
  left: clamp(0px, calc(50% - var(--media-half) - 170px), 110px);
  top: 0.62em;
}

.hero__word--market {
  right: clamp(0px, calc(50% - var(--media-half) - 226px), 110px);
  top: min(2.95em, calc(var(--media-height) - 2.15em));
  text-align: right;
}

.hero__word--puzzles {
  right: clamp(0px, calc(50% - var(--media-half) - 226px), 110px);
  top: min(3.82em, calc(var(--media-height) - 1.1em));
  text-align: right;
}

.hero__copy {
  position: absolute;
  right: 0;
  bottom: clamp(-22px, -1.8svh, -12px);
  z-index: 3;
  width: min(410px, 29vw);
  color: var(--muted);
}

.hero__copy p {
  margin: 0 0 clamp(16px, 2.2svh, 22px);
  font-size: clamp(20px, 1.28vw, 25px);
  font-weight: 400;
  line-height: 1.24;
  letter-spacing: -0.02em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 272px;
  min-height: 70px;
  padding: 20px 32px;
  border: 1px solid rgba(20, 27, 28, 0.1);
  background: var(--button-bg);
  color: var(--button-ink);
  font-family: "DM Mono", "SFMono-Regular", Consolas, monospace;
  font-size: clamp(18px, 1.15vw, 24px);
  font-weight: 500;
  letter-spacing: 0.32em;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.button:hover {
  background: #fff6ea;
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

@media (max-width: 1100px) {
  .shell {
    width: min(calc(100% - 28px), 980px);
    min-height: calc(100svh - 28px);
    margin: 14px auto;
    border-radius: 30px;
    padding: 28px 18px 24px;
  }

  .brand {
    min-height: 36px;
  }

  .hero {
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2svh, 18px);
    --media-width: 100%;
    --media-half: 50%;
    --media-height: auto;
    margin-top: clamp(28px, 5.2svh, 44px);
    height: auto;
    min-height: auto;
  }

  .hero__media {
    position: relative;
    left: auto;
    top: auto;
    order: 2;
    width: 100%;
    height: auto;
    aspect-ratio: 1.06 / 1;
    transform: none;
    border-radius: 24px;
    background-position: center;
  }

  .hero__title {
    position: relative;
    inset: auto;
    order: 1;
    width: 100%;
    font-size: clamp(56px, 15vw, 104px);
    line-height: 0.9;
  }

  .hero__word,
  .hero__word--solving,
  .hero__word--market,
  .hero__word--puzzles {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    text-align: center;
    transform: none;
  }

  .hero__word--market,
  .hero__word--puzzles {
    padding-left: 0;
  }

  .hero__copy {
    position: relative;
    right: auto;
    bottom: auto;
    order: 3;
    width: min(100%, 520px);
    margin: 0 auto;
    text-align: left;
  }

  .hero__copy p {
    font-size: clamp(19px, 5vw, 24px);
    line-height: 1.22;
  }
}

@media (max-width: 560px) {
  .shell {
    width: calc(100vw - 8px);
    max-width: none;
    min-height: calc(100svh - 8px);
    margin: 4px auto;
    border-radius: 24px;
    padding: 22px 8px 16px;
    overflow: hidden;
  }

  .brand {
    min-width: 164px;
  }

  .brand__mark {
    width: 150px;
  }

  .hero {
    gap: 12px;
    margin-top: clamp(22px, 3.2svh, 28px);
  }

  .hero__media {
    height: min(367px, calc(100svh - 480px));
    aspect-ratio: auto;
    border-radius: 18px;
    background-position: 50% 50%;
  }

  .hero__title {
    font-size: clamp(30px, 8.4vw, 36px);
    line-height: 0.9;
    text-align: center;
    white-space: nowrap;
  }

  .hero__word,
  .hero__word--solving,
  .hero__word--market,
  .hero__word--puzzles {
    display: inline;
  }

  .hero__word:not(:last-child) {
    margin-right: 0.1em;
  }

  .hero__copy {
    width: 100%;
  }

  .hero__copy p {
    margin-bottom: 14px;
    font-size: clamp(18px, 5.4vw, 22px);
  }

  .button {
    width: 100%;
    min-width: 0;
    min-height: 62px;
    padding: 18px 22px;
    font-size: 17px;
    letter-spacing: 0.2em;
  }
}
