/* Shared styles for the AgentDexBench page. Tokens, buttons, table and tile styles
   are taken from the cwe-bench page. Archivo is served from site/fonts. Body and mono text use
   system fonts, so the page makes no outside request.

   Type scale, and nothing smaller than 13px:
     13  mono: labels, tags, captions, notes, table heads      14  table cells, card text, buttons
     16  body                                                   18  card titles
     --fs-section  section titles and tile values               --fs-hero  the hero headline
   Spacing: a section is 64px top and bottom (48px on a phone). A title is followed by 16px, a
   block (table, grid, cards, button row) starts 24px below the text above it, cards sit 16px apart.

   Shared classes (a section's own classes start with its name: hero-, lb-, grid-, task-, how-, fail-):
     .shell                       page column, 1080px max
     .section, .section-band      section padding; band adds the darker full-width background
     .section-head                title with a label at its right (wraps on a phone)
     .section-title, .sub-title   headings        .body, .note: paragraph, small mono caption
     .card, .card-media, .card-title, .card-body, .cardgrid
                                  card, its flush top picture or clip, and a grid of cards
     .clip                        a video or picture cut to 800x570, which hides the caption burned
                                  into the bottom of the source clips
     .btn-primary, .btn-ghost, .btn-row  buttons
     .tablewrap, .tbl             table (.num right-aligned, .strong on cells)
     .tag                         small pill label
     .tiles, .tile, .tile-label, .tile-value      stat tiles
     .ph-label, .ph-bar           "Placeholder data" label and top bar; hidden until base.js shows
                                  them when the data says placeholder (data-rdb-placeholder)
     .sr-only
   Tokens: --bg --fg-1 --fg-2 --fg-3 --border --accent --c-* --r-md --r-lg --r-pill
           --font-display --font-body --font-mono --fs-section --fs-hero */

