:root {
  --bg-color: #050505;
  --text-color: #f0f0f0;
  --accent-color: #ffffff;
  --brand-color: #3b82f6;
  --font-main: 'Inter', sans-serif;
  --font-mono: 'Space Grotesk', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-main);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

#showroomRoot {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh; /* Fixes mobile URL bar cutoff */
  overflow: hidden;
  z-index: 1;
}

#c {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh; /* Fixes mobile URL bar cutoff */
  z-index: 1;
  outline: none;
}

/* ================= LOADING SCREEN ================= */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh; /* Fixes mobile URL bar cutoff */
  background-color: #000;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  text-align: center;
  width: 300px;
}

.loader-logo {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  margin-bottom: 0.5rem;
}

.loader-sub {
  font-size: 0.8rem;
  color: #666;
  letter-spacing: 0.3em;
  margin-bottom: 2rem;
}

.loader-bar-wrap {
  width: 100%;
  height: 2px;
  background-color: #222;
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}

.loader-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background-color: #fff;
  transition: width 0.1s linear;
}

.loader-hint {
  font-size: 0.7rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ================= HUD ================= */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh; /* Fixes mobile URL bar cutoff so bottom hints are visible */
  pointer-events: none;
  z-index: 10;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 2s ease 1s;
}

#hud.visible {
  opacity: 1;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  /* mix-blend-mode removed — it made the quote button invisible on dark mobile screens */
}

.hud-brand {
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  pointer-events: auto; /* Re-enable pointer events for the link */
}

.hud-home-btn {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.4rem 1rem 0.4rem 0.5rem;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.hud-home-btn:hover {
  transform: scale(1.05);
}

.hud-home-border-glow {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: linear-gradient(135deg, #4D89C9, #8BA3CA, #ffffff);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.hud-home-bg {
  position: absolute;
  inset: 1px;
  border-radius: 9999px;
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.hud-home-btn:hover .hud-home-border-glow,
.hud-home-btn:hover .hud-home-bg {
  opacity: 1;
}

.hud-home-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hud-logo-svg {
  height: 1rem;
  width: auto;
  transition: transform 0.7s ease;
}

.hud-home-btn:hover .hud-logo-svg {
  transform: rotate(360deg);
}

.hud-tag {
  color: #888;
}

.hud-right-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  pointer-events: auto;
}

.hud-quote-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-main);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #fff;
  text-decoration: none;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.hud-quote-btn:hover {
  transform: scale(1.05);
  color: #fff;
}

.hud-quote-border-glow {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(77, 137, 201, 0.4), rgba(77, 137, 201, 0.1));
  border: 1px solid rgba(77, 137, 201, 0.5);
  transition: opacity 0.3s ease, background 0.3s ease;
  z-index: 0;
}

.hud-quote-btn:hover .hud-quote-border-glow {
  background: linear-gradient(135deg, rgba(77, 137, 201, 0.8), rgba(77, 137, 201, 0.4));
  border-color: rgba(77, 137, 201, 0.9);
}

.hud-quote-bg {
  position: absolute;
  inset: 1px;
  border-radius: 9999px;
  background: rgba(5, 5, 8, 0.9);
  backdrop-filter: blur(8px);
  z-index: 1;
}

.hud-quote-text {
  position: relative;
  z-index: 2;
  color: #4D89C9;
}

.hud-quote-btn:hover .hud-quote-text {
  color: #fff;
}

.hud-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.5);
  animation: bounceHint 2s infinite;
  transition: opacity 0.5s ease;
}

.hud-look-hint {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.1rem;
}

@keyframes bounceHint {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -10px); }
}

.hud-depth {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
}

.depth-bar-wrap {
  width: 100px;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.2);
}

.depth-bar {
  height: 100%;
  background-color: #fff;
  width: 0%;
}

.depth-val {
  min-width: 3ch;
}

