/* =====================================================
   3DREAMS PRELOADER
   Warm cream + orange + yellow · NO BLACK · NO SQUARE GRID BACKGROUND
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@500;700;800&family=JetBrains+Mono:wght@300;400;500&display=swap');

#tdp-loader {
  /* WARM LIGHT PALETTE — matches 3dreams.gr aesthetic */
  --tdp-bg:           #FBF6EC;   /* warm cream — main background */
  --tdp-bg-soft:      #F2EBDD;   /* slightly darker cream */
  --tdp-bg-warm:      #EFE5D2;   /* warm beige depth */
  --tdp-ink:          #2D1F12;   /* warm dark brown — used INSTEAD of black */
  --tdp-ink-soft:     #5C4A38;   /* muted brown for secondary text */
  --tdp-ink-faint:    rgba(45, 31, 18, 0.45);
  --tdp-line:         rgba(45, 31, 18, 0.12);

  --tdp-orange:       #FF7A1A;   /* brand orange */
  --tdp-orange-deep:  #E8651A;
  --tdp-orange-soft:  rgba(255, 122, 26, 0.55);
  --tdp-yellow:       #FFC93C;   /* brand yellow */
  --tdp-yellow-warm:  #FFB13A;
  --tdp-yellow-hot:   #FFD86B;

  /* realistic printer materials */
  --tdp-metal:        #6B6258;   /* warm aluminum extrusion */
  --tdp-metal-light:  #8A8175;
  --tdp-metal-dark:   #4A4239;
  --tdp-bed-glow:     #FFB13A;
}

#tdp-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 201, 60, 0.16) 0%, rgba(255, 122, 26, 0.07) 31%, rgba(251, 246, 236, 0) 58%),
    linear-gradient(135deg, #FFF8EA 0%, #FBF6EC 48%, #F1E5CF 100%);
  background-size: auto !important;
  background-image: radial-gradient(circle at 50% 42%, rgba(255, 201, 60, 0.16) 0%, rgba(255, 122, 26, 0.07) 31%, rgba(251, 246, 236, 0) 58%), linear-gradient(135deg, #FFF8EA 0%, #FBF6EC 48%, #F1E5CF 100%) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--tdp-ink);
}

/* warm vignette — uses cream tones, not black */
#tdp-loader::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.20) 0%, rgba(255,255,255,0) 44%, rgba(239,229,210,0.56) 100%);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
  opacity: 0.55;
}

/* warm orb glow behind printer — orange/yellow ambient */
#tdp-loader::after {
  content: '';
  position: absolute;
  width: 560px; height: 560px;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 201, 60, 0.22) 0%, rgba(255, 122, 26, 0.10) 38%, transparent 65%);
  pointer-events: none;
  z-index: 1;
  animation: tdp-orb-pulse 4s ease-in-out infinite;
}
@keyframes tdp-orb-pulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.05); }
}

#tdp-loader.tdp-exit {
  transform: translateY(-100%);
  transition: transform 0.75s cubic-bezier(0.76, 0, 0.24, 1);
}

.tdp-stage {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 20px;
  max-width: 92vw;
}

/* ─── REALISTIC 3D PRINTER ─────────────────── */
.tdp-printer {
  width: clamp(200px, 28vw, 260px);
  height: auto;
  display: block;
}

/* aluminum frame extrusions */
.tdp-frame-post,
.tdp-frame-top {
  fill: var(--tdp-metal);
  opacity: 0;
  animation: tdp-fade 0.4s 0.1s ease forwards;
}
.tdp-frame-edge {
  fill: var(--tdp-metal-dark);
  opacity: 0;
  animation: tdp-fade 0.4s 0.15s ease forwards;
}
.tdp-frame-shine {
  fill: var(--tdp-metal-light);
  opacity: 0;
  animation: tdp-fade-shine 0.4s 0.2s ease forwards;
}
@keyframes tdp-fade-shine { to { opacity: 0.7; } }
@keyframes tdp-fade        { to { opacity: 1; } }

