body {
  margin: 0;
  overflow: hidden;
  user-select: none;
  background-color: #1a5b92;
  font-family: sans-serif;
}

#viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  cursor: grab;
  /* Hide scrollbar for Chrome, Safari and Opera */
  &::-webkit-scrollbar {
    display: none;
  }
  /* Hide scrollbar for IE, Edge and Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

#viewport:active {
  cursor: grabbing;
}

#canvas-area {
  position: relative;
  width: 4000px;
  height: 4000px;
  /* Blueprint background */
  background-color: #1a5b92;
  background-image:
    url("assets/images/noise.png"),
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size:
    200px 200px,
    100px 100px,
    100px 100px,
    20px 20px,
    20px 20px;
  background-blend-mode: overlay, normal, normal, normal, normal;
}
#svg-container,
#models-layer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#svg-container {
  max-width: 90vw;
  max-height: 90vh;
  filter: drop-shadow(0 40px 50px rgba(4, 99, 219, 0.15));
}

#models-layer {
  pointer-events: none;
  z-index: 20;
}

/* Glassmorphism Blur Effect overlay */
.glass-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 99, 219, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  pointer-events: none;
  z-index: 10;
  transition:
    backdrop-filter 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    background 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.glass-overlay.active {
  background: rgba(26, 91, 146, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: auto;
}

/* 3D Container Settings */
.interactive-model-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 240px;
  cursor: pointer;
  pointer-events: auto; /* Make it clickable inside the pass-through layer */
  z-index: 5;
  filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.3));
  transition:
    filter 0.8s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

#models-layer.has-active-model .interactive-model-wrapper:not(.active) {
  filter: blur(12px) drop-shadow(0 5px 5px rgba(0, 0, 0, 0.1));
  opacity: 0.4;
  pointer-events: none;
}

.pencil-wrapper {
  margin-top: 500px;
  margin-left: 180px;
}

.compass-wrapper {
  margin-top: -1000px;
  margin-left: -240px;
}

.magnify-wrapper {
  margin-top: 800px;
  margin-left: 1000px;
}

.interactive-model {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
}

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

.instruction-text {
  font-family: "Architects Daughter", cursive;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0;
  text-align: center;
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.instruction-icon {
  width: 24px;
  height: 24px;
  stroke-width: 2.5px;
  opacity: 0.9;
}

h1#title {
  font-family: "Cabin Sketch", sans-serif;
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  margin-bottom: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
  text-align: center;
}

#svg-container p {
  font-family: "Architects Daughter", cursive;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.1);
}
svg {
  width: auto;
  height: auto;
  max-height: 70vh;
  transform-style: preserve-3d;
}


.blog-panel {
  position: fixed;
  top: 50%;
  right: 40px;
  transform: translateY(-50%) translateX(40px) rotate(0.4deg);
  width: 45vw;
  max-width: 750px;
  height: 85vh;
  /* Aged paper look */
  background-color: #f5f0e8;
  background-image:
    url("assets/images/noise.png"),
    linear-gradient(160deg, #fdfaf3 0%, #f0e9d6 60%, #ede3cb 100%);
  background-blend-mode: overlay, normal;
  background-size: 200px 200px, 100% 100%;
  border: none;
  border-radius: 4px;
  padding: 48px 48px 48px 72px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  overflow-y: auto;
  transition:
    transform 0.8s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1);

  /* Subtle scrollbar */
  &::-webkit-scrollbar {
    width: 6px;
  }
  &::-webkit-scrollbar-track {
    background: transparent;
  }
  &::-webkit-scrollbar-thumb {
    background: rgba(120, 90, 50, 0.2);
    border-radius: 10px;
  }
  &::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 90, 50, 0.35);
  }
}

.blog-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) rotate(0.4deg);
}

.blog-title {
  font-family: "Architects Daughter", cursive;
  font-size: 2rem;
  color: #2c1a0e;
  margin-top: 0;
  margin-bottom: 8px;
  line-height: 1.2;
}

.blog-text {
  font-family: "Architects Daughter", cursive;
  font-size: 1rem;
  line-height: 1.7;
  color: #3a2510;
  margin: 0;
}

.blog-text a {
  color: #7a3b0f;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.3s ease;
}

.blog-text a:hover {
  color: #2c1a0e;
}

.blog-subtitle {
  font-family: "Architects Daughter", cursive;
  font-size: 1.4rem;
  color: #2c1a0e;
  margin-top: 16px;
  margin-bottom: 4px;
}

.blog-list {
  font-family: "Architects Daughter", cursive;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #3a2510;
  margin: 8px 0;
  padding-left: 24px;
}

.blog-list li {
  margin-bottom: 8px;
}

.blog-list code {
  background: rgba(80, 50, 20, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Fira Code", monospace;
  font-size: 0.85rem;
  color: #6b3a10;
}

.blog-code {
  margin: 16px 0;
  background: rgba(60, 40, 15, 0.06);
  border: 1px solid rgba(100, 70, 30, 0.2);
  border-radius: 4px;
  padding: 20px;
  overflow-x: auto;
}

.blog-code pre {
  margin: 0;
  font-family: "Fira Code", monospace;
  font-size: 0.9rem;
  color: #4a2e0a;
  line-height: 1.5;
}

.blog-code code {
  font-family: inherit;
  color: #7a3b0f;
}

.blog-panel img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 16px 0;
  border: 1px solid rgba(100, 70, 30, 0.15);
}