/* ================= MODAL (INTERACTIVE PREVIEWS) ================= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: relative;
  width: 90%;
  max-width: 1200px;
  height: 85vh;
  background-color: #111;
  border: 1px solid #333;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(0) scale(1);
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal.hidden .modal-panel {
  transform: translateY(40px) scale(0.98);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s, transform 0.2s;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.modal-frame-wrap {
  flex-grow: 1;
  position: relative;
  background-color: #000;
  overflow: hidden;
  border-bottom: 1px solid #222;
}

.modal-frame {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Interactive simulated elements inside the modal frame */
.sim-header {
  position: absolute;
  top: 0; left: 0; width: 100%;
  padding: 20px 40px;
  display: flex; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  color: white;
}
.sim-logo { font-weight: bold; font-size: 1.2rem; }
.sim-nav { display: flex; gap: 20px; }
.sim-nav span { cursor: pointer; position: relative; }
.sim-nav span:hover::after {
  content: ''; position: absolute; bottom: -5px; left: 0; width: 100%; height: 2px; background: white;
}
.sim-hero {
  text-align: center; color: white;
  transform: translateY(20px);
  opacity: 0;
  animation: fadeUp 1s forwards 0.5s;
}
.sim-hero h1 { font-size: 4rem; margin-bottom: 20px; font-family: 'Space Grotesk', sans-serif; text-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.sim-hero button { 
  padding: 15px 30px; border: none; background: white; color: black; 
  font-weight: bold; border-radius: 30px; cursor: pointer; transition: transform 0.2s;
}
.sim-hero button:hover { transform: scale(1.05); }

@keyframes fadeUp {
  to { transform: translateY(0); opacity: 1; }
}

.modal-info {
  padding: 2rem;
  background-color: #0a0a0a;
  min-height: 150px;
}

.modal-title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.modal-desc {
  color: #aaa;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 800px;
  margin-bottom: 1.5rem;
}

.modal-tags {
  display: flex;
  gap: 0.5rem;
}

.modal-tag {
  font-size: 0.7rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  border: 1px solid #333;
  color: #888;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ================= MODAL TOOLBAR ================= */
.modal-panel {
  display: flex;
  flex-direction: column;
}

.modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #0d0d0d;
  border-bottom: 1px solid #222;
  gap: 1rem;
  flex-shrink: 0;
}

.modal-toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.modal-toolbar-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-toolbar-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.modal-open-btn {
  background: none;
  border: 1px solid #333;
  color: #aaa;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 1rem;
  cursor: pointer;
  border-radius: 4px;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.modal-open-btn:hover {
  border-color: #fff;
  color: #fff;
}

/* ================= DEVICE PREVIEW BUTTONS ================= */
.modal-device-btns {
  display: flex;
  gap: 0.4rem;
}

.device-btn {
  background: none;
  border: 1px solid #2a2a2a;
  color: #555;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}

.device-btn:hover {
  border-color: #555;
  color: #aaa;
}

.device-btn.active {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,0.06);
}

/* ================= IFRAME CONTAINER ================= */
.modal-frame-wrap {
  flex-grow: 1;
  position: relative;
  background: #050505;
  overflow: hidden;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-iframe-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  transition: width 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* iframe element itself */
.modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

/* ================= COMING SOON STATE ================= */
.modal-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 1rem;
  color: #555;
}

.modal-coming-soon .cs-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #f59e0b;
  border: 1px solid #f59e0b44;
  padding: 0.3rem 1rem;
  border-radius: 20px;
}

.modal-coming-soon h3 {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  color: #fff;
  font-weight: 300;
  letter-spacing: 0.1em;
}

.modal-coming-soon p {
  font-size: 0.9rem;
  color: #555;
  text-align: center;
  max-width: 400px;
  line-height: 1.6;
}

.modal-info-wrapper {
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  flex-shrink: 0;
}

.modal-info {
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.modal-quote-wrap {
  padding: 0 1.5rem 1.25rem 1.5rem;
  width: 100%;
}

.modal-quote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(77, 137, 201, 0.15), rgba(77, 137, 201, 0.05));
  border: 1px solid rgba(77, 137, 201, 0.3);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: all 0.3s ease;
}

.modal-quote-btn .arrow {
  transition: transform 0.3s ease;
}

