/* ==========================================================================
   NAPIZO Tools — shared design system
   "Dil-kash" theme: warm cream paper #FDF8F4 · deep plum ink #33263F ·
   violet #7C3AED (primary) · rose #CE2F80 (AI accents).
   All text colors meet WCAG AA contrast (4.5:1 normal text, 3:1 large text).
   (Legacy variable names --teal/--amber kept for compatibility; their
   values are the violet/rose theme colors, matching the main stylesheet.)
   Type:     Space Grotesk (display) / IBM Plex Sans (body) / IBM Plex Mono (data)
   ========================================================================== */

:root {
  --bg: #FDF8F4;
  --surface: #FFFFFF;
  --ink: #33263F;
  --ink-soft: #7A6A8A;
  --ink-faint: #776487;
  --line: #F0E4DA;
  --line-strong: #DECDBD;
  --teal: #7C3AED;
  --teal-dark: #6D28D9;
  --teal-tint: #EEE9FD;
  --amber: #EC4899;
  --amber-dark: #BE185D;
  --amber-tint: #FCE7F3;
  --danger: #B33636;
  --danger-tint: #FBE7E7;
  --radius-s: 10px;
  --radius-m: 16px;
  --font-display: "Space Grotesk", "IBM Plex Sans", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --shell-max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-dark); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.75rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.35rem, 1.15rem + 0.7vw, 1.75rem); letter-spacing: -0.005em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; color: var(--ink-soft); max-width: 68ch; }
.shell { max-width: var(--shell-max); margin: 0 auto; padding: 0 20px; }

/* ---------- header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 40;
}
.site-header .shell { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); display: inline-block; }
.main-nav { display: flex; gap: 4px; align-items: center; }
.main-nav a {
  font-size: 0.92rem; color: var(--ink-soft); text-decoration: none;
  padding: 8px 12px; border-radius: var(--radius-s); font-weight: 500;
}
.main-nav a:hover { color: var(--ink); background: var(--bg); }
.main-nav a.current { color: var(--teal-dark); background: var(--teal-tint); }
.nav-toggle { display: none; }

@media (max-width: 780px) {
  .main-nav { position: fixed; inset: 64px 0 0 0; background: var(--surface); flex-direction: column; align-items: stretch; padding: 12px 20px; gap: 2px; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
  .main-nav.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 1.02rem; }
  .nav-toggle {
    display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center;
    background: none; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 18px; height: 2px; background: var(--ink); position: relative; transition: transform .15s ease;
  }
  .nav-toggle span::before { position: absolute; top: -6px; }
  .nav-toggle span::after { position: absolute; top: 6px; }
}

/* ---------- breadcrumb ---------- */
.breadcrumb { padding: 14px 0 0; font-size: 0.85rem; color: var(--ink-faint); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li::after { content: "/"; margin-left: 6px; color: var(--line-strong); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--ink-faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--teal-dark); }
.breadcrumb li[aria-current] { color: var(--ink-soft); }

/* ---------- hero / intro ---------- */
.tool-hero { padding: 28px 0 8px; }
.tool-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--teal-dark); font-weight: 600; margin-bottom: 10px; }
.tool-kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tool-kicker.ai { color: var(--amber-dark); }
.tool-intro { max-width: 62ch; color: var(--ink-soft); }

/* ---------- workbench (the tool itself) ---------- */
.workbench {
  display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr);
  gap: 0; border: 1px solid var(--line); border-radius: var(--radius-m);
  background: var(--surface); overflow: hidden; margin: 22px 0 8px;
}
.workbench-panel { padding: 24px; }
.workbench-panel + .workbench-panel { border-left: 1px solid var(--line); background: #FBFBF8; }
@media (max-width: 860px) {
  .workbench { grid-template-columns: 1fr; }
  .workbench-panel + .workbench-panel { border-left: none; border-top: 1px solid var(--line); }
}
.panel-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--ink-faint); text-transform: uppercase; margin-bottom: 14px; display: block; }

/* form controls */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 0.78rem; color: var(--ink-faint); margin-top: 4px; }
input[type=text], input[type=url], input[type=tel], input[type=email], input[type=number],
input[type=password], select, textarea {
  width: 100%; font: inherit; font-size: 0.95rem; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; min-height: 140px; font-family: var(--font-body); }
input[type=color] { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--teal); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 130px; }
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); padding: 7px 13px; border-radius: 999px; font-size: 0.85rem; cursor: pointer; color: var(--ink-soft); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.92rem; padding: 11px 20px;
  border-radius: var(--radius-s); border: 1px solid transparent; cursor: pointer;
  text-decoration: none; line-height: 1;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-primary:disabled { background: var(--line-strong); cursor: not-allowed; }
