/* ════════════════════════════════════════════════════════════════
   nozel.at – Custom Styles
   Tailwind CSS via CDN handles utility classes.
   This file contains custom animations, gradients, and overrides.
   ════════════════════════════════════════════════════════════════ */

/* ─── Base & Reset ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #ffffff;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #FF6600;
}

/* ─── Text Gradient ─────────────────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, #FF6600 0%, #FF8533 50%, #FFa366 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ─── Navbar ────────────────────────────────────────────────── */
#navbar {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
}

/* ─── Hero Section ──────────────────────────────────────────── */
.hero-fallback-gradient {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 30%, #eef2f7 50%, #f1f5f9 70%, #e2e8f0 100%);
}

/* Animated grid pattern for hero fallback */
.hero-fallback-gradient::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 102, 0, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 102, 0, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridPulse 4s ease-in-out infinite alternate;
}

@keyframes gridPulse {
  0%   { opacity: 0.3; }
  100% { opacity: 0.8; }
}

/* ─── Fade-Up Animation ─────────────────────────────────────── */
.animate-fade-up {
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Scroll Reveal ─────────────────────────────────────────── */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--delay, 0s);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Step Cards: Mobile Timeline ───────────────────────────── */
@media (max-width: 767px) {
  .step-card {
    position: relative;
    padding-left: 2rem;
  }

  .step-card::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #FF660040, transparent);
  }

  .step-card:last-child::before {
    background: linear-gradient(to bottom, #FF660040, transparent 50%);
  }
}

/* ─── Material Cards Hover ──────────────────────────────────── */
.material-card > div {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.material-card:hover > div {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* ─── Infill Buttons ────────────────────────────────────────── */
.infill-btn {
  cursor: pointer;
  user-select: none;
}

.infill-btn.active {
  background: rgba(255, 102, 0, 0.1) !important;
  border-color: #FF6600 !important;
  color: #FF6600 !important;
  box-shadow: 0 0 20px rgba(255, 102, 0, 0.1);
}

.infill-btn:not(.active):hover {
  border-color: rgba(255, 102, 0, 0.5);
  color: #1f2937;
}

/* ─── File Drop Zone ────────────────────────────────────────── */
#file-drop-zone.drag-over {
  border-color: #FF6600;
  background: rgba(255, 102, 0, 0.03);
}

#file-drop-zone.drag-over svg {
  color: #FF6600;
}

/* ─── Form Inputs Focus Glow ────────────────────────────────── */
input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.08);
}

/* ─── Submit Button Loading State ───────────────────────────── */
#submit-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

#submit-btn.loading::after {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Three.js Canvas ───────────────────────────────────────── */
#three-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
  cursor: grab;
}

#three-canvas:active {
  cursor: grabbing;
}

/* ─── Counter Animation ─────────────────────────────────────── */
.counter {
  font-variant-numeric: tabular-nums;
}

/* ─── Selection Color ───────────────────────────────────────── */
::selection {
  background: rgba(255, 102, 0, 0.3);
  color: #1f2937;
}

::-moz-selection {
  background: rgba(255, 102, 0, 0.3);
  color: #1f2937;
}

/* ─── Mobile Menu Animation ─────────────────────────────────── */
#mobile-menu.open {
  max-height: 400px;
}

/* ─── Print Bed Glow Effect ─────────────────────────────────── */
@keyframes bedGlow {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

/* ─── Smooth Section Transitions ────────────────────────────── */
section {
  position: relative;
  scroll-margin-top: 6rem; /* 96px default on desktop */
}

@media (max-width: 1023px) {
  section {
    scroll-margin-top: 5rem; /* 80px on tablet/mobile */
  }
}

/* ─── Responsive Adjustments ────────────────────────────────── */
@media (max-width: 640px) {
  .text-gradient {
    /* Ensure gradient text is visible on smaller screens */
    font-size: inherit;
  }
}

/* Infill Button Active State */
.infill-btn.active {
  background-color: rgba(255, 102, 0, 0.1) !important;
  border-color: rgb(255, 102, 0) !important;
  color: rgb(255, 102, 0) !important;
}
