/* ---------------------------------------------------------------------------
   whatamisigning.xyz

   Dark instrument panel. The visual job is to make three things unmissable:
   what the request authorises, the facts worth noticing, and the digest to
   check against a hardware wallet.

   Colour carries meaning and nothing else. Green marks provenance (official
   metadata exists), amber marks facts worth reading twice, orange marks a
   value at its maximum. Nothing here ever renders a verdict, so there is no
   red "danger" and no green "safe".
--------------------------------------------------------------------------- */

:root {
  --bg:            #0a0c0b;
  --bg-grid:       #10130f;
  --surface:       #111512;
  --surface-2:     #161b17;
  --border:        #232a25;
  --border-bright: #333d36;

  --text:          #e8ece8;
  --text-soft:     #a3ada5;
  --text-quiet:    #6d766f;

  --green:         #5ec27e;
  --green-dim:     #2f4f3b;
  --amber:         #e0b055;
  --amber-dim:     #4a3c1d;
  --orange:        #ff9159;
  --link:          #7fb5e8;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 62rem;
  --radius: 4px;
}

/* A light rendering exists so the page is not hostile in a bright room, but
   the design is dark-first and the tokens above are the reference. */
@media (prefers-color-scheme: light) {
  :root {
    --bg:            #f7f8f6;
    --bg-grid:       #eceee9;
    --surface:       #ffffff;
    --surface-2:     #f2f4f1;
    --border:        #dee2db;
    --border-bright: #c2c9bf;

    --text:          #12150f;
    --text-soft:     #4e564b;
    --text-quiet:    #7d867a;

    --green:         #2c7a4b;
    --green-dim:     #bfe0cb;
    --amber:         #8a6516;
    --amber-dim:     #f0e2bd;
    --orange:        #b4501c;
    --link:          #1f5b96;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: -1px -1px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--text); }

/* Precise underline rather than a highlighter smear — the page is an
   instrument, and a marker-pen effect reads as decoration. */
em {
  font-style: normal;
  color: var(--text);
  border-bottom: 1px solid var(--amber);
  padding-bottom: 1px;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--green);
}

::selection { background: var(--green-dim); color: var(--text); }

/* --- top bar -------------------------------------------------------------- */

.topbar {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.mark { color: var(--green); font-size: 1rem; line-height: 1; }
.tld { color: var(--text-quiet); }

.topbar-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-quiet);
  letter-spacing: 0.04em;
  text-align: right;
}

/* --- layout --------------------------------------------------------------- */

main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

/* --- hero ----------------------------------------------------------------- */

.hero { padding: 4.5rem 0 2.5rem; }

h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0 0 1.1rem;
}

.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.5;
  color: var(--text-soft);
  max-width: 40rem;
  margin: 0 0 1.6rem;
}

.assurance {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.79rem;
  line-height: 1.5;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin: 0;
  max-width: 44rem;
}
.assurance-dot {
  flex: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}

/* --- panels --------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}

.panel-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.panel-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-quiet);
}

textarea {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.6;
  padding: 1rem;
  resize: vertical;
  min-height: 9rem;
}
textarea::placeholder { color: var(--text-quiet); }
textarea:focus { outline: 0; }
.panel--input:focus-within { border-color: var(--border-bright); }

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* --- buttons -------------------------------------------------------------- */

button {
  font-family: var(--mono);
  cursor: pointer;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.primary {
  background: var(--green);
  color: #06110b;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 1.3rem;
}
.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--green) 85%, #fff); }

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}
.examples-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-quiet);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 0.15rem;
}

.ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border-bright);
  font-size: 0.76rem;
  padding: 0.35rem 0.6rem;
}
.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--text-quiet); }

button:disabled { opacity: 0.35; cursor: progress; }

/* --- status --------------------------------------------------------------- */

.status {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-quiet);
  margin: 0.85rem 0 0;
}

/* --- result card ---------------------------------------------------------- */

.card {
  margin-top: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
}
.card--error { border-color: var(--border-bright); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-quiet);
  margin-bottom: 0.85rem;
}
.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-quiet);
}
.badge--erc7730 { color: var(--green); }
.badge--erc7730 .badge-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}
.badge--pattern { color: var(--amber); }
.badge--pattern .badge-dot { background: var(--amber); }
.badge-owner { color: var(--text-quiet); font-weight: 400; letter-spacing: 0.02em; text-transform: none; }

.intent {
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 0.55rem;
}

.summary {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0 0 0.85rem;
  max-width: 44rem;
}

.badge-explain {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-quiet);
  margin: 0 0 1.4rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
  max-width: 44rem;
}

/* --- field rows ----------------------------------------------------------- */

.rows {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) 1fr;
  gap: 0;
  margin: 0 0 1.5rem;
}
.rows dt {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--text-quiet);
  padding: 0.6rem 1rem 0.6rem 0;
  border-top: 1px solid var(--border);
}
.rows dd {
  margin: 0;
  min-width: 0;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}
