/* ===== ROOT VARIABLES ===== */
:root {
  /* Core palette */
  --bg: #0b0b0b;
  --panel: #0f0f0f;
  --card-bg: linear-gradient(135deg, #0f0f0f 0%, #151515 100%);

  --text: #f5f5f5;
  --muted: #a9a9a9;
  --line: rgba(255, 255, 255, 0.06);

  /* Accent colors (for buttons, active states, history chips) */
  --accent-blue: #0ea5e9;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  /* Neon accent for selected thumbnails / key highlights */
  --accent-neo: #d4ff4f;

  /* Layout */
  --navH: 70px;
  --maxw: 1600px;
  --gutter: clamp(16px, 4vw, 48px);

  /* Shared effects */
  --radius-card: 16px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.6);
  --transition-fast: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Workspace root container (wraps the whole 3D workspace section) ---------- */
.timrx-3dprint {
  /* Layout tokens */
  --ws-navH: 80px;                         /* Reserved height for top nav */
  --ws-gap: 20px;                          /* Base gutter between columns */

  /* Card tokens */
  --ws-card-bg: #0f0f0f;
  --ws-card-border: rgba(255, 255, 255, 0.06);

  /* Typography tokens */
  --ws-text: #ffffff;
  --ws-text-muted: #8a8a8a;

  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--ws-text);
  background: #0b0b0b;
  padding: 0;
  overflow: hidden;
}

/* Workspace-scoped reset --------------------------------------------------- */
.timrx-3dprint *,
.timrx-3dprint *::before,
.timrx-3dprint *::after {
  box-sizing: border-box;
}


.timrx-3dprint * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navH);
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body.print3d-page {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  line-height: 1.6;
  overflow: hidden;      /* Lock scroll when workspace is in compact mode */
  height: 100vh;
}

/* When history / page needs to scroll (toggled by JS) */
body.print3d-page.history-expanded {
  overflow: auto;
  height: auto;
  min-height: 100vh;
}

/* Allow scrolling for expanded views (tutorials, stories, converter, about) */
body.print3d-page.tutorials-view,
body.print3d-page.stories-view,
body.print3d-page.converter-view,
body.print3d-page.about-view {
  overflow: auto;
  overflow-x: hidden;
  height: auto;
  min-height: 100vh;
  padding-top: var(--navH);
}

/* Animated Background */
body.print3d-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 20s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

/* Spin animation for loading spinners */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Float animation for empty states */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Ensure all main content floats above the animated layer */
body.print3d-page > * {
  position: relative;
  z-index: 1;
}

body.print3d-page > .nav {
  position: fixed;
  z-index: 3000;
}

/* Utilities */
.hidden {
  display: none !important;
}
