/* espelho.notx.blue components. The .db-* rules are copied verbatim from
   notx.blue's assets/site-v2.css (itself a copy of down.blue's index.html), and
   the wordmark suffix rule from links.notx.blue's src/styles.css, so the sites
   stay one family: keep them identical rather than tuning them here. The es-*
   rules at the end are the only site-specific CSS. */

.db-wordmark {
  margin: var(--space-10) 0 var(--space-6);
  font: var(--weight-display) clamp(var(--text-display-1), 13vw, 116px)/1.1 var(--font-display);
  letter-spacing: var(--tracking-display);
  color: var(--text-1);
  text-align: center;
  white-space: nowrap;
}
/* The *.notx.blue rule: the first word keeps down.blue's exact size, and the
   ".notx.blue" suffix is set smaller by one shared scale; tracking is
   re-applied so it scales with the suffix. Copied from links.notx.blue. */
.db-wordmark { --wordmark-suffix-scale: 0.66; }
.wordmark-suffix {
  font-size: calc(var(--wordmark-suffix-scale) * 1em);
  letter-spacing: var(--tracking-display);
}
/* Meta lines, tags and labels: typewriter, uppercase, tracked out. */
.db-meta { font: var(--type-meta); text-transform: uppercase; letter-spacing: var(--tracking-meta); color: var(--text-3); }
.db-micro { font: var(--type-label); text-transform: uppercase; letter-spacing: var(--tracking-meta); }
/* Running machine output and fine print: typewriter, but readable. */
.db-note { font: var(--type-code); color: var(--text-3); }

/* Every box title — panel head, callout spine — is the same object: an ink
   block in typewriter caps. The panel itself carries .cast. */
.db-panel { background: var(--surface-card); }
.db-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  margin: 0; padding: var(--box-head-pad); border-bottom: var(--border);
  background: var(--project-ink); color: var(--project-ink-contrast);
  font: var(--weight-bold) var(--text-caption)/1.3 var(--font-mono);
  letter-spacing: var(--tracking-meta); text-transform: uppercase;
}

/* Buttons carry only their type and colour; .cast.press in the markup does
   the halftone shadow, the lift on hover and the slam on press. */
.db-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3);
  background: var(--surface-page); color: var(--text-1);
  font: var(--weight-bold) var(--text-body-sm)/1.25 var(--font-body);
  padding: 8px 12px; cursor: pointer; text-align: center; text-decoration: none;
}
a.db-btn, a.db-btn:visited, a.db-btn:hover { color: var(--text-1); background: var(--surface-page); text-decoration: none; }
.db-btn-primary, a.db-btn-primary, a.db-btn-primary:visited, a.db-btn-primary:hover {
  background: var(--project-ink); border-color: var(--project-ink); color: var(--project-ink-contrast);
}
.db-btn-danger { background: var(--ink-red); border-color: var(--ink-red); color: var(--on-red); }
/* Disabled: no travel, no shadow (.press handles both), a sunken fill and
   the second text colour. Never an opacity fade. */
.db-btn:disabled, .db-btn-primary:disabled, .db-btn-danger:disabled {
  background: var(--surface-sunken); border-color: var(--border-strong); color: var(--text-2); cursor: not-allowed;
}
.db-btn-sm { padding: 4px 7px; font-size: var(--text-meta); }

/* Support links: each takes a system ink with its on-* partner, so they
   stay legible in all three themes. */
.db-chip {
  display: inline-flex; align-items: center; padding: 5px 9px;
  font: var(--type-label); text-transform: uppercase; letter-spacing: var(--tracking-meta); text-decoration: none;
}
a.db-chip-pix, a.db-chip-pix:visited, a.db-chip-pix:hover { background: var(--ink-pix); color: var(--on-pix); }
a.db-chip-mercadopago, a.db-chip-mercadopago:visited, a.db-chip-mercadopago:hover { background: #00B1EA; color: #000; }
a.db-chip-coffee, a.db-chip-coffee:visited, a.db-chip-coffee:hover { background: var(--ink-yellow); color: var(--on-yellow); }
a.db-chip-sponsors, a.db-chip-sponsors:visited, a.db-chip-sponsors:hover { background: var(--ink-sponsors); color: var(--on-sponsors); }

/* ---- shared with notx.blue's own rules ---- */

[hidden] { display: none !important; }

.skip-link { position: absolute; left: 16px; top: -100px; z-index: 10; padding: 12px; background: var(--surface-card); color: var(--text-1); }
.skip-link:focus { top: 8px; }

/* Wordmark on pages where the h1 is the panel title: same type, but a link home. */
.db-wordmark a, .db-wordmark a:visited, .db-wordmark a:hover { color: inherit; text-decoration: none; }
/* App rows sit inside a casting panel, so they rest flat (.cast-flat). */
.nx-apps, .nx-links { margin: 0; padding: 0; list-style: none; }
.nx-apps { display: grid; gap: var(--space-4); }
.nx-app {
  display: grid; gap: var(--space-4); padding: var(--space-5);
  border-left: var(--space-3) solid var(--project-ink); background: var(--surface-page);
}
.nx-app-name { margin: 0 0 var(--space-1); font: var(--weight-bold) var(--text-body)/1.25 var(--font-display); overflow-wrap: anywhere; }
.nx-app-text { margin: 0; color: var(--text-2); font: var(--text-body-sm)/1.4 var(--font-body); }
.nx-app-aside { margin: var(--space-2) 0 0; color: var(--text-3); font: var(--type-meta); }
.nx-app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }
.nx-app-extra { margin: var(--space-3) 0 0; padding: 0; list-style: none; display: grid; gap: var(--space-1); font: var(--text-body-sm)/1.4 var(--font-body); }
.nx-link-list { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.nx-link-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-3); }
.nx-app-actions { align-items: stretch; }
.nx-app-extension { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); font: var(--text-body-sm)/1.4 var(--font-body); }
/* Neutral secondary button: .db-btn paper fill and ink border, mono label, so it
   never competes with the app's ink on "Open project". */
