/* Haunted Contractors one-page site. Palette and fonts follow logo/README.md. */

@font-face {
  font-family: "Anton";
  src: url("assets/fonts/Anton-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  font-weight: 700;
  src: url("assets/fonts/BarlowCondensed-Bold.ttf") format("truetype");
  font-display: swap;
}

:root {
  --night: #141a30;
  --night-lt: #1e2747;
  --deep: #0c1020;
  --hivis: #ffc531;
  --hivis-dk: #e3a400;
  --ghost: #eefcf6;
  --glow: #7ff2d0;
  --bone: #f6f1e4;
  --steel: #c9cfdb;
  --display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --tape-room: calc(50px + 1.2vw);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--deep);
  color: var(--bone);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: clip;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--glow);
  outline-offset: 3px;
}

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

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

.hero {
  position: relative;
  /* Leaves room for the tape strip, so the whole strip fits on the first screen. */
  min-height: calc(100svh - var(--tape-room));
  display: flex;
  flex-direction: column;
  isolation: isolate;
  overflow: hidden;
  background: var(--deep);
}

.hero__scene {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__img,
.hero__canvas,
.hero__skylight,
.hero__scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__img {
  object-fit: cover;
  object-position: 50% 50%;
}

/* The same frame rendered with the lightning light on. Faded in by site.js. */
.hero__img--flash {
  opacity: 0;
  filter: brightness(1.7) saturate(0.9);
}

.hero__skylight {
  opacity: 0;
  mix-blend-mode: screen;
  background: radial-gradient(
    ellipse 60% 75% at var(--bolt-x, 20%) 0%,
    rgba(200, 190, 255, 0.55),
    rgba(120, 110, 220, 0.18) 45%,
    transparent 75%
  );
}

.hero__canvas {
  pointer-events: none;
}

#bolt-canvas {
  opacity: 0;
}

.hero__scrim {
  background:
    linear-gradient(90deg, rgba(12, 16, 32, 0.72) 0%, rgba(12, 16, 32, 0.35) 38%, transparent 62%),
    linear-gradient(180deg, rgba(12, 16, 32, 0.55) 0%, transparent 22%, transparent 70%, var(--deep) 100%);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--gutter);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav__links {
  display: flex;
  gap: clamp(14px, 3vw, 32px);
  font-family: var(--label);
  font-size: 19px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav__links a {
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.nav__links a:hover {
  border-bottom-color: var(--hivis);
}

.hero__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  width: min(600px, 100%);
  padding: 24px var(--gutter) 110px;
}

.hero__logo img {
  width: 100%;
  margin-left: -3%;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.55));
}

.hero__tagline {
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.45;
  max-width: 30em;
  text-shadow: 0 2px 12px rgba(12, 16, 32, 0.9);
}

.storm-toggle {
  position: absolute;
  right: var(--gutter);
  bottom: 52px;
  padding: 7px 14px;
  border: 1px solid rgba(201, 207, 219, 0.35);
  border-radius: 999px;
  background: rgba(12, 16, 32, 0.55);
  color: var(--steel);
  font-family: var(--label);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.storm-toggle:hover {
  color: var(--bone);
  border-color: var(--glow);
}

/* ---------------------------------------------------------------- buttons */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 22px;
  align-items: center;
}

.cta-row--center {
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 10px 30px;
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Hi-vis tape button from the UI kit: one per group, tilted by 2 degrees. */
.btn--tape {
  position: relative;
  padding-inline: 62px;
  color: var(--deep);
  background:
    repeating-linear-gradient(-45deg, var(--deep) 0 9px, transparent 9px 18px) left / 40px 100% no-repeat,
    repeating-linear-gradient(-45deg, var(--deep) 0 9px, transparent 9px 18px) right / 40px 100% no-repeat,
    var(--hivis);
  transform: rotate(-2deg);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35);
}

.btn--tape:hover {
  transform: rotate(-2deg) translateY(-3px);
  box-shadow: 0 11px 0 rgba(0, 0, 0, 0.35);
}

.btn--ghost {
  color: var(--ghost);
  border: 2px solid var(--glow);
  background: rgba(127, 242, 208, 0.08);
  box-shadow: 0 0 22px rgba(127, 242, 208, 0.18);
}

.btn--ghost:hover {
  background: rgba(127, 242, 208, 0.2);
  transform: translateY(-3px);
}

.btn.is-soon {
  cursor: default;
  filter: saturate(0.55) brightness(0.85);
}

.btn.is-soon:hover {
  transform: none;
}

.btn--tape.is-soon:hover {
  transform: rotate(-2deg);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.35);
}

/* ---------------------------------------------------------------- tape strip */

