.hero { padding: 64px 0 28px; }
.hero-centered { text-align: center; max-width: 760px; margin-inline: auto; }
.hero-centered .eyebrow { margin-bottom: 18px; }
.hero-copy h1, .hero-centered h1 { font-size: clamp(2.55rem, 7vw, 4.9rem); line-height: 1.02; letter-spacing: -.052em; margin: 0 0 18px; font-weight: 730; }
.hero-copy p, .hero-centered p { color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); max-width: 650px; }
.hero-centered p { margin-inline: auto; }
.hero-actions { display: flex; gap: 11px; flex-wrap: wrap; margin-top: 25px; }
.hero-centered .hero-actions { justify-content: center; }
.hero-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; margin-top: 22px; color: var(--muted); font-size: .9rem; }
.hero-trust span::before { content: "✓"; color: var(--primary); font-weight: 800; margin-right: 6px; }
.hero-demo {
  padding: 22px;
  max-width: 480px;
  margin: 34px auto 0;
  box-shadow: var(--shadow);
}
.demo-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.demo-row { display: flex; gap: 9px; align-items: center; justify-content: space-between; padding: 11px 13px; background: var(--surface-2); border: 1px solid transparent; border-radius: 11px; margin-bottom: 8px; }
.demo-row.good { color: var(--text); }
.demo-row.good span:last-child { color: var(--success); font-weight: 800; }
.demo-row.bad { opacity: .48; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; max-width: 620px; margin: 0 auto; }
.stat-card { padding: 18px 14px; height: 100%; text-align: center; box-shadow: none; }
.stat-number { font-size: 1.65rem; font-weight: 760; letter-spacing: -.03em; }
.feature-card { padding: 22px; height: 100%; box-shadow: none; }
.learn-grid { display: grid; gap: 14px; }
.learn-item { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.article-wrap { width: min(100% - 28px, 860px); margin-inline: auto; }
.article-wrap h2 { margin-top: 34px; color: var(--text); }
.article-wrap h3 { margin-top: 28px; }
.article-wrap p, .article-wrap li { color: #59645d; }
.cheat-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.cheat-table td { padding: 12px 14px; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cheat-table td:first-child { width: 30%; border-left: 1px solid var(--border); border-radius: 12px 0 0 12px; color: var(--primary); font-family: var(--font-mono); font-weight: 760; }
.cheat-table td:last-child { border-right: 1px solid var(--border); border-radius: 0 12px 12px 0; color: var(--muted); }
.playground-output mark { background: #cfead9; color: #173524; border-radius: 4px; padding: 0 2px; }
.home-section-head { max-width: 690px; margin-bottom: 26px; }
.home-section-head p { color: var(--muted); margin-bottom: 0; }
.cta-panel { padding: 34px 22px; text-align: center; }
.cta-panel p { max-width: 650px; margin-inline: auto; }

/* Retention-first home: self-typing product demo + hook question */
.home-retention .retention-hero { padding: 52px 0 30px; overflow: hidden; }
.retention-hero-grid { display: grid; gap: 32px; align-items: center; }
.retention-copy { min-width: 0; }
.retention-copy .eyebrow { margin-bottom: 18px; }
.retention-copy h1 { font-size: clamp(2.55rem, 6.4vw, 4.65rem); line-height: 1.02; letter-spacing: -.052em; margin: 0 0 18px; font-weight: 740; }
.retention-copy > p { color: var(--muted); font-size: clamp(1rem, 1.9vw, 1.12rem); max-width: 610px; margin: 0; }
.retention-copy .hero-actions { justify-content: flex-start; }
.retention-copy .hero-trust { justify-content: flex-start; }
.retention-cta { position: relative; overflow: hidden; isolation: isolate; }
.retention-cta::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.16); transform: translateX(-110%) skewX(-18deg); transition: transform .42s ease; z-index: -1; }
.retention-cta:hover::after, .retention-cta:focus-visible::after { transform: translateX(110%) skewX(-18deg); }
.retention-cta-primary { box-shadow: 0 10px 24px rgba(47,125,91,.18); }
.retention-cta-primary:hover, .retention-cta-primary:focus-visible { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(47,125,91,.24); }

.hook-question { margin-top: 24px; max-width: 610px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 17px 18px; border: 1px solid #c9e2d3; border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(240,247,242,.92)); box-shadow: var(--shadow-sm); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.hook-question:hover, .hook-question:focus-visible { transform: translateY(-2px); border-color: #9fc8ad; box-shadow: 0 12px 28px rgba(31,50,38,.10); }
.hook-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 1.45rem; font-weight: 800; }
.hook-copy { display: grid; gap: 2px; min-width: 0; }
.hook-copy strong { font-size: 1rem; line-height: 1.35; }
.hook-copy span { color: var(--muted); font-size: .89rem; line-height: 1.45; }
.hook-arrow { color: var(--primary); font-size: 1.3rem; font-weight: 800; transition: transform .18s ease; }
.hook-question:hover .hook-arrow { transform: translateX(3px); }

.live-demo { padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.live-demo-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.live-label { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 790; font-size: .78rem; letter-spacing: .055em; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 rgba(47,125,91,.24); animation: demoLivePulse 2s ease-out infinite; }
.live-demo-field { border: 1px solid var(--border); background: var(--surface-2); border-radius: 14px; padding: 14px; }
.live-demo-label { display: block; font-size: .84rem; font-weight: 710; margin-bottom: 8px; }
.demo-regex-box { min-height: 51px; display: flex; align-items: center; overflow-x: auto; white-space: nowrap; padding: 12px 13px; background: var(--code-bg); color: var(--code-text); border: 1px solid #334139; border-radius: 10px; font-family: var(--font-mono); font-size: .79rem; scrollbar-width: thin; }
.demo-regex-box #typingRegex { color: #dff3e7; }
.demo-regex-box .regex-slash { color: #8fb6a0; }
.typing-caret { width: 2px; height: 1.15em; background: #eff8f1; margin: 0 2px; flex: 0 0 auto; animation: demoCaretBlink 1s step-end infinite; }
.typing-status-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .76rem; margin-top: 9px; }
.typing-progress { height: 3px; border-radius: 999px; overflow: hidden; background: #dfe8e1; margin-top: 7px; }
.typing-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .1s linear; }
.demo-test-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 17px 0 10px; font-size: .87rem; }
.demo-test-head > span { color: var(--muted); font-size: .76rem; }
.live-results { display: grid; gap: 7px; }
.live-result { opacity: .28; transform: translateY(5px) scale(.985); display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); transition: opacity .3s ease, transform .3s ease, background .3s ease, border-color .3s ease; }
.live-result code { min-width: 0; overflow-wrap: anywhere; word-break: break-word; color: var(--text); font-size: .78rem; }
.live-result .result-state { flex: 0 0 auto; font-size: .76rem; font-weight: 760; }
.live-result.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.live-result.is-match { background: #eef8f1; border-color: #c7e4d1; }
.live-result.is-match .result-state { color: var(--success); }
.live-result.is-reject { background: #fcf1f0; border-color: #efcfcc; }
.live-result.is-reject .result-state { color: var(--danger); }
.live-demo-footer { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); }
.live-demo-footer > div { display: grid; gap: 1px; }
.live-demo-footer strong { font-size: .82rem; }
.live-demo-footer span { color: var(--muted); font-size: .75rem; }
.demo-replay { min-height: 38px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); padding: 7px 12px; font-size: .78rem; font-weight: 720; transition: background .18s ease, transform .18s ease; }
.demo-replay:hover, .demo-replay:focus-visible { background: var(--surface-3); transform: translateY(-1px); }

.retention-steps { padding: 16px 0 8px; }
.step-strip { display: grid; gap: 10px; }
.step-card { min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 17px; padding: 16px; box-shadow: var(--shadow-sm); }
.step-card h3 { font-size: 1rem; margin: 0 0 2px; }
.step-card p { color: var(--muted); font-size: .86rem; line-height: 1.45; margin: 0; }
.step-connector { display: none; color: var(--primary); text-align: center; font-weight: 800; }
.retention-stats { padding-top: 26px; padding-bottom: 34px; }
.retention-final-cta { border-color: #cde2d4; }

@keyframes demoCaretBlink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes demoLivePulse { 0% { box-shadow: 0 0 0 0 rgba(47,125,91,.30); } 70% { box-shadow: 0 0 0 8px rgba(47,125,91,0); } 100% { box-shadow: 0 0 0 0 rgba(47,125,91,0); } }
@keyframes heroReveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes siteSectionReveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.hero-reveal { opacity: 0; animation: heroReveal .55s ease forwards; }
.hero-reveal-1 { animation-delay: .06s; }
.hero-reveal-2 { animation-delay: .12s; }
.hero-reveal-3 { animation-delay: .18s; }
.hero-reveal-4 { animation-delay: .25s; }
.hero-reveal-5 { animation-delay: .32s; }
.hero-reveal-6 { animation-delay: .39s; }

/* Small, consistent motion language on the remaining screens without redesigning them. */
body:not(.home-retention) main > section { animation: siteSectionReveal .38s ease both; }
body:not(.home-retention) .btn-game:hover, body:not(.home-retention) .btn-game:focus-visible { box-shadow: 0 9px 22px rgba(47,125,91,.14); }

@media (prefers-reduced-motion: reduce) {
  .hero-reveal, body:not(.home-retention) main > section { opacity: 1; animation: none !important; transform: none !important; }
  .live-dot, .typing-caret { animation: none !important; }
  .retention-cta::after { display: none; }
  .live-result { transition: none; }
}

/* === Voltar hero ao formato centralizado (mantendo as animações) === */
.home-retention .retention-hero-grid {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
}
.home-retention .retention-copy {
  text-align: center;
}
.home-retention .retention-copy > p {
  margin-inline: auto;
}
.home-retention .retention-copy .hero-actions,
.home-retention .retention-copy .hero-trust {
  justify-content: center;
}
.home-retention .hook-question {
  margin-inline: auto;
  text-align: left;
}
.home-retention .live-demo {
  max-width: 460px;
  margin: 30px auto 0;
  width: 100%;
}


/* === Educational content hub / SEO articles === */
.learn-hub-hero { padding: 64px 0 34px; text-align: center; }
.learn-hub-hero .page-subtitle { margin-inline: auto; max-width: 760px; }
.learn-hub-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap:16px; }
.learn-topic-card { display:flex; flex-direction:column; min-height:100%; padding:22px; border:1px solid var(--border); border-radius:18px; background:var(--surface); box-shadow:var(--shadow-sm); transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.learn-topic-card:hover, .learn-topic-card:focus-within { transform:translateY(-2px); border-color:#b7d4c1; box-shadow:0 12px 28px rgba(31,50,38,.08); }
.learn-topic-card .topic-kicker { font-family:var(--font-mono); color:var(--primary); font-size:.74rem; font-weight:760; letter-spacing:.05em; text-transform:uppercase; }
.learn-topic-card h2, .learn-topic-card h3 { font-size:1.12rem; margin:8px 0 8px; }
.learn-topic-card p { color:var(--muted); font-size:.93rem; line-height:1.6; flex:1; }
.learn-topic-card a { font-weight:760; text-decoration:none; }
.article-breadcrumb { display:flex; flex-wrap:wrap; gap:7px; align-items:center; color:var(--muted); font-size:.86rem; margin-bottom:20px; }
.article-breadcrumb a { color:var(--muted); }
.article-layout { display:grid; gap:28px; }
.article-main { min-width:0; }
.article-main h2 { margin-top:2.25rem; scroll-margin-top:90px; }
.article-main h3 { margin-top:1.45rem; }
.article-main p, .article-main li { line-height:1.78; }
.article-main ul, .article-main ol { padding-left:1.25rem; }
.article-toc { padding:18px; border:1px solid var(--border); border-radius:16px; background:var(--surface-2); }
.article-toc strong { display:block; margin-bottom:9px; }
.article-toc a { display:block; color:var(--muted); padding:4px 0; font-size:.9rem; }
.article-callout { padding:18px 20px; border-left:4px solid var(--primary); background:var(--primary-soft); border-radius:0 14px 14px 0; margin:22px 0; }
.article-example { margin:18px 0; }
.article-example .code-panel { white-space:pre-wrap; overflow-wrap:anywhere; }
.article-meta { display:flex; flex-wrap:wrap; gap:10px; color:var(--muted); font-size:.84rem; margin-top:12px; }
.related-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:12px; }
.related-link { display:block; padding:16px; border:1px solid var(--border); border-radius:14px; background:var(--surface); text-decoration:none; font-weight:720; }
.article-actions { display:flex; flex-wrap:wrap; gap:10px; }
@media (min-width: 992px) { .article-layout { grid-template-columns:minmax(0,1fr) 250px; align-items:start; } .article-aside { position:sticky; top:92px; } }
@media (prefers-reduced-motion: reduce) { .learn-topic-card { transition:none; } }


/* === Conteúdo aprofundado / exercícios / desafios === */
.exercise-grid, .challenge-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(290px,1fr)); gap:16px; }
.exercise-card, .challenge-card { padding:20px; box-shadow:none; }
.exercise-card p, .challenge-card p { color:var(--muted); }
.solution-box { border-top:1px solid var(--border); padding-top:12px; }
.solution-box summary { cursor:pointer; font-weight:760; color:var(--primary); }
.solution-box[open] summary { margin-bottom:8px; }
.challenge-tests { display:grid; gap:5px; padding:12px; border-radius:12px; background:var(--surface-2); }
.challenge-tests strong { font-size:.76rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.challenge-tests code { overflow-wrap:anywhere; }
.cheat-table { width:100%; border-collapse:collapse; }
.cheat-table th, .cheat-table td { padding:13px 16px; border-bottom:1px solid var(--border); text-align:left; vertical-align:top; }
.cheat-table th { background:var(--surface-2); font-size:.78rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.cheat-table tr:last-child td { border-bottom:0; }

/* === Raio-X da Regex === */
.string-content { min-width:0; display:grid; gap:8px; }
.capture-xray { border:1px solid var(--border); background:var(--surface-2); border-radius:14px; padding:14px; }
.capture-xray.compact { padding:10px; margin-top:5px; }
.capture-xray-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:10px; }
.capture-map { display:block; padding:10px 12px; border-radius:10px; background:var(--code-bg); color:var(--code-text); font-family:var(--font-mono); overflow-wrap:anywhere; line-height:1.9; }
.capture-segment { border-radius:4px; padding:2px 0; }
.capture-groups, .assertion-list { display:flex; flex-wrap:wrap; gap:7px; margin-top:9px; }
.capture-chip, .assertion-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 9px; border:1px solid var(--border); border-radius:999px; background:var(--surface); font-size:.76rem; }
.capture-chip code { color:inherit; font-weight:760; }
.assertion-chip { border-color:#c8d7cc; background:#f1f6f2; color:#355b43; }
.capture-color-0 { background:#dff1e6 !important; color:#225b3a !important; }
.capture-color-1 { background:#e3ecf8 !important; color:#294f78 !important; }
.capture-color-2 { background:#f8ead8 !important; color:#7a5120 !important; }
.capture-color-3 { background:#efe4f6 !important; color:#654077 !important; }
.capture-color-4 { background:#f6e2e2 !important; color:#7a3a3a !important; }
.capture-color-5 { background:#e0f1f2 !important; color:#2b6065 !important; }
@media (max-width:575.98px) { .exercise-grid,.challenge-grid{grid-template-columns:1fr;} .cheat-table th,.cheat-table td{padding:10px 11px;} .capture-chip,.assertion-chip{width:100%; border-radius:10px; justify-content:space-between;} }