.rows dt:first-of-type, .rows dd:first-of-type { border-top: 0; }

.value { display: flex; flex-direction: column; gap: 0.15rem; }
.value-text {
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.45;
  word-break: break-all;
}
.value-text.is-emphatic {
  color: var(--orange);
  font-weight: 600;
}
.value-note { font-family: var(--mono); font-size: 0.72rem; color: var(--text-soft); }
.value-note--quiet { color: var(--text-quiet); }

/* --- worth noticing ------------------------------------------------------- */

.notes {
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
  border: 1px solid var(--amber-dim);
  border-left: 2px solid var(--amber);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.5rem;
}
.notes h3 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 0.6rem;
}
.notes ul { margin: 0; padding-left: 1.05rem; }
.notes li {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}
.notes li:last-child { margin-bottom: 0; }
.notes li::marker { color: var(--amber); }

/* --- verify against device ------------------------------------------------ */

.verify {
  border-top: 1px solid var(--border);
  padding-top: 1.4rem;
}
.verify h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.verify p {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0 0 1rem;
  max-width: 44rem;
}

.hashes {
  display: grid;
  grid-template-columns: minmax(6rem, 9rem) 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
.hashes dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-quiet);
}
.hashes dd { margin: 0; min-width: 0; }
.mono {
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.5;
  word-break: break-all;
  color: var(--green);
}

.meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--text-quiet);
  margin: 1.4rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  word-break: break-all;
}

/* --- explainer grid ------------------------------------------------------- */

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  margin-top: 5rem;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.notes-grid article {
  background: var(--surface);
  padding: 1.4rem;
}
.notes-grid h2 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}
.num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--green);
  letter-spacing: 0.06em;
}
.notes-grid p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0;
}

/* --- faq ------------------------------------------------------------------ */

.faq { margin-top: 3rem; }
.faq > h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
}
.faq-item {
  border-top: 1px solid var(--border);
  padding: 1.15rem 0;
}
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-item h3 {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.45rem;
  color: var(--text);
}
.faq-item p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-soft);
  margin: 0;
  max-width: 46rem;
}

/* --- upsell --------------------------------------------------------------- */

.upsell {
  margin-top: 3rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.upsell h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
}
.upsell p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0 0 1rem;
  max-width: 46rem;
}

.upsell-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.upsell-links--spaced { margin-top: 1.5rem; }
.wordmark--link { text-decoration: none; }
.btn-link {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  padding: 0.45rem 0.9rem;
}
.btn-link:hover { border-color: var(--green); color: var(--green); }

.disclosure-note {
  font-size: 0.78rem !important;
  line-height: 1.55;
  color: var(--text-quiet) !important;
  margin: 0 !important;
}

/* --- tip jar -------------------------------------------------------------- */

.donate {
  margin-top: 1.5rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
}
.donate-body { flex: 1 1 22rem; min-width: 0; }
.donate h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
}
.donate p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0 0 0.9rem;
  max-width: 34rem;
}
.donate-address-label {
  font-family: var(--mono);
  font-size: 0.72rem !important;
  letter-spacing: 0.04em;
  color: var(--text-quiet) !important;
  margin-bottom: 0.4rem !important;
}

.donate-address {
  display: block;
  font-size: 0.8rem;
  color: var(--green);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.6rem;
  word-break: break-all;
  user-select: all;
}

.copy-btn { font-family: var(--mono); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* White plate behind the code: QR readers expect dark modules on a light
   field, so the code is never inverted to match the dark UI. */
.donate-qr {
  margin: 0;
  flex: 0 0 auto;
  text-align: center;
}
.donate-qr img {
  display: block;
  width: 180px;
  height: 180px;
  background: #fff;
  border: 6px solid #fff;
  border-radius: 6px;
}
.donate-qr figcaption {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-quiet);
  margin-top: 0.55rem;
  letter-spacing: 0.06em;
}

@media (max-width: 40rem) {
  .donate { padding: 1.1rem; gap: 1.25rem; justify-content: center; }
  .donate-qr { margin: 0 auto; }
}

/* --- footer --------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}
.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
footer p {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-quiet);
  margin: 0 0 0.6rem;
  max-width: 46rem;
}
.footer-warning { color: var(--text-soft); }

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 40rem) {
  .hero { padding: 2.75rem 0 2rem; }
  main { padding: 0 1rem 4rem; }
  .topbar-inner, .footer-inner { padding-left: 1rem; padding-right: 1rem; }
  .card, .upsell { padding: 1.1rem; }

  .rows, .hashes { grid-template-columns: 1fr; }
  .rows dt { padding-bottom: 0.15rem; border-top: 1px solid var(--border); }
  .rows dd { padding-top: 0; border-top: 0; }
  .rows dd:first-of-type { border-top: 0; }
  .hashes dt { padding-top: 0.4rem; }

  .examples { margin-left: 0; width: 100%; }
  .primary { width: 100%; }
}

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