.home-page {
  --glass-1x: url("/assets/blue-glass-panels.webp?v=smooth-glass");
  --glass-2x: url("/assets/blue-glass-panels@2x.webp");
}
.home-glass, .home-page .panel-close { --glass-poster: var(--glass-1x); }
@supports (background-image: image-set(url("") 1x)) {
  .home-glass, .home-page .panel-close {
    --glass-poster: image-set(var(--glass-1x) 1x, var(--glass-2x) 2x);
  }
}
.home-page::before { content: none; }
.home-glass {
  --glass-width: 1440;
  --glass-height: 943;
  --copy-shade: radial-gradient(ellipse 43% 29% at 84% 58%, #03081752 24%, transparent 100%);
  grid-area: 1 / 1 / 3 / 2;
  position: relative;
  z-index: -1;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
  pointer-events: none;
  background-color: #050919;
  background-image: var(--glass-poster), var(--glass-preview, none);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.home-glass canvas, .home-glass::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.home-glass canvas { display: block; opacity: 0; }
.home-glass canvas[data-ready] { opacity: 1; }
.home-glass::after {
  content: "";
  background:
    var(--copy-shade),
    linear-gradient(to bottom, #03061666, transparent 20%, transparent 65%, var(--bg) 100%),
    linear-gradient(110deg, #02061138, transparent 42%, #02061225);
}
@media (max-width: 800px) {
  .home-glass {
    --copy-shade: linear-gradient(to bottom, transparent 41%, #03071855 58%, #04081580 77%, transparent);
  }
}
@media (max-width: 800px) and (orientation: portrait) {
  .home-glass {
    --glass-1x: url("/assets/blue-glass-panels-mobile.webp?v=smooth-glass");
    --glass-2x: url("/assets/blue-glass-panels-mobile@2x.webp");
    --glass-width: 390;
    --glass-height: 819;
  }
}
.home-page .panel-close {
  background-image:
    linear-gradient(to bottom, var(--bg), transparent 40%, transparent 58%, var(--bg)),
    linear-gradient(90deg, #040719cb, #04071910 85%),
    var(--glass-poster);
}

.chess-composition {
  position: relative;
  isolation: isolate;
  height: clamp(438px, calc(100svh - clamp(84px, 7.6vw, 128px) - 180px), 700px);
}

.chess-hero h1 {
  margin: 0;
  color: #f5f5f2;
  font: 390 clamp(46px, 5.55vw, 102px)/.98 var(--site-font);
  letter-spacing: -.049em;
}

.headline-opening, .headline-ending {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.headline-opening { top: 19%; left: 0; }
.headline-ending { right: 0; bottom: 22%; text-align: right; }
.headline-ending span { display: block; }

.chess-stage {
  position: absolute;
  top: 0;
  bottom: 28px;
  left: 46%;
  width: 53%;
  transform: translateX(-50%);
  overflow: clip;
  container-type: size;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}

.chess-stage:focus-visible { outline: 2px solid #80aaff; outline-offset: -3px; }
/* Match the camera's vertical fit and its minimum horizontal field of view.
   Sharing one frame keeps the still and the live sculpture registered at every size. */
.chess-framing {
  position: absolute;
  left: 50%;
  top: 50%;
  height: min(100cqh, calc(100cqw * 2.23 / 1.79));
  aspect-ratio: 3 / 2;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.chess-framing canvas, .chess-poster, .chess-poster img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.chess-poster {
  background: var(--chess-preview, none) center / 100% 100% no-repeat;
}
.chess-poster[data-ready] { background-image: none; }
.chess-framing canvas { opacity: 0; }
.chess-stage[data-renderer="webgl"] canvas { opacity: 1; }
.chess-stage[data-renderer="webgl"] .chess-poster { visibility: hidden; }
.chess-poster-king { opacity: var(--reflection, 0); }

.chess-hint {
  visibility: hidden;
  position: absolute;
  bottom: 0;
  left: 46%;
  margin: 0;
  padding-block: 8px;
  transform: translateX(-50%);
  color: #d4daea;
  text-align: center;
  font: 450 13px/1.4 var(--site-font);
}
.chess-stage[role="slider"] + .chess-hint { visibility: visible; }
.hint-touch, .hint-keys { display: none; }
.chess-stage:focus-visible + .chess-hint :is(.hint-mouse, .hint-touch) { display: none; }
.chess-stage:focus-visible + .chess-hint .hint-keys { display: inline; }

.chess-hero-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(22px, 3vw, 46px) 0 clamp(36px, 4vw, 68px);
}

.chess-hero-footer p {
  max-width: 48ch;
  margin: 0;
  color: #bdc3cd;
  font: 400 clamp(16px, 1.22vw, 21px)/1.45 var(--site-font);
}

.chess-hero-footer .actions { gap: clamp(18px, 2.2vw, 38px); }
.chess-hero-footer .button, .chess-hero-footer .underlined {
  font-size: clamp(16px, 1.2vw, 20px);
}

.home-perception {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: clamp(44px, 6vw, 96px);
  border-top: 1px solid #343945;
}

.home-perception h2 { font-size: clamp(32px, 4.4vw, 70px); }
.home-perception a { flex: none; }

@media (hover: none) {
  .hint-mouse { display: none; }
  .hint-touch { display: inline; }
}

@media (max-width: 800px) {
  .chess-composition {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto clamp(230px, min(73vw, 37svh), 355px) auto auto;
    height: auto;
    padding-top: 18px;
  }
  .chess-hero h1 {
    display: grid;
    grid-area: 1 / 1 / 4 / 2;
    grid-template-rows: subgrid;
    pointer-events: none;
    font-size: clamp(40px, 12.5vw, 78px);
  }
  .headline-opening, .headline-ending { position: static; grid-column: 1; }
  .headline-opening { grid-row: 1; }
  .headline-ending { grid-row: 3; }
  .chess-stage {
    position: relative;
    inset: auto;
    grid-area: 2 / 1;
    width: 100%;
    transform: none;
  }
  .chess-hint {
    position: static;
    grid-area: 4 / 1;
    text-align: right;
    transform: none;
  }
  .chess-hero-footer { align-items: start; flex-direction: column; gap: 18px; padding-top: 20px; }
  .home-perception { align-items: start; flex-direction: column; gap: 16px; }
}

@media (max-width: 650px) {
  .home-page .header { padding-block: 24px 12px; gap: 14px; }
  .home-page .header nav { justify-content: space-between; column-gap: 8px; }
  .home-page .header nav a:not(.outline) { padding-block: 6px; }
  .home-page .header .outline { position: absolute; top: 18px; right: 0; }
}

@media (max-width: 800px) and (hover: none) {
  .chess-hero h1 { grid-row: 1 / 5; }
  .headline-ending { grid-row: 4; }
  .chess-hint {
    grid-row: 3;
    text-align: center;
    padding-block: 0 14px;
  }
}

@media (max-width: 370px) {
  .home-page .header nav { column-gap: 5px; font-size: 12px; }
  .home-page .home-brand-slot { width: 164px; }
}
