/* ==========================================================================
   PixelDrop — "Darkroom" design system
   A file becomes a link the way a negative becomes a print: drop it in,
   let it develop, walk away with something you can hand to someone else.
   ========================================================================== */
:root {
  /* darkroom neutrals */
  --darkroom:       #15110c;
  --darkroom-2:     #1c1710;
  --darkroom-3:     #241d14;
  --paper:          #f3ecdc;
  --paper-dim:      #b7ab93;
  --paper-faint:    #7c7260;
  --border:         #372c1e;
  --border-soft:    #2a2116;

  /* safelight — the warm red-orange glow of a photo darkroom */
  --safelight:      #ff5a2e;
  --safelight-dim:  #c8431f;
  --safelight-soft: rgba(255, 90, 46, 0.14);

  /* film base — the teal-cyan of processed film / the "it worked" color */
  --film:           #4fd6c4;
  --film-soft:      rgba(79, 214, 196, 0.14);

  --whatsapp:       #25d366;
  --danger:         #ff6b6b;
  --danger-soft:    rgba(255, 107, 107, 0.14);

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --header-h: 72px;

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  position: relative;
  min-height: 100vh;
  background: var(--darkroom);
  color: var(--paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle film-grain texture over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--safelight); color: #1a1109; }

a { color: inherit; }

/* ==========================================================================
   Header
   ========================================================================== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: linear-gradient(180deg, rgba(21, 17, 12, 0.97) 0%, rgba(21, 17, 12, 0.88) 100%);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 200;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--darkroom-3);
  border: 1px solid var(--border);
  color: var(--safelight);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.brand:hover .brand-mark {
  border-color: var(--safelight-dim);
  box-shadow: 0 0 0 1px rgba(255, 90, 46, 0.25), 0 0 16px rgba(255, 90, 46, 0.25);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--paper);
}

.brand-name em {
  font-style: normal;
  color: var(--safelight);
}

.brand:active { transform: translateY(1px); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  color: var(--paper-dim);
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  transition: color 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}

.icon-btn:active { transform: translateY(1px) scale(0.96); }

.icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #0c0906;
  color: var(--paper);
  padding: 5px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.icon-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.icon-btn:hover { background: rgba(243, 236, 220, 0.05); border-color: var(--border); }

.whatsapp-btn:hover {
  color: var(--whatsapp);
  box-shadow: 0 0 0 1px rgba(37,211,102,0.3), 0 0 18px rgba(37,211,102,0.25);
}

.github-btn:hover {
  color: var(--paper);
  box-shadow: 0 0 0 1px rgba(243,236,220,0.25), 0 0 18px rgba(243,236,220,0.12);
}

.api-btn:hover {
  color: var(--film);
  box-shadow: 0 0 0 1px rgba(79,214,196,0.3), 0 0 18px rgba(79,214,196,0.25);
}

/* ==========================================================================
   Page shell + footer
   ========================================================================== */
.page {
  position: relative;
  padding-top: var(--header-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 20px 28px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--paper-faint);
  letter-spacing: 0.02em;
  border-top: 1px solid var(--border-soft);
}

.site-footer .dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--paper-faint);
  flex: none;
}

.site-footer a { color: var(--paper-dim); text-decoration: none; }
.site-footer a:hover { color: var(--film); }

/* ==========================================================================
   Hero / upload card
   ========================================================================== */
.hero {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.hero-glow-a {
  width: 460px; height: 460px;
  background: var(--safelight);
  top: -160px; left: -120px;
}

.hero-glow-b {
  width: 380px; height: 380px;
  background: var(--film);
  bottom: -150px; right: -90px;
  opacity: 0.18;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--safelight);
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--safelight);
  box-shadow: 0 0 8px 1px rgba(255,90,46,0.7);
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 470px;
  background: linear-gradient(180deg, var(--darkroom-2) 0%, rgba(28, 23, 16, 0.92) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  overflow: hidden;
}

/* punched sprocket-hole strips, top and bottom of the card — the film-strip
   signature that carries through the whole page */
.sprockets {
  height: 14px;
  background: var(--darkroom-3);
  background-image: radial-gradient(circle, var(--darkroom-2) 3px, transparent 3.2px);
  background-size: 22px 14px;
  background-position: 11px center;
  background-repeat: repeat-x;
  border-bottom: 1px solid var(--border-soft);
}

.sprockets.sprockets-bottom {
  border-bottom: none;
  border-top: 1px solid var(--border-soft);
}

.card-body { padding: 34px 34px 30px; }

.card-head { margin-bottom: 24px; }

.card-head h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.subtitle {
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.93rem;
  line-height: 1.5;
}