/* Ruled-line texture and red margin live on the content so they scroll */
.blog-panel-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Faint horizontal ruled lines */
  background-image: repeating-linear-gradient(
    transparent,
    transparent 27px,
    rgba(160, 120, 70, 0.12) 27px,
    rgba(160, 120, 70, 0.12) 28px
  );
  /* Red margin rule */
  border-left: 1px solid rgba(200, 80, 80, 0.3);
  padding-left: 16px;
}

/* Paper Screenshots Layer */
#paper-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let clicks pass through the layer itself */
  z-index: 2; /* Below the models-layer (z-index: 20) and glass-overlay (z-index: 10) */
}

.paper-screenshot {
  position: absolute;
  margin: 0;
  background-color: #fcfcfc;
  padding: 12px 12px 48px 12px; /* Polaroid style padding */
  box-shadow: 2px 8px 24px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  pointer-events: auto; /* Make the paper clickable/hoverable */
  transform-origin: center top;
  /* Use CSS variable for base rotation so hover can easily override while maintaining rotation */
  --base-rotation: 0deg;
  transform: rotate(var(--base-rotation));
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s cubic-bezier(0.25, 1, 0.5, 1), z-index 0.3s step-end;
}

/* Individual Positioning and Rotations */
.screenshot-1 { top: 600px; left: 800px; --base-rotation: -8deg; }
.screenshot-2 { top: 1200px; left: 3200px; --base-rotation: 5deg; }
.screenshot-3 { top: 2800px; left: 600px; --base-rotation: -3deg; }
.screenshot-4 { top: 3200px; left: 2800px; --base-rotation: 6deg; }
.screenshot-5 { top: 1800px; left: 400px; --base-rotation: -12deg; }
.screenshot-6 { top: 300px; left: 2500px; --base-rotation: 4deg; }
.screenshot-7 { top: 2400px; left: 3400px; --base-rotation: -7deg; }
.screenshot-8 { top: 3500px; left: 1500px; --base-rotation: 9deg; }

/* Clean hover state using CSS variable */
.paper-screenshot:hover {
  transform: rotate(var(--base-rotation)) scale(1.05) translateY(-5px);
  box-shadow: 4px 16px 32px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 5;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s cubic-bezier(0.25, 1, 0.5, 1), z-index 0s step-start;
}

.paper-screenshot img {
  width: 380px;
  height: auto;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: block;
}

/* Tape effect */
.paper-screenshot::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 120px;
  height: 35px;
  background-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
}

/* Add slight random rotation to tape for variation */
.paper-screenshot:nth-child(even)::before {
  transform: translateX(-50%) rotate(3deg);
  width: 100px;
}
.paper-screenshot:nth-child(3n)::before {
  transform: translateX(-40%) rotate(-4deg);
  width: 130px;
}

/* Decorations */
.coffee-stain {
  position: absolute;
  top: 1750px;
  left: 2200px;
  width: 450px;
  height: auto;
  opacity: 0.85;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
  transform: rotate(35deg);
}



/* Sticky Notes */
.sticky-note {
  position: absolute;
  width: 200px;
  height: 200px;
  padding: 24px;
  background-color: #ffed74; /* Default yellow */
  box-shadow: 4px 8px 16px rgba(0, 0, 0, 0.2);
  font-family: "Caveat", cursive;
  font-size: 2rem;
  color: #333;
  pointer-events: auto;
  z-index: 3;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  /* Curling bottom right corner */
  border-bottom-right-radius: 40px 10px;
  --base-rotation: 0deg;
  transform: rotate(var(--base-rotation));
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}


/* Fold effect */
.sticky-note::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.1) 100%);
  border-bottom-right-radius: 10px;
  pointer-events: none;
}

.sticky-note p {
  margin: 0;
}

.note-1 { 
  top: 900px; 
  left: 1400px; 
  --base-rotation: -5deg; 
}
.note-2 { 
  top: 2100px; 
  left: 2600px; 
  --base-rotation: 8deg; 
  background-color: #ff9ee2; /* Pink note */
}

/* Eraser & Graphite Smudges */
.eraser-smudge {
  position: absolute;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
  filter: blur(12px);
  pointer-events: none;
  z-index: 1;
}

.graphite-smudge {
  position: absolute;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

/* =====================
   Responsive — Mobile
   ===================== */
@media (max-width: 640px) {
  h1#title {
    font-size: 2.4rem;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
  }

  #svg-container p,
  .instruction-text {
    font-size: 1rem;
  }

  /* Smaller default model size on mobile */
  .interactive-model-wrapper {
    width: 100px;
    height: 150px;
  }

  /* Blog panel: bottom sheet instead of right sidebar */
  .blog-panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    height: 68vh;
    border-radius: 20px 20px 0 0;
    padding: 40px 20px 20px 28px;
    /* Slide up from below — no rotation on a bottom sheet */
    transform: translateY(100%);
    rotate: 0deg;
  }

  .blog-panel.active {
    transform: translateY(0);
    rotate: 0deg;
  }

  /* Drag handle indicator */
  .blog-panel::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(160, 120, 70, 0.35);
    border-radius: 2px;
    pointer-events: none;
    z-index: 2;
  }
}