.nx-source { font-family: var(--font-mono); font-weight: var(--weight-bold); font-size: var(--text-meta); gap: var(--space-2); }
.nx-source-link { font-size: var(--text-meta); }
@media (min-width: 640px) {
  .nx-app { grid-template-columns: 1fr max-content; align-items: start; }
  .nx-app-actions { justify-content: flex-end; }
}

/* Policy copy inside its panel. */
.nx-policy h2 { margin: var(--space-6) 0 var(--space-2); font: var(--weight-bold) var(--text-body)/1.3 var(--font-display); }
.nx-policy h2:first-child { margin-top: 0; }
.nx-policy p { margin: 0 0 var(--space-4); overflow-wrap: anywhere; }

/* Small buttons and chips match down.blue on a pointer; on touch they grow to
   the 44px target. */
@media (pointer: coarse) {
  .db-btn, .db-chip { min-height: 44px; }
}

.theme-switch svg { display: none; flex: none; }
.theme-switch[data-next-theme="dark"] .theme-icon-dark,
.theme-switch[data-next-theme="terminal"] .theme-icon-terminal,
.theme-switch[data-next-theme="light"] .theme-icon-light { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.nx-policy p + p { margin-top: 0.875rem; }
.nx-policy section { margin-top: 1.75rem; }
.nx-policy h2 { margin-bottom: 0.5rem; }

/* ---- espelho.notx.blue only ---- */

/* The core idea, set apart from the lead: an ink spine like the app rows. */

.es-list { margin: 0; padding-left: 1.25rem; display: grid; gap: var(--space-2); list-style: square; }
ol.es-list { list-style: decimal; }
.es-list li::marker { color: var(--project-ink-edge); font-weight: var(--weight-bold); }
.es-prose > * + * { margin-top: var(--space-4); }
.es-prose p { margin-bottom: 0; overflow-wrap: anywhere; }
.es-handle { font-family: var(--font-mono); font-size: var(--text-body-sm); overflow-wrap: anywhere; }

/* "espelho" alone already fills a phone at down.blue's size, so on narrow
   screens the suffix drops to its own line instead of overflowing. */
@media (max-width: 559px) {
  .db-wordmark { white-space: normal; }
  .wordmark-suffix { display: block; }
}

/* Black on dark paper: the edge (light in dark, the ink itself elsewhere)
   keeps the black blocks visible; see web/tailwind-input.css. */
.nx-app { border-left-color: var(--project-ink-edge); }
.db-wordmark .ink-block { outline: 2px solid var(--project-ink-edge); }
.db-btn-primary, a.db-btn-primary, a.db-btn-primary:visited, a.db-btn-primary:hover { border-color: var(--project-ink-edge); }

/* The goal: a quiet aside under the intro, no box. */
.es-goal { padding-top: var(--space-4); border-top: 1px dotted var(--border-dotted, currentColor); color: var(--text-2); }
.es-goal p { margin: 0; display: inline; }
.es-goal-head { font-weight: var(--weight-bold); color: var(--text-1, inherit); }
.es-goal-head::after { content: ' '; }
.es-goal-text { font: inherit; }

/* FAQ: accordion, same pattern as links.notx.blue. */
.faq-list { display: flex; flex-direction: column; padding: 0; }
.faq-item { border-bottom: 1px dotted var(--border-dotted, currentColor); }
.faq-item:last-child { border-bottom: 0; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 44px; padding: var(--space-4) var(--space-6); font: var(--weight-bold) var(--text-body-sm)/1.35 var(--font-body); cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-family: var(--font-mono); flex: none; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item[open] summary { color: var(--project-ink-edge); }
.faq-answer { padding: 0 var(--space-6) var(--space-5); color: var(--text-2); }
