/* ============ Faraday-cage dropzone (PF.cageDrop) ============
   Shared by the landing hero and the app dashboard. The art is a wireframe
   geodesic sphere — the same truncated icosahedron as the brand hero orb —
   drawn as inline SVG by js/cage-drop.js (geometry baked from
   scripts/gen-faraday-cage.js). Strokes and nodes use currentColor, so the
   .dropzone hover/drag color flip energizes the whole cage for free.

   States driven by js/cage-drop.js:
     .capturing — door held open while the document flies in
     .sealed    — door stays shut (beats :hover) once the document is inside
   All transitions/animations are covered by the global reduced-motion gate in
   main.css; the JS sequence itself is gated on prefersReducedMotion. */

.dropzone-hero {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 36px 28px 40px;
  border-width: 2.5px;
  border-radius: 20px;
  background: var(--bg-elev);
  text-align: center;
  isolation: isolate;
  overflow: hidden;
}
.dropzone-hero strong { font-size: 17px; }
.dropzone-hero .dropzone-hint { font-size: 13.5px; margin-top: 4px; }

/* "Stays on your device" affordance pinned to the dropzone — the box reads as
   "upload here" by default, so we counter that right on it. */
.dz-lock {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 4px 10px;
}
.dz-lock svg { width: 12px; height: 12px; }

