/* ============================================================
   Divano - 3D Preview Layer  (2026, v1)
   Styles the lazy <model-viewer> modal opened by js/divano-3d.js,
   plus the reusable "Preview 3D" button (.dv3d-btn) and card
   badge (.dv3d-badge). Self-contained: defines its own tokens so
   it works even if load order changes. Deep-teal backdrop, tan
   accents - minimalist architect clarity, on brand.
   ============================================================ */

:root {
  --dv3d-backdrop: rgba(3, 15, 17, 0.96);
  --dv3d-panel: #061a1c;
  --dv3d-tan: #e4d3c0;
  --dv3d-tan-bright: #efe2d1;
  --dv3d-tan-line: rgba(228, 211, 192, 0.26);
  --dv3d-ink: #edf1ef;
  --dv3d-ink-2: #c3cfca;
  --dv3d-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------------------------------------
   1 · OVERLAY / BACKDROP
   ------------------------------------------------------------ */
.dv3d-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;           /* above the projects lightbox + header */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 40px);
  background: var(--dv3d-backdrop);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.32s var(--dv3d-ease);
  overscroll-behavior: contain;
}
.dv3d-overlay.dv3d-in { opacity: 1; }

/* ------------------------------------------------------------
   2 · MODAL PANEL
   ------------------------------------------------------------ */
.dv3d-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(94vw, 1040px);
  height: min(86vh, 760px);
  max-height: 92vh;
  background: linear-gradient(180deg, #08201f 0%, #041416 100%);
  border: 1px solid var(--dv3d-tan-line);
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.36s var(--dv3d-ease);
}
.dv3d-overlay.dv3d-in .dv3d-modal { transform: none; }

/* ------------------------------------------------------------
   3 · HEADER (title + close)
   ------------------------------------------------------------ */
.dv3d-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 14px 22px;
  border-bottom: 1px solid var(--dv3d-tan-line);
  flex: 0 0 auto;
}
.dv3d-title {
  margin: 0;
  font-family: 'Dosis', sans-serif;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 15px;
  color: var(--dv3d-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dv3d-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--dv3d-tan-line);
  border-radius: 50%;
  background: transparent;
  color: var(--dv3d-tan);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.25s var(--dv3d-ease),
    border-color 0.25s var(--dv3d-ease),
    background 0.25s var(--dv3d-ease);
}
.dv3d-close:hover,
.dv3d-close:focus-visible {
  color: var(--dv3d-tan-bright);
  border-color: var(--dv3d-tan);
  background: rgba(228, 211, 192, 0.08);
  outline: none;
}

/* ------------------------------------------------------------
   4 · STAGE (holds the model-viewer)
   ------------------------------------------------------------ */
.dv3d-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 90% at 50% 20%, rgba(228, 211, 192, 0.05), transparent 60%),
    #041416;
}
.dv3d-stage model-viewer {
  width: 100%;
  height: 100%;
  display: block;
  --poster-color: transparent;
  background-color: transparent;
}

/* ------------------------------------------------------------
   5 · SPINNER (tan ring) + hint + error
   ------------------------------------------------------------ */
.dv3d-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--dv3d-ink-2);
  pointer-events: none;
}
.dv3d-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(228, 211, 192, 0.22);
  border-top-color: var(--dv3d-tan);
  animation: dv3d-spin 0.9s linear infinite;
}
.dv3d-loader span {
  font-family: 'Dosis', sans-serif;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}
@keyframes dv3d-spin { to { transform: rotate(360deg); } }

.dv3d-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  text-align: center;
  font-family: 'Dosis', sans-serif;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--dv3d-ink-2);
  opacity: 0.7;
  pointer-events: none;
}

.dv3d-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  color: var(--dv3d-ink-2);
}
.dv3d-error strong {
  color: var(--dv3d-ink);
  font-family: 'Dosis', sans-serif;
  font-weight: 300;
  letter-spacing: 0.1em;
  font-size: 17px;
}
.dv3d-error small { font-size: 13px; opacity: 0.8; }

/* ------------------------------------------------------------
   6 · REUSABLE "Preview 3D" BUTTON  (.dv3d-btn)
   Minimal tan outline + small wireframe-cube glyph.
   Markup only needs: <button class="dv3d-btn" data-preview3d="…">Preview 3D</button>
   ------------------------------------------------------------ */
.dv3d-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-top: 6px;
  padding: 14px 26px;
  border: 1px solid var(--dv3d-tan);
  border-radius: 2px;
  background: var(--dv3d-tan);        /* solid tan - an unmissable CTA */
  color: #06181a;
  font-family: 'Dosis', sans-serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 12px 34px rgba(228, 211, 192, 0.20);
  transition: background 0.28s var(--dv3d-ease),
    transform 0.28s var(--dv3d-ease),
    box-shadow 0.28s var(--dv3d-ease);
}
.dv3d-btn::before {
  content: "";
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: var(--dv3d-cube) center / contain no-repeat;
  mask: var(--dv3d-cube) center / contain no-repeat;
  transition: transform 0.5s var(--dv3d-ease);
}
.dv3d-btn:hover,
.dv3d-btn:focus-visible {
  background: var(--dv3d-tan-bright);
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(228, 211, 192, 0.30);
  outline: none;
}
.dv3d-btn:hover::before,
.dv3d-btn:focus-visible::before { transform: rotate(-35deg) scale(1.06); } /* the cube "turns" - reads as 3D */

/* shared wireframe-cube glyph (data-URI, tinted via mask) */
:root {
  --dv3d-cube: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.5 21 7.5v9L12 21.5 3 16.5v-9z'/%3E%3Cpath d='M12 2.5v19M3 7.5l9 5 9-5'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------
   7 · CARD BADGE  (.dv3d-badge) - tiny cue on a project card
   ------------------------------------------------------------ */
.dv3d-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--dv3d-tan);
  border-radius: 100px;
  background: var(--dv3d-tan);          /* solid tan pill - clearly signals 3D */
  color: #06181a;
  font-family: 'Dosis', sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 10.5px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(3, 15, 17, 0.35);
  transition: transform 0.28s var(--dv3d-ease), background 0.28s var(--dv3d-ease);
}
.dv3d-badge:hover { transform: translateY(-2px); background: var(--dv3d-tan-bright); }
.dv3d-badge::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: var(--dv3d-cube) center / contain no-repeat;
  mask: var(--dv3d-cube) center / contain no-repeat;
}

/* ------------------------------------------------------------
   8 · RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 600px) {
  .dv3d-modal { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .dv3d-title { font-size: 13px; letter-spacing: 0.1em; }
}

/* ------------------------------------------------------------
   9 · REDUCED MOTION - no spin, no panel slide/scale
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .dv3d-overlay,
  .dv3d-modal { transition: none; }
  .dv3d-modal { transform: none; }
  .dv3d-spinner { animation: none; border-top-color: var(--dv3d-tan); }
}
