/* ============================================================
   imgblur.app — industrial darkroom aesthetic
   Archivo Black (display) + IBM Plex Mono (everything else)
   ============================================================ */
:root {
  --ink: #101010;
  --paper: #181818;
  --panel: #1f1f1f;
  --edge: #2e2e2e;
  --text: #e8e4da;
  --text-dim: #969084;
  --signal: #ffd61f;          /* hazard yellow */
  --signal-ink: #131000;
  --danger: #ff5436;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --display: "Archivo Black", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* film grain overlay */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--edge);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 18px; height: 18px; background: var(--signal);
  clip-path: polygon(0 0, 100% 0, 100% 60%, 60% 60%, 60% 100%, 0 100%);
}
.logo-text { font-family: var(--display); font-size: 19px; letter-spacing: .5px; }
.logo-text em { font-style: normal; color: var(--signal); }
.privacy-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim);
  border: 1px solid var(--edge); padding: 6px 12px; border-radius: 999px;
}
.privacy-pill .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #58d666;
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- hero ---------- */
.hero { padding: clamp(36px, 7vw, 80px) clamp(16px, 4vw, 48px) 40px; max-width: 1060px; margin: 0 auto; }
.hero-title {
  font-family: var(--display);
  font-size: clamp(44px, 9vw, 110px);
  line-height: .95; letter-spacing: -1px;
  text-transform: uppercase;
  margin-bottom: 26px;
}
.hero-title .line { display: block; animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.hero-title .line:nth-child(2) { animation-delay: .08s; }
.hero-title .line:nth-child(3) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
.hero-title .strike {
  color: transparent;
  -webkit-text-stroke: 2px var(--danger);
  position: relative;
}
.hero-title .strike::after {
  content: ""; position: absolute; left: -2%; right: 30%; top: 48%;
  height: clamp(8px, 1.6vw, 18px); background: var(--danger);
  transform: rotate(-1.5deg);
}
.hero-sub {
  max-width: 560px; color: var(--text-dim); font-size: 16px; margin-bottom: 38px;
  animation: rise .6s .24s cubic-bezier(.2,.7,.2,1) both;
}
.hero-sub strong { color: var(--text); }

/* ---------- dropzone ---------- */
.dropzone {
  border: 2px dashed #4a4538;
  background:
    repeating-linear-gradient(-45deg, transparent 0 18px, rgba(255, 214, 31, .035) 18px 36px),
    var(--paper);
  padding: clamp(40px, 7vw, 80px) 24px;
  text-align: center; cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .15s;
  animation: rise .6s .3s cubic-bezier(.2,.7,.2,1) both;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--signal); outline: none; }