.btn-ai { background: var(--amber); color: #241704; }
.btn-ai:hover { background: var(--amber-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* output */
.output-empty { color: var(--ink-faint); font-size: 0.9rem; padding: 40px 10px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-s); }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.stat-cell { background: var(--surface); padding: 14px 16px; }
.stat-cell .num { font-family: var(--font-mono); font-size: 1.55rem; font-weight: 500; color: var(--teal-dark); display: block; }
.stat-cell .lbl { font-size: 0.78rem; color: var(--ink-faint); }
.result-box { border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); padding: 16px; font-family: var(--font-mono); font-size: 0.92rem; white-space: pre-wrap; word-break: break-word; min-height: 60px; }
.qr-preview { display: flex; align-items: center; justify-content: center; min-height: 220px; background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 0/16px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 16px; }
.qr-preview img, .qr-preview svg, .qr-preview canvas { max-width: 100%; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius-m); padding: 34px 16px; text-align: center; cursor: pointer; background: var(--surface); }
.dropzone.drag { border-color: var(--teal); background: var(--teal-tint); }
.dropzone strong { color: var(--ink); }
.preview-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview-pair figure { margin: 0; }
.preview-pair figcaption { font-size: 0.78rem; color: var(--ink-faint); margin-top: 6px; text-align: center; }
.preview-pair img { border-radius: var(--radius-s); border: 1px solid var(--line); width: 100%; height: 200px; object-fit: contain; background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 0/16px 16px; }
.progress { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 12px; display: none; }
.progress.active { display: block; }
.progress > i { display: block; height: 100%; width: 0%; background: var(--teal); transition: width .2s ease; }
.status-msg { font-size: 0.88rem; padding: 10px 12px; border-radius: var(--radius-s); margin-top: 12px; display: none; }
.status-msg.show { display: block; }
.status-msg.info { background: var(--teal-tint); color: var(--teal-dark); }
.status-msg.error { background: var(--danger-tint); color: var(--danger); }
.status-msg.warn { background: var(--amber-tint); color: var(--amber-dark); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list span { background: var(--teal-tint); color: var(--teal-dark); font-family: var(--font-mono); font-size: 0.85rem; padding: 5px 10px; border-radius: 999px; }

/* content sections */
.section { padding: 44px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: none; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 780px) { .two-col { grid-template-columns: 1fr; } }
.step-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step-list li { counter-increment: step; padding: 14px 0 14px 40px; position: relative; border-bottom: 1px solid var(--line); }
.step-list li:last-child { border-bottom: none; }
.step-list li::before { content: counter(step); position: absolute; left: 0; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--teal-tint); color: var(--teal-dark); font-family: var(--font-mono); font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.feature-grid .feature h3 { font-size: 1rem; margin-bottom: 4px; }
.feature-grid .feature p { font-size: 0.92rem; margin: 0; }
.privacy-box { display: flex; gap: 16px; padding: 20px; background: var(--teal-tint); border-radius: var(--radius-m); align-items: flex-start; }
.privacy-box p { color: var(--ink); }
.privacy-box .icon { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--ink-faint); font-size: 1.2rem; flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin-top: 10px; font-size: 0.94rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.related-card { display: block; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; background: var(--surface); }
.related-card:hover { border-color: var(--teal); }
.related-card .k { font-size: 0.72rem; font-family: var(--font-mono); color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.related-card h2, .related-card h3 { font-size: 0.98rem; margin: 4px 0 0; color: var(--ink); }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 20px; }
.site-footer .shell { padding: 40px 20px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h2, .footer-grid h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid a { color: var(--ink-soft); text-decoration: none; font-size: 0.92rem; display: block; padding: 5px 0; }
.footer-grid a:hover { color: var(--teal-dark); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; font-size: 0.82rem; color: var(--ink-faint); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Placeholder text — explicit AA-passing color (browser default is too faint) */
input::placeholder, textarea::placeholder { color: #7A6A8A; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* favicon generator rows */
.favicon-list { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.favicon-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.favicon-row img { image-rendering: pixelated; background: #fff; border: 1px solid var(--line); border-radius: 6px; flex: none; }
.favicon-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.favicon-meta strong { font-size: 0.95rem; }
.favicon-meta .lbl { font-size: 0.8rem; color: var(--ink-faint); }
