html.quartz-at-entrance { background: #000; }
#quartz-intro {
  --inset: clamp(24px, 6vw, 108px);
  --warm-white: #f2efe8;
  position: relative;
  z-index: 1000;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  min-height: 38rem;
  height: 100vh;
  height: 100svh;
  background: #000;
  color: var(--warm-white);
  font-family: "Segoe UI", Arial, sans-serif;
}
#quartz-intro a, #quartz-intro button { -webkit-tap-highlight-color: transparent; }
#quartz-intro a:focus-visible, #quartz-intro button:focus-visible { outline: 2px solid #e8d3a9; outline-offset: 6px; }
.quartz-skip, .quartz-replay, .quartz-enter { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.quartz-skip { position: absolute; z-index: 4; right: var(--inset); top: max(16px, env(safe-area-inset-top)); color: #bebbb6; text-underline-offset: 5px; font-size: .875rem; text-decoration-color: #67655f; }
.quartz-composition { position: relative; align-self: center; margin: 0 auto; width: min(100%, 1860px); height: 100%; }
.quartz-sculpture {
  position: absolute;
  top: 49%;
  right: 3.2%;
  transform: translateY(-50%);
  width: min(54vw, 91svh, 925px);
  aspect-ratio: 1;
}
.quartz-stone, .quartz-glint { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.quartz-stone { object-fit: contain; }
.quartz-glint {
  pointer-events: none;
  opacity: 0;
  background: center / contain no-repeat url("media/crystal-opening/quartz.webp");
  filter: brightness(2.5) contrast(1.08);
  mix-blend-mode: screen;
  mask-image: linear-gradient(112deg, transparent 37%, rgb(0 0 0 / .25) 44%, #000 49%, rgb(0 0 0 / .33) 52%, transparent 60%);
  mask-size: 320% 100%;
  mask-repeat: no-repeat;
}
.quartz-caption { position: absolute; z-index: 1; top: 45%; left: var(--inset); width: 46%; transform: translateY(-28%); }
.quartz-ellipsis { display: flex; gap: 11px; align-items: center; height: 10px; margin: 0 0 clamp(20px, 2.8vh, 32px) 3px; }
.quartz-ellipsis i { display: block; width: 5px; height: 5px; border-radius: 50%; background: #d5cab5; }
.quartz-ellipsis i:nth-child(2) { opacity: .76; }
.quartz-ellipsis i:nth-child(3) { opacity: .52; }
.quartz-lines p { margin: 0; font-size: clamp(48px, 5.7vw, 97px); font-weight: 550; letter-spacing: -.064em; line-height: 1.025; }
.quartz-sr-copy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.quartz-word { white-space: nowrap; }
.quartz-lines em { display: block; font: italic 400 1.12em/.99 'Surface Serif', Georgia, serif; letter-spacing: -.046em; color: #d5d0c6; text-wrap: balance; }
.quartz-lines .quartz-invitation { font-size: clamp(44px, 5.2vw, 83px); }
.quartz-lines .quartz-invitation em { max-width: 12ch; }
#quartz-intro:not([data-play]) .quartz-invitation { font: 400 clamp(16px, 1.5vw, 23px)/1.5 'Segoe UI', Arial, sans-serif; letter-spacing: -.015em; margin-top: 20px; color: #d5d0c6; }
#quartz-intro:not([data-play]) .quartz-invitation em { display: inline; font: inherit; letter-spacing: inherit; }
.quartz-controls { position: absolute; left: var(--inset); right: var(--inset); bottom: max(23px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; z-index: 3; }
.quartz-enter { margin-left: auto; text-decoration: none; border: 1px solid #8a8780; border-radius: 999px; padding: 0 22px; font-size: .9375rem; font-weight: 550; color: var(--warm-white); background: #000; transition: background .2s, color .2s; }
.quartz-enter:hover { background: var(--warm-white); color: #141412; }
.quartz-replay { color: #c9c6bf; padding: 0 5px 0 0; background: none; border: 0; gap: 8px; font-size: .875rem; }
.quartz-replay[hidden] { display: none; }
.quartz-replay svg { width: 19px; height: 19px; }
.quartz-playback { display: flex; align-items: center; gap: 6px; }
.quartz-pause { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -10px; padding: 0; border: 0; color: #c9c6bf; background: transparent; cursor: pointer; }
.quartz-pause svg { width: 18px; height: 18px; }
.quartz-pause[hidden], .quartz-resume-icon, #quartz-intro[data-paused] .quartz-pause-icon { display: none; }
#quartz-intro[data-paused] .quartz-resume-icon { display: block; }
@media all {
  #quartz-intro[data-play] .quartz-lines { display: grid; }
  #quartz-intro[data-play] .quartz-lines p { grid-area: 1 / 1; }
  #quartz-intro[data-play] .quartz-ellipsis i { animation: quartz-dot .5s both !important; }
  #quartz-intro[data-play] .quartz-ellipsis i:nth-child(2) { animation-delay: .18s !important; }
  #quartz-intro[data-play] .quartz-ellipsis i:nth-child(3) { animation-delay: .36s !important; }
  #quartz-intro[data-play] .quartz-stone { animation: quartz-reveal 1.7s .47s cubic-bezier(.19,.66,.2,1) both !important; }
  #quartz-intro[data-play] .quartz-glint { animation: quartz-sweep 12s .75s ease-in-out infinite both !important; }
  #quartz-intro[data-play] .quartz-question { animation: quartz-question-out .52s var(--question-exit) both !important; }
  #quartz-intro[data-play] .quartz-letter { animation: quartz-letter-in var(--letter-fade) var(--letter-at) ease-out both !important; }
  #quartz-intro[data-play] .quartz-enter { animation: quartz-controls-in .55s 1.35s both !important; }
  #quartz-intro[data-play]:is([data-paused],[data-away],[data-tab-hidden]) [class^="quartz-"],
  #quartz-intro[data-play]:is([data-paused],[data-away],[data-tab-hidden]) .quartz-ellipsis i { animation-play-state: paused !important; }
}
@keyframes quartz-dot { from { opacity: 0; transform: scale(.55); } }
@keyframes quartz-reveal { from { opacity: 0; filter: brightness(.3); transform: scale(.965); } to { opacity: 1; filter: brightness(1); transform: scale(1); } }
/* A two-second outward pass, three seconds off the crystal, then a softer return. */
@keyframes quartz-sweep {
  0%     { mask-position: 100% 0; opacity: 0; }
  4%     { mask-position: 82% 0; opacity: .88; }
  13%    { mask-position: 22% 0; opacity: .88; }
  17%,42% { mask-position: 0% 0; opacity: 0; }
  46%    { mask-position: 21% 0; opacity: .76; }
  55%    { mask-position: 80% 0; opacity: .76; }
  59%,100% { mask-position: 100% 0; opacity: 0; }
}
@keyframes quartz-question-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes quartz-letter-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes quartz-controls-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 700px) and (orientation: portrait) {
  #quartz-intro { min-height: 540px; }
  .quartz-sculpture { width: min(108vw, 54svh); top: 6.7%; right: 50%; transform: translateX(50%); }
  .quartz-caption { top: auto; bottom: 15%; width: calc(100% - var(--inset) * 2); transform: none; }
  .quartz-ellipsis { margin-bottom: 16px; }
  .quartz-lines p { font-size: clamp(43px, 11.6vw, 68px); }
  .quartz-lines .quartz-invitation { font-size: clamp(37px, 9.7vw, 60px); }
  .quartz-lines .quartz-invitation em { max-width: 15ch; }
  .quartz-glint { background-image: url("media/crystal-opening/quartz-small.webp"); }
}
@media (min-width: 701px) and (max-aspect-ratio: 1/1) {
  .quartz-sculpture { width: min(74vw, 53svh); top: 5%; right: 50%; transform: translateX(50%); }
  .quartz-caption { top: 62%; left: 13%; width: 76%; transform: none; }
  .quartz-lines .quartz-invitation em { max-width: none; }
}
@media (orientation: landscape) and (max-height: 620px) {
  #quartz-intro { min-height: 315px; }
  .quartz-sculpture { width: min(51vw, 86svh); }
  .quartz-lines p { font-size: clamp(34px, 5.1vw, 62px); }
  .quartz-lines .quartz-invitation { font-size: clamp(30px, 4.6vw, 56px); }
  .quartz-controls { bottom: 9px; }
}