.dropzone.dragover { border-color: var(--signal); transform: scale(1.005); background-color: #221f14; }
.dz-icon {
  display: inline-block; font-family: var(--mono); font-weight: 700;
  border: 1px solid var(--edge); border-bottom-width: 3px; border-radius: 6px;
  padding: 6px 12px; margin-bottom: 18px; color: var(--text-dim); font-size: 14px;
}
.dz-main { font-size: clamp(16px, 2.4vw, 21px); font-weight: 500; }
.dz-browse {
  font: inherit; color: var(--signal); background: none; border: none;
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
.dz-hint { margin-top: 10px; font-size: 12px; color: var(--text-dim); letter-spacing: .4px; }

/* ---------- editor ---------- */
.editor { animation: rise .4s both; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  background: var(--panel); border: 1px solid var(--edge);
  padding: 10px 14px; position: sticky; top: 8px; z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.tool-group { display: flex; align-items: center; gap: 6px; }
.tool-group + .tool-group { border-left: 1px solid var(--edge); padding-left: 18px; }
.push-right { margin-left: auto; }
.tool-btn {
  font: 500 13px var(--mono); color: var(--text-dim);
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  padding: 7px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: color .15s, border-color .15s, background .15s;
}
.tool-btn:hover:not(:disabled) { color: var(--text); border-color: var(--edge); }
.tool-btn.active { color: var(--signal-ink); background: var(--signal); border-color: var(--signal); font-weight: 700; }
.tool-btn:disabled { opacity: .35; cursor: default; }
.tb-swatch { width: 14px; height: 14px; border-radius: 2px; display: inline-block; }
.swatch-blur  { background: linear-gradient(135deg,#9b9b9b,#5d5d5d); filter: blur(1.2px); }
.swatch-pixel { background: conic-gradient(#bbb 25%, #666 0 50%, #999 0 75%, #444 0); }
.swatch-black { background: #000; border: 1px solid #555; }
.tool-btn.active .swatch-black { border-color: var(--signal-ink); }

.slider-group label { font-size: 12px; color: var(--text-dim); }
.slider-group output { font-size: 12px; min-width: 2ch; color: var(--signal); font-weight: 700; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 110px; height: 3px;
  background: var(--edge); border-radius: 2px; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--signal); border: 2px solid var(--ink);
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--signal); border: 2px solid var(--ink);
}

.dl-btn {
  font: 700 14px var(--mono); letter-spacing: .3px;
  color: var(--signal-ink); background: var(--signal);
  border: none; border-radius: 4px; padding: 10px 18px; cursor: pointer;
  box-shadow: 0 3px 0 #8f7600;
  transition: transform .1s, box-shadow .1s, filter .15s;
}
.dl-btn:hover { filter: brightness(1.06); }
.dl-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8f7600; }

.canvas-shell {
  margin-top: 14px; position: relative;
  background:
    repeating-conic-gradient(#202020 0 25%, #262626 0 50%) 0 0/24px 24px;
  border: 1px solid var(--edge);
  display: flex; justify-content: center; align-items: center;
  min-height: 220px; overflow: hidden;
}
#canvas { max-width: 100%; height: auto; display: block; cursor: crosshair; touch-action: none; }
.hud {
  position: absolute; bottom: 10px; left: 12px;
  font-size: 11px; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-dim); background: rgba(16,16,16,.8);
  padding: 4px 10px; border-radius: 3px; pointer-events: none;
}
.editor-tip { margin-top: 12px; font-size: 12.5px; color: var(--text-dim); }
.editor-tip strong { color: var(--signal); }

/* ---------- trust strip ---------- */
.strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  border-block: 1px solid var(--edge); margin-top: 64px;
}
.strip-item {
  padding: 26px clamp(16px, 3vw, 36px);
  border-right: 1px solid var(--edge);
  display: flex; flex-direction: column; gap: 6px;
}
.strip-item:last-child { border-right: none; }
.strip-item b { font-family: var(--display); font-size: 16px; letter-spacing: .4px; text-transform: uppercase; }
.strip-item span { font-size: 12.5px; color: var(--text-dim); }

/* ---------- content / SEO ---------- */
.content { max-width: 760px; margin: 0 auto; padding: 64px clamp(16px, 4vw, 48px) 80px; }
.content h2 {
  font-family: var(--display); font-size: clamp(20px, 3vw, 27px);
  text-transform: uppercase; letter-spacing: .3px;
  margin: 52px 0 16px;
}
.content h2:first-child { margin-top: 0; }
.content p { color: var(--text-dim); margin-bottom: 14px; }
.content p strong, .content li b { color: var(--text); }
.content em { color: var(--signal); font-style: normal; }

.use-grid {
  list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px; background: var(--edge); border: 1px solid var(--edge); margin: 20px 0;
}
.use-grid li { background: var(--paper); padding: 16px 18px; font-size: 13.5px; color: var(--text-dim); }
.use-grid li b { display: block; margin-bottom: 4px; font-size: 14px; }

details {
  border: 1px solid var(--edge); background: var(--paper);
  margin-bottom: 8px; padding: 0 18px;
}
details summary {
  cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 14px;
  list-style: none; position: relative; padding-right: 30px;
}
details summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  color: var(--signal); font-size: 18px;
}
details[open] summary::after { content: "–"; }
details p { padding-bottom: 16px; font-size: 13.5px; }
details a { color: var(--signal); }

/* ---------- pro card ---------- */
.pro-card {
  margin-top: 56px; border: 2px solid var(--signal);
  background: linear-gradient(160deg, #221e0e, var(--paper) 55%);
  padding: clamp(22px, 4vw, 36px);
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.pro-copy h3 { font-family: var(--display); text-transform: uppercase; font-size: 19px; margin-bottom: 8px; }
.pro-copy p { font-size: 13.5px; max-width: 420px; margin: 0; }
.pro-form { display: flex; gap: 8px; flex-wrap: wrap; }
.pro-form input {
  font: 14px var(--mono); color: var(--text);
  background: var(--ink); border: 1px solid var(--edge); border-radius: 4px;
  padding: 11px 14px; min-width: 230px;
}
.pro-form input:focus { outline: none; border-color: var(--signal); }
.pro-form button {
  font: 700 14px var(--mono); color: var(--signal-ink); background: var(--signal);
  border: none; border-radius: 4px; padding: 11px 18px; cursor: pointer;
}
.pro-form button:hover { filter: brightness(1.06); }
.pro-form button:disabled { opacity: 0.6; cursor: wait; }
.pro-status { margin-top: 10px; font-size: 0.85rem; }
.pro-status.ok { color: var(--signal); }
.pro-status.err { color: var(--danger); }

/* ---------- footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  padding: 22px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--edge);
  font-size: 12px; color: var(--text-dim);
}
.foot-kbd { letter-spacing: .4px; }

@media (max-width: 640px) {
  .tool-group + .tool-group { border-left: none; padding-left: 0; }
  .push-right { margin-left: 0; width: 100%; }
  .dl-btn { width: 100%; }
}
