  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { height: 100%; overflow: hidden; background: #000; }
  #gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

  #ui {
    position: fixed; inset: 0; z-index: 5;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    pointer-events: none;
    font-family: 'Times New Roman', Times, serif;
    color: #f2f2ee;
  }
  #ui h1 {
    font-weight: 400;
    font-size: clamp(44px, 8vw, 104px);
    letter-spacing: 0.05em;
    line-height: 1.02;
    text-align: center;
    text-shadow: 0 0 26px rgba(0,0,0,0.75), 0 0 60px rgba(0,0,0,0.5);
  }
  #links {
    position: fixed; bottom: clamp(16px, 4vw, 30px); left: 50%; transform: translateX(-50%); z-index: 6;
    display: flex; justify-content: center; align-items: center; gap: clamp(12px, 3vw, 16px);
    max-width: calc(100vw - 20px); box-sizing: border-box;
    font-family: 'Times New Roman', Times, serif;
    padding: clamp(10px, 2.6vw, 13px);
    border-radius: clamp(23px, 5.6vw, 29px);
    /* liquid glass */
    background: linear-gradient(rgba(255,255,255,0.16), rgba(255,255,255,0.05));
    backdrop-filter: blur(18px) saturate(165%);
    -webkit-backdrop-filter: blur(18px) saturate(165%);
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 10px 34px rgba(0,0,0,0.38),
                inset 0 1px 0 rgba(255,255,255,0.35),
                inset 0 -1px 0 rgba(255,255,255,0.06);
  }
  #links a {
    color: rgba(255, 255, 255, 0.82);
    display: flex; align-items: center; justify-content: center;
    width: clamp(40px, 10vw, 48px);
    height: clamp(40px, 10vw, 48px);
    border-radius: 26%;
    /* frosted app tile */
    background: linear-gradient(160deg, rgba(255,255,255,0.30), rgba(255,255,255,0.10) 55%, rgba(255,255,255,0.16));
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.28);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35),
                inset 0 1px 0 rgba(255,255,255,0.45),
                inset 0 -1px 1px rgba(255,255,255,0.08);
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
  }
  #links a svg {
    width: 68%;
    height: 68%;
    display: block;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.35));
  }
  #links a:hover {
    color: #ffffff;
    transform: scale(1.12) translateY(-3px);
    background: linear-gradient(160deg, rgba(255,255,255,0.42), rgba(255,255,255,0.16) 55%, rgba(255,255,255,0.24));
  }
  .tintlayer {
    position: fixed; inset: 0; z-index: 4;
    pointer-events: none;
    opacity: 0;
    transform: scale(1);
    transition: opacity 0.6s ease, transform 0.5s ease;
    mix-blend-mode: color;
    will-change: transform;
  }
  /* the rainbow (and any tint) rides the dive: the gradient blows up past the
     edges at the same cadence as the visualizer's zoom into the pattern */
  body.info-open .tintlayer { transform: scale(3.4); transition: opacity 0.6s ease, transform 1.1s cubic-bezier(0.5, 0, 0.85, 0.4); }
  #links a { position: relative; }
  .copytip {
    position: absolute; bottom: calc(100% + 14px); left: 50%;
    transform: translateX(-50%) translateY(4px);
    font-size: 12px; letter-spacing: 0.08em; white-space: nowrap;
    color: rgba(255,255,255,0.92);
    background: rgba(18,18,18,0.6);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 10px; padding: 5px 11px;
    opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
  }
  .copytip.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  #ui, #links { transition: opacity 0.6s ease; }
  body.info-open #ui, body.info-open #links { opacity: 0; pointer-events: none; }
  /* the back room: a 3d corridor of glass panels floating over the visualizer */
  #info {
    position: fixed; inset: 0; z-index: 8;
    opacity: 0; pointer-events: none;
    transition: opacity 0.7s ease;
    font-family: 'Times New Roman', Times, serif;
    color: #f2f2ee;
    touch-action: none;
    cursor: default;
  }
  #info.open { opacity: 1; pointer-events: auto; }
  #info.dragging { cursor: default; }
  #cam { position: absolute; inset: 0; perspective: 1000px; overflow: hidden; }
  #world { position: absolute; inset: 0; transform-style: preserve-3d; }
  .panel {
    position: absolute;
    left: 50%;
    top: clamp(90px, 16vh, 170px);
    width: min(400px, 76vw);
    text-align: center;
    will-change: transform, opacity;
  }
  .panel h2 {
    font-weight: 400; font-style: normal;
    font-size: clamp(13px, 2vw, 15px);
    text-transform: uppercase;
    letter-spacing: 0.34em;
    color: rgba(255,255,255,0.75);
    text-shadow: 0 1px 6px rgba(0,0,0,0.85), 0 0 22px rgba(0,0,0,0.55);
    margin-bottom: 1.1em;
  }
  .panel h2::after {
    content: ''; display: block;
    width: 38px; height: 1px; margin: 1em auto 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.6), transparent);
  }
  .panel p {
    font-size: clamp(17px, 2.8vw, 21px); line-height: 1.6;
    color: #fff;
    text-shadow: 0 1px 5px rgba(0,0,0,0.85), 0 0 26px rgba(0,0,0,0.6);
  }
  .panel .foot {
    position: absolute;
    left: 50%; transform: translateX(-50%);
    top: calc(86vh - clamp(90px, 16vh, 170px));
    font-size: clamp(15px, 2.2vw, 18px);
    white-space: nowrap;
  }
  a.homebtn { text-decoration: none; }
  .homebtn {
    display: inline-block; padding: 2px 14px; margin: 0 2px;
    border-radius: 12px; cursor: pointer;
    color: rgba(255,255,255,0.95);
    background: linear-gradient(160deg, rgba(255,255,255,0.30), rgba(255,255,255,0.10));
    border: 1px solid rgba(255,255,255,0.28);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.4);
    transition: transform 0.25s ease, background 0.25s ease;
  }
  .homebtn:hover {
    transform: scale(1.08);
    background: linear-gradient(160deg, rgba(255,255,255,0.42), rgba(255,255,255,0.18));
  }
  #infoClose {
    position: absolute; top: clamp(16px, 3vw, 26px); right: clamp(16px, 3vw, 26px);
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; line-height: 1; cursor: pointer;
    color: rgba(255,255,255,0.85);
    background: linear-gradient(160deg, rgba(255,255,255,0.30), rgba(255,255,255,0.10));
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.28);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.45);
    transition: transform 0.25s ease;
  }
  #infoClose:hover { transform: scale(1.1); }
  #bc {
    position: fixed; inset: 0; width: 100%; height: 100%;
    object-fit: cover;
    z-index: 7; background: #000;
    opacity: 0;
    filter: saturate(1) contrast(1) brightness(1);
    transition: opacity 1.1s ease, filter 0.8s ease;
    pointer-events: none;
  }
  #bc.on { opacity: 1; }
  #bc.entering { animation: bcMoshIn 1.1s both; }
  #bc.closing { transition: opacity 1.9s ease, filter 0.8s ease; }
  #bc.closing.quick-return { transition: opacity 1s ease, filter 1s ease; }
  @keyframes bcMoshIn {
    0%, 38% { opacity: 0; transform: scale(1.08) translate3d(0, 0, 0); filter: brightness(0.35) saturate(3) contrast(1.8); }
    39% { opacity: 0.12; transform: scale(1.065) translate3d(-1.8%, 0.8%, 0); filter: brightness(0.42) saturate(3.4) contrast(2); }
    47% { opacity: 0.34; transform: scale(1.045) translate3d(1.2%, -0.5%, 0); filter: brightness(0.58) saturate(2.7) contrast(1.7); }
    58% { opacity: 0.62; transform: scale(1.025) translate3d(-0.5%, 0, 0); filter: brightness(0.78) saturate(2) contrast(1.4); }
    72% { opacity: 0.86; transform: scale(1.01) translate3d(0.3%, 0, 0); filter: brightness(0.94) saturate(1.35) contrast(1.15); }
    100% { opacity: 1; transform: scale(1) translate3d(0, 0, 0); filter: brightness(1) saturate(1) contrast(1); }
  }
  @media (max-width: 600px) {
    #links { gap: 4.6vw; padding: 3.2vw; border-radius: 7.6vw; }
    #links a { width: 14vw; height: 14vw; }
  }
