@font-face {
  font-family: "Neue Montreal";
  src: url("fonts/PPNeueMontreal-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #000; color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  background: #000;
  overflow-x: clip;
}

.hero {
  height: 100vh;
  height: 100dvh;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.keyboard {
  flex-shrink: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(8px, 1.15vw, 19px);
  width: min(1460px, calc(100% - 64px));
  margin: 0 auto;
  height: clamp(90px, 19vw, 290px);
  align-items: center;
}

.scene { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.has-3d .keycap { visibility: hidden; }

.greeting, .scroll-caption {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: calc(50% + clamp(26px, 6.2vw, 96px) + 22px);
  margin: 0;
  color: #ffffff;
  font: 400 clamp(24px, 2.4vw, 36px) "Neue Montreal", "Inter", Arial, sans-serif;
  line-height: 1.4;
  text-align: center;
  letter-spacing: -0.025em;
  pointer-events: none;
}

.scroll-caption {
  position: static;
}

.details {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: auto;
  top: calc(50% + clamp(26px, 6.2vw, 96px) + 22px);
}

.contacts {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  color: #666;
  font: 400 clamp(17px, 1.5vw, 21px) "Neue Montreal", "Inter", Arial, sans-serif;
}

.contacts a { color: #929292; text-decoration: none; transition: color 180ms ease; }
.contacts a:hover, .contacts a:focus-visible { color: #fff; }
.contacts a:focus-visible { outline: 1px solid #999; outline-offset: 5px; border-radius: 2px; }

.has-3d .greeting, .has-3d .details {
  opacity: var(--greeting-reveal, 0);
  transform: translateY(calc(8px * (1 - var(--greeting-reveal, 0))));
}

.key {
  --rx: -5deg;
  --ry: 0deg;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 27%;
  background: transparent;
  perspective: 700px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.key:nth-child(1) { --ry: -8deg; }
.key:nth-child(2) { --ry: -5deg; }
.key:nth-child(3) { --ry: -2deg; }
.key:nth-child(5) { --ry: 2deg; }
.key:nth-child(6) { --ry: 5deg; }
.key:nth-child(7) { --ry: 8deg; }

.keycap {
  color: #ffffff;
  font: 600 clamp(16px, 4.5vw, 68px) Arial, sans-serif;
  align-content: center;
  text-align: center;
  position: absolute;
  inset: 0 0 8px;
  display: block;
  border: 1px solid #454545;
  border-radius: inherit;
  background: #030303;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  box-shadow:
    inset 1px 1px 1px #8a8a8a,
    inset -1px -1px 1px #262626,
    inset 3px 3px 2px #151515,
    0 2px 0 #242424,
    0 4px 0 #101010,
    0 6px 0 #373737,
    0 7px 0 #111,
    0 9px 0 #070707,
    0 10px 0 #252525,
    0 15px 15px #000;
  transition: transform 220ms ease-out, background 220ms, box-shadow 220ms;
  pointer-events: none;
}

.keycap::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 25%;
  border: 1px solid transparent;
  border-top-color: #171717;
  border-left-color: #111;
  border-bottom-color: #1c1c1c;
  background: linear-gradient(135deg, #ffffff03, transparent 35%);
}

.keycap::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid transparent;
  border-radius: inherit;
  border-top-color: #ffffff28;
  border-left-color: #ffffff15;
  mask-image: linear-gradient(135deg, #000, transparent 65%);
}

.key:hover .keycap { background: #090909; }

@media (max-width: 600px) {
  .keyboard { width: calc(100% - 28px); gap: 6px; }
  .keycap { bottom: 5px; }
}

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

@media (max-width: 760px) {
  .scroll-caption { max-width: 28ch; margin: 0 auto; font-size: clamp(17px, 4.3vw, 22px); line-height: 1.45; }
  .contacts { gap: 12px; margin-top: 16px; font-size: 16px; }
  .contacts a { display: inline-flex; align-items: center; min-height: 44px; }
}
