/* Proof-of-pick / verification page styles.
 *
 * Bank-statement calm — this is a receipt, not a casino floor.
 * Cream paper, ink black, one accent green for the pass state,
 * one accent red for the fail state.
 *
 * Naming: BEM under .pf (proof).
 */

:root {
  --pf-paper:   #f8f5ef;
  --pf-ink:     #17171a;
  --pf-muted:   #6a6a70;
  --pf-line:    #d8d3c8;
  --pf-accent:  #205931;   /* saturday sage */
  --pf-pass:    #1f7a3a;
  --pf-warn:    #a86d1e;
  --pf-fail:    #a3221f;
  --pf-mono:    ui-monospace, "SFMono-Regular", "Cascadia Mono", "Menlo",
                "Consolas", monospace;
}

.pf {
  max-width: 880px;
  margin: 0 auto;
  padding: 3rem 1.25rem 6rem;
  color: var(--pf-ink);
  background: var(--pf-paper);
  font-family: "Source Serif Pro", Georgia, "Times New Roman", serif;
  line-height: 1.55;
}

/* ── Hero ─────────────────────────────────────────────────── */
.pf__hero {
  text-align: center;
  border-bottom: 1px solid var(--pf-line);
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
}
.pf__hero--compact { padding-bottom: 1.5rem; margin-bottom: 1.5rem; }

.pf__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--pf-muted);
  margin: 0 0 0.75rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.pf__title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.pf__lede {
  color: var(--pf-muted);
  font-size: 1.05rem;
  max-width: 60ch;
  margin: 0 auto;
}

.pf__h2 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pf-muted);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--pf-line);
}

/* ── Stats ────────────────────────────────────────────────── */
.pf__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0 0 3rem;
}
.pf__stat {
  text-align: center;
  padding: 1.25rem 0.75rem;
  border: 1px solid var(--pf-line);
  background: #fff;
}
.pf__stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--pf-accent);
  font-variant-numeric: tabular-nums;
}
.pf__stat-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--pf-muted);
  margin-top: 0.25rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ── How-it-works steps ───────────────────────────────────── */
.pf__how { margin-bottom: 3rem; }
.pf__steps {
  list-style: decimal;
  padding-left: 1.5rem;
  margin: 0;
}
.pf__steps li {
  padding: 0.35rem 0;
  color: var(--pf-ink);
}
.pf__steps li em {
  color: var(--pf-muted);
  font-style: italic;
}

/* ── Cards / tables ───────────────────────────────────────── */
.pf__card {
  background: #fff;
  border: 1px solid var(--pf-line);
  padding: 1.5rem 1.5rem 1.25rem;
  margin: 0 0 1.5rem;
}

