:root {
  color-scheme: light;
  --background: #ffffff;
  --circle: #000000;
  --ink: #000000;
  --margin: clamp(18px, 3vw, 40px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--background);
  color: var(--ink);
}

/* Keep the document canvas painted, including the area sampled by browser UI. */
body { position: relative; }

.viewport-fill {
  position: fixed;
  z-index: 0;
  inset: 0;
  min-height: 100vh;
  min-height: 100lvh;
  background-color: var(--background);
  pointer-events: none;
}

.artwork {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--background);
  touch-action: pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
}

.artwork.is-dragging { cursor: grabbing; }

.circle {
  /* 1,388 px across a 2,000 px reference. Keep both axes identical. */
  width: 69.4vmin;
  width: min(69.4vw, 69.4dvh);
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--circle);
  pointer-events: none;
}

.quiet-control {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.contact {
  position: fixed;
  z-index: 1;
  top: max(var(--margin), calc(var(--safe-top) + 12px));
  right: max(var(--margin), calc(var(--safe-right) + 12px));
  min-width: 68px;
  min-height: 44px;
  margin-top: -12px;
  text-align: right;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .07em;
  line-height: 1;
}

.copyright {
  position: fixed;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 8px max(var(--margin), calc(var(--safe-right) + 12px))
    max(var(--margin), calc(var(--safe-bottom) + 12px))
    max(var(--margin), calc(var(--safe-left) + 12px));
  color: var(--ink);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: .045em;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Paint the bottom edge without masking the circle in short landscape views. */
.copyright::after {
  content: "";
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  left: 0;
  height: max(100px, var(--safe-bottom));
  background-color: var(--background);
}

.quiet-control:hover { text-decoration: underline; text-underline-offset: 4px; }
.quiet-control:focus-visible,
.email:focus-visible {
  outline: 1.5px solid currentColor;
  outline-offset: 5px;
}

.ticket {
  position: fixed;
  inset: 0;
  width: min(620px, calc(100vw - max(20px, var(--safe-left)) - max(20px, var(--safe-right))));
  height: clamp(150px, calc((100vw - 40px) / 2.3), 270px);
  max-width: none;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - max(20px, var(--safe-top)) - max(20px, var(--safe-bottom)));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 1px;
  overflow: hidden;
  color: #141414;
  background: rgb(245 242 233 / 61.6%);
  -webkit-backdrop-filter: blur(3px) saturate(1.06);
  backdrop-filter: blur(3px) saturate(1.06);
  box-shadow: 0 2px 18px rgb(0 0 0 / 4%);
}

.ticket::backdrop { background: transparent; }

.ticket::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -80%;
  left: -45%;
  width: 58%;
  height: 260%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgb(140 186 199 / 22%) 26%,
    rgb(244 239 158 / 26.4%) 51%,
    rgb(220 133 126 / 16.5%) 72%,
    transparent 100%);
  filter: blur(7px);
  transform: translateX(90%) rotate(18deg);
  pointer-events: none;
}

.ticket[open]::before { animation: refracted-light 22s linear infinite alternate; }

.ticket-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 32px 36px;
  display: flex;
  align-items: center;
}

.email {
  display: inline-block;
  max-width: 100%;
  color: inherit;
  font-size: clamp(18px, 5vw, 31px);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  user-select: text;
  -webkit-user-select: text;
  -webkit-tap-highlight-color: transparent;
}

.email:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

.close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.copy {
  position: absolute;
  bottom: 12px;
  left: 36px;
  min-width: 44px;
  min-height: 44px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .08em;
  text-align: left;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes refracted-light {
  from { transform: translateX(25%) rotate(18deg); }
  to { transform: translateX(245%) rotate(18deg); }
}

@media (min-width: 900px) {
  .contact { font-size: 12px; }
}

@media (max-width: 480px) {
  .ticket-content { padding: 24px; }
  .copy { left: 24px; bottom: 8px; }
  .close { top: 4px; right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticket[open]::before { animation: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .ticket { background: #f5f2e9; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .ticket::before { display: none; }
}

@media (forced-colors: active) {
  .artwork, .circle { forced-color-adjust: none; }
  .ticket { background: Canvas; border: 1px solid CanvasText; color: CanvasText; }
  .ticket::before { display: none; }
}