/* base/foot of the printer */
.tdp-base {
  fill: var(--tdp-metal-dark);
  opacity: 0;
  animation: tdp-fade 0.4s 0.05s ease forwards;
}
.tdp-base-edge {
  fill: var(--tdp-metal);
  opacity: 0;
  animation: tdp-fade 0.4s 0.1s ease forwards;
}
.tdp-foot {
  fill: var(--tdp-orange);
  opacity: 0;
  animation: tdp-fade 0.4s 0.15s ease forwards;
}

/* HEATED BED — glows yellow */
.tdp-bed {
  fill: url(#tdp-bed-grad);
  filter: drop-shadow(0 0 10px rgba(255, 177, 58, 0.85));
  opacity: 0;
  animation: tdp-bed-heat 0.6s 0.35s ease forwards, tdp-bed-pulse 2.4s 1s ease-in-out infinite;
}
@keyframes tdp-bed-heat { to { opacity: 1; } }
@keyframes tdp-bed-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 177, 58, 0.85)); }
  50%      { filter: drop-shadow(0 0 16px rgba(255, 201, 60, 1)); }
}

/* FILAMENT SPOOL on top */
.tdp-spool-outer {
  fill: var(--tdp-ink-soft);
  opacity: 0;
  animation: tdp-fade 0.4s 0.2s ease forwards;
}
.tdp-spool-filament {
  fill: var(--tdp-orange);
  opacity: 0;
  animation: tdp-fade 0.4s 0.25s ease forwards;
}
.tdp-spool-hub {
  fill: var(--tdp-metal-light);
  opacity: 0;
  animation: tdp-fade 0.4s 0.3s ease forwards;
}
.tdp-spool-ring {
  stroke: var(--tdp-orange-deep);
  stroke-width: 0.8;
  fill: none;
  opacity: 0;
  animation: tdp-fade-shine 0.4s 0.3s ease forwards;
}
.tdp-spool {
  transform-origin: 160px 38px;
  animation: tdp-spool-spin 8s linear infinite;
}
@keyframes tdp-spool-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* filament feeding from spool to head — moves with the head */
.tdp-feed-tube {
  stroke: var(--tdp-ink-soft);
  stroke-width: 1.6;
  stroke-linecap: round;
  fill: none;
  opacity: 0;
  animation: tdp-fade-shine 0.4s 0.45s ease forwards;
}

/* GANTRY rises during print */
.tdp-gantry-y {
  transform-origin: center;
  will-change: transform;
}


/* X-axis beam */
.tdp-beam {
  fill: var(--tdp-metal);
  opacity: 0;
  animation: tdp-fade 0.3s 0.55s ease forwards;
}
.tdp-beam-rail {
  fill: var(--tdp-metal-dark);
  opacity: 0;
  animation: tdp-fade 0.3s 0.55s ease forwards;
}

/* print head sweeps L↔R while gantry rises */
.tdp-head-x {
  transform-origin: 160px 200px;
  opacity: 0;
  will-change: transform;
  animation: tdp-head-show 0.30s 0.55s ease forwards;
}
@keyframes tdp-head-show { to { opacity: 1; } }

/* HOTEND ASSEMBLY — heatsink with fins, heater block, nozzle */
.tdp-heatsink     { fill: var(--tdp-metal-light); }
.tdp-heatsink-fin { stroke: var(--tdp-metal-dark); stroke-width: 0.7; }
.tdp-heater-block {
  fill: url(#tdp-heater-grad);
  filter: drop-shadow(0 0 4px rgba(255, 122, 26, 0.55));
  animation: tdp-heater-glow 2s ease-in-out infinite;
}
@keyframes tdp-heater-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 122, 26, 0.55)); }
  50%      { filter: drop-shadow(0 0 8px rgba(255, 159, 64, 0.9)); }
}
.tdp-nozzle {
  fill: url(#tdp-nozzle-grad);
  filter: drop-shadow(0 1px 5px rgba(255, 159, 64, 0.95));
}

/* part-cooling fan — rotates */
.tdp-fan-housing { fill: var(--tdp-metal); }
.tdp-fan-blades {
  fill: var(--tdp-ink-soft);
  transform-origin: 178px 192px;
  animation: tdp-fan-spin 0.4s linear infinite;
}
@keyframes tdp-fan-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* molten filament strand from nozzle tip */
.tdp-extrude {
  stroke: var(--tdp-orange);
  stroke-width: 1.4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(255, 159, 64, 0.95));
  animation: tdp-extrude-flick 0.16s linear infinite;
}
@keyframes tdp-extrude-flick {
  0%, 100% { opacity: 0.95; }
  50%      { opacity: 0.55; }
}