.modal-quote-btn:hover {
  background: linear-gradient(135deg, rgba(77, 137, 201, 0.3), rgba(77, 137, 201, 0.1));
  border-color: rgba(77, 137, 201, 0.6);
  transform: translateY(-2px);
}

.modal-quote-btn:hover .arrow {
  transform: translateX(4px);
}

.modal-info-left {
  flex: 1;
}

.modal-desc {
  color: #aaa;
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.modal-notes {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
}

.modal-note-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 140px;
  max-width: 200px;
}

.modal-note-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #444;
}

.modal-note-text {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.5;
}

/* ================= MOBILE OPTIMIZATIONS ================= */
@media (max-width: 768px) {
  /* Ensure canvas never intercepts browser scroll gestures */
  #c {
    touch-action: none;
  }

  /* HUD: Tighter padding on small screens */
  #hud {
    padding: 0.75rem;
  }

  .hud-top {
    font-size: 0.65rem;
    align-items: center;
  }

  .hud-home-btn {
    padding: 0.35rem 0.75rem 0.35rem 0.45rem;
    gap: 0.4rem;
  }

  .hud-tag {
    display: none;
  }

  .hud-right-actions {
    gap: 0;
    pointer-events: auto;
  }

  /* ===== GET A QUOTE PILL — Full mobile fix ===== */
  .hud-quote-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    /* Solid fallback border so the button is always visible */
    border: 1.5px solid rgba(77, 137, 201, 0.7);
    background: rgba(5, 5, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0 12px rgba(77, 137, 201, 0.35), inset 0 0 8px rgba(77, 137, 201, 0.08);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
  }

  .hud-quote-btn:active {
    box-shadow: 0 0 20px rgba(77, 137, 201, 0.6), inset 0 0 12px rgba(77, 137, 201, 0.15);
    border-color: rgba(77, 137, 201, 1);
  }

  /* Hide the pseudo-element layers on mobile — replaced by solid styles above */
  .hud-quote-border-glow,
  .hud-quote-bg {
    display: none;
  }

  .hud-quote-text {
    position: relative;
    z-index: 2;
    color: #7ab3e8;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
  }

  .hud-depth {
    right: 0.75rem;
    bottom: 0.75rem;
    gap: 0.5rem;
    font-size: 0.6rem;
  }

  .depth-bar-wrap {
    width: 60px;
  }

  .hud-scroll-hint {
    bottom: 0.75rem;
    font-size: 0.6rem;
    gap: 0.3rem;
  }

  .hud-look-hint {
    font-size: 0.58rem;
  }

  /* Modal: Full-screen on mobile to prevent cutoff */
  .modal-panel {
    width: 100%;
    height: 100dvh;
    max-width: 100%;
    border-radius: 0;
    border: none;
  }

  /* Toolbar: Stack elements vertically on small screens */
  .modal-toolbar {
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .modal-toolbar-left {
    order: 1;
    flex: 1;
    min-width: 0;
  }

  .modal-toolbar-title {
    font-size: 0.7rem;
  }

  .modal-device-btns {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .device-btn {
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
  }

  .modal-toolbar-right {
    order: 2;
    flex: 0;
  }

  .modal-open-btn {
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
  }

  .modal-close {
    position: relative;
    top: unset;
    right: unset;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  /* Info footer: Stack vertically on mobile */
  .modal-info {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    max-height: 35vh;
    overflow-y: auto;
  }

  .modal-desc {
    font-size: 0.8rem;
  }

  .modal-tags {
    flex-wrap: wrap;
  }

  .modal-notes {
    flex-direction: column;
    gap: 0.75rem;
  }

  .modal-note-block {
    min-width: unset;
    max-width: unset;
  }

  /* Coming soon state */
  .modal-coming-soon h3 {
    font-size: 1.2rem;
  }

  .modal-coming-soon p {
    font-size: 0.8rem;
  }

  /* Conversion CTA */
  .modal-quote-wrap {
    padding: 0 1rem 1rem 1rem;
  }

  .modal-quote-btn {
    padding: 0.8rem;
    font-size: 0.75rem;
  }
}
