/* APIntegrity brand theme — matches logo (gunmetal + electric blue→cyan).
   Shared across scoreboard, sales, recommendations. Served at /static/brand.css */
:root {
  --bg0:#0a1118; --bg1:#0f1c26; --bg2:#15202b;
  --panel:#141f29; --panel2:#1b2a36; --border:#243544; --border2:#2d4150;
  --cyan:#35d0f0; --blue:#1f8bff; --blue2:#0f6fe0;
  --text:#e8f1f8; --muted:#8aa0b2; --muted2:#6b8294;
  --grad:linear-gradient(135deg,#35d0f0 0%,#1f8bff 55%,#0f6fe0 100%);
  --ok:#4ade80; --okbg:rgba(34,197,94,0.15); --okbd:rgba(34,197,94,0.3);
  --warn:#facc15; --warnbg:rgba(234,179,8,0.15); --warnbd:rgba(234,179,8,0.3);
  --bad:#f87171; --badbg:rgba(239,68,68,0.15); --badbd:rgba(239,68,68,0.3);
  --grey:#94a3b8; --greybg:rgba(148,163,184,0.15); --greybd:rgba(148,163,184,0.3);
}
* { box-sizing:border-box; }
html,body { margin:0; padding:0; }
body {
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  color:var(--text); line-height:1.6; min-height:100vh;
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(53,208,240,0.10), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(31,139,255,0.10), transparent 55%),
    linear-gradient(180deg,var(--bg0),var(--bg1) 40%,var(--bg2));
}
a { color:var(--cyan); text-decoration:none; }
a:hover { text-decoration:underline; }

