/* ==========================================================================
   Page layout: the frame, the grey card and the "?" button
   ========================================================================== */

:root {
  --page: #fff;
  --card: #d9d9d9;
  --ink: #000;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

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

html { scroll-padding-top: env(safe-area-inset-top, 0px); }

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

body {
  background: var(--page);
  font-family: "Inter", system-ui, sans-serif;
  overflow: hidden;
}

.frame {
  height: 100%;
  padding: clamp(12px, 2.1vw, 32px);
}

.card {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--card);
  border-radius: clamp(20px, 1.4vw, 52px);
  touch-action: none;
  cursor: grab;
}
.card.dragging { cursor: grabbing; }

/* The lettering, centred on the card: white and mostly see-through */
.card .hvge-glass {
  --hvge-glass-color: #fff;
  --hvge-glass-opacity: 0.2;
  position: absolute;
  top: 50%;
  left: 6%;
  width: 88%;
  transform: translateY(-50%);
}

/* "?" button that opens the About dialog */
.help {
  position: absolute;
  right: clamp(16px, 2.2vw, 34px);
  bottom: clamp(16px, 2.2vw, 34px);
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: 600 14px/1 "Inter", system-ui, sans-serif;
  cursor: pointer;
}
.help:focus-visible { outline: 2px solid #000; outline-offset: 3px; }

/* Phones held upright: the lettering runs along the card's length.
   Keep this query in sync with UPRIGHT_QUERY in js/glass.js and js/word-column.js. */
@media (max-width: 700px) and (orientation: portrait) {
  .card { container-type: size; }

  .card .hvge-glass {
    left: 50%;
    width: auto;
    height: min(94cqh, calc(88cqw * 1342 / 406));
    aspect-ratio: 406 / 1342;
    transform: translate(-50%, -50%);
  }

  /* Lettering turned 90°: use the pre-rotated masks */
  .card .hvge-glass__lens--fill {
    -webkit-mask-image: url("../assets/glass-silhouette-upright.png");
    mask-image: url("../assets/glass-silhouette-upright.png");
  }
  .card .hvge-glass__lens--strokes {
    -webkit-mask-image: url("../assets/glass-shape-upright.png");
    mask-image: url("../assets/glass-shape-upright.png");
  }
}
