/* Loop — escuro, uma cor quente (brasa), serifa nos titulos, mono nos numeros. */
:root {
  --bg: #0b0b0d;
  --bg-2: #121216;
  --line: #24242b;
  --text: #f2efe9;
  --muted: #9b9891;
  --ember: #ff5a1f;
  --ember-2: #ffb08a;
  --ash: #5d5b56;
  --ok: #7ad38b;
  /* mesma tipografia do Claudeploy: Manrope em tudo, mono do sistema so em enderecos */
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
b { font-weight: 600; }
code { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.01em; }
code.num { font-weight: 500; letter-spacing: 0; }
.muted { color: var(--muted); }
.err { color: var(--ember); min-height: 1.4em; margin: 6px 0 0; font-size: 14px; }
main { max-width: 980px; margin: 0 auto; padding: 0 20px 60px; }

/* brasas no fundo, atras de tudo */
#embers { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.top, main, footer { position: relative; z-index: 1; }

/* cartoes surgem ao rolar */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* topo */
.top { max-width: 980px; margin: 0 auto; padding: 22px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.brand .ring { width: 30px; height: 30px; fill: none; stroke: var(--ember); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.brand .ring .head { fill: var(--ember); stroke: none; }
.links { display: flex; gap: 18px; font-size: 14px; }
.links a { color: var(--muted); text-decoration: none; }
.links a:hover { color: var(--text); }

/* hero */
.hero { padding: 40px 0 34px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: center; }
.hero-text { min-width: 0; }
.hero h1 { font-weight: 600; font-size: clamp(36px, 5.8vw, 64px); line-height: 1.12; margin: 0 0 16px; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: inherit; }
.lead { font-size: 17px; color: var(--muted); margin: 0; max-width: 60ch; }
.lead b { color: var(--text); font-weight: 600; }
.lead em { font-style: normal; color: var(--text); font-weight: 600; }
.loop-mark { position: relative; width: 220px; height: 220px; }
.loop-mark svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.loop-mark .track { stroke: var(--line); stroke-width: 6; }
.loop-mark .arc { stroke: var(--ember); stroke-width: 6; stroke-dasharray: 78 22; transform-origin: 50% 50%; filter: drop-shadow(0 0 7px rgba(255,90,31,.6)); animation: spin 14s linear infinite, breathe 3.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { stroke-dasharray: 78 22; opacity: 1; } 50% { stroke-dasharray: 66 34; opacity: .8; } }
.loop-mark .arrow { stroke: var(--ember); stroke-width: 6; opacity: 0; }
.loop-mark.dead .arc, .loop-mark.dead .arrow { stroke: var(--ash); animation: none; }
.loop-mark.waiting .arc { animation-duration: 40s; stroke: var(--ember-2); }
.loop-mark.burned .arc { stroke: var(--ash); stroke-dasharray: 100 0; animation: none; opacity: 0.6; }
.mark-n { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mark-n .mark-label { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.mark-n #mark-n { font-size: 48px; line-height: 1; font-weight: 700; letter-spacing: -.03em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* cartoes */
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 24px; margin: 18px 0; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.head { justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.eyebrow { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
h2 { font-weight: 600; font-size: clamp(26px, 3.2vw, 34px); margin: 0; line-height: 1.12; letter-spacing: -.02em; }
.pill { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.live { color: var(--text); border-color: rgba(122,211,139,.35); }
.pill.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 8px; box-shadow: 0 0 0 0 rgba(122,211,139,.6); animation: pulse 1.8s infinite; }
.pill.warn { color: var(--text); border-color: #3a3a44; }
.pill.dead { color: var(--ash); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(122,211,139,.6); } 100% { box-shadow: 0 0 0 10px rgba(122,211,139,0); } }
.status-text { margin: 0 0 18px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: rgba(255,255,255,.015); min-width: 0; }
.num, code { overflow-wrap: anywhere; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 28px; margin-top: 4px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; min-height: 1.2em; }
.ca { margin-top: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ca .k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.ca code { font-size: 13px; background: var(--bg); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); word-break: break-all; }
.rule { margin: 16px 0 0; font-size: 14px; color: var(--muted); }

/* botoes */
.btn { font: inherit; font-size: 14px; font-weight: 600; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { border-color: #3a3a44; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.primary { background: var(--ember); border-color: var(--ember); color: #14100e; }
.btn.primary:hover { background: #ff7040; }
.btn.danger { border-color: rgba(255,90,31,.5); color: var(--text); }
.btn.burn { background: var(--ember); border-color: var(--ember); color: #14100e; grid-column: 1 / -1; font-size: 16px; padding: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* pote */
.big { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.bar { height: 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.fill { height: 100%; width: 0%; background: linear-gradient(90deg, #ff5a1f, #ffb08a, #ff5a1f); background-size: 200% 100%; transition: width 1.2s ease; animation: shimmer 3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pot-legend { display: flex; justify-content: space-between; margin: 10px 0 14px; font-size: 14px; color: var(--muted); }
.pot-legend b { color: var(--text); }
.pot .muted { margin: 0; font-size: 14px; }
.final-box { margin-top: 16px; padding: 16px; border-radius: 12px; border: 1px solid rgba(255,90,31,.5); background: rgba(255,90,31,.06); font-size: 15px; }
.final-box b { color: var(--text); }

/* linha do tempo */
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 18px; }
.timeline li::before { content: ""; position: absolute; left: -33px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg-2); border: 3px solid var(--ash); }
.timeline li.live::before { border-color: var(--ok); background: var(--ok); }
.timeline li.burned::before { border-color: var(--ember); background: var(--ember); }
.timeline li.graduated::before { border-color: var(--ember-2); }
.timeline .t-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.timeline .t-head b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.timeline .t-meta { font-size: 13px; color: var(--muted); }
.timeline .t-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 16px; margin-top: 8px; font-size: 13px; }
.timeline .t-grid span { color: var(--muted); }
.timeline .t-grid b { font-weight: 500; }
.timeline .t-ca { font-size: 12px; margin-top: 6px; }
.timeline .t-ca a { color: var(--muted); }

/* feed */
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { padding: 14px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; }
.posts li:first-child { border-top: 0; padding-top: 0; }
.posts .p-text { font-size: 16px; }
.posts .p-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.posts .p-meta a { color: var(--muted); }

/* regras */
.rules { padding-left: 22px; margin: 16px 0 0; display: grid; gap: 10px; }
.rules li { color: var(--muted); }
.rules li b { color: var(--text); }
.sym-text { font-family: var(--mono); color: var(--text); }
.agent-box { margin-top: 22px; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; display: grid; gap: 8px; }
.agent-box .k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.agent-box code { font-size: 13px; word-break: break-all; }
.agent-box .muted { margin: 4px 0 0; font-size: 14px; }
.agent-box .btn { justify-self: start; }

/* admin */
.admin:target { display: block !important; }
.admin input { font: inherit; font-family: var(--mono); font-size: 14px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); flex: 1; min-width: 200px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 12px; }
.log ul { list-style: none; padding: 0; margin: 8px 0 0; font-family: var(--mono); font-size: 12px; color: var(--muted); display: grid; gap: 4px; max-height: 320px; overflow: auto; }
.log summary { cursor: pointer; color: var(--muted); font-size: 14px; }

footer { max-width: 980px; margin: 0 auto; padding: 24px 20px 40px; border-top: 1px solid var(--line); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .loop-mark .arc, .fill, .pill.live::before { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  #embers { display: none; }
}

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 16px; }
  .loop-mark { width: 150px; height: 150px; }
  .mark-n #mark-n { font-size: 40px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat .v { font-size: 19px; }
  .card { padding: 18px; border-radius: 14px; }
  .links a:not(#link-pons) { display: none; }
  .timeline { padding-left: 18px; }
  .timeline li { padding-left: 12px; }
  .timeline li::before { left: -25px; }
  h2 { font-size: 26px; }
  .big { font-size: 26px; }
  .posts li { grid-template-columns: 1fr; }
}