/* ─── PRINTED 3DREAMS WORD ─────────────────── */
.tdp-word-base {
  fill: rgba(255, 122, 26, 0.18);
  opacity: 0;
  animation: tdp-fade 0.35s 0.95s ease forwards;
}

.tdp-word-letter {
  font-family: 'Unbounded', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 800;
  text-anchor: middle;
  fill: var(--tdp-orange);
  stroke: #E8651A;
  stroke-width: 0.7;
  paint-order: stroke fill;
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(255, 122, 26, 0.24));
  dominant-baseline: alphabetic;
  transition: opacity 0.12s linear;
}

#tdp-print-clip-rect {
  fill: #ffffff;
}

.tdp-active-layer {
  fill: #FFD86B;
  filter: drop-shadow(0 0 6px rgba(255, 201, 60, 0.92));
}

/* ─── LOGO ─────────────────── */

/* ─── LOGO ─────────────────── */

.tdp-logo {
  display: block;
  width: clamp(160px, 28vw, 260px);
  height: auto;
  max-height: 90px;
  object-fit: contain;
  opacity: 0;
  transform: translateY(20px) scale(0.94);
  animation: tdp-logo-in 0.85s 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes tdp-logo-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* fallback typographic wordmark */
.tdp-wordmark {
  display: flex;
  gap: 0.015em;
  overflow: hidden;
  padding: 4px 0.08em;
  line-height: 1;
}
.tdp-wordmark span {
  font-family: 'Unbounded', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 6vw, 56px);
  letter-spacing: 0.04em;
  color: var(--tdp-ink);
  display: inline-block;
  transform: translateY(110%);
  animation: tdp-letter-up 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.tdp-wordmark span:nth-child(1) { animation-delay: 0.05s; color: var(--tdp-orange); }
.tdp-wordmark span:nth-child(2) { animation-delay: 0.13s; }
.tdp-wordmark span:nth-child(3) { animation-delay: 0.21s; }
.tdp-wordmark span:nth-child(4) { animation-delay: 0.29s; }
.tdp-wordmark span:nth-child(5) { animation-delay: 0.37s; }
.tdp-wordmark span:nth-child(6) { animation-delay: 0.45s; }
.tdp-wordmark span:nth-child(7) { animation-delay: 0.53s; }
@keyframes tdp-letter-up { to { transform: translateY(0); } }

/* ─── TAGLINE + PROGRESS ─────────────────── */
.tdp-tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--tdp-orange);
  margin-top: -4px;
  opacity: 0;
  animation: tdp-fade 0.5s 1s ease forwards;
  padding-left: 0.45em;
}

.tdp-bar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: clamp(220px, 26vw, 280px);
  margin-top: 4px;
  opacity: 0;
  animation: tdp-fade 0.5s 1.1s ease forwards;
}
.tdp-bar {
  flex: 1;
  height: 2px;
  background: var(--tdp-line);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.tdp-bar-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--tdp-yellow) 0%, var(--tdp-orange) 100%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.1s linear;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 159, 64, 0.55);
}
.tdp-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--tdp-orange);
  letter-spacing: 0.055em;
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ─── CORNER HUD READOUTS ─────────────────── */
.tdp-corner {
  position: absolute;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--tdp-ink-soft);
  text-transform: uppercase;
  z-index: 3;
  opacity: 0;
  animation: tdp-fade 0.6s 0.55s ease forwards;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.tdp-corner.tl { top: 28px; left: 32px; }
.tdp-corner.tr { top: 28px; right: 32px; }
.tdp-corner.bl { bottom: 28px; left: 32px; }
.tdp-corner.br { bottom: 28px; right: 32px; }
.tdp-corner .tdp-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--tdp-orange);
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px var(--tdp-orange);
  animation: tdp-blink 1s ease-in-out infinite;
}
@keyframes tdp-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}
.tdp-corner .tdp-val {
  color: var(--tdp-ink);
  margin-left: 4px;
  font-weight: 600;
}

/* corner crosshair brackets removed */

