/*
 * AgenticLevel by Bailder — design system.
 * Marca Bailder "clean tech": bege quente + Inter + detalhes NEON LED (acento, nunca tudo).
 * O "B" e o número do score usam a fita de LED (--b-grad). Zero hex solto em componente — só var().
 */

/* ---------- Fontes (self-host Inter via Propshaft — url() bare é resolvida pelo asset pipeline) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/inter-400-1e94a563.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/inter-500-5949f5fc.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/inter-600-a957bd0d.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/inter-700-cbc762c0.woff2") format("woff2"); }

/* ---------- Tokens da marca (EXATOS) ---------- */
:root {
  --white:  #fffefb;
  --paper:  #f1eee5;
  --ink:    #191714;
  --gray-700: #47423a;
  --gray-500: #5f5a51;
  --gray-400: #736d63;
  --gray-200: #d7d1c2;
  --gray-100: #e9e5d9;

  --neon-cyan:    #00e0ff;
  --neon-blue:    #4d7cff;
  --neon-violet:  #8a45ff;
  --neon-magenta: #c837ff;
  --neon-pink:    #ff2d9b;
  --led-base:     #14120f;

  --neon-grad: linear-gradient(115deg, var(--neon-cyan), var(--neon-blue) 26%, var(--neon-violet) 50%, var(--neon-magenta) 72%, var(--neon-pink));
  --b-grad: linear-gradient(122deg, var(--led-base) 0%, var(--led-base) 30%, #4b4b54 35%, #8f8f9c 39%, #dcdce4 42.5%, var(--neon-cyan) 47%, var(--neon-blue) 54%, var(--neon-violet) 62%, var(--neon-magenta) 72%, var(--neon-pink) 84%, var(--neon-pink) 100%);

  --accent:      #2f7dff;
  --accent-text: #175cd3;
  --tier-verde: #16a34a; --tier-amarelo: #d9a400; --tier-vermelho: #e5484d;

  --color-bg: var(--paper);
  --color-card: var(--white);
  --color-surface: var(--gray-100);
  --color-border: var(--gray-200);
  --color-text: var(--ink);
  --color-muted: var(--gray-500);
  --color-faded: var(--gray-400);

  --space-sm: 8px; --space-md: 16px; --space-lg: 24px; --space-xl: 32px; --space-2xl: 48px;
  --space-3xl: clamp(48px, 9vw, 80px); --space-4xl: clamp(64px, 12vw, 120px);

  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 22px; --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(20,15,10,.06), 0 8px 22px rgba(20,15,10,.04);
  --shadow-md: 0 8px 30px rgba(20,15,10,.08);
  --shadow-lg: 0 18px 48px rgba(10,10,20,.10);
  --ring: 0 0 0 3px rgba(45,130,255,.20);

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);
  --t-fast: 140ms var(--ease-out); --t-normal: 240ms var(--ease-out); --t-slow: 420ms var(--ease-out);

  --container-max: 1120px; --container-narrow: 720px;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg, video { max-width: 100%; }
img { display: block; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 500;
  background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: var(--radius-full);
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: var(--space-4xl); }
.section__head { max-width: 640px; margin-bottom: var(--space-2xl); }
.section__head h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 700; letter-spacing: -.02em; }
.section__head h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; letter-spacing: -.03em; }
.section__head p { margin-top: 10px; color: var(--color-muted); font-size: 1.05rem; }

.eyebrow {
  font-family: var(--font-mono); font-size: .74rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--color-faded); margin-bottom: 14px;
}
.block-title { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: var(--space-md); }

