:root {
  color-scheme: dark;
  --bg: #080b0f;
  --panel: rgba(17, 23, 29, 0.82);
  --panel-solid: #11171d;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f2e9;
  --muted: #9da6ad;
  --gold: #d6af61;
  --gold-soft: #f1dba5;
  --green: #78c8a0;
  --red: #ef8e86;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background: #080b0f;
  color: var(--text);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 11, 15, 0.72) 0%, rgba(8, 11, 15, 0.84) 52%, rgba(8, 11, 15, 0.95) 100%),
    radial-gradient(circle at 50% 20%, rgba(8, 11, 15, 0.08), rgba(8, 11, 15, 0.62) 78%),
    url("/cigo-background.png") center top / cover no-repeat;
}

a { color: inherit; text-decoration-color: rgba(214, 175, 97, 0.55); text-underline-offset: 0.2em; }
button, input { font: inherit; }
button { cursor: pointer; }

.ambient { position: fixed; pointer-events: none; filter: blur(80px); opacity: 0.13; border-radius: 50%; }
.ambient-one { width: 18rem; height: 18rem; background: var(--gold); top: 20%; right: -8rem; }
.ambient-two { width: 15rem; height: 15rem; background: #2d8e76; bottom: 10%; left: -7rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 15, 0.86);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(1180px, calc(100% - 1.75rem));
  min-height: 74px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  align-items: center;
}

.brand { display: inline-flex; align-items: center; gap: 0.65rem; min-width: 0; text-decoration: none; }
.brand-icons { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 0.35rem; }
.brand-icon { display: block; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.brand-copy { min-width: 0; }
.brand strong, .brand small { display: block; line-height: 1.15; }
.brand strong { letter-spacing: 0.04em; font-weight: 850; }
.brand small { color: var(--muted); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.18rem; font-weight: 750; }

.nav-toggle { display: none; }
.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.45rem; }
.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.5rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
  transition: 0.2s ease;
}
.nav a:hover, .nav a:focus-visible { color: var(--text); border-color: rgba(214, 175, 97, 0.48); background: rgba(214, 175, 97, 0.09); outline: none; }
.nav-link-icon { width: 14px; height: 14px; border-radius: 50%; object-fit: cover; }

main { width: min(1040px, calc(100% - 2rem)); margin: 0 auto; }
.hero { padding: 7rem 0 4.5rem; max-width: 880px; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: 0.17em; font-size: 0.72rem; font-weight: 750; margin: 0 0 0.8rem; }
h1, h2, h3, blockquote { font-family: Georgia, "Times New Roman", serif; }
h1 { font-size: clamp(3rem, 8vw, 6.6rem); line-height: 0.98; letter-spacing: -0.055em; margin: 0; max-width: 900px; font-weight: 500; }
.hero h1 { text-shadow: 0 3px 28px rgba(0, 0, 0, 0.96); }
.lede { color: #e1dfd8; font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 760px; margin: 1.8rem 0 2.5rem; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.96); }

form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; backdrop-filter: blur(18px); box-shadow: 0 30px 70px rgba(0,0,0,0.24); }
form label { display: block; color: var(--gold-soft); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 0.55rem 0.2rem; }
.lookup-row { display: grid; grid-template-columns: 1fr auto; gap: 0.7rem; }
input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: #080c10; color: var(--text); padding: 0.95rem 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
input:focus { outline: 2px solid rgba(214, 175, 97, 0.45); border-color: var(--gold); }
button, .link-button { border: 1px solid var(--gold); border-radius: 14px; background: var(--gold); color: #171108; padding: 0.9rem 1.2rem; font-weight: 750; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .link-button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.55; cursor: wait; }
.help { color: var(--muted); margin: 0.75rem 0 0 0.2rem; font-size: 0.82rem; }

.status { border-radius: 14px; margin: 0 0 1.5rem; padding: 0.9rem 1rem; border: 1px solid var(--line); background: var(--panel); }
.status.working { color: var(--gold-soft); }
.status.success { color: var(--green); border-color: rgba(120,200,160,0.35); }
.status.error { color: var(--red); border-color: rgba(239,142,134,0.35); }

.results { padding-bottom: 3rem; }
.result-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 1.2rem; }
.result-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 500; }
.result-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.secondary { background: transparent; color: var(--gold-soft); border-color: rgba(214,175,97,0.45); padding: 0.68rem 0.9rem; }