.pf__facts {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 0.5rem 1.25rem;
  margin: 0;
  font-size: 0.95rem;
}
.pf__facts dt {
  color: var(--pf-muted);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.pf__facts dd { margin: 0; word-break: break-word; }
.pf__facts--crypto dt { font-size: 0.85rem; }

.pf__mono {
  font-family: var(--pf-mono);
  font-size: 0.9em;
  background: #f2eee6;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  display: inline-block;
}
.pf__break {
  word-break: break-all;
  white-space: normal;
}

.pf__batches,
.pf__proof,
.pf__members {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.pf__batches th, .pf__proof th, .pf__members th {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 2px solid var(--pf-line);
  color: var(--pf-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
}
.pf__batches td, .pf__proof td, .pf__members td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--pf-line);
  vertical-align: top;
}
.pf__batches tr:last-child td,
.pf__proof tr:last-child td,
.pf__members tr:last-child td { border-bottom: none; }

.pf__batches a, .pf__members a {
  color: var(--pf-accent);
  text-decoration: none;
  font-weight: 500;
}
.pf__batches a:hover, .pf__members a:hover { text-decoration: underline; }

.pf__badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.03em;
  font-weight: 600;
}
.pf__badge--anchored { background: #d7ead9; color: var(--pf-pass); }
.pf__badge--offchain { background: #f0e9d5; color: var(--pf-warn); }

.pf__empty {
  color: var(--pf-muted);
  font-style: italic;
  text-align: center;
  padding: 2rem 0;
}

/* ── Canonical bytes block ────────────────────────────────── */
.pf__canonical {
  background: #fbf8f2;
  border: 1px solid var(--pf-line);
  padding: 0.9rem 1rem;
  font-family: var(--pf-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0 0 0.75rem;
}

.pf__copy,
.pf__lookup-form button {
  background: var(--pf-accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1.1rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border-radius: 3px;
}
.pf__copy:hover, .pf__lookup-form button:hover { opacity: 0.9; }
.pf__copy[data-copied="true"]::after { content: " ✓"; }

/* ── Verdict banner ───────────────────────────────────────── */
.pf__verdict {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border: 2px solid var(--pf-line);
  padding: 1.25rem 1.5rem;
  margin: 0 0 2rem;
  background: #fff;
  transition: border-color 0.25s, background 0.25s;
}
.pf__verdict[data-state="checking"] { border-color: var(--pf-muted); }
.pf__verdict[data-state="checking"] .pf__verdict-icon { color: var(--pf-muted); animation: pf-spin 1.4s linear infinite; }
.pf__verdict[data-state="pass"]     { border-color: var(--pf-pass); background: #f4faf5; }
.pf__verdict[data-state="pass"] .pf__verdict-icon { color: var(--pf-pass); }
.pf__verdict[data-state="warn"]     { border-color: var(--pf-warn); background: #fbf7ed; }
.pf__verdict[data-state="warn"] .pf__verdict-icon { color: var(--pf-warn); }
.pf__verdict[data-state="fail"]     { border-color: var(--pf-fail); background: #fbf3f2; }
.pf__verdict[data-state="fail"] .pf__verdict-icon { color: var(--pf-fail); }

.pf__verdict-icon svg { display: block; }
.pf__verdict-headline {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}
.pf__verdict-detail {
  color: var(--pf-muted);
  font-size: 0.92rem;
}

@keyframes pf-spin { to { transform: rotate(360deg); } }

/* ── Lookup form ──────────────────────────────────────────── */
.pf__lookup { text-align: center; }
.pf__lookup-form {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0;
}
.pf__lookup-form label {
  color: var(--pf-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.pf__lookup-form input {
  border: 1px solid var(--pf-line);
  padding: 0.5rem 0.75rem;
  font-family: var(--pf-mono);
  font-size: 1rem;
  width: 14ch;
  background: #fff;
}

.pf__hint {
  color: var(--pf-muted);
  font-size: 0.88rem;
  margin: 0.5rem 0;
}

.pf__foot {
  text-align: center;
  margin-top: 2rem;
  color: var(--pf-muted);
  font-size: 0.88rem;
}
.pf__foot a { color: var(--pf-accent); text-decoration: none; }
.pf__foot a:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .pf__stats { grid-template-columns: 1fr; }
  .pf__facts { grid-template-columns: 1fr; gap: 0.15rem; }
  .pf__facts dt { margin-top: 0.5rem; }
}

/* ────────────────────────────────────────────────────────────
 * Certificate view — /verify/<pick_id>/
 *
 * Formal document treatment. Reader lands on this expecting a
 * proof — the page reads like one. Ornate frame, central seal,
 * "This is to certify…" preamble, formal record of the pick,
 * cryptographic seal, signature line. Technical detail (Merkle
 * proof, canonical bytes) collapses into an appendix so the
 * certificate itself stays clean.
 *
 * Print-friendly: @media print rules render a single A4-sized
 * document with the certificate body, no navigation chrome, no
 * technical appendix — readers can File → Print → Save as PDF
 * and share an actual "authentication certificate" file.
 */

.pf--certificate {
  max-width: 780px;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.cert {
  position: relative;
  background: #fbf8f0;
  background-image:
    radial-gradient(circle at 30% 20%, rgba(139, 90, 43, 0.03), transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(139, 90, 43, 0.025), transparent 40%);
  border: 1px double #8b5a2b;
  padding: 3.25rem 2.75rem 2.25rem;
  margin-bottom: 2rem;
  box-shadow:
    0 2px 8px rgba(26, 22, 18, 0.06),
    inset 0 0 0 6px #fbf8f0,
    inset 0 0 0 7px rgba(139, 90, 43, 0.28);
  font-family: "Source Serif Pro", "Playfair Display", Georgia, "Times New Roman", serif;
}

/* ── Ornate corner flourishes ─────────────────────────────── */
.cert__corner {
  position: absolute;
  width: 44px;
  height: 44px;
  color: #8b5a2b;
  pointer-events: none;
}
.cert__corner--tl { top: 14px; left: 14px; }
.cert__corner--tr { top: 14px; right: 14px; }
.cert__corner--bl { bottom: 14px; left: 14px; }
.cert__corner--br { bottom: 14px; right: 14px; }
.cert__corner svg { width: 100%; height: 100%; display: block; }

/* ── Masthead ─────────────────────────────────────────────── */
.cert__masthead {
  text-align: center;
  margin-bottom: 1.5rem;
}

.cert__masthead-org {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #8b5a2b;
  margin: 0 0 0.65rem;
}

.cert__masthead-title {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  color: #17171a;
  margin: 0 0 0.4rem;
  line-height: 1.15;
  letter-spacing: -0.005em;
}

.cert__masthead-schema {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  color: #6a6a70;
  margin: 0;
  letter-spacing: 0.04em;
}

.cert__masthead-schema .pf__mono {
  background: transparent;
  padding: 0;
  font-size: 11px;
  color: #6f4520;
  font-weight: 700;
}

/* ── Central seal ─────────────────────────────────────────── */
.cert__seal {
  margin: 0.25rem auto 1.5rem;
  width: 140px;
  filter: drop-shadow(0 4px 8px rgba(111, 69, 32, 0.28));
}
.cert__seal svg { width: 100%; height: auto; display: block; }

/* ── Verdict banner (overrides base pf__verdict inside cert) ─ */
.cert__verdict {
  max-width: 620px;
  margin: 1rem auto 1.5rem;
  padding: 0.9rem 1.25rem;
}

/* ── Formal preamble ──────────────────────────────────────── */
.cert__preamble {
  text-align: center;
  max-width: 60ch;
  margin: 0 auto 2rem;
  font-family: "Source Serif Pro", Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.55;
  color: #17171a;
  font-style: italic;
}

.cert__preamble strong {
  font-style: normal;
  font-weight: 700;
}

/* ── Record sections ──────────────────────────────────────── */
.cert__section {
  margin: 0 0 2rem;
}

.cert__section-rule {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(139, 90, 43, 0.4) 20%,
    rgba(139, 90, 43, 0.4) 80%,
    transparent 100%);
  margin-bottom: 0.75rem;
}

.cert__section-title {
  text-align: center;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #8b5a2b;
  margin: 0 0 1.25rem;
}

.cert__record {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 0.55rem 1.5rem;
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.cert__record dt {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6a6a70;
  padding-top: 3px;
}

.cert__record dd {
  margin: 0;
  color: #17171a;
  word-break: break-word;
}

.cert__record--seal dd {
  font-size: 13px;
}

.cert__dim {
  color: #6a6a70;
  font-size: 0.92em;
}

/* Mono inside a certificate record — smaller, denser than base pf__mono */
.cert__record .pf__mono {
  font-size: 12px;
  background: rgba(26, 22, 18, 0.04);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ── Signature footer ─────────────────────────────────────── */
.cert__signature {
  margin: 2.5rem 0 0.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
}

.cert__signed-line {
  grid-column: 1 / -1;
  height: 1px;
  background: rgba(23, 23, 26, 0.25);
  margin-bottom: 1rem;
}

.cert__signed-block {
  text-align: left;
}

.cert__signed-by {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #8b5a2b;
  margin: 0 0 0.35rem;
}

.cert__signed-name {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  color: #17171a;
  margin: 0 0 0.15rem;
  letter-spacing: -0.005em;
}

.cert__signed-meta {
  font-size: 12px;
  color: #6a6a70;
  margin: 0;
}

.cert__signed-ref {
  text-align: right;
}

.cert__signed-ref-label {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #6a6a70;
  margin: 0 0 0.25rem;
}

.cert__signed-ref-id {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  color: #17171a;
  margin: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ── Technical appendix (collapsible below the certificate) ─ */
.cert-appendix {
  margin: 1.5rem 0 1rem;
  border-top: 1px solid var(--pf-line);
  padding-top: 0.5rem;
}

.cert-appendix > summary {
  cursor: pointer;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b5a2b;
  padding: 0.6rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cert-appendix > summary::-webkit-details-marker { display: none; }

.cert-appendix > summary::before {
  content: "▸";
  transition: transform 0.15s;
  color: rgba(139, 90, 43, 0.6);
}

.cert-appendix[open] > summary::before {
  transform: rotate(90deg);
}

.cert-appendix > * + section {
  margin-top: 1rem;
}

.cert-actions {
  text-align: center;
  margin: 1rem 0 0;
}

.cert-actions__print {
  background: transparent;
  color: #8b5a2b;
  border: 1px solid rgba(139, 90, 43, 0.4);
  padding: 0.55rem 1.2rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}

.cert-actions__print:hover {
  background: #8b5a2b;
  color: #fbf8f0;
}

/* ── Mobile — collapse ornate frame ───────────────────────── */
@media (max-width: 560px) {
  .cert {
    padding: 2rem 1.25rem 1.5rem;
    box-shadow:
      0 2px 8px rgba(26, 22, 18, 0.06),
      inset 0 0 0 4px #fbf8f0,
      inset 0 0 0 5px rgba(139, 90, 43, 0.28);
  }
  .cert__corner { width: 28px; height: 28px; }
  .cert__corner--tl, .cert__corner--tr { top: 8px; }
  .cert__corner--bl, .cert__corner--br { bottom: 8px; }
  .cert__corner--tl, .cert__corner--bl { left: 8px; }
  .cert__corner--tr, .cert__corner--br { right: 8px; }

  .cert__seal { width: 110px; }
  .cert__preamble { font-size: 13.5px; }

  .cert__record {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .cert__record dt { margin-top: 0.6rem; }

  .cert__signature {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .cert__signed-ref { text-align: left; }
}

/* ── Print — the actual "save as PDF" moment ──────────────── */
@media print {
  body { background: #fff; margin: 0; }
  .site-nav, .site-footer, .cert-appendix, .cert-actions,
  header:not(.cert__masthead), footer:not(.cert__signature) {
    display: none !important;
  }
  .pf, .pf--certificate {
    max-width: none;
    padding: 0;
    background: #fff;
  }
  .cert {
    box-shadow: none;
    border: 1px double #8b5a2b;
    page-break-inside: avoid;
    padding: 2rem 2rem 1.5rem;
    margin: 0;
  }
  .cert__verdict { display: none; }
  .cert__preamble { color: #000; }
  .cert__seal { width: 100px; }
  .cert__signed-line { background: #000; }
}