/* Stacked: cage is the star up top, copy below. */
.dz-split {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}
.dz-pane { min-width: 0; }
.dz-pane-copy { text-align: center; }
.dz-pane-art {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── The cage + its door ────────────────────────────────────────────────────
   Idles with the hero orb's own float (reuses heroFloat from landing.css).
   The door is the whole front "flower" — the central hexagon plus its ring of
   6 tiles. At rest it sits flush and reads as more cage; on hover/drag it
   swings ~110° open on its left hinge to receive the file. */
.dz-cage {
  position: relative;
  width: 248px;
  height: 248px;
  pointer-events: none;
  perspective: 800px;
  color: inherit;
  animation: heroFloat 6.5s ease-in-out infinite;
}
.dz-cage-sphere {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* soft halo behind the cage — brightens when it energizes (opacity only) */
.dz-cage::before {
  content: "";
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle,
    color-mix(in srgb, currentColor 20%, transparent) 0%, transparent 64%);
  opacity: .35;
  transition: opacity .2s ease;
}
.dropzone-hero:hover .dz-cage::before,
.dropzone-hero.drag .dz-cage::before,
.dropzone-hero.capturing .dz-cage::before,
.dropzone-hero.sealed .dz-cage::before { opacity: .9; }
/* keep the cage energized through the whole capture, even if the pointer
   wanders off mid-animation */
.dropzone-hero.capturing,
.dropzone-hero.sealed {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
/* doorway rim — invisible while the door fills it, revealed once it swings */
.dz-cage-rim {
  opacity: 0;
  transition: opacity .22s ease;
}
.dropzone-hero:hover:not(.sealed) .dz-cage-rim,
.dropzone-hero.drag:not(.sealed) .dz-cage-rim,
.dropzone-hero.capturing .dz-cage-rim { opacity: .5; }
/* the door leaf — geometry baked to the exact projected faces of the sphere
   SVG, so closed = seamless cage. Left-edge hinge, house rise curve. */
.dz-cage-door {
  position: absolute;
  left: 11.25%;
  top: 11.75%;
  width: 77.51%;
  height: 77.68%;
  opacity: .92;
  transform-origin: left center;
  transform: rotateY(0deg);
  backface-visibility: visible;
  transition: transform .36s cubic-bezier(.2, .7, .3, 1);
}
.dz-cage-door svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
/* panel glazing — transparent at rest, faintly glassy once open */
.dz-door-fill {
  fill: currentColor;
  fill-opacity: 0;
  transition: fill-opacity .22s ease;
}
.dropzone-hero:hover:not(.sealed) .dz-cage-door,
.dropzone-hero.drag:not(.sealed) .dz-cage-door,
.dropzone-hero.capturing .dz-cage-door { transform: rotateY(-110deg); }
.dropzone-hero:hover:not(.sealed) .dz-door-fill,
.dropzone-hero.drag:not(.sealed) .dz-door-fill,
.dropzone-hero.capturing .dz-door-fill { fill-opacity: .1; }

/* ── The captured document — sits between sphere (behind) and door (front) ── */
.dz-thumb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 39%;
  max-height: 58%;
  transform: translate(-50%, -50%);
  opacity: 0;            /* revealed by the capture animation (WAAPI) */
  pointer-events: none;
}
.dz-thumb img,
.dz-thumb .dz-thumb-page {
  display: block;
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, .45);
}
.dz-thumb img { background: #fff; }
/* placeholder sheet — white page with text bars, like the hero orb's doc */
.dz-thumb .dz-thumb-page {
  aspect-ratio: 3 / 4;
  background:
    repeating-linear-gradient(to bottom,
      transparent 0 22%,
      #cfd8de 22% 26%,
      transparent 26% 38%) content-box,
    #fff;
  padding: 18% 16%;
  box-sizing: border-box;
}

/* ── Dashboard variant: compact row — cage left, copy right ──────────────── */
.dash-drop { margin: 18px 0 22px; }
/* Cloud-import row (Google Drive, etc.) sits below the cage card, centered —
   same component as tool pages (PF.attachCloudSources), spaced off the card. */
.dash-drop .dropzone-cloud-row { margin-top: 14px; }
/* Compound selector (not bare .dz-dash): app.css's .dropzone loads AFTER this
   file, so a single-class rule would lose the padding/radius to .dropzone's
   defaults at equal specificity. .dropzone-hero.dz-dash (0,2,0) wins outright. */
.dropzone-hero.dz-dash { padding: 16px 22px; border-radius: 16px; }
.dz-dash .dz-split {
  flex-direction: row;
  gap: 22px;
  justify-content: center;
}
.dz-dash .dz-pane-copy {
  text-align: left;
  align-self: center;
  /* fixed basis so the centered row keeps one width across empty / in-hand
     states — the cage must not shift when the copy (or actions) changes */
  flex: 0 0 360px;
  max-width: 360px;
}
.dz-dash .dz-cage { width: 188px; height: 188px; }
.dz-dash strong { font-size: 15px; }
.dz-dash .dropzone-hint { font-size: 12.5px; }

@media (max-width: 640px) {
  .dz-dash .dz-split { flex-direction: column; gap: 12px; }
  .dz-dash .dz-pane-copy { text-align: center; flex-basis: auto; }
}

@media (prefers-reduced-motion: reduce) {
  /* The global gate in main.css collapses durations; additionally hold the
     door closed and the cage still so no transform end-states linger. */
  .dz-cage { animation: none; }
  .dropzone-hero:hover:not(.sealed) .dz-cage-door,
  .dropzone-hero.drag:not(.sealed) .dz-cage-door,
  .dropzone-hero.capturing .dz-cage-door { transform: rotateY(0deg); }
}

/* ── Document in hand ───────────────────────────────────────────────────── */
/* held statically (arriving on the dashboard with a file already captured) */
.dz-thumb.shown { opacity: 1; }

/* change / clear affordances — lifted above the invisible file-input overlay
   so they're clickable; interactive children don't trigger the label */
.dz-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: center;
}
.dz-dash .dz-actions { justify-content: flex-start; }
.dz-actions .btn { padding: 4px 12px; font-size: 12.5px; }
@media (max-width: 640px) {
  .dz-dash .dz-actions { justify-content: center; }
}

/* Empty-state affordances ("Open a file…" + "Camera") — same lift above the
   invisible file-input overlay as .dz-actions so both buttons stay clickable,
   laid out as a peer row. Camera was promoted here from the cloud row below. */
.dz-open-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.dz-dash .dz-open-actions { justify-content: flex-start; }
.dz-scan-btn { display: inline-flex; align-items: center; gap: 6px; }
.dz-scan-btn svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .dz-dash .dz-open-actions { justify-content: center; }
}
