/* Seções da página, na ordem em que aparecem. */

/* ==================== HERÓI ==================== */
.hero { position: relative; overflow: hidden; isolation: isolate; padding-block: clamp(40px, 7vw, 88px) clamp(48px, 7vw, 96px); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(48% 70% at 80% 35%, rgba(var(--glow-rgb), 0.2), transparent);
}
#petals { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* ヘレナ na margem, como no cartão de perfil, escrito traço a traço */
.kanji {
  display: none;
  position: absolute; z-index: -1; top: 118px;
  left: clamp(6px, calc((100vw - 1120px) / 2 - 86px), 140px);
  width: 78px; height: 234px; overflow: visible;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  user-select: none;
}
@media (min-width: 1280px) { .kanji { display: block; } }

/* Os 4 traços moram num SVG de tamanho zero; os dois desenhos só os reusam. */
.kanji-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Telas menores que 1280 px não têm margem para o desenho vertical, então o
   ヘレナ vem na horizontal, no topo do texto do herói. */
.kanji-h {
  display: block; width: 132px; height: 44px; margin-bottom: 18px; overflow: visible;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  user-select: none;
}
@media (min-width: 1280px) { .kanji-h { display: none; } }

.kanji .ghost use, .kanji-h .ghost use { stroke: rgba(var(--hi-rgb), 0.2); stroke-width: 6; }
.kanji .ink use, .kanji-h .ink use {
  stroke: var(--brand-hi); stroke-width: 6;
  stroke-dasharray: 1; stroke-dashoffset: 0;
  filter: drop-shadow(0 0 5px rgba(var(--hi-rgb), 0.55));
}
.kanji .tip { fill: #fff; opacity: 0; filter: drop-shadow(0 0 5px var(--brand-hi)); }

.hero-grid { display: grid; gap: 44px; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.5rem, 5.6vw, 4.3rem); line-height: 1.04;
  margin-block: 14px 20px;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.hero h1 .line > span { display: block; }
.hero h1 .accent { color: var(--brand-hi); }
.hero .sub { color: var(--muted); font-size: 1.12rem; max-width: 54ch; }
.note { color: var(--dim); font-size: 0.9rem; max-width: 56ch; }
.note code { color: var(--brand-hi); font-size: 0.86em; }

.card-shot { position: relative; margin: 0; min-width: 0; }
.card-shot::before {
  content: ""; position: absolute; inset: 8% 4% -4%; z-index: -1;
  background: radial-gradient(closest-side, rgba(var(--glow-rgb), 0.55), transparent);
  filter: blur(28px);
}
.tilt {
  position: relative; border-radius: 18px;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s var(--ease);
  will-change: transform;
}
.tilt.live { transition: transform 0.08s linear; }
.tilt img {
  width: 100%; height: auto;
  border-radius: 18px; border: 1px solid var(--line-2);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.8);
}
.tilt .glare {
  position: absolute; inset: 0; border-radius: 18px; pointer-events: none; opacity: 0;
  background: radial-gradient(320px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.14), transparent 60%);
  transition: opacity 0.3s;
}
.tilt.live .glare { opacity: 1; }
.card-shot figcaption { color: var(--dim); font-size: 0.84rem; margin-top: 14px; text-align: center; }

/* ==================== NÚMEROS ==================== */
.ledger { border-block: 1px solid var(--line); background: var(--bg-2); }
.ledger ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ledger li { padding: 26px 24px; border-left: 1px solid var(--line); }
.ledger li:first-child { border-left: 0; padding-left: 0; }
.ledger b { display: block; font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 4vw, 2.9rem); color: var(--gold); line-height: 1.05; font-variant-numeric: tabular-nums; }
.ledger span { color: var(--muted); font: 500 0.78rem var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
@media (max-width: 640px) {
  .ledger ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger li:nth-child(3) { border-left: 0; padding-left: 0; }
  .ledger li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* ==================== O JOGO (bento) ==================== */
.bento { display: grid; gap: 14px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.c2 { grid-column: span 2; }
.c3 { grid-column: span 3; }
.c6 { grid-column: 1 / -1; }
@media (max-width: 960px) { .c2 { grid-column: span 3; } }
@media (max-width: 620px) { .c2, .c3 { grid-column: 1 / -1; } }

.cell {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 22px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.2s;
}
.cell:hover { border-color: var(--line-2); }
/* foco de luz que segue o mouse */
.cell::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(var(--glow-rgb), 0.17), transparent 70%);
  transition: opacity 0.3s;
}
.cell:hover::before { opacity: 1; }
.cell-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cell h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; }
.cell p { color: var(--muted); font-size: 0.96rem; }
.cell .grow { flex: 1; }

