@font-face {
  font-family: "Instrument Serif";
  src: url("assets/instrument-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #0d0c0a;
  --headline: #f0eee7;
  --body: #938e85;
  --line: #c9c3b7;
  --focus: #d7d1c5;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--background);
  color: var(--headline);
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* Logo treatment */
.brand {
  position: absolute;
  z-index: 3;
  top: 52px;
  left: 64px;
  width: 192px;
  line-height: 0;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

/* Hero SVG */
.hero-visual {
  --grid-response: 0;
  --grid-shift-x: 0px;
  --grid-shift-y: 0px;
  --grid-warp-x: 0px;
  --grid-warp-y: 0px;
  position: absolute;
  z-index: 0;
  top: -14%;
  right: -10%;
  width: 90%;
  height: 128%;
  color: var(--line);
  pointer-events: none;
  transform: translate3d(
    var(--grid-shift-x),
    var(--grid-shift-y),
    0
  );
  transition: transform 170ms cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

.field-lines {
  vector-effect: non-scaling-stroke;
  stroke-width: .82;
  transition: transform 190ms cubic-bezier(.22, .61, .36, 1);
}

.field-lines--fine {
  opacity: calc(.23 + var(--grid-response) * .08);
  transform: translate3d(
    var(--grid-warp-x),
    var(--grid-warp-y),
    0
  );
}

.field-lines--vertical {
  opacity: calc(.21 + var(--grid-response) * .07);
}

.field-lines--structure {
  opacity: calc(.19 + var(--grid-response) * .06);
  stroke-width: 1.2;
  transform: translate3d(
    calc(var(--grid-warp-x) * .45),
    calc(var(--grid-warp-y) * .45),
    0
  );
}

.field-nodes {
  opacity: calc(.26 + var(--grid-response) * .09);
}

/* Copy layout */
.copy {
  position: absolute;
  z-index: 2;
  top: 53%;
  left: 64px;
  width: min(610px, calc(100% - 128px));
  transform: translateY(-38%);
}

.copy::before {
  position: absolute;
  z-index: -1;
  inset: -72px -118px -78px -72px;
  background: radial-gradient(
    ellipse at 34% 48%,
    rgba(13, 12, 10, .98) 0%,
    rgba(13, 12, 10, .94) 42%,
    rgba(13, 12, 10, .62) 66%,
    rgba(13, 12, 10, 0) 88%
  );
  content: "";
  pointer-events: none;
}

.copy h1 {
  max-width: 610px;
  margin: 0;
  color: var(--headline);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: .012em;
}

.copy p {
  max-width: 480px;
  margin: 28px 0 0;
  color: var(--body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-top: 38px;
  padding: 4px 0 6px;
  border-bottom: 1px solid rgba(240, 238, 231, .42);
  color: var(--headline);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none;
  transition: border-color 160ms ease, opacity 160ms ease;
}

.cta__arrow {
  display: inline-block;
  transition: transform 160ms ease;
}

.cta:hover {
  border-color: rgba(240, 238, 231, .9);
  opacity: .82;
}

.cta:hover .cta__arrow {
  transform: translateX(3px);
}

.cta:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 6px;
  border-color: transparent;
}

@media (max-width: 1200px) {
  .brand {
    top: 44px;
    left: 48px;
    width: 180px;
  }

  .copy {
    left: 48px;
    width: min(540px, calc(100% - 96px));
  }

  .copy h1 {
    max-width: 540px;
    font-size: 52px;
  }

  .hero-visual {
    right: -17%;
    width: 96%;
  }
}

@media (max-width: 900px) and (min-width: 641px) {
  .brand {
    top: 36px;
    left: 36px;
    width: 168px;
  }

  .copy {
    left: 36px;
    width: min(500px, calc(100% - 72px));
  }

  .copy h1 {
    font-size: 48px;
  }

  .copy p {
    max-width: 450px;
    font-size: 17px;
  }

  .hero-visual {
    right: -26%;
    width: 105%;
  }
}

/* Mobile behavior */
@media (max-width: 640px) {
  .brand {
    top: 24px;
    left: 24px;
    width: 154px;
  }

  .hero-visual {
    top: 3%;
    right: -70%;
    width: 146%;
    height: 96%;
    opacity: .74;
  }

  .copy {
    top: max(208px, 31svh);
    left: 24px;
    width: calc(100% - 48px);
    transform: none;
  }

  .copy::before {
    inset: -42px -24px -48px -38px;
    background: radial-gradient(
      ellipse at 38% 46%,
      rgba(13, 12, 10, .97) 0%,
      rgba(13, 12, 10, .9) 44%,
      rgba(13, 12, 10, .42) 68%,
      rgba(13, 12, 10, 0) 90%
    );
  }

  .copy h1 {
    max-width: 100%;
    font-size: 40px;
    line-height: 1.08;
    letter-spacing: .01em;
  }

  .copy p {
    max-width: 340px;
    margin-top: 24px;
    font-size: 16px;
    line-height: 1.5;
  }

  .cta {
    margin-top: 32px;
    font-size: 15px;
  }
}

@media (max-width: 380px), (max-height: 700px) and (max-width: 640px) {
  .brand {
    top: 20px;
    left: 20px;
    width: 145px;
  }

  .copy {
    top: max(185px, 29svh);
    left: 20px;
    width: calc(100% - 40px);
  }

  .copy h1 {
    font-size: 36px;
    line-height: 1.08;
  }

  .copy p {
    margin-top: 22px;
    font-size: 16px;
  }

  .cta {
    margin-top: 28px;
  }
}

@media (max-height: 560px) and (min-width: 641px) {
  .brand {
    top: 24px;
    left: 28px;
    width: 150px;
  }

  .copy {
    top: 55%;
    left: 28px;
    width: 470px;
    transform: translateY(-36%);
  }

  .copy h1 {
    font-size: 40px;
  }

  .copy p {
    max-width: 430px;
    margin-top: 16px;
    font-size: 16px;
  }

  .cta {
    margin-top: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-visual {
    transform: none;
    transition: none;
  }

  .field-lines {
    transform: none;
    transition: none;
  }

  .cta,
  .cta__arrow {
    transition: none;
  }
}

/* Keyboard-only blackjack shell */
.blackjack-shell {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 7, 6, .68);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.blackjack-shell[hidden] {
  display: none;
}

.blackjack-terminal {
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr) 48px;
  width: min(680px, 100%);
  height: min(500px, calc(100svh - 48px));
  overflow: hidden;
  border: 1px solid rgba(201, 195, 183, .3);
  border-radius: 4px;
  background: #0b0a08;
  box-shadow: 0 24px 72px rgba(0, 0, 0, .52);
  color: #d7d3ca;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.blackjack-terminal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 15px;
  border-bottom: 1px solid rgba(201, 195, 183, .14);
  background: #100f0d;
  color: #8f8b83;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
}

.blackjack-terminal__close {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8f8b83;
  cursor: pointer;
  font: inherit;
  place-items: center;
}

.blackjack-terminal__close:hover {
  color: #f0eee7;
}

.blackjack-terminal__close:focus-visible {
  outline: 1px solid #d7d1c5;
  outline-offset: 1px;
}

.blackjack-terminal__output {
  overflow: auto;
  padding: 20px;
  scrollbar-color: rgba(201, 195, 183, .25) transparent;
}

.blackjack-terminal__line {
  margin: 0 0 7px;
  color: #a7a299;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.blackjack-terminal__line--bright {
  color: #f0eee7;
}

.blackjack-terminal__line--muted {
  color: #77736c;
}

.blackjack-terminal__line--accent {
  color: #c94b36;
}

.blackjack-terminal__prompt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-top: 1px solid rgba(201, 195, 183, .14);
  color: #c94b36;
}

.blackjack-terminal__input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f0eee7;
  caret-color: #c94b36;
  font: inherit;
  font-size: 14px;
  line-height: 1;
}

.blackjack-terminal__input::selection {
  background: rgba(201, 75, 54, .42);
}

@media (max-width: 640px) {
  .blackjack-shell {
    padding: 12px;
  }

  .blackjack-terminal {
    height: min(520px, calc(100svh - 24px));
  }

  .blackjack-terminal__output {
    padding: 16px;
  }

  .blackjack-terminal__line {
    font-size: 12px;
  }

  .blackjack-terminal__prompt {
    padding: 0 16px;
  }

  .blackjack-terminal__input {
    font-size: 16px;
  }
}