/* Header + nav — centered, large transparent logo */
.site-header {
  padding:2.5rem 2rem 1.75rem; display:flex; flex-direction:column; align-items:center;
  text-align:center; gap:1.1rem; border-bottom:1px solid var(--border);
  background:linear-gradient(180deg, rgba(21,32,43,0.85), rgba(10,17,24,0.25));
  backdrop-filter:blur(6px);
}
.site-header img.logo {
  width:clamp(200px, 35vw, 320px); height:auto; max-width:none;
  filter:drop-shadow(0 0 28px rgba(53,208,240,0.30));
}
/* Logo image already contains the wordmark + tagline, so hide the text brand block. */
.site-header .brand { display:none; }
.site-nav { margin:0; display:flex; gap:0.5rem; flex-wrap:wrap; justify-content:center; }
.site-nav a {
  padding:0.5rem 1.1rem; border-radius:8px; font-size:0.9rem; font-weight:600;
  color:var(--muted); border:1px solid var(--border2); text-decoration:none;
  background:rgba(255,255,255,0.02);
}
.site-nav a:hover { color:var(--text); border-color:var(--cyan); background:rgba(53,208,240,0.08); text-decoration:none; }
.site-nav a.active { color:#071018; background:var(--grad); border-color:transparent; box-shadow:0 3px 14px rgba(31,139,255,0.35); }

.container { max-width:1200px; margin:0 auto; padding:1.75rem 2rem 3rem; }

/* Cards / panels */
.panel, .card, .stat-card, .form-card, .key-card {
  background:linear-gradient(180deg,var(--panel),var(--panel2));
  border:1px solid var(--border); border-radius:12px;
  box-shadow:0 6px 24px rgba(0,0,0,0.35); color:var(--text);
}
.card { padding:1.5rem; margin-bottom:1rem; }

/* Buttons */
.btn, .cta {
  display:inline-block; background:var(--grad); color:#071018; padding:0.75rem 1.5rem;
  border-radius:8px; text-decoration:none; font-weight:700; border:none; cursor:pointer;
  box-shadow:0 4px 16px rgba(31,139,255,0.35); transition:transform .08s ease, box-shadow .15s ease;
}
.btn:hover, .cta:hover { transform:translateY(-1px); box-shadow:0 6px 22px rgba(53,208,240,0.45); text-decoration:none; }
.btn.secondary, .cta.secondary { background:transparent; color:var(--cyan); border:1px solid var(--border2); box-shadow:none; }
.btn.secondary:hover, .cta.secondary:hover { border-color:var(--cyan); background:rgba(53,208,240,0.08); }
.btn:disabled { opacity:0.45; cursor:not-allowed; transform:none; }

/* Badges / tiers (support both .tier-no-cap hyphen form and .tier.nocap form) */
.tier, .badge, .tag {
  display:inline-block; padding:0.15rem 0.55rem; border-radius:5px; font-size:0.72rem;
  font-weight:700; text-transform:uppercase; letter-spacing:0.03em;
}
.tier-no-cap, .tier.nocap, .tag.nocap { background:var(--okbg); color:var(--ok); border:1px solid var(--okbd); }
.tier-sus, .tier.sus, .tag.sus { background:var(--warnbg); color:var(--warn); border:1px solid var(--warnbd); }
.tier-cap, .tier.cap, .tag.cap { background:var(--badbg); color:var(--bad); border:1px solid var(--badbd); }
.tier-unrated, .tier.unrated, .tag.unrated { background:var(--greybg); color:var(--grey); border:1px solid var(--greybd); }
.itype { background:rgba(53,208,240,0.12); color:var(--cyan); border:1px solid rgba(53,208,240,0.3); }
.keytype { background:rgba(31,139,255,0.12); color:#7cc0ff; border:1px solid rgba(31,139,255,0.25); }
.keytype.none { background:var(--okbg); color:var(--ok); border:1px solid var(--okbd); }
.keytype.unknown { background:var(--warnbg); color:var(--warn); border:1px solid var(--warnbd); }

/* Stats — hero cards with per-tier gradients */
.stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0.75rem; margin-bottom:1rem; }
.stat-card {
  background:linear-gradient(180deg,var(--panel),var(--panel2));
  border:1px solid var(--border);
  border-radius:14px;
  padding:1rem 1.25rem;
  position:relative;
  overflow:hidden;
  display:flex; flex-direction:column; gap:0.5rem;
}
.stat-card::before {
  content:""; position:absolute; inset:0 auto 0 0; width:3px; background:var(--grad);
}
.stat-card h3 {
  margin:0 0 0.4rem; font-size:0.72rem; text-transform:uppercase; color:var(--muted); letter-spacing:0.06em;
}
.stat-card .value {
  font-size:2rem; font-weight:800; color:var(--text); line-height:1.1;
}
.stat-card .value[onclick] { cursor:pointer; }
.stat-card.nocap { border-color:var(--okbd); background:linear-gradient(180deg,rgba(34,197,94,0.10),var(--panel2)); }
.stat-card.sus { border-color:var(--warnbd); background:linear-gradient(180deg,rgba(234,179,8,0.10),var(--panel2)); }
.stat-card.cap { border-color:var(--badbd); background:linear-gradient(180deg,rgba(239,68,68,0.10),var(--panel2)); }
.stat-card.total { border-color:rgba(53,208,240,0.3); background:linear-gradient(180deg,rgba(53,208,240,0.08),var(--panel2)); }

@media (max-width: 860px) {
  .stat-card { padding:0.9rem 0.95rem; min-width:0; }
  .stat-card::before { width:2px; }
  .stat-card h3 { font-size:0.63rem; letter-spacing:0.05em; }
  .stat-card .value { font-size:1.55rem; line-height:1.15; }
  .stat-card .ico { width:18px; height:18px; flex-basis:18px; }
}

/* Tables */
table { width:100%; border-collapse:collapse; background:linear-gradient(180deg,var(--panel),var(--panel2)); border:1px solid var(--border); border-radius:14px; overflow:hidden; margin-bottom:1rem; }
th { background:#0e1922; padding:0.75rem 1rem; text-align:left; font-size:0.72rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.05em; border-bottom:1px solid var(--border); }
td { padding:0.75rem 1rem; border-bottom:1px solid var(--border); font-size:0.9rem; color:var(--text); }
tr:last-child td { border-bottom:none; }
tbody tr:hover { background:rgba(53,208,240,0.05); }
.score { font-weight:700; font-family:ui-monospace,Menlo,monospace; color:var(--cyan); }
.flags { font-size:0.75rem; color:var(--muted2); }
code { background:#0c151d; padding:0.1rem 0.35rem; border-radius:4px; font-family:ui-monospace,Menlo,monospace; font-size:0.85rem; color:var(--cyan); border:1px solid var(--border); }

/* Hero (sales) */
.hero {
  background:linear-gradient(135deg, rgba(31,139,255,0.16), rgba(53,208,240,0.10));
  border:1px solid rgba(53,208,240,0.28); color:var(--text);
  padding:2.75rem 2.25rem; border-radius:16px; margin-bottom:2.5rem;
}
.hero h2 { margin:0 0 1rem; font-size:2rem; font-weight:800; }
.hero p { margin:0 0 1.5rem; font-size:1.1rem; color:#c7d6e2; }

/* Sections / features */
.section { margin-bottom:2.5rem; }
.section h3 { font-size:1.3rem; margin:0 0 1.25rem; }
.two-col { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:1rem; }
.feature { background:linear-gradient(180deg,var(--panel),var(--panel2)); border:1px solid var(--border); border-radius:12px; padding:1.25rem; }
/* FEATURE_ICON_IMG: brand icons replace the emoji, which rendered differently on every platform. */
.feature .icon { font-size:1.6rem; margin-bottom:0.5rem; line-height:0; }
.feature .icon img { width:34px; height:34px; object-fit:contain; filter:drop-shadow(0 0 8px rgba(53,208,240,0.28)); }
.feature h4 { margin:0 0 0.4rem; }
.feature p { margin:0; color:var(--muted); font-size:0.92rem; }
.api-item { display:flex; justify-content:space-between; align-items:center; padding:0.85rem; border:1px solid var(--border); border-radius:8px; margin-bottom:0.5rem; cursor:pointer; transition:border-color .15s; background:#0e1922; }
.api-item:hover { border-color:rgba(53,208,240,0.45); }
.endpoint { background:#0c151d; border:1px solid var(--border); border-radius:8px; padding:1rem; font-family:ui-monospace,Menlo,monospace; font-size:0.85rem; margin-bottom:1rem; color:#9fb6c7; overflow-x:auto; }

/* Pagination */
.pagination { display:flex; justify-content:center; align-items:center; gap:0.5rem; margin:2rem 0; padding:1rem; border-radius:12px; border:1px solid var(--border); background:linear-gradient(180deg,var(--panel),var(--panel2)); }
.pagination button { background:#0e1922; border:1px solid var(--border2); padding:0.4rem 0.9rem; border-radius:8px; cursor:pointer; font-size:0.85rem; color:var(--text); font-weight:600; }
.pagination button:hover { border-color:var(--cyan); background:rgba(53,208,240,0.08); }
.pagination button:disabled { opacity:0.4; cursor:not-allowed; }
.pagination .page-num { font-weight:700; color:var(--cyan); }
.pagination .page-info { font-size:0.85rem; color:var(--muted); }

/* Footer */
footer, .site-footer { margin-top:3rem; padding:2rem; border-top:1px solid var(--border); color:var(--muted); font-size:0.85rem; }

/* Modal */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(4,8,12,0.72); z-index:1000; backdrop-filter:blur(5px); }
.modal { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); width:min(700px,92vw); max-height:85vh; overflow-y:auto; background:linear-gradient(180deg,var(--panel),var(--panel2)); border:1px solid var(--border2); border-radius:14px; padding:1.5rem; z-index:1001; box-shadow:0 20px 60px rgba(0,0,0,0.6); color:var(--text); }
/* CLOSE_BTN_RESET: it is a <button>, so the UA background made it a white box. */
.modal .close-btn { position:absolute; top:10px; right:14px; font-size:1.5rem; cursor:pointer; color:var(--muted); line-height:1; background:transparent; border:none; padding:0.1rem 0.3rem; }
.modal .close-btn:hover { color:var(--text); }
.modal h2 { margin:0 0 0.5rem; font-size:1.5rem; color:var(--text); }
.modal-sub { margin-bottom:1rem; color:var(--muted); font-size:0.95rem; }
.modal-row { margin-bottom:1rem; }
.modal-row .label { font-weight:700; color:var(--cyan); font-size:0.78rem; text-transform:uppercase; letter-spacing:0.05em; }
.modal-row .value { color:var(--text); }

.empty { text-align:center; padding:3rem; color:var(--muted); }
.loading { display:none; text-align:center; padding:2rem; color:var(--cyan); }

/* ─────────────────────────────────────────────────────────────────────────
   Mobile (MOBILE_V1)
   Phone first: the scoreboard is read on a phone more often than a desktop.
   Four full-width stat slabs and a 7-column table are unusable there, so the
   stats become a 2×2 grid and every table row becomes a labelled card.
   ───────────────────────────────────────────────────────────────────────── */

/* Stat cards: icon + label on one line, number under it. */
.stat-card .stat-head { display:flex; align-items:center; gap:0.5rem; margin-bottom:0.35rem; }
.stat-card .stat-head h3 { margin:0; }
.stat-card .ico {
  width:22px; height:22px; flex:0 0 22px; object-fit:contain;
  filter:drop-shadow(0 0 6px rgba(53,208,240,0.35));
}

@media (max-width: 860px) {
  .container { padding:1.1rem 1rem 2.5rem; }
  .site-header { padding:1.25rem 1rem 1rem; gap:0.75rem; }
  .site-header img.logo { width:clamp(150px, 30vw, 200px); height:auto; }
  /* MOBILE_V1_NAV: one scrollable row beats a ragged two-line block. */
  .site-nav { gap:0.4rem; width:100%; overflow-x:auto; justify-content:flex-start;
    flex-wrap:nowrap; -webkit-overflow-scrolling:touch; scrollbar-width:none; padding-bottom:2px; }
  .site-nav::-webkit-scrollbar { display:none; }
  .site-nav a { flex:0 0 auto; padding:0.55rem 0.95rem; font-size:0.85rem; }

  /* 2×2 instead of four stacked slabs */
  .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:0.75rem; margin-bottom:1.5rem; }
  .stat-card { padding:0.8rem 0.85rem; min-width:0; }
  .stat-card::before { width:2px; }
  .stat-card h3 { font-size:0.63rem; letter-spacing:0.05em; }
  .stat-card .value { font-size:1.55rem; line-height:1.15; }
  .stat-card .ico { width:18px; height:18px; flex-basis:18px; }

  .hero { padding:1.5rem 1.15rem; border-radius:14px; margin-bottom:1.5rem; }
  .hero h2 { font-size:1.4rem; }
  .hero p { font-size:1rem; }
  .section h3 { font-size:1.1rem; }
  .card, .feature { padding:1rem; }
  .btn, .cta { padding:0.8rem 1.2rem; width:100%; text-align:center; }
  .endpoint { font-size:0.78rem; }
  footer, .site-footer { padding:1.5rem 1rem; }
}

/* Table → cards. Needs each cell to carry data-label. */
@media (max-width: 760px) {
  /* The rows below are display:block cards, but the table element itself is
     still display:table, and a CSS table can never shrink below the widest
     unbreakable word it contains -- width:100% does not cap that. One long MCP
     slug ("com.clauxel.a2areplayreceipt/a2areplayreceipt-mcp") therefore pushed
     the whole table past the page's content width, so the result cards sat a
     few pixels wider than the stat cards and filter chips above them. Plain API
     listings have short names and a 16-char id, stayed inside the container and
     looked correctly aligned, which is what made this look type-specific.
     display:block takes the table out of that sizing mode entirely. */
  table { background:none; border:none; box-shadow:none; border-radius:0;
    display:block; width:100%; max-width:100%; }
  tbody { display:block; width:100%; }
  thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  tbody tr {
    display:block; margin-bottom:0.7rem; padding:0.9rem 1rem;
    background:linear-gradient(180deg,var(--panel),var(--panel2));
    border:1px solid var(--border); border-radius:12px;
    box-shadow:0 4px 16px rgba(0,0,0,0.3);
  }
  tbody tr:hover { background:linear-gradient(180deg,var(--panel),var(--panel2)); }
  tbody td {
    display:flex; align-items:center; justify-content:space-between; gap:0.75rem;
    padding:0.3rem 0; border-bottom:none; font-size:0.88rem;
  }
  tbody td::before {
    content:attr(data-label); flex:0 0 auto; color:var(--muted);
    font-size:0.68rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em;
  }
  /* First cell is the API name: full-width heading, no label. Namespaced MCP
     slugs have no spaces to break on, so wrap them anywhere rather than let a
     single token dictate the card width. */
  tbody td[data-label="API"] {
    display:block; padding:0 0 0.55rem; margin-bottom:0.5rem;
    border-bottom:1px solid var(--border); font-size:0.98rem;
    overflow-wrap:anywhere; word-break:break-word; min-width:0;
  }
  tbody td[data-label="API"]::before { content:none; }
  tbody td .flags { text-align:right; font-size:0.72rem; }
  /* Renamed from "Flags" to "Findings" in the chips rework; this selector was
     left behind and matched nothing, so the label sat vertically centred
     against a three-line chip stack instead of beside the first chip. */
  tbody td[data-label="Findings"] { align-items:flex-start; }

  .pagination { flex-wrap:wrap; gap:0.4rem; padding:0.75rem; }
  .pagination button { flex:1 1 auto; min-height:44px; }
  .pagination .page-info { flex:1 0 100%; text-align:center; order:3; }

  /* Modals become bottom sheets. */
  .modal {
    top:auto; bottom:0; left:0; transform:none; width:100%;
    max-height:88vh; border-radius:16px 16px 0 0; padding:1.25rem 1rem 1.75rem;
  }
  .modal h2 { font-size:1.25rem; padding-right:2rem; }
  .modal .close-btn { font-size:1.9rem; top:6px; right:16px; padding:0.25rem; }

  /* Tap targets: badges are buttons here, not decoration. */
  .auth, .itype { padding:5px 11px; font-size:0.74rem; }
  .api-item { flex-direction:column; align-items:flex-start; gap:0.4rem; }
}

@media (max-width: 380px) {
  .stat-card .value { font-size:1.35rem; }
  .stat-card h3 { font-size:0.58rem; }
}

/* Logo intro animation — plays once on page load */
.logo.intro {
  opacity:0;
  transform:translateY(-20px) scale(0.9);
  animation:logo-intro 0.8s ease-out forwards;
}
@keyframes logo-intro {
  to { opacity:1; transform:translateY(0) scale(1); }
}

/* Full-screen logo intro — plays once on page load */
#intro-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #0a1118 0%, #0f1c26 40%, #15202b 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: intro-fade 3s ease-in-out forwards;
}
.logo-large {
  width: clamp(300px, 65vw, 800px);
  height: auto;
  filter: drop-shadow(0 0 40px rgba(53,208,240,0.55));
  animation: logo-scale 1.2s ease-out;
}
@keyframes logo-scale {
  0% { transform: scale(0.35); opacity: 0; }
  55% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes intro-fade {
  0%, 65% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