/* recibo do /trabalhar */
.receipt { font-family: var(--font-mono); font-size: 0.8rem; border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; background: var(--sunk); }
.receipt .t { color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.75rem; }
.receipt div { display: flex; justify-content: space-between; gap: 12px; }
.receipt .plus { color: var(--green); }
.receipt .minus { color: var(--red); }

/* sequência de 7 dias do /daily */
.streak { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 132px; align-items: end; }
.streak .day { display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; height: 100%; }
.streak .day i { display: block; height: calc(var(--h) * 0.68%); background: var(--line-2); border-radius: 4px 4px 0 0; transform-origin: bottom; }
.streak .day.last i { background: var(--gold); }
.streak .day span { font: 500 0.75rem var(--font-mono); color: var(--muted); text-align: center; }
.streak .day em { font: 400 0.75rem var(--font-mono); color: var(--dim); text-align: center; font-style: normal; }
.cap { color: var(--dim); font: 400 0.75rem var(--font-mono); }

/* carteira exposta x banco protegido */
.expo { display: grid; gap: 8px; font-size: 0.9rem; }
.expo div { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); }
.expo .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.expo .dot.red { background: var(--red); }
.expo .dot.blue { background: var(--blue); }
.expo small { color: var(--dim); margin-left: auto; font-size: 0.78rem; }

/* barra de energia */
.energy { height: 10px; background: var(--bg-3); border-radius: 10px; overflow: hidden; }
.energy i { display: block; height: 100%; width: 64%; background: var(--brand-hi); border-radius: 10px; transform-origin: left; }

/* conquistas */
.ach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ach {
  --rc: var(--r-common);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px; font-size: 0.86rem;
  border: 1px solid color-mix(in srgb, var(--rc) 42%, transparent);
  background: color-mix(in srgb, var(--rc) 10%, transparent);
}
.ach.uncommon { --rc: var(--r-uncommon); }
.ach.rare { --rc: var(--r-rare); }
.ach.epic { --rc: var(--r-epic); }
.ach.legendary { --rc: var(--r-legendary); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--dim); font: 400 0.75rem var(--font-mono); }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--rc, var(--r-common)); }

/* ==================== VEJA FUNCIONANDO ==================== */
.notes { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 18px; }
.notes li { display: grid; gap: 2px; padding-left: 16px; border-left: 2px solid var(--line-2); }
.notes b { font-family: var(--font-display); font-size: 1.05rem; }
.notes span { color: var(--muted); font-size: 0.94rem; }

/* ==================== ROTINA ==================== */
/* Ordem das camadas fixada de propósito: a linha (z-index 0) fica atrás dos
   itens (z-index 1) mesmo quando a animação de entrada faz cada item virar
   um bloco próprio, senão a linha dourada passa por cima dos números. */
.steps { --p: 0; list-style: none; margin: 0; padding: 0; position: relative; isolation: isolate; display: grid; }
.steps::before, .steps::after { content: ""; position: absolute; z-index: 0; left: 25px; top: 30px; width: 2px; border-radius: 2px; }
.steps::before { bottom: 30px; background: var(--line); }
.steps::after { height: calc((100% - 60px) * var(--p)); background: var(--gold); }
.steps li {
  position: relative; z-index: 1; counter-increment: step;
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px 20px; align-items: center;
  padding-block: 18px;
}
.steps li + li { border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--line-2);
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--brand-hi);
  transition: color 0.4s, border-color 0.4s;
  position: relative; z-index: 1;
}
.steps li.done::before { color: var(--gold); border-color: var(--gold); }
.steps { counter-reset: step; }
.steps h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.steps p { color: var(--muted); font-size: 0.95rem; margin-top: 2px; }
.steps div { min-width: 0; }
@media (max-width: 640px) {
  .steps li { grid-template-columns: 52px minmax(0, 1fr); }
  .steps li .cmd { grid-column: 2; }
}