@font-face { font-family: 'Archivo'; font-weight: 400; font-display: swap; src: url('../fonts/Archivo-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Archivo'; font-weight: 500; font-display: swap; src: url('../fonts/Archivo-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Archivo'; font-weight: 600; font-display: swap; src: url('../fonts/Archivo-SemiBold.ttf') format('truetype'); }

:root {
  --font-display: 'Archivo', -apple-system, system-ui, 'Helvetica Neue', Arial, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --fs-section: clamp(24px, 3.2vw, 34px);
  --fs-hero: clamp(34px, 4.4vw, 52px);

  --c-brand-orange:      #F26125;
  --c-brand-orange-tint: #FFE4D6;
  --c-tan:       #CBB9A1;
  --c-beige-100: #FBFAF8;  /* card */
  --c-beige-200: #F8F7F2;  /* page */
  --c-beige-300: #F2EEE5;  /* band */
  --c-ink-900: #171616;
  --c-ink-700: #4E4F4F;
  --c-ink-600: #747575;
  --c-ink-300: #E5E5E1;
  --c-ink-200: #ECEAE3;

  --bg: var(--c-beige-200);
  --fg-1: var(--c-ink-900);
  --fg-2: var(--c-ink-700);
  --fg-3: var(--c-ink-600);
  --border: var(--c-ink-300);
  --accent: var(--c-brand-orange);

  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: clip; /* clip, not hidden: hidden would break the sticky nav */
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--c-brand-orange-tint); color: var(--c-ink-900); }
a { color: inherit; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; position: relative; z-index: 1; }
img, video { max-width: 100%; }

.shell { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Tags and the placeholder label ---------- */
.tag, .ph-label {
  display: inline-block;
  margin: 0;
  padding: 4px 9px;
  font: 500 13px/1.2 var(--font-mono);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--fg-2);
  background: var(--c-beige-100);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}
.ph-label { border-color: var(--c-tan); }
.ph-label[hidden], .ph-bar[hidden] { display: none; }
.ph-bar { background: var(--c-beige-300); border-bottom: 1px solid var(--border); }
.ph-bar .shell { padding-top: 6px; padding-bottom: 6px; font: 400 13px/1.4 var(--font-mono); letter-spacing: 0; color: var(--fg-2); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  background: rgba(248, 247, 242, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease-standard);
}
.topbar.is-stuck { border-bottom-color: var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar .wordmark { display: block; height: 26px; }
.topbar .wordmark img { height: 100%; width: auto; display: block; }
.toplinks { display: flex; align-items: center; gap: 28px; }
.toplink {
  font: 500 14px/1 var(--font-body);
  color: var(--fg-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms var(--ease-standard);
}
.toplink:hover { color: var(--accent); }
.toplink:focus-visible, .navtoggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.navtoggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-1);
  cursor: pointer;
}
.navtoggle .navtoggle-x { display: none; }
.navtoggle[aria-expanded="true"] .navtoggle-bars { display: none; }
.navtoggle[aria-expanded="true"] .navtoggle-x { display: inline; }

/* ---------- Buttons ---------- */
.btn-row { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn-primary, .btn-ghost {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  padding: 12px 22px;
  font: 600 14px/1.2 var(--font-body);
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  border-radius: var(--r-md);
  transition: transform 400ms var(--ease-standard), box-shadow 400ms var(--ease-standard), background-color 400ms var(--ease-standard), border-color 400ms var(--ease-standard), color 400ms var(--ease-standard);
}
.btn-primary {
  position: relative;
  overflow: hidden;
  color: #FFFFFF;
  background: #E37F43;
  border: 1px solid #E79154;
  box-shadow: inset 0 1px 4px #FFF9CE;
}
.btn-primary:hover { background: #CA733E; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(224, 132, 74, 0.35), inset 0 1px 4px #FFF9CE; }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--c-brand-orange-tint), inset 0 1px 4px #FFF9CE; }
.btn-primary .btn-glow {
  position: absolute; z-index: 2; top: -6px; right: -6px; width: 20px; aspect-ratio: 1;
  border-radius: 100%; background: #FFF5AE; filter: blur(12px); pointer-events: none;
}
.btn-primary .btn-text { position: relative; z-index: 1; }
.btn-ghost { color: var(--fg-2); background: transparent; border: 1px solid var(--border); box-shadow: 0 1px 1px rgba(55, 54, 68, 0.06); }
.btn-ghost:hover { border-color: #E37F43; color: #E37F43; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(227, 127, 67, 0.15); }
.btn-ghost:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--c-brand-orange-tint); }
.topcta { padding: 8px 16px; white-space: nowrap; }

/* ---------- Sections and headings ---------- */
.section { padding-top: 64px; padding-bottom: 64px; scroll-margin-top: 76px; }
.section-band { position: relative; }
.section-band::before {
  content: '';
  background: var(--c-beige-300);
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
}
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 16px; }
.section-head .section-title { margin: 0; }
.section-title {
  margin: 0 0 16px;
  max-width: 760px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-section);
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.sub-title {
  margin: 48px 0 16px;
  font: 600 18px/1.25 var(--font-display);
  letter-spacing: -0.02em;
}
.body { margin: 0; max-width: 720px; font: 400 16px/1.6 var(--font-body); color: var(--fg-2); }
.body + .body { margin-top: 16px; }
.note { margin: 12px 0 0; max-width: 720px; font: 400 13px/1.6 var(--font-mono); letter-spacing: 0; color: var(--fg-3); }
.note + .note { margin-top: 4px; }

/* ---------- Cards ---------- */
.cardgrid { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  background: var(--c-beige-100);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.card-media { margin: -20px -20px 18px; border-bottom: 1px solid var(--border); background: var(--c-ink-900); }
.card-title { margin: 0 0 8px; font: 600 18px/1.25 var(--font-display); letter-spacing: -0.02em; color: var(--fg-1); }
.card-body { margin: 0; font: 400 14px/1.55 var(--font-body); color: var(--fg-2); }
.card-body + .card-body { margin-top: 10px; }
.clip { display: block; width: 100%; height: auto; aspect-ratio: 80 / 57; object-fit: cover; object-position: 50% 0; background: var(--c-ink-900); }

/* ---------- Stat tiles ---------- */
.tiles { margin-top: 40px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: var(--c-beige-100);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.tile-label { font: 500 13px/1.3 var(--font-mono); letter-spacing: 0.02em; text-transform: uppercase; color: var(--fg-3); }
.tile-value { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-section); line-height: 1; letter-spacing: -0.02em; }

/* ---------- Tables ---------- */
.tablewrap { margin: 24px 0 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--c-beige-100); }
.tbl { width: 100%; border-collapse: collapse; font: 400 14px/1.5 var(--font-body); color: var(--fg-2); }
.tbl th {
  font: 500 13px/1.3 var(--font-mono);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-3);
  text-align: left;
  vertical-align: bottom;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td { padding: 13px 20px; border-bottom: 1px solid var(--c-ink-200); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th.num { text-align: right; }
.tbl .strong { color: var(--fg-1); font-weight: 600; }

/* ---------- Footer ---------- */
.footer { flex-shrink: 0; border-top: 1px solid var(--border); background: var(--c-beige-300); }
.footer .shell { padding-top: 32px; padding-bottom: 32px; display: grid; grid-template-columns: auto 1fr; gap: 12px 24px; align-items: start; }
.footer .mark { display: block; height: 22px; opacity: 0.85; }
.footer .mark img { height: 100%; width: auto; display: block; }
.footer-credits, .footer .copy { margin: 0; max-width: 760px; font: 400 13px/1.6 var(--font-mono); letter-spacing: 0; color: var(--fg-3); }
.footer .copy { grid-column: 2; }

/* ---------- Responsive ---------- */
@media (max-width: 899px) {
  .topbar { padding: 0; }
  .topbar .shell { padding: 0 20px; }
  .topbar-inner { min-height: 64px; }
  .navtoggle { display: inline-flex; }
  .toplinks {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 1;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 4px 20px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px -12px rgba(23, 22, 22, 0.22);
  }
  .toplinks[hidden] { display: none; }
  .toplink { display: flex; align-items: center; min-height: 48px; font-size: 16px; }
  .toplinks .topcta { margin-top: 12px; padding: 12px 16px; }
}
@media (max-width: 920px) {
  .cardgrid { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .shell { padding: 0 20px; }
  .section { padding-top: 48px; padding-bottom: 48px; }
  .tiles { gap: 12px; }
  .tile { padding: 14px; }
  .tbl th, .tbl td { padding-left: 14px; padding-right: 14px; }
  .footer .shell { grid-template-columns: minmax(0, 1fr); }
  .footer .copy { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