.tape {
  position: relative;
  z-index: 2;
  margin: -26px -2vw 0;
  padding: 10px 0;
  overflow: hidden;
  background: var(--hivis);
  color: var(--deep);
  border-block: 8px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--deep) 0 12px, var(--hivis) 12px 24px) 8;
  transform: rotate(-1.2deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.tape__track {
  display: flex;
  width: max-content;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: pre;
  animation: tape-slide 28s linear infinite;
}

@keyframes tape-slide {
  to {
    transform: translateX(-25%);
  }
}

/* ---------------------------------------------------------------- sections */

.section {
  position: relative;
  overflow: clip;
  padding: clamp(72px, 11vw, 136px) 0;
  background: var(--night);
}

.section > .wrap {
  position: relative;
  z-index: 1;
}

/* Ghost that leans in from the side of a section when it scrolls into view (site.js adds .is-out).
   The outer box stays in place so the observer can see it; only the body moves. */
.boo {
  position: absolute;
  z-index: 0;
  width: clamp(96px, 12vw, 210px);
  pointer-events: none;
}

.boo__body {
  position: relative;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.boo--left {
  left: 0;
  bottom: clamp(8px, 3vw, 48px);
}

.boo--left .boo__body {
  transform: translateX(-115%) rotate(0deg);
}

.boo--left.is-out .boo__body {
  transform: translateX(-24%) rotate(24deg);
}

.boo--right {
  right: 0;
  top: clamp(40px, 7vw, 110px);
}

.boo--right .boo__body {
  transform: translateX(115%) rotate(0deg);
}

.boo--right.is-out .boo__body {
  transform: translateX(24%) rotate(-24deg);
}

.boo__bubble {
  position: absolute;
  top: -6%;
  padding: 2px 12px;
  background: var(--hivis);
  color: var(--deep);
  font-family: var(--display);
  font-size: clamp(16px, 1.7vw, 26px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s ease 0s;
}

.boo--left .boo__bubble {
  left: 78%;
  transform: rotate(-30deg);
}

.boo--right .boo__bubble {
  right: 78%;
  transform: rotate(30deg);
}

.boo.is-out .boo__bubble {
  opacity: 1;
  transition-delay: 0.45s;
}

.eyebrow {
  font-family: var(--label);
  font-size: 19px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hivis);
}

h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 5.4vw, 60px);
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
  margin: 8px 0 20px;
}

.lead {
  font-size: clamp(17px, 1.8vw, 20px);
  color: var(--steel);
  max-width: 34em;
}

.job {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}

.features {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  gap: 26px;
}

.features li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.features h3 {
  font-family: var(--label);
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.features p {
  color: var(--steel);
  margin-top: 4px;
}

/* Contract sheet on a clipboard, as in the in-game job sheet. */
.sheet {
  position: relative;
  padding: 54px 28px 30px;
  background: var(--bone);
  color: var(--deep);
  border-radius: 4px;
  transform: rotate(2.5deg);
  box-shadow: 0 0 0 10px #6b4a2b, 0 0 0 12px #3d2a18, 0 30px 50px rgba(0, 0, 0, 0.5);
}

.sheet__clip {
  position: absolute;
  top: -22px;
  left: 50%;
  width: 120px;
  height: 44px;
  transform: translateX(-50%);
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(#dfe4ee, #8e96a8);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.35);
}

.sheet__head {
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

.sheet__site {
  font-family: var(--label);
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--deep);
}

.sheet__list {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.35;
}

.sheet__list li {
  position: relative;
  padding: 7px 0 7px 32px;
  border-bottom: 1px dashed rgba(12, 16, 32, 0.3);
}

.sheet__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--deep);
}

.sheet__list li.is-done {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  color: rgba(12, 16, 32, 0.6);
}

.sheet__list li.is-done::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 9px;
  height: 16px;
  border: solid #1c7a5c;
  border-width: 0 4px 4px 0;
  transform: rotate(40deg);
}

.sheet__foot {
  padding-right: 96px;
  min-height: 62px;
  font-family: var(--label);
  font-size: 19px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sheet__stamp {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border: 5px double #b3261e;
  border-radius: 50%;
  color: #b3261e;
  font-family: var(--display);
  font-size: 34px;
  transform: rotate(-14deg);
  opacity: 0.85;
}

.section--join {
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(127, 242, 208, 0.1), transparent 70%),
    var(--night-lt);
  text-align: center;
}

.join {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.join__badge {
  width: clamp(150px, 20vw, 220px);
  margin-bottom: 24px;
}

.join .lead {
  margin-bottom: 40px;
}

.footer {
  padding: 40px 0 48px;
  background: var(--deep);
  color: var(--steel);
  font-size: 15px;
}

.footer__inner {
  display: flex;
  align-items: center;
  gap: 28px;
}

.footer__inner img {
  width: 130px;
  flex: none;
}

.footer__text {
  display: grid;
  gap: 6px;
}

.footer__text strong {
  color: var(--bone);
}

.footer__contact a {
  color: var(--hivis);
}

/* ---------------------------------------------------------------- small screens */

@media (max-width: 860px) {
  .job {
    grid-template-columns: minmax(0, 1fr);
  }

  .sheet {
    width: min(360px, 100% - 24px);
    margin: 20px auto 0;
  }

  /* The sheet now fills the bottom of the section, so this ghost leans in at the top right. */
  .boo--left {
    left: auto;
    right: 0;
    bottom: auto;
    top: 14px;
  }

  .boo--left .boo__body {
    transform: translateX(115%) rotate(0deg);
  }

  .boo--left.is-out .boo__body {
    transform: translateX(24%) rotate(-24deg);
  }

  .boo--left .boo__bubble {
    left: auto;
    right: 78%;
    transform: rotate(30deg);
  }
}

@media (max-width: 640px) {
  .nav__brand span,
  .nav__links a[href="#job"] {
    display: none;
  }

  .hero__content {
    justify-content: flex-end;
    padding-bottom: 110px;
  }

  /* The art keeps to the upper part so the ghost stays visible above the logo. */
  .hero__scene {
    bottom: auto;
    height: 66%;
  }

  .hero__scrim {
    background: linear-gradient(180deg, rgba(12, 16, 32, 0.5) 0%, transparent 20%, transparent 62%, var(--deep) 100%);
  }

  .hero__img {
    object-position: 47% 50%;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    font-size: 19px;
    padding-inline: 20px;
  }

  .btn--tape {
    padding-inline: 50px;
  }

  .features li {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tape__track {
    animation: none;
  }

  .boo__body,
  .boo__bubble {
    transition: none;
  }

  .btn {
    transition: none;
  }
}