/* drop zone, framed like a viewfinder */
#drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 40px 16px;
  cursor: pointer;
  text-align: center;
  background: rgba(243, 236, 220, 0.015);
  transition: border-color 0.15s, background 0.15s;
}

.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--paper-faint);
  opacity: 0.55;
  transition: border-color 0.15s, opacity 0.15s;
}
.corner-tl { top: 8px; left: 8px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.corner-tr { top: 8px; right: 8px; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.corner-bl { bottom: 8px; left: 8px; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.corner-br { bottom: 8px; right: 8px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

.drop-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--safelight-soft);
  color: var(--safelight);
}

#drop-zone:hover,
#drop-zone.dragging {
  border-color: var(--safelight);
  background: var(--safelight-soft);
}

#drop-zone:hover .corner,
#drop-zone.dragging .corner { border-color: var(--safelight); opacity: 1; }

#drop-zone.has-file { border-color: var(--film); border-style: solid; }
#drop-zone.has-file .corner { border-color: var(--film); opacity: 1; }
#drop-zone.has-file .drop-icon { background: var(--film-soft); color: var(--film); }

#drop-text {
  color: var(--paper-dim);
  font-size: 0.92rem;
}

#file-name {
  color: var(--film);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.83rem;
  word-break: break-all;
}

#submit-btn {
  position: relative;
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--safelight);
  color: #1a0f08;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 90, 46, 0.25);
}

#submit-btn:hover { filter: brightness(1.08); box-shadow: 0 8px 28px rgba(255, 90, 46, 0.4); }
#submit-btn:active { transform: translateY(1px); }
#submit-btn:disabled { cursor: not-allowed; opacity: 0.75; box-shadow: none; }

.btn-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(26, 15, 8, 0.3);
  border-top-color: #1a0f08;
  animation: spin 0.7s linear infinite;
}

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

.hidden { display: none !important; }

#progress-wrap {
  position: relative;
  margin-top: 16px;
  height: 8px;
  background: var(--darkroom-3);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--safelight), var(--film));
  transition: width 0.2s;
}

#result {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px dashed var(--border);
}

/* rubber-stamp badges — the signature "developed" / "rejected" mark */
.stamp {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  margin-bottom: 18px;
  border: 2px solid currentColor;
  border-radius: 3px 13px 4px 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: rotate(-2.5deg);
}

.stamp::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid currentColor;
  border-radius: 5px 15px 6px 14px;
  opacity: 0.35;
  transform: rotate(1.5deg);
  pointer-events: none;
}

.success-badge { color: var(--film); }
.error-badge { color: var(--danger); }

#error { margin-top: 20px; }

.link-row { margin-bottom: 14px; }

.link-row label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--paper-faint);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.copy-field {
  display: flex;
  gap: 8px;
}

.copy-field input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--darkroom);
  color: var(--paper);
  font-size: 0.83rem;
  font-family: var(--font-mono);
}

.copy-field input:focus { outline: 1px solid var(--safelight); outline-offset: 1px; }

.copy-btn {
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--darkroom-3);
  color: var(--paper);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.copy-btn:hover { background: var(--film-soft); border-color: var(--film); color: var(--film); }

.open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--safelight);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.open-btn:hover { text-decoration: underline; }

/* ==========================================================================
   API docs page
   ========================================================================== */
.docs {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 24px 40px;
  width: 100%;
  z-index: 1;
}

.docs-head { margin-bottom: 34px; }

.docs-head h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.docs-card {
  position: relative;
  background: var(--darkroom-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 22px;
}

.docs-card-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--paper-faint);
  margin: 20px 0 8px;
}

.docs-card-label:first-child { margin-top: 0; }

.mono-field input { font-weight: 500; }

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.method-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.method-badge.post {
  background: var(--safelight-soft);
  color: var(--safelight);
  border-color: rgba(255,90,46,0.3);
}

.endpoint-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
}

.endpoint-desc {
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.89rem;
  line-height: 1.55;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.param-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--paper-dim);
}

.param-table tr:last-child td { border-bottom: none; }

.param-table td:first-child {
  width: 170px;
  color: var(--paper);
}

.param-table code {
  background: var(--darkroom);
  border: 1px solid var(--border-soft);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--film);
}

.code-block {
  background: var(--darkroom);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--paper-dim);
  white-space: pre;
  line-height: 1.65;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 520px) {
  .topbar { padding: 0 16px; }
  .brand-name { font-size: 1.05rem; }
  .card-body { padding: 26px 22px 24px; }
  .docs { padding: 42px 16px 30px; }
  .param-table td:first-child { width: 120px; }
}
