/* cleanplate web demo.
   Header, hero, decorative frames, tabs, card, dropzone and buttons adapted from
   ishara-madu/gemini-watermark-remover (MIT, © 2026 Ishara Madushanka); colours, copy and the result view are ours. */
:root {
  --bg-primary: #f5f5f7;
  --bg-card: #ffffff;
  --bg-card-border: #e2e8f0;
  --bg-header: rgba(245, 245, 247, 0.85);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --brand-primary: #0f766e;
  --brand-gradient: linear-gradient(135deg, #14b8a6 0%, #0d9488 50%, #115e59 100%);
  --brand-glow: 0 8px 25px -4px rgba(13, 148, 136, 0.28);
  --ok: #16a34a;
  --radius-xl: 1.25rem;
  --radius-lg: 1rem;
  --radius-md: 0.625rem;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --t: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/plus-jakarta-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/plus-jakarta-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  /* soft aurora: teal top-left, violet top-right, a rose glow lower down */
  background-image:
    radial-gradient(60rem 40rem at -10% -10%, rgba(45, 212, 191, 0.30), transparent 60%),
    radial-gradient(50rem 36rem at 110% 0%, rgba(139, 92, 246, 0.24), transparent 60%),
    radial-gradient(46rem 34rem at 85% 75%, rgba(244, 114, 182, 0.18), transparent 60%),
    radial-gradient(50rem 40rem at 5% 90%, rgba(56, 189, 248, 0.16), transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }

/* ── Header ── */
.app-header {
  position: sticky; top: 0; z-index: 100; width: 100%;
  background: rgba(245, 245, 247, 0.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.header-container {
  max-width: 1280px; margin: 0 auto; padding: 0.85rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.brand-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; }
.nav-menu { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 0.5rem 0.8rem; border-radius: var(--radius-md); text-decoration: none;
  font-size: 0.9rem; color: var(--text-muted); transition: all var(--t);
}
.nav-link:hover { color: var(--text-main); background: #eaeaee; }
.btn-github {
  display: inline-flex; align-items: center; gap: 0.45rem; margin-left: 0.5rem;
  padding: 0.5rem 0.85rem; border-radius: calc(var(--radius-lg) - 0.25rem);
  font-size: 0.825rem; text-decoration: none; line-height: 1;
  background: #111828; color: #e5e7eb; box-shadow: var(--shadow-sm); transition: all var(--t);
}
.btn-github:hover { background: #202533; box-shadow: var(--shadow-md); }

/* ── Layout ── */
.container { position: relative; width: 100%; max-width: 1000px; margin: 0 auto; padding: 1.5rem 1rem 3rem; flex: 1; }

/* ── Hero ── */
.hero-section { position: relative; z-index: 3; text-align: center; margin: 2rem auto 2.5rem; max-width: 900px; }
.hero-section::before {
  content: ''; position: absolute; inset: -70px -140px -40px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(closest-side at 35% 45%, rgba(45, 212, 191, 0.22), transparent),
    radial-gradient(closest-side at 68% 40%, rgba(139, 92, 246, 0.18), transparent),
    radial-gradient(closest-side at 52% 75%, rgba(244, 114, 182, 0.12), transparent);
  filter: blur(24px);
}
.hero-eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--brand-primary); background: rgba(20, 184, 166, 0.1); padding: 0.3rem 0.75rem; border-radius: 999px;
  margin-bottom: 1rem;
}
.hero-title { font-size: 3.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 1rem; letter-spacing: -0.025em; }
.hero-accent { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-description { font-size: 1.02rem; color: var(--text-muted); line-height: 1.65; max-width: 680px; margin: 0 auto; }
.hero-description strong { color: var(--text-main); }
.hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.4rem; }
.hero-badge-pill {
  display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.8125rem; font-weight: 500;
  background: var(--bg-card); border: 1px solid var(--bg-card-border); padding: 0.35rem 0.8rem;
  border-radius: 999px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--c); display: inline-block; }

/* ── Decorative before/after frames ── */
.hero-bg-frame-container { position: absolute; pointer-events: none; z-index: 1; }
.hero-bg-frame-container.left { top: 250px; left: -16%; width: 250px; height: 250px; }
.hero-bg-frame-container.right { top: 270px; right: -20%; width: 330px; height: 330px; }
.hero-bg-frame-container.left .hero-bg-frame { transform: rotate(-6deg); }
.hero-bg-frame-container.right .hero-bg-frame { transform: rotate(6deg); }
.hero-bg-frame {
  position: relative; width: 100%; height: 100%; background: #fff; padding: 1rem;
  border-radius: 2.6rem; border: 1px solid var(--bg-card-border);
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.1); opacity: 0.92;
}
.hero-bg-img { width: 100%; height: 100%; object-fit: cover; border-radius: 1.8rem; display: block; }
.frame-tag {
  position: absolute; top: 1.6rem; left: 1.6rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; background: rgba(15, 23, 42, 0.75); color: #fff; padding: 0.25rem 0.6rem; border-radius: 999px;
}
.frame-tag.ok { background: rgba(13, 148, 136, 0.9); }
@media (max-width: 1180px) { .hero-bg-frame-container { display: none; } }

/* ── Tabs ── */
.tab-container {
  position: relative; z-index: 2; display: flex; gap: 0.5rem; margin: 3rem auto 1.5rem;
  background: rgba(226, 232, 240, 0.7); backdrop-filter: blur(8px); padding: 0.35rem; border-radius: var(--radius-lg); max-width: 320px;
}
.tab-btn {
  flex: 1; padding: 0.65rem 1rem; border-radius: calc(var(--radius-lg) - 0.25rem); border: none; background: transparent;
  color: var(--text-muted); font: 600 0.9rem inherit; font-family: inherit; cursor: pointer; transition: all var(--t);
}
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active { background: #fff; color: var(--text-main); box-shadow: var(--shadow-sm); }

/* ── Card + dropzone ── */
.card {
  position: relative; z-index: 2; background: var(--bg-card); border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl); padding: 1.75rem; box-shadow: var(--shadow-lg);
}
.dropzone {
  border: 2px dashed #cbd5e1; border-radius: var(--radius-lg); padding: 3.25rem 1.5rem; text-align: center; cursor: pointer;
  background: var(--bg-primary); transition: all var(--t); display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--brand-primary); background: rgba(20, 184, 166, 0.04); transform: translateY(-2px); }
.dropzone:focus-within { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.dropzone-icon { color: var(--brand-primary); margin-bottom: 0.5rem; transition: transform var(--t); }
.dropzone:hover .dropzone-icon { transform: scale(1.1); }
.dropzone-title { font-size: 1.05rem; font-weight: 700; }
.dropzone-sub { color: var(--text-muted); font-size: 0.825rem; }

.busy { text-align: center; padding: 3rem 1rem; }
.spinner {
  width: 2.6rem; height: 2.6rem; margin: 0 auto 1rem; border-radius: 50%;
  border: 3px solid rgba(13, 148, 136, 0.2); border-top-color: var(--brand-primary); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.busy-title { font-weight: 700; }
.busy-sub { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.3rem; }

.notice { text-align: center; padding: 1.5rem 1rem; }
.notice-title { font-weight: 700; font-size: 1.05rem; }
.notice-sub { color: var(--text-muted); font-size: 0.9rem; margin: 0.4rem auto 1rem; max-width: 560px; }
.error { margin-top: 1rem; color: #b91c1c; font-size: 0.9rem; text-align: center; }

/* ── Result ── */
.detect-badge {
  display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 500; margin-bottom: 1rem;
  color: #065f46; background: #ecfdf5; border: 1px solid #a7f3d0; padding: 0.4rem 0.8rem; border-radius: 999px;
}
.result-row { display: grid; grid-template-columns: 1fr 220px; gap: 1rem; align-items: start; }
.compare {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #e5e7eb; --pos: 50%;
  border: 1px solid var(--bg-card-border); touch-action: none; justify-self: center; width: fit-content; max-width: 100%;
}
.compare canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 72vh; }
.compare canvas.before { width: 100%; height: 100%; max-height: none; }
.compare canvas.before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: #fff; transform: translateX(-1px); pointer-events: none; box-shadow: 0 0 6px rgba(0,0,0,.35); }
.compare-line span {
  position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%); border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-md);
}
.compare-line span::before { content: '‹ ›'; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--text-main); letter-spacing: 2px; }
.compare input[type='range'] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare input[type='range']:focus-visible + .compare-tag { outline: 2px solid var(--brand-primary); }
.compare-tag {
  position: absolute; top: 0.6rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: #fff; background: rgba(15, 23, 42, 0.7); padding: 0.2rem 0.55rem; border-radius: 999px; pointer-events: none;
}
.compare-tag.l { left: 0.6rem; }
.compare-tag.r { right: 0.6rem; background: rgba(13, 148, 136, 0.9); }
.zoom-col { display: flex; flex-direction: column; gap: 0.75rem; }
.zoom-card { background: var(--bg-primary); border: 1px solid var(--bg-card-border); border-radius: var(--radius-md); padding: 0.5rem; }
.zoom-card figcaption { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.4rem; }
.zoom-card figcaption.ok { color: var(--ok); }
.zoom-card canvas { display: block; width: 100%; height: auto; border-radius: 0.4rem; image-rendering: pixelated; }
.log-box { margin-top: 1rem; font-size: 0.85rem; }
.log-box summary { cursor: pointer; color: var(--text-muted); }
.log {
  margin-top: 0.5rem; padding: 0.75rem; background: #0f172a; color: #cbd5e1; border-radius: var(--radius-md);
  font: 0.78rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; text-align: left; overflow-x: auto;
}
.notice .log { max-width: 640px; margin: 0 auto 1rem; }
.actions { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.25rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md); font: 500 0.9rem inherit; font-family: inherit; border: none; cursor: pointer; transition: all var(--t);
}
.btn-primary { background: var(--brand-gradient); color: #fff; box-shadow: var(--brand-glow); }
.btn-primary:hover { box-shadow: 0 10px 25px -4px rgba(13, 148, 136, 0.4); }
.btn-secondary { background: #fff; color: var(--text-main); border: 1px solid var(--bg-card-border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--bg-primary); border-color: #cbd5e1; }
.btn:focus-visible, .tab-btn:focus-visible, .nav-link:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

/* ── Video panel ── */
.progress { width: min(420px, 100%); height: 6px; margin: 0.9rem auto 0; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--brand-gradient); transition: width 0.3s; }
.video-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.video-pair figure { background: var(--bg-primary); border: 1px solid var(--bg-card-border); border-radius: var(--radius-md); padding: 0.5rem; }
.video-pair figcaption { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.4rem; }
.video-pair figcaption.ok { color: var(--ok); }
.zoom-pair { margin-top: 0.75rem; }
.zoom-pair canvas { display: block; width: 100%; height: auto; border-radius: 0.4rem; background: #000; image-rendering: pixelated; }
.video-pair video { display: block; width: 100%; max-height: 70vh; border-radius: 0.4rem; background: #000; }
a.btn { text-decoration: none; }
.card-title { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card-text { color: var(--text-muted); line-height: 1.6; font-size: 0.95rem; }
.cmd { margin: 1rem 0; padding: 1rem; background: #0f172a; color: #e2e8f0; border-radius: var(--radius-md); overflow-x: auto; font: 0.85rem/1.6 ui-monospace, monospace; }


.app-footer { width: 100%; text-align: center; padding: 2rem 1rem 2.5rem; font-size: 0.85rem; border-top: 1px solid var(--bg-card-border); }
.app-footer p + p { margin-top: 0.35rem; font-size: 0.8rem; }

@media (max-width: 760px) {
  .hero-title { font-size: 2.2rem; }
  .result-row { grid-template-columns: 1fr; }
  .zoom-col { flex-direction: row; }
  .zoom-card { flex: 1; }
  .video-pair { grid-template-columns: 1fr; }
  .nav-link { display: none; }
  .card { padding: 1.1rem; }
}

/* ── Feedback ── */
.nav-btn { border: none; background: none; font: inherit; cursor: pointer; }
.link { border: none; background: none; padding: 0; font: inherit; color: var(--brand-primary); text-decoration: underline; cursor: pointer; }
.actions.center { justify-content: center; }
.fb { margin: auto; border: none; border-radius: var(--radius-xl); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.35); color: var(--text-main); }
.fb::backdrop { background: rgba(15, 23, 42, 0.35); backdrop-filter: blur(3px); }
.fb form { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.85rem; }
.fb h2 { font-size: 1.25rem; letter-spacing: -0.02em; }
.fb-kinds { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fb-kinds label { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; padding: 0.35rem 0.7rem; border: 1px solid var(--bg-card-border); border-radius: 999px; cursor: pointer; }
.fb-kinds label:has(input:checked) { border-color: var(--brand-primary); background: rgba(20, 184, 166, 0.08); }
.fb-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; font-weight: 600; }
.fb-field textarea, .fb-field input { font: inherit; font-weight: 400; padding: 0.6rem 0.75rem; border: 1px solid var(--bg-card-border); border-radius: var(--radius-md); resize: vertical; }
.fb-field textarea:focus, .fb-field input:focus { outline: 2px solid var(--brand-primary); outline-offset: 1px; }
.fb-check { font-size: 0.85rem; display: flex; gap: 0.4rem; align-items: center; }
.fb-ctx { max-height: 160px; overflow: auto; margin: 0; }
.fb-note { font-size: 0.8rem; color: var(--text-muted); }
.fb-status { font-size: 0.85rem; min-height: 1.2em; }
.fb-status.ok { color: var(--ok); } .fb-status.err { color: #b91c1c; }
.fb .actions { margin-top: 0; }
