@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600&family=DM+Serif+Display:ital@0;1&family=Geist+Mono:wght@400;500&display=swap');

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

:root {
  --bg:           #f7f6f3;
  --bg2:          #ffffff;
  --bg3:          #f0ede8;
  --border:       #e4e0d8;
  --border2:      #ccc8bf;
  --text:         #1a1916;
  --text2:        #6b6760;
  --text3:        #a09c97;
  --accent:       #1a1916;
  --accent-bg:    #1a1916;
  --accent-text:  #f7f6f3;
  --green:        #2d6a4f;
  --green-bg:     #ebf5f0;
  --red:          #c0392b;
  --red-bg:       #fdf0ee;
  --amber:        #b45309;
  --amber-bg:     #fef3e2;
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    16px;
  --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Instrument Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; }
.display { font-family: 'DM Serif Display', serif; font-weight: 400; }
.mono { font-family: 'Geist Mono', monospace; }

/* ── NAV ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247,246,243,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 0;
}
.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 19px;
  color: var(--text);
  text-decoration: none;
  margin-right: 32px;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.nav-logo em { font-style: italic; color: var(--text2); }
.nav-links {
  display: flex; gap: 2px;
  flex: 1;
}
.nav-link {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--text); background: var(--bg3); }
.nav-cta {
  margin-left: auto;
  padding: 6px 16px;
  background: var(--accent-bg);
  color: var(--accent-text);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.nav-cta:hover { opacity: 0.85; }

/* ── HERO ── */
.hero {
  padding: 64px 24px 48px;
  max-width: 700px;
  margin: 0 auto;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500;
  color: var(--text2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero-eyebrow::before {
  content: '';
  width: 20px; height: 1px;
  background: var(--border2);
}
.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 16px;
}
.hero h1 em { font-style: italic; color: var(--text2); }
.hero p {
  font-size: 16px;
  color: var(--text2);
  line-height: 1.65;
  max-width: 520px;
  font-weight: 400;
}
.hero-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 24px;
}
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px; font-weight: 500;
  color: var(--text2);
}
.pill svg { width: 12px; height: 12px; }

/* ── TOOL CONTAINER ── */
.tool-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── CARD ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ── DROP ZONE ── */
.drop-zone {
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  background: var(--bg2);
  position: relative;
  box-shadow: var(--shadow);
}
.drop-zone:hover, .drop-zone.over {
  border-color: var(--text);
  background: var(--bg3);
}
.drop-zone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.drop-icon {
  width: 52px; height: 52px;
  margin: 0 auto 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.drop-icon svg { width: 22px; height: 22px; color: var(--text2); }
.drop-zone h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 22px; font-weight: 400;
  margin-bottom: 8px;
}
.drop-zone p { font-size: 14px; color: var(--text2); line-height: 1.5; }
.drop-zone strong { color: var(--text); font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ── TWO COL ── */
.two-col {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 680px) { .two-col { grid-template-columns: 1fr; } }

/* ── SIDEBAR ── */
.sidebar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.sidebar-section { margin-bottom: 20px; }
.sidebar-section:last-child { margin-bottom: 0; }
.sidebar-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
  display: block;
}

/* ── SLIDERS ── */
.slider-row { margin-bottom: 12px; }
.slider-row-label {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 5px;
  color: var(--text);
}
.slider-row-label .val {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--text2);
  background: var(--bg3);
  padding: 1px 6px;
  border-radius: 4px;
}
input[type="range"] {
  width: 100%; height: 3px;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--text);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg2);
  box-shadow: 0 0 0 1px var(--border2);
  transition: transform 0.12s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ── CHIP GROUP ── */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px; font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.13s;
  background: var(--bg2);
  white-space: nowrap;
}
.chip:hover { border-color: var(--border2); color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ── FORMAT GRID ── */
.fmt-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.fmt-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.13s;
  background: var(--bg2);
}
.fmt-card:hover { border-color: var(--border2); }
.fmt-card.active { background: var(--text); border-color: var(--text); }
.fmt-card .name { font-size: 12px; font-weight: 600; color: var(--text); }
.fmt-card .desc { font-size: 10px; color: var(--text2); margin-top: 1px; }
.fmt-card.active .name, .fmt-card.active .desc { color: var(--bg); }

/* ── TOGGLE ── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text);
  margin-bottom: 10px;
}
.toggle { position: relative; width: 34px; height: 18px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-bg {
  position: absolute; inset: 0;
  background: var(--border2);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.18s;
}
.toggle input:checked ~ .toggle-bg { background: var(--text); }
.toggle-bg::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: white;
  border-radius: 50%;
  transition: transform 0.18s;
}
.toggle input:checked ~ .toggle-bg::after { transform: translateX(16px); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none;
  transition: all 0.14s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--text); color: var(--bg);
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-outline:hover { border-color: var(--text); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-full { width: 100%; }

/* ── PREVIEW AREA ── */
.preview-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 420px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.preview-empty {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text3);
  gap: 10px; font-size: 14px;
}
.preview-empty svg { opacity: 0.3; width: 40px; height: 40px; }

