/* LocalKit — privacy-first utility aesthetic */
:root {
  --bg: #0f1419;
  --bg-elevated: #1a222d;
  --bg-soft: #243041;
  --ink: #e8eef6;
  --ink-muted: #9aa8bc;
  --ink-faint: #6b7a90;
  --border: #2e3a4a;
  --border-strong: #44566e;
  --accent: #5b8def;
  --accent-hover: #7aa3f5;
  --accent-soft: rgba(91, 141, 239, 0.14);
  --accent-ink: #c5d7ff;
  --success: #3ecf8e;
  --success-bg: rgba(62, 207, 142, 0.12);
  --warn: #e6b84d;
  --warn-bg: rgba(230, 184, 77, 0.12);
  --danger: #f07178;
  --danger-bg: rgba(240, 113, 120, 0.12);
  --focus: #7aa3f5;
  --shadow: 0 1px 2px rgba(0,0,0,0.25), 0 8px 24px rgba(0,0,0,0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max: 1120px;
  --header-h: 64px;
  --drop-border: #3d5169;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.site-header {
  background: rgba(26, 34, 45, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--accent-hover); }
.logo__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, #4a7ae8, #6ec8ff);
  color: #0a1220;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
}
.nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent-hover); }
.badge-privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid rgba(62, 207, 142, 0.35);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .badge-privacy { display: none; }
  .nav a:not(.nav-keep) { display: none; }
}

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 2rem 1.25rem 5.5rem;
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 720px) {
  .site-footer__inner { grid-template-columns: 1.3fr 1fr 1fr 0.9fr; }
}
.site-footer h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin: 0 0 0.6rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.35rem 0; }
.site-footer a { color: var(--ink-muted); text-decoration: none; font-size: 0.92rem; }
.site-footer a:hover { color: var(--accent-hover); }
.site-footer__tag { color: var(--ink-muted); font-size: 0.92rem; margin: 0.4rem 0 0; }
.site-footer__legal {
  max-width: var(--max);
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}
.hero {
  padding: 1.75rem 0 1.25rem;
}
.hero h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.hero__tag {
  font-size: 1.05rem;
  color: var(--ink-muted);
  margin: 0 0 1.1rem;
  max-width: 40rem;
}
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}
.trust {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
}
.trust--ok { color: var(--success); border-color: rgba(62, 207, 142, 0.35); background: var(--success-bg); }
.trust svg { width: 14px; height: 14px; flex-shrink: 0; }

.tool-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 1.5rem 0 2rem;
}
@media (min-width: 640px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .tool-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: inherit;
}
.tool-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 1.15rem;
}
.tool-card h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.tool-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
  flex: 1;
}
.tool-card__cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}
.dropzone {
  border: 2px dashed var(--drop-border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 2rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  position: relative;
}
.dropzone:hover, .dropzone:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone.is-dragover {
  border-color: var(--success);
  background: var(--success-bg);
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.25);
}
.dropzone__title {
  margin: 0 0 0.35rem;
  font-weight: 650;
  font-size: 1.05rem;
}
.dropzone__hint {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.controls {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}
@media (min-width: 640px) {
  .controls.cols-2 { grid-template-columns: 1fr 1fr; }
  .controls.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.field input[type="number"],
.field input[type="text"],
.field select {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
}
.field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 650;
  font-size: 0.92rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary {
  background: var(--accent);
  color: #0a1220;
}
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn--ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-hover); }
.btn--danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(240, 113, 120, 0.35);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}
.chip.is-active, .chip:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.file-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.file-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
}
.file-item__thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-soft);
}
.file-item__meta { min-width: 0; }
.file-item__name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-item__size {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-family: var(--mono);
}
.file-item__actions { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.status {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}
.status--busy { color: var(--warn); }
.status--ok { color: var(--success); }
.status--err { color: var(--danger); }

.prose {
  max-width: 42rem;
  color: var(--ink-muted);
}
.prose h2 { color: var(--ink); margin-top: 1.75rem; font-size: 1.25rem; }
.prose h3 { color: var(--ink); margin-top: 1.25rem; font-size: 1.05rem; }
.prose p, .prose li { font-size: 0.98rem; }
.faq details {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin: 0.55rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--ink);
}
.faq details[open] summary { margin-bottom: 0.5rem; }
.faq details p { margin: 0; color: var(--ink-muted); font-size: 0.95rem; }

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 0 0 0.75rem;
}
.breadcrumbs a { color: var(--ink-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

.ad-slot {
  margin: 1rem 0;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.ad-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.ad-placeholder {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--ink-faint);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  text-align: center;
  padding: 0.75rem;
}
.ad-slot--sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  margin: 0;
  padding: 0.4rem 0.75rem calc(0.4rem + env(safe-area-inset-bottom));
  background: rgba(15, 20, 25, 0.95);
  border-top: 1px solid var(--border);
  display: none;
}
@media (max-width: 720px) {
  .ad-slot--sticky:not(.is-dismissed) { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; }
  .ad-slot--sticky .ad-placeholder { min-height: 50px; max-width: none; flex: 1; }
}
.ad-dismiss {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.exif-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.exif-table th, .exif-table td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.exif-table th {
  width: 38%;
  color: var(--ink-muted);
  font-weight: 600;
}
.exif-table td { font-family: var(--mono); word-break: break-word; }
.preview-pair {
  display: grid;
  gap: 1rem;
}
@media (min-width: 720px) {
  .preview-pair { grid-template-columns: 1fr 1fr; }
}
.preview-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}
.preview-box img {
  max-height: 220px;
  border-radius: 8px;
  background: #000;
}
.preview-box__label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.compare-sizes {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.compare-sizes strong { color: var(--success); }

.note {
  font-size: 0.88rem;
  color: var(--ink-muted);
  background: var(--warn-bg);
  border: 1px solid rgba(230, 184, 77, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  margin: 0.75rem 0 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