/* ==================== CARREIRA ==================== */
.ladder { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin-bottom: 20px; min-height: 3.4rem; }
.readout h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; }
.readout .pay { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.readout .pay small { font: 400 0.85rem var(--font-body); color: var(--muted); }
.readout .meta { font: 400 0.78rem var(--font-mono); color: var(--dim); }
.ladder-scroll { overflow-x: auto; padding-bottom: 6px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 200px; min-width: 640px; }
.bar { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; padding: 0; background: none; border: 0; cursor: pointer; }
.bar span { display: block; width: 100%; height: var(--h); background: var(--line-2); border-radius: 4px 4px 0 0; transform-origin: bottom; transition: background 0.15s; }
.bar:hover span, .bar:focus-visible span { background: var(--brand); }
.bar[aria-pressed="true"] span { background: var(--gold); }
.axis { display: flex; gap: 6px; min-width: 640px; margin-top: 8px; font: 400 0.75rem var(--font-mono); color: var(--dim); }
.axis span { flex: 1; text-align: center; }
.axis-cap { color: var(--dim); font: 400 0.75rem var(--font-mono); margin-top: 6px; }

details.all { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
details.all > summary { padding: 16px 22px; font-weight: 600; }

/* ==================== CRIME ==================== */
.dark { position: relative; overflow: hidden; isolation: isolate; }
.dark .wrap { position: relative; }
.dark::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 50% at 85% 0%, rgba(var(--red-rgb), 0.1), transparent), var(--bg); }
.stamp {
  position: absolute; right: var(--gutter); top: 4px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: 0.14em;
  color: var(--red); border: 3px solid var(--red); border-radius: 6px; padding: 6px 14px;
  transform: rotate(-7deg); opacity: 0.85; pointer-events: none; user-select: none;
}
@media (max-width: 760px) { .stamp { display: none; } }
.dossier { position: relative; }
.files { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .files { grid-template-columns: minmax(0, 1fr); } }
.file { background: var(--crime-bg); border: 1px solid var(--crime-line); border-radius: var(--radius); padding: 22px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.file header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.file h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.file p { color: var(--muted); font-size: 0.95rem; }
dl.facts { margin: 0; display: grid; border-top: 1px solid var(--crime-line); }
dl.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--crime-line); font-size: 0.9rem; }
dl.facts dt { color: var(--dim); }
dl.facts dd { margin: 0; font-family: var(--font-mono); font-size: 0.84rem; text-align: right; color: var(--text); }
dl.facts dd.bad { color: var(--red); }
dl.facts dd.good { color: var(--green); }

/* ==================== COMANDOS ==================== */
.count { color: var(--dim); font-size: 0.88rem; margin-bottom: 14px; }
.list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.item { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.item .n { font-family: var(--font-mono); font-weight: 500; color: var(--brand-hi); font-size: 0.95rem; overflow-wrap: anywhere; }
.item .a { font-family: var(--font-mono); color: var(--dim); font-size: 0.76rem; overflow-wrap: anywhere; }
.item p { color: var(--muted); font-size: 0.9rem; }
.empty { color: var(--muted); padding: 24px; border: 1px dashed var(--line-2); border-radius: 12px; text-align: center; grid-column: 1 / -1; }

/* ==================== SERVIDORES E DÚVIDAS ==================== */
.ethos-list { margin: 0; display: grid; }
.ethos-list > div { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr); gap: 8px 28px; padding: 24px 0; border-top: 1px solid var(--line); }
.ethos-list > div:last-child { border-bottom: 1px solid var(--line); }
.ethos-list dt { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.ethos-list dd { margin: 0; color: var(--muted); max-width: 62ch; }
.ethos-list code { color: var(--brand-hi); font-size: 0.9em; }
@media (max-width: 620px) { .ethos-list > div { grid-template-columns: minmax(0, 1fr); } }

.faq { display: grid; gap: 10px; margin-top: clamp(40px, 6vw, 72px); max-width: 820px; }
.faq h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; margin-bottom: 8px; }
.q { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.q > summary { padding: 16px 20px; font-weight: 600; }
.q[open] { border-color: var(--line-2); }
.q .ans { padding: 0 20px 18px; color: var(--muted); font-size: 0.97rem; max-width: 68ch; }
.q .ans code { color: var(--brand-hi); font-size: 0.88em; }

/* ==================== COMEÇAR ==================== */
.start { text-align: center; }
.start .head { margin-inline: auto; justify-items: center; }
.start .head::after { margin-inline: auto; }
.start ol { list-style: none; margin: 0 auto 32px; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: left; max-width: 920px; }
@media (max-width: 760px) { .start ol { grid-template-columns: minmax(0, 1fr); } }
.start li { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.start li b { font-family: var(--font-display); font-size: 1.15rem; }
.start li p { color: var(--muted); font-size: 0.94rem; }
.start .says { margin-inline: auto; text-align: left; margin-bottom: 30px; }

/* ==================== RODAPÉ ==================== */
footer { position: relative; overflow: hidden; isolation: isolate; border-top: 1px solid var(--line); background: var(--bg-2); }
footer::before {
  content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: min(680px, 100%);
  background: url("../assets/img/helena-banner.webp") center / cover no-repeat;
  opacity: 0.26;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 55%);
          mask-image: linear-gradient(to right, transparent, #000 55%);
}
footer .cols { display: grid; gap: 32px; grid-template-columns: 1.4fr repeat(2, 1fr); padding-block: 48px 28px; }
@media (max-width: 760px) { footer .cols { grid-template-columns: minmax(0, 1fr); } }
footer h4 { margin: 0 0 12px; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
footer li a { color: var(--muted); font-size: 0.94rem; }
footer li a:hover { color: var(--text); }
footer .about { color: var(--muted); font-size: 0.94rem; max-width: 38ch; margin-top: 12px; }
footer .legal { border-top: 1px solid var(--line); padding-block: 18px; color: var(--dim); font-size: 0.84rem; }