.message-card { background: linear-gradient(145deg, rgba(22,29,35,0.94), rgba(12,17,21,0.94)); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.35rem, 4vw, 2.4rem); margin: 1rem 0; box-shadow: 0 24px 55px rgba(0,0,0,0.2); }
.message-topline { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.verified-pill { color: var(--green); background: rgba(120,200,160,0.1); border: 1px solid rgba(120,200,160,0.25); border-radius: 999px; padding: 0.28rem 0.65rem; font-size: 0.74rem; }
.tax-pill { color: var(--gold-soft); background: rgba(214,175,97,0.08); border-color: rgba(214,175,97,0.28); }
.message-quote { font-size: clamp(1.8rem, 4.7vw, 3.5rem); line-height: 1.12; letter-spacing: -0.025em; margin: 2rem 0 0.8rem; color: #fffaf0; }
.message-author { color: var(--gold); margin: 0 0 2rem; }
.transfer-amount { font-size: 1.15rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1.3rem; }
.transfer-amount strong { color: var(--text); font-size: 1.5rem; }
.transfer-facts { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.fact-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.78rem 0.9rem; border-bottom: 1px solid var(--line); }
.fact-row:nth-last-child(-n+2) { border-bottom: 0; }
.fact-row:nth-child(odd) { border-right: 1px solid var(--line); }
.fact-label { color: var(--muted); }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; overflow-wrap: anywhere; }
.proof-details { margin-top: 1.1rem; color: var(--muted); }
.proof-details summary { cursor: pointer; color: var(--gold-soft); }
.proof-values { background: rgba(0,0,0,0.16); border-radius: 12px; padding: 0.6rem 0.9rem; margin-top: 0.7rem; }
.proof-values p { margin: 0.55rem 0; }
.tax-card { background: rgba(14,19,23,0.78); padding-top: 1.35rem; padding-bottom: 1.35rem; }
.tax-card .transfer-amount { margin-bottom: 0.8rem; }
.tax-note { color: var(--muted); font-size: 0.82rem; margin: 0.9rem 0 0; }
.result-note { color: var(--muted); font-size: 0.85rem; }
.cid-link { display: inline-block; max-width: 15rem; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

.preview-panel, .disclosure { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 6vw, 5rem); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem, 5vw, 3.5rem); margin: 2rem 0; }
.preview-panel h2, .disclosure h2 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.05; font-weight: 500; margin: 0; }
.preview-panel p, .disclosure p { color: var(--muted); }
.preview-message blockquote { font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.25; margin: 0; }
.preview-message p { color: var(--gold); }

.proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 4rem 0; }
.proof-grid article { border-top: 1px solid var(--gold); padding: 1.2rem 0.2rem; }
.proof-grid span { color: var(--gold); font-size: 0.72rem; letter-spacing: 0.12em; }
.proof-grid h3 { font-size: 1.65rem; margin: 0.5rem 0; }
.proof-grid p { color: var(--muted); margin: 0; }

.disclosure { grid-template-columns: 1fr; }
.disclosure p { max-width: 790px; }
dl { display: grid; grid-template-columns: repeat(4, 1fr); margin: 1rem 0 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
dl div { padding: 1rem; border-right: 1px solid var(--line); }
dl div:last-child { border-right: 0; }
dt { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }
dd { margin: 0.25rem 0 0; color: var(--gold-soft); font-size: 1.1rem; }

footer { width: min(1040px, calc(100% - 2rem)); margin: 4rem auto 0; border-top: 1px solid var(--line); padding: 1.5rem 0 3rem; color: var(--muted); font-size: 0.78rem; display: flex; justify-content: space-between; gap: 2rem; }
footer p { margin: 0; max-width: 650px; }

@media (max-width: 980px) {
  .topbar-inner { grid-template-columns: 1fr auto; }
  .nav-toggle {
    display: inline-flex;
    justify-self: end;
    min-height: 38px;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.96);
    color: var(--text);
    font-weight: 800;
  }
  .nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0.875rem;
    right: 0.875rem;
    max-height: 72vh;
    overflow-y: auto;
    padding: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.98);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .topbar-inner.nav-open .nav { display: grid; }
  .nav a { width: 100%; border-radius: 12px; background: rgba(255, 255, 255, 0.06); white-space: normal; text-align: center; }
  .brand small { display: none; }
}

@media (max-width: 760px) {
  .hero { padding-top: 4rem; }
  .lookup-row { grid-template-columns: 1fr; }
  .lookup-row button { width: 100%; }
  .result-heading { align-items: start; flex-direction: column; }
  .transfer-facts, .preview-panel, .proof-grid { grid-template-columns: 1fr; }
  .fact-row { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .fact-row:last-child { border-bottom: 0 !important; }
  dl { grid-template-columns: repeat(2, 1fr); }
  dl div:nth-child(2) { border-right: 0; }
  dl div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  footer { flex-direction: column; }
}

@media (max-width: 520px) {
  .topbar-inner { width: min(calc(100% - 1.25rem), 1180px); }
  .brand { gap: 0.45rem; font-size: 0.86rem; overflow: hidden; }
  .brand-icons { gap: 0.22rem; }
  .brand-icon { width: 25px; height: 25px; }
  .brand-copy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav { grid-template-columns: 1fr; }
}

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