.tdp-status {
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--tdp-ink-soft);
  opacity: 0;
  animation: tdp-fade 0.4s 1.25s ease forwards;
  font-weight: 500;
}
.tdp-status .tdp-blink-cursor {
  display: inline-block;
  animation: tdp-text-blink 0.9s steps(2) infinite;
  color: var(--tdp-orange);
}
@keyframes tdp-text-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

html.tdp-html-loading,
body.tdp-loading { overflow: hidden !important; height: 100vh; }

/* ─── RESPONSIVE — works on every screen ─────────────────── */

/* tablets */
@media (max-width: 1024px) {
  .tdp-corner.tl, .tdp-corner.bl { left: 22px; }
  .tdp-corner.tr, .tdp-corner.br { right: 22px; }
}

@media (max-width: 768px) {
  .tdp-stage   { gap: 22px; }
  .tdp-printer { width: clamp(190px, 32vw, 230px); }
  .tdp-corner  { font-size: 8.5px; letter-spacing: 0.2em; }
}

/* phones */
@media (max-width: 640px) {
  .tdp-corner    { font-size: 8px; letter-spacing: 0.18em; }
  .tdp-corner.tl, .tdp-corner.bl { left: 16px; }
  .tdp-corner.tr, .tdp-corner.br { right: 16px; }
  .tdp-corner.tl, .tdp-corner.tr { top: 18px; }
  .tdp-corner.bl, .tdp-corner.br { bottom: 18px; }
  .tdp-stage     { gap: 20px; padding: 16px; }
  .tdp-printer   { width: clamp(170px, 55vw, 220px); }
  .tdp-logo      { width: clamp(150px, 60vw, 220px); max-height: 70px; }
  .tdp-wordmark span { font-size: clamp(28px, 9vw, 44px); }
  .tdp-bar-row   { width: clamp(200px, 60vw, 240px); }
  .tdp-tag       { font-size: 9px; letter-spacing: 0.35em; }
  #tdp-loader::after { width: 380px; height: 380px; }
}

/* small phones */
@media (max-width: 420px) {
  .tdp-corner.tr, .tdp-corner.br { display: none; }
  .tdp-printer { width: 180px; }
  .tdp-stage   { gap: 18px; }
}

@media (max-width: 340px) {
  .tdp-corner.bl { display: none; }
  .tdp-printer { width: 160px; }
  .tdp-stage   { gap: 16px; padding: 12px; }
}

/* landscape phones — short viewports */
@media (max-height: 520px) {
  .tdp-printer { width: clamp(140px, 18vw, 180px); }
  .tdp-stage   { gap: 12px; }
  .tdp-logo    { max-height: 48px; }
  .tdp-corner  { font-size: 8px; }
  .tdp-bar-row { width: clamp(180px, 28vw, 220px); }
  .tdp-tag     { margin-top: -2px; }
}

@media (max-height: 400px) {
  .tdp-corner.bl, .tdp-corner.br { display: none; }
  .tdp-printer { width: 130px; }
}

/* laptops — bigger printer + logo */
@media (min-width: 1280px) {
  .tdp-printer { width: clamp(260px, 22vw, 300px); }
  .tdp-logo    { width: clamp(220px, 22vw, 290px); max-height: 100px; }
  .tdp-stage   { gap: 28px; }
  .tdp-corner  { font-size: 10px; }
}

/* large desktops */
@media (min-width: 1600px) {
  .tdp-printer { width: 320px; }
  .tdp-logo    { width: 300px; max-height: 110px; }
  .tdp-stage   { gap: 32px; }
}

/* 4K + ultrawide */
@media (min-width: 2200px) {
  .tdp-printer { width: 380px; }
  .tdp-logo    { width: 340px; max-height: 130px; }
  .tdp-stage   { gap: 38px; }
  .tdp-corner  { font-size: 11px; }
  .tdp-tag     { font-size: 11px; }
  .tdp-pct, .tdp-status { font-size: 11px; }
  .tdp-bar-row { width: 320px; }
}

/* ─── ACCESSIBILITY ─────────────────── */
@media (prefers-reduced-motion: reduce) {
  #tdp-loader *,
  #tdp-loader *::before,
  #tdp-loader *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .tdp-wordmark span { transform: translateY(0); }
  .tdp-logo          { opacity: 1; transform: none; }
}
