@font-face {
  font-family: "Noto Serif";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/noto-serif.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Serif";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/noto-serif-italic.woff2") format("woff2");
}

@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/manrope.woff2") format("woff2");
}

:root {
  --page: #1a1c1f;
  --surface: #111416;
  --card: #1a1e21;
  --gold: #dcb792;
  --gold-hover: #fad2ac;
  --on-gold: #26282b;
  --heading: #e2e2e6;
  --muted: #a0a5aa;
  --hairline: #26282b;
  --ghost-border: #6b727833;
  --on-surface: #e3e3e3;
  --font-noto-serif: "Noto Serif", serif;
  --font-manrope: Manrope, sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  background: var(--page);
  color: var(--on-surface);
  font-family: var(--font-manrope);
}

.font-body {
  font-family: var(--font-manrope), sans-serif;
}

.font-headline {
  font-family: var(--font-noto-serif), serif;
}

.font-label {
  font-family: var(--font-manrope), sans-serif;
}

.text-on-surface {
  color: var(--on-surface);
}

.bg-surface {
  background-color: var(--surface);
}

.gold-gradient,
.editorial-gradient {
  background: linear-gradient(135deg, #fad2ac, #dcb792);
}

.glass-nav {
  backdrop-filter: blur(20px);
  background: #111416b3;
}

.glass-panel {
  backdrop-filter: blur(12px);
  background: #202529b3;
}

.ghost-border {
  border: 1px solid #6b727833;
}

.serif-italic {
  font-family: "Noto Serif", serif;
  font-style: italic;
}

button {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

button:disabled,
a[aria-disabled="true"] {
  cursor: default;
  opacity: 0.4;
  pointer-events: none;
}

.htmx-indicator {
  display: none;
}

.htmx-request.htmx-indicator,
.htmx-request .htmx-indicator {
  display: flex;
}

.htmx-request .idle-panel {
  display: none;
}

@keyframes gold-pulse {
  0%,
  100% {
    opacity: 0.28;
    transform: scaleY(0.65);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes float-up {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scale-in {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-reveal {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glow-pulse {
  0%, 100% {
    opacity: 0.5;
    filter: blur(20px);
  }
  50% {
    opacity: 0.8;
    filter: blur(25px);
  }
}

.processing-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, #dcb792, transparent);
  animation: gold-pulse 1.6s ease-in-out infinite;
  transform-origin: top center;
}

.processing-container {
  animation: float-up 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.processing-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(220, 183, 146, 0.15) 0%, transparent 70%);
  animation: glow-pulse 3s ease-in-out infinite;
  pointer-events: none;
}

.processing-text {
  background: linear-gradient(
    90deg,
    rgba(220, 183, 146, 0.4),
    rgba(250, 210, 172, 1),
    rgba(220, 183, 146, 0.4)
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2s linear infinite;
}

.dropzone.is-dragover {
  border-color: #dcb792;
  background: rgba(220, 183, 146, 0.04);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropzone {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropzone.is-filled .dropzone-prompt {
  display: none;
}

.dropzone-preview {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: scale-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropzone.is-filled .dropzone-preview {
  display: block;
}

/* ═══════════════════════════════════════════════════════════
   Before/After Reveal Slider
   
   Duas imagens perfeitamente sobrepostas no mesmo container.
   A imagem melhorada é a base (position: relative, define a altura).
   A imagem original é o overlay (position: absolute, inset: 0).
   clip-path: inset() na overlay controla a revelação.
   Nenhuma imagem se move — só a máscara muda.
   ═══════════════════════════════════════════════════════════ */

.comparison-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  user-select: none;
  touch-action: none;
  animation: scale-in 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base: imagem melhorada — permanece no fluxo para definir a altura */
.comparison-base {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* Overlay: imagem original — absolutamente sobreposta à base */
.comparison-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  /* clip-path controlado via JS: inset(0 0 0 P%) */
}

/* Divisor / Handle */
.comparison-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, transparent 0%, #dcb792 15%, #dcb792 85%, transparent 100%);
  cursor: ew-resize;
  z-index: 10;
  transform: translateX(-50%);
}

.comparison-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(220, 183, 146, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(220, 183, 146, 0.4);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.comparison-handle:hover::before,
.comparison-handle:active::before {
  width: 56px;
  height: 56px;
  box-shadow: 0 6px 30px rgba(220, 183, 146, 0.6);
}

.comparison-handle::after {
  content: '⟷';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: #26282b;
  font-weight: bold;
  pointer-events: none;
}

/* Labels */
.comparison-label {
  position: absolute;
  top: 16px;
  padding: 6px 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: rgba(26, 30, 33, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(220, 183, 146, 0.2);
  border-radius: 4px;
  z-index: 5;
  opacity: 0;
  animation: slide-reveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.comparison-label.after {
  left: 16px;
  color: #dcb792;
  animation-delay: 0.2s;
}

.comparison-label.before {
  right: 16px;
  color: rgba(160, 165, 170, 1);
  animation-delay: 0.3s;
}

.result-stagger > * {
  animation: float-up 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: both;
}

.result-stagger > *:nth-child(1) { animation-delay: 0s; }
.result-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.result-stagger > *:nth-child(3) { animation-delay: 0.2s; }
.result-stagger > *:nth-child(4) { animation-delay: 0.3s; }
.result-stagger > *:nth-child(5) { animation-delay: 0.4s; }

.image-block {
  animation: scale-in 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: both;
}

.image-block:nth-child(1) { animation-delay: 0.1s; }
.image-block:nth-child(2) { animation-delay: 0.25s; }

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid #dcb792;
  outline-offset: 4px;
  border-radius: 4px;
}

/* Smooth page transitions */
#workspace > * {
  animation: float-up 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Gold accent hover effects */
a:hover,
button:hover:not(:disabled) {
  filter: brightness(1.1);
}

/* Refined shadows */
.shadow-refined {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(220, 183, 146, 0.1);
}

/* Image hover zoom effect */
.image-block img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-block:hover img {
  transform: scale(1.02);
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(135deg, #fad2ac, #dcb792);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
