/* ==========================================================================
   NANETJA — Design tokens
   Identidade: grid de QR Code. Tudo nasce do módulo quadrado e dos
   "finder patterns" (os 3 quadrados de canto que todo QR tem).
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Inter-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/SpaceMono-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/SpaceMono-Bold.woff2') format('woff2');
}

:root {
  /* Cor */
  --ink: #14171A;
  --ink-soft: #3A3F3B;
  --muted: #6B7169;
  --paper: #F3F4EF;
  --paper-raised: #FFFFFF;
  --line: #DADDD4;
  --signal: #1F7A4D;       /* verde-sinal — QR Code */
  --signal-bright: #34C77B;
  --warm: #E8552C;         /* laranja-sinal — Imagens */
  --warm-bright: #FF6B3D;
  --focus: #1B5CFF;

  /* Tipografia */
  --font-display: 'Space Mono', 'Courier New', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --radius: 6px;
  --radius-lg: 14px;
  --module: 8px; /* unidade base do "grid" — tudo é múltiplo disso */
  --max-width: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  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: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 16px; color: var(--ink-soft); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--signal);
  display: inline-block;
}
.eyebrow.warm { color: var(--warm); }
.eyebrow.warm::before { background: var(--warm); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 244, 239, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .dots {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  grid-template-rows: repeat(3, 5px);
  gap: 2px;
}
.logo .dots span { background: var(--ink); }
.logo .dots span:nth-child(1),
.logo .dots span:nth-child(3),
.logo .dots span:nth-child(7),
.logo .dots span:nth-child(9),
.logo .dots span:nth-child(5) { background: var(--signal); }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--signal);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  margin: 4px auto;
}

@media (max-width: 760px) {
  .main-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 20px;
  }
  .main-nav a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-toggle { display: block; }
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink);
  color: var(--paper-raised);
}
.btn-primary:hover { background: var(--signal); }
.btn-outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--ink); }

/* ---------- Hero + assinatura visual (grid QR) ---------- */
.hero {
  padding: 64px 0 88px;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hero-copy p.lead {
  font-size: 1.15rem;
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.qr-signature {
  aspect-ratio: 1;
  width: 100%;
  max-width: 340px;
  margin-left: auto;
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  grid-template-rows: repeat(13, 1fr);
  gap: 2px;
  padding: 18px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.qr-signature .m {
  background: transparent;
  border-radius: 1px;
  opacity: 0;
  transform: scale(.4);
  animation: qrIn .35s ease forwards;
}
.qr-signature .m.on { background: var(--ink); }
.qr-signature .m.finder { background: var(--ink); }
.qr-signature .m.signal { background: var(--signal); }

@keyframes qrIn {
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .qr-signature { margin: 0 auto; max-width: 260px; }
}

/* ---------- Seções de ferramentas ---------- */
.tools-section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
.tools-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color .15s ease, transform .15s ease;
}
.tool-card:hover {
  border-color: var(--signal);
  transform: translateY(-2px);
}
.tools-section.imagens .tool-card:hover { border-color: var(--warm); }
.tool-card .glyph {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--paper);
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-size: 0.85rem;
}
.tool-card h3 { margin-bottom: 6px; }
.tool-card p { font-size: 0.92rem; margin-bottom: 0; }

/* ---------- Rodapé ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 28px;
  margin-top: 40px;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}
.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.footer-links a:hover { color: var(--ink); }
.footer-note { font-size: 0.82rem; color: var(--muted); max-width: 640px; }
.footer-note a { text-decoration: underline; }

/* ---------- Página de ferramenta ---------- */
.tool-hero {
  padding: 44px 0 8px;
  border-bottom: 1px solid var(--line);
}
.tool-hero .container { max-width: 820px; }

.tool-app {
  padding: 40px 0;
}
.tool-app .container { max-width: 820px; }

.tool-panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.field-group { margin-bottom: 20px; }
.field-group label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.field-group input[type="text"],
.field-group input[type="url"],
.field-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.98rem;
  background: var(--paper);
}
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row .field-group { flex: 1; min-width: 140px; }

.color-swatches { display: flex; gap: 10px; }
.color-swatches button {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.color-swatches button[aria-pressed="true"] {
  border-color: var(--ink);
}

.qr-result {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
}
.qr-result-canvas {
  background: #fff;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  min-height: 180px;
  min-width: 180px;
  display: grid;
  place-items: center;
}
.qr-result-canvas.empty { color: var(--muted); font-size: 0.85rem; }
.result-actions { display: flex; gap: 12px; }

.safety-note {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  max-width: 40ch;
  margin: 4px 0 0;
}
.safety-note a { text-decoration: underline; }

.ad-slot {
  margin: 40px 0;
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.info-block { padding: 32px 0; }
.info-block .container { max-width: 820px; }
.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.benefits-list li {
  font-size: 0.94rem;
  color: var(--ink-soft);
  display: flex;
  gap: 8px;
}
.benefits-list li::before {
  content: "";
  width: 6px; height: 6px;
  margin-top: 8px;
  background: var(--signal);
  flex-shrink: 0;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-item summary {
  padding: 16px 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--muted);
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p { padding-bottom: 16px; }

.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.related-tools a {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
}
.related-tools a:hover { border-color: var(--signal); }

@media (max-width: 600px) {
  .benefits-list { grid-template-columns: 1fr; }
  .tool-panel { padding: 22px 18px; }
}

/* ---------- Componentes de ferramentas de imagem ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.image-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 20px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.image-drop:hover,
.image-drop.dragover {
  border-color: var(--signal);
  background: #fff;
}
.image-drop-hint {
  font-size: 0.9rem;
  color: var(--muted);
}
.image-drop .drop-cta {
  font-weight: 600;
  color: var(--ink);
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 4px 0 20px;
}

.rotate-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.rotate-controls .btn { padding: 10px 16px; font-size: 0.86rem; }

.image-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 26px 0 6px;
}
.image-preview-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.image-preview-box img {
  max-height: 220px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 4px;
}
.preview-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.preview-label span { color: var(--signal); text-transform: none; letter-spacing: 0; }

input[type="range"] {
  width: 100%;
  accent-color: var(--signal);
}

@media (max-width: 640px) {
  .image-preview-grid { grid-template-columns: 1fr; }
}