/* ---------- O "B" de LED (assinatura) ---------- */
.brand__b {
  font-weight: 700; font-size: 1.5em; line-height: 1;
  background: var(--b-grad); background-size: 260% 100%; background-position: 0% 0%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: bshift 7s var(--ease-inout) infinite;
}
.brand__b--sm { font-size: 1.2em; }
@keyframes bshift { 0%,100% { background-position: 0% 0%; } 50% { background-position: 100% 0%; } }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: baseline; gap: 8px; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand__name { font-size: 1.05rem; }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.nav__links a { color: var(--gray-700); font-weight: 500; font-size: .95rem; }
.nav__links a:hover { color: var(--ink); text-decoration: none; }
.nav__cta {
  padding: 8px 16px; border-radius: var(--radius-full);
  background: var(--ink); color: var(--white) !important;
}
.nav__cta:hover { background: #000; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-full); font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--ink); color: var(--white); }
.btn--primary:hover { background: #000; box-shadow: var(--shadow-md); }
.btn--ghost { background: var(--color-card); color: var(--ink); border-color: var(--color-border); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--share { background: var(--color-card); border-color: var(--color-border); color: var(--gray-700); padding: 10px 18px; }
.btn--share:hover { border-color: var(--accent); color: var(--accent-text); }

/* ---------- Grade + arquétipo pill ---------- */
.grade {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.4em; padding: 3px 12px; border-radius: var(--radius-full);
  font-weight: 700; font-family: var(--font-mono); letter-spacing: .02em;
  border: 1.5px solid currentColor; background: var(--color-card);
}
.grade--sm { font-size: .8rem; padding: 2px 10px; }
.grade--lg { font-size: 1.3rem; padding: 6px 18px; }
.grade--a, .grade--ap, .grade--am { color: var(--tier-verde); }
.grade--b, .grade--bp, .grade--bm { color: var(--accent-text); }
.grade--c, .grade--cp, .grade--cm { color: var(--neon-violet); }
.grade--d { color: var(--neon-magenta); }
.grade--f { color: var(--tier-vermelho); }

.archetype-pill {
  display: inline-flex; align-items: center; padding: 4px 14px; border-radius: var(--radius-full);
  background: var(--color-surface); color: var(--gray-700);
  font-size: .82rem; font-weight: 600; letter-spacing: -.01em;
}

/* ---------- O número do score (fita de LED) ---------- */
.score-number {
  font-weight: 700; letter-spacing: -.04em; line-height: .95; font-size: clamp(3rem, 8vw, 4.4rem);
  background: var(--b-grad); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.score-number--xl { font-size: clamp(4.5rem, 16vw, 9rem); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(48px, 8vw, 96px) var(--space-4xl); }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero__title { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; line-height: 1.04; letter-spacing: -.035em; }
.hero__sub { margin-top: var(--space-lg); font-size: 1.15rem; color: var(--gray-700); max-width: 32ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--space-xl); }

.install {
  display: flex; align-items: center; gap: 10px; margin-top: var(--space-xl);
  padding: 14px 18px; border-radius: var(--radius-md);
  background: var(--ink); color: var(--white); box-shadow: var(--shadow-md);
  overflow-x: auto; scroll-behavior: auto;
}
.install__prompt { color: var(--neon-cyan); font-family: var(--font-mono); font-weight: 600; }
.install__cmd { font-family: var(--font-mono); font-size: .95rem; white-space: nowrap; }
.install__note { margin-top: 10px; font-size: .85rem; color: var(--color-faded); }

.hero__card {
  background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-xl);
  padding: var(--space-xl); box-shadow: var(--shadow-lg); text-align: center;
}
.card__eyebrow { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--color-faded); }
.hero__card .score-number { margin-block: 6px 12px; }
.score-meta { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.hero__radar { margin-top: var(--space-md); display: flex; justify-content: center; }

/* ---------- Radar / hexágono LED ---------- */
.radar { display: block; overflow: visible; }
.radar__ring { fill: none; stroke: var(--color-border); stroke-width: 1; }
.radar__spoke { stroke: var(--color-border); stroke-width: 1; }
.radar__data { filter: drop-shadow(0 0 8px rgba(77,124,255,.35)); }
.radar__dot { fill: var(--white); stroke: var(--neon-blue); stroke-width: 1.5; }
.radar__label { font-family: var(--font-mono); font-size: 11px; font-weight: 600; fill: var(--color-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Mini leaderboard (home) ---------- */
.board-preview { background: var(--color-surface); border-block: 1px solid var(--color-border); }
.mini-board { list-style: none; display: grid; gap: 10px; margin-bottom: var(--space-xl); }
.mini-row {
  display: grid; grid-template-columns: 2.5em 44px 1fr auto auto auto; align-items: center; gap: 14px;
  padding: 12px 18px; background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.mini-row:hover { border-color: var(--accent); transform: translateX(2px); }
.mini-row__rank { font-family: var(--font-mono); font-weight: 700; color: var(--color-faded); }
.mini-row__hex { display: inline-flex; }
.mini-row__handle { font-weight: 600; color: var(--ink); }
.mini-row__arch { color: var(--color-muted); font-size: .9rem; }
.mini-row__score { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Pilares (home grid) ---------- */
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.pillar-card {
  position: relative; background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-lg); transition: border-color var(--t-fast);
}
.pillar-card:hover { border-color: var(--accent); }
.pillar-card__cap {
  display: inline-block; font-family: var(--font-mono); font-size: .74rem; font-weight: 600;
  color: var(--accent-text); background: rgba(45,130,255,.10); padding: 2px 10px; border-radius: var(--radius-full); margin-bottom: 12px;
}
.pillar-card h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -.01em; }
.pillar-card p { margin-top: 8px; color: var(--color-muted); font-size: .95rem; }

/* ---------- Manifesto ---------- */
.manifesto { text-align: center; }
.manifesto__title { font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 700; letter-spacing: -.03em; }
.manifesto__lede { margin: var(--space-md) auto 0; max-width: 52ch; color: var(--gray-700); font-size: 1.1rem; }
.compare {
  display: flex; align-items: stretch; justify-content: center; gap: var(--space-md);
  margin: var(--space-2xl) auto; flex-wrap: wrap;
}
.compare__col {
  flex: 1 1 220px; max-width: 300px; text-align: left;
  background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-lg);
}
.compare__col--them { opacity: .78; }
.compare__col--us { border-color: var(--accent); box-shadow: var(--shadow-md); }
.compare__k { display: block; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--color-faded); }
.compare__v { display: block; margin-top: 8px; font-size: 1.05rem; font-weight: 600; }
.compare__col--us .compare__v { color: var(--accent-text); }
.compare__vs { align-self: center; font-size: 1.6rem; color: var(--color-faded); }
.manifesto__punch { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; margin-bottom: var(--space-xl); }

/* ---------- Perfil ---------- */
.profile__grid {
  display: grid; gap: var(--space-2xl);
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "head   head"
    "score  radar"
    "pillars stats"
    "share  share";
  padding-block: var(--space-3xl);
}
.profile__head { grid-area: head; text-align: center; }
.profile__ident { display: inline-flex; align-items: center; gap: 12px; }
.avatar { border-radius: var(--radius-full); border: 2px solid var(--color-border); }
.avatar--xs { width: 24px; height: 24px; border-width: 1px; }
.profile__handle { font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; }
.verified { color: var(--accent-text); font-size: .9em; }
.profile__name { color: var(--color-muted); font-size: .95rem; text-align: left; }
.archetype-headline { margin-top: var(--space-md); font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 700; letter-spacing: -.03em; background: var(--neon-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.archetype-tagline { margin-top: 8px; color: var(--gray-700); font-size: 1.1rem; }

.profile__score { grid-area: score; align-self: center; text-align: center; }
.score-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: var(--space-md); }
.percentile { font-family: var(--font-mono); font-weight: 600; color: var(--color-muted); }
.profile__radar { grid-area: radar; display: flex; justify-content: center; align-items: center; }

.profile__pillars { grid-area: pillars; }
.pillar-bars { list-style: none; display: grid; gap: 14px; }
.pbar { display: grid; grid-template-columns: 8.5em 1fr auto; align-items: center; gap: 12px; }
.pbar__name { font-size: .92rem; font-weight: 500; color: var(--gray-700); }
.pbar__track { height: 8px; border-radius: var(--radius-full); background: var(--color-surface); overflow: hidden; }
.pbar__fill { display: block; height: 100%; border-radius: var(--radius-full); background: var(--neon-grad); transition: width var(--t-slow); }
.pbar__val { font-family: var(--font-mono); font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pbar__cap { color: var(--color-faded); font-weight: 500; }

.profile__stats { grid-area: stats; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
.stat { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-lg); text-align: center; }
.stat__v { display: block; font-family: var(--font-mono); font-size: 2rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__k { display: block; margin-top: 4px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--color-faded); }

.profile__share { grid-area: share; text-align: center; padding-top: var(--space-md); border-top: 1px solid var(--color-border); }
.share-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.profile__inspector { display: inline-block; margin-top: var(--space-lg); font-size: .9rem; color: var(--color-muted); }

/* ---------- Leaderboard ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--color-surface); border-radius: var(--radius-full); margin-bottom: var(--space-md); }
.tab { padding: 8px 18px; border-radius: var(--radius-full); font-weight: 600; font-size: .9rem; color: var(--gray-700); }
.tab:hover { text-decoration: none; color: var(--ink); }
.tab.is-active { background: var(--color-card); color: var(--ink); box-shadow: var(--shadow-sm); }
.optin-note { color: var(--color-faded); font-size: .88rem; margin-bottom: var(--space-lg); }
.empty { color: var(--color-muted); padding-block: var(--space-2xl); text-align: center; }

.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-card); }
.board-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.board-table th, .board-table td { padding: 14px 16px; text-align: left; }
.board-table thead th { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--color-faded); border-bottom: 1px solid var(--color-border); font-weight: 600; }
.board-table tbody tr + tr td { border-top: 1px solid var(--color-border); }
.board-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.col-rank { width: 3em; }
.rank-num { font-family: var(--font-mono); font-weight: 700; color: var(--color-faded); }
.col-arch { width: 40px; }
.mini-hex { display: inline-flex; }
.user-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.user-cell:hover { text-decoration: none; color: var(--accent-text); }
.flag { font-size: .85rem; }
.col-score { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--color-border); padding-block: var(--space-2xl); background: var(--color-surface); }
.foot__inner { display: grid; gap: 8px; text-align: center; }
.foot__brand { display: inline-flex; align-items: baseline; gap: 8px; justify-content: center; font-weight: 700; color: var(--ink); }
.foot__tag { font-family: var(--font-mono); font-size: .82rem; letter-spacing: .04em; color: var(--gray-700); }
.foot__meta { color: var(--color-muted); font-size: .85rem; max-width: 60ch; margin-inline: auto; }
.foot__copy { color: var(--color-faded); font-size: .8rem; }

/* ---------- Sheen neon (controller shimmer) ---------- */
[data-controller~="shimmer"] { position: relative; overflow: hidden; }
[data-controller~="shimmer"]::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(115deg, transparent 42%, rgba(0,224,255,.10) 48%, rgba(138,69,255,.12) 52%, rgba(255,45,155,.08) 56%, transparent 62%);
  transform: translateX(-130%); opacity: 0;
}
[data-controller~="shimmer"].is-shimmering::after { animation: sheen 1.5s var(--ease-out) forwards; }
@keyframes sheen { 0% { transform: translateX(-130%); opacity: 0; } 18% { opacity: 1; } 100% { transform: translateX(130%); opacity: 0; } }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__card { order: -1; }
  .pillar-grid { grid-template-columns: 1fr; }
  .profile__grid {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "score" "radar" "pillars" "stats" "share";
  }
  .mini-row { grid-template-columns: 2em 40px 1fr auto; row-gap: 4px; }
  .mini-row__arch, .mini-row__score { grid-column: 3 / -1; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .pbar { grid-template-columns: 6.5em 1fr auto; }
  .nav__links { gap: 12px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .brand__b { animation: none; background-position: 0% 0%; }
  [data-controller~="shimmer"]::after { display: none; }
}
