/* The 3D model page: the model fills the screen, the title and the view buttons float over it. */
:root { --ink: #142235; --soft: #526077; --paper: #f1efeb; --red: #d81f26; --glass: rgba(255, 255, 255, .84); --lift: 0 10px 30px -18px rgba(20, 34, 53, .5); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); font-family: Manrope, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
.m3d { position: fixed; inset: 0; }
.m3d canvas { display: block; touch-action: none; }

.m3d__title { position: fixed; z-index: 2; left: 16px; top: 16px; display: grid; grid-template-columns: auto; gap: 2px; max-width: calc(100% - 300px); padding: 12px 16px 14px; border-radius: 14px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--lift); }
.m3d__back { justify-self: start; margin-bottom: 6px; color: var(--soft); font-size: 13px; font-weight: 700; text-decoration: none; }
.m3d__back:hover { color: var(--ink); }
.m3d__name small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.m3d__name strong { display: block; margin-top: 2px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.m3d__more { margin: 2px 0 0; font-size: 14px; color: var(--soft); }
.m3d__more span { font-size: 12px; }
.m3d__info { display: none; }

.m3d__views { position: fixed; z-index: 2; right: 16px; top: 16px; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--lift); }
.m3d__views button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: none; font: 700 14px Manrope, sans-serif; color: var(--soft); cursor: pointer; }
.m3d__views button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.m3d__tip { position: fixed; z-index: 3; padding: 8px 12px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; pointer-events: none; transform: translate(-50%, calc(-100% - 14px)); opacity: 0; transition: opacity .15s; }
.m3d__tip span { opacity: .7; font-weight: 600; }
.m3d__hint { position: fixed; z-index: 2; left: 50%; bottom: 16px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--glass); font-size: 13px; font-weight: 600; color: var(--soft); text-align: center; pointer-events: none; transition: opacity .4s; }
.m3d__hint.is-gone { opacity: 0; }

.m3d__loading, .m3d__failed { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: max-content; max-width: calc(100% - 48px); margin: 0; font-size: 15px; font-weight: 700; color: var(--soft); text-align: center; }
.m3d__failed { display: none; }
.m3d__failed a { color: var(--ink); }
.m3d.is-ready .m3d__loading, .m3d.is-failed .m3d__loading { display: none; }
.m3d.is-failed .m3d__failed { display: block; }

/* phones: the model gets the screen; one line on top, the views under the thumb */
@media (max-width: 600px) {
  .m3d__title { left: 10px; right: 10px; top: calc(10px + env(safe-area-inset-top)); max-width: none; grid-template-columns: auto 1fr auto; align-items: center; gap: 0 10px; padding: 6px 8px 6px 6px; border-radius: 12px; }
  .m3d__back { display: grid; place-items: center; width: 34px; height: 34px; margin: 0; border-radius: 50%; background: #fff; border: 1px solid #d5d9df; color: var(--ink); font-size: 16px; }
  .m3d__back-text, .m3d__name .long { display: none; }
  .m3d__name { min-width: 0; }
  .m3d__name small, .m3d__name strong { display: inline; margin: 0; }
  .m3d__name small { font-size: 11px; }
  .m3d__name small::after { content: " "; }
  .m3d__name strong { font-size: 15px; white-space: nowrap; }
  .m3d__info { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #d5d9df; border-radius: 50%; background: #fff; font: 800 14px Manrope, sans-serif; color: var(--ink); cursor: pointer; }
  .m3d__title.is-open .m3d__info { background: var(--ink); border-color: var(--ink); color: #fff; }
  .m3d__more { display: none; grid-column: 1 / -1; padding: 4px 6px 4px; font-size: 13px; }
  .m3d__title.is-open .m3d__more { display: block; }
  .m3d__views { left: 10px; right: 10px; top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); justify-content: space-between; }
  .m3d__views button { flex: 1; min-height: 44px; padding: 0 8px; }
  .m3d__hint { bottom: calc(76px + env(safe-area-inset-bottom)); border-radius: 14px; }
}