/* ── COMPARISON SLIDER ── */
.compare-wrap {
  position: relative; flex: 1;
  overflow: hidden; cursor: ew-resize;
  min-height: 380px; user-select: none;
}
.compare-wrap img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.compare-after { clip-path: inset(0 50% 0 0); }
.compare-line {
  position: absolute; top: 0; bottom: 0;
  left: 50%; width: 1px;
  background: rgba(26,25,22,0.4);
  pointer-events: none;
}
.compare-knob {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 32px; height: 32px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  font-size: 11px; color: var(--text2);
  font-weight: 600;
}
.compare-labels {
  position: absolute; bottom: 12px; left: 0; right: 0;
  display: flex; justify-content: space-between;
  padding: 0 14px; pointer-events: none;
}
.compare-labels span {
  background: rgba(247,246,243,0.85);
  backdrop-filter: blur(4px);
  padding: 3px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 500;
  color: var(--text2);
  border: 1px solid var(--border);
}

/* ── STATS BAR ── */
.stats-bar {
  display: flex; gap: 24px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); }
.stat-val { font-family: 'Geist Mono', monospace; font-size: 14px; font-weight: 500; color: var(--text); }
.stat-val.good { color: var(--green); }
.stat-val.warn { color: var(--amber); }

/* ── PREVIEW FOOTER ── */
.preview-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.preview-footer-info { font-size: 12px; color: var(--text2); }

/* ── EXIF TABLE ── */
.exif-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.exif-table tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.exif-table td { padding: 7px 10px; }
.exif-table td:first-child { color: var(--text2); width: 45%; }
.exif-table td:last-child { color: var(--text); font-weight: 500; }
.exif-scroll { max-height: 300px; overflow-y: auto; }
.exif-scroll::-webkit-scrollbar { width: 3px; }
.exif-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── THREAT BADGE ── */
.threat {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 6px;
  border: 1px solid transparent;
}
.threat.high { background: var(--red-bg); border-color: #f5c6c2; color: var(--red); }
.threat.med  { background: var(--amber-bg); border-color: #fce3b4; color: var(--amber); }
.threat.ok   { background: var(--green-bg); border-color: #c0ddd1; color: var(--green); }

/* ── SPINNER ── */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(247,246,243,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 999;
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  transform: translateY(50px); opacity: 0;
  transition: all 0.28s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-md);
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── SEO CONTENT ── */
.seo-section {
  max-width: 720px;
  margin: 64px auto 0;
  padding: 0 24px 80px;
}
.seo-section h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 26px; font-weight: 400;
  margin-bottom: 12px;
  color: var(--text);
}
.seo-section p {
  font-size: 15px; color: var(--text2);
  line-height: 1.7; margin-bottom: 24px;
}
.faq { margin-top: 40px; }
.faq h2 { margin-bottom: 20px; }
.faq-item {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-q {
  font-size: 15px; font-weight: 500; color: var(--text);
  margin-bottom: 8px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-q svg { flex-shrink: 0; transition: transform 0.2s; }
.faq-q.open svg { transform: rotate(180deg); }
.faq-a {
  font-size: 14px; color: var(--text2); line-height: 1.65;
  display: none; padding-top: 4px;
}
.faq-a.open { display: block; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  max-width: 1000px; margin: 0 auto;
}
.footer-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 17px; color: var(--text);
  text-decoration: none;
}
.footer-logo em { font-style: italic; color: var(--text2); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--text2); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.footer-note { font-size: 12px; color: var(--text3); }

/* ── INTENT CARDS (enhance) ── */
.intent-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; margin-bottom: 4px;
}
.intent-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 10px 8px;
  cursor: pointer;
  transition: all 0.14s;
  background: var(--bg2);
  position: relative;
}
.intent-card:hover { border-color: var(--border2); }
.intent-card.active { border-color: var(--text); background: var(--bg3); }
.intent-card .ic-icon { font-size: 18px; margin-bottom: 4px; }
.intent-card .ic-name { font-size: 12px; font-weight: 600; color: var(--text); }
.intent-card .ic-desc { font-size: 10px; color: var(--text2); margin-top: 1px; line-height: 1.4; }

/* ── ANALYSIS BADGE ── */
.analysis-strip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text2);
  display: none;
}
.analysis-strip.show { display: flex; flex-direction: column; gap: 6px; }
.analysis-row { display: flex; align-items: center; gap: 8px; }
.analysis-bar-wrap { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.analysis-bar { height: 100%; background: var(--text); border-radius: 2px; transition: width 0.5s ease; }
.analysis-key { width: 72px; font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── ADVANCED TOGGLE ── */
.advanced-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text2);
  cursor: pointer; margin-bottom: 10px;
  user-select: none;
}
.advanced-toggle svg { transition: transform 0.18s; }
.advanced-toggle.open svg { transform: rotate(180deg); }
.advanced-panel { display: none; }
.advanced-panel.open { display: block; }

/* ── HOMEPAGE GRID ── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.tool-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  transition: all 0.16s;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.tool-card:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card-icon {
  width: 40px; height: 40px;
  background: var(--bg3);
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.tool-card h3 {
  font-size: 15px; font-weight: 600;
  color: var(--text);
}
.tool-card p { font-size: 13px; color: var(--text2); line-height: 1.5; }
.tool-card .tc-pill {
  margin-top: auto;
  align-self: flex-start;
  font-size: 11px; font-weight: 500;
  color: var(--text3);
  display: flex; align-items: center; gap: 4px;
}
