/* Tokens espelhados de lib/theme.dart (AppColors.dark / .light). Cantos retos: 6 / 10 / 14. */
:root {
  --bg: #0A0A0A; --surface: #141414; --elevated: #1E1E1E; --line: #2A2A2A;
  --text: #F5F5F2; --text2: #B4B4AE; --text3: #8E8E88;
  --accent: #2E9BFF; --accent-ink: #2E9BFF; --accent-soft: #0E2238; --on-accent: #0A0A0A;
  --accent-mid: color-mix(in srgb, var(--line) 55%, var(--accent));
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --wrap: 1120px; --gutter: 16px;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', 'Noto Sans Devanagari', sans-serif;
  --track: .14em; --track-chip: .1em;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F2F2EE; --surface: #FFFFFF; --elevated: #EAEAE4; --line: #DADAD2;
  --text: #0A0A0A; --text2: #4A4A46; --text3: #66665F;
  --accent-ink: #0057C2; --accent-soft: #DCEBFF;
  color-scheme: light;
}
/* Devanágari: espaçar letras quebra as ligaduras (igual ao app). */
:lang(hi) { --track: 0; --track-chip: 0; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: var(--r-sm); z-index: 10; font-weight: 600; }
.skip:focus { top: 8px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.muted { color: var(--text2); }

/* Tipografia */
.display {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  line-height: 1.02; letter-spacing: .01em; margin: 0;
}
:lang(ja) .display, :lang(hi) .display { font-family: var(--body); font-weight: 800; letter-spacing: 0; line-height: 1.2; }
.eyebrow {
  margin: 0 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--track); color: var(--text2);
}
h1.display { font-size: clamp(40px, 7vw, 76px); }
.h-xl { font-size: clamp(40px, 6vw, 64px); }
.h-lg { font-size: clamp(32px, 4.4vw, 48px); }
.lead { font-size: 18px; color: var(--text2); max-width: 34em; margin: 0; }
.stripes {
  width: 72px; height: 8px; margin: 12px 0 24px;
  background: repeating-linear-gradient(-55deg, var(--accent) 0 5px, transparent 5px 9px);
}

/* Topo */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: italic 800 24px/1 var(--display); text-transform: uppercase; }
.logo svg { fill: var(--accent); stroke: none; }
.logo.small { font-size: 18px; }
.logo { white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.lang { position: relative; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text2); }
.lang select { appearance: none; border: 0; background: transparent; font-weight: 600; font-size: 14px; color: var(--text); padding-right: 4px; cursor: pointer; }
.lang select:focus-visible { outline: none; }
.lang:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: border-color .15s; }
.icon-btn:hover { border-color: var(--text3); }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

/* Hero */
.hero { display: grid; gap: 40px; padding-block: 48px 64px; align-items: center; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--r-md); font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: var(--track-chip); font-size: 14px; }
.btn-primary { background: var(--accent); color: var(--on-accent); transition: filter .15s; }
.btn-primary:hover { filter: brightness(1.08); }
.store { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text2); font-size: 14px; font-weight: 500; }
.store svg { fill: currentColor; stroke: none; }

.hero-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.hero-card figcaption { padding: 16px 20px 20px; display: grid; gap: 12px; }
.hero-card strong { font-size: 32px; }
.photos { position: relative; aspect-ratio: 3 / 2; background: var(--elevated); overflow: hidden; }
.photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .25s ease-out; }
.photos img + img { opacity: 0; }
.photos.end img + img { opacity: 1; }
.phase { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 20px 0; font-size: 13px; font-weight: 600; color: var(--text3); }
.phase span { border-top: 4px solid var(--line); padding-top: 8px; transition: border-color .25s, color .25s; }
.phase span:first-child, .phase.end span:last-child { border-color: var(--accent); color: var(--text); }
.phase.end span:first-child { border-color: var(--line); color: var(--text3); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 12px; font-weight: 600; letter-spacing: var(--track-chip); text-transform: uppercase; color: var(--text2); }
.chip-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Catálogo */
.catalog { padding-block: 56px 32px; border-top: 1px solid var(--line); scroll-margin-top: 64px; }
.searchbar { position: relative; display: flex; align-items: center; margin-bottom: 32px; }
.searchbar svg { position: absolute; left: 16px; color: var(--text2); pointer-events: none; }
.searchbar input { width: 100%; height: 56px; padding: 0 16px 0 48px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: 16px; }
.searchbar input::placeholder { color: var(--text3); }
.searchbar input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

.section-label { margin: 0 0 4px; }
.hint { margin: 0 0 16px; color: var(--text2); }
.bodies { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 640px; margin: 0 auto 40px; }
.body { display: grid; gap: 8px; justify-items: center; margin: 0; }
.body svg { width: 100%; height: auto; max-height: 440px; stroke: none; }
.body figcaption { font-size: 12px; font-weight: 600; letter-spacing: var(--track); text-transform: uppercase; color: var(--text2); }
.b-outline { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.b-part { fill: var(--line); stroke: var(--bg); stroke-width: 1.2; transition: fill .15s; }
[data-theme="light"] .b-part { fill: #BDBDB4; stroke: var(--surface); }
[data-theme="light"] .b-outline { fill: var(--elevated); stroke: #BDBDB4; }
.b-part.on { fill: var(--accent); }
.b-part.mid { fill: var(--accent-mid); }
.tap .b-part { cursor: pointer; }
.tap .b-part.hover { fill: var(--accent); }

.muscle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.mcard { display: grid; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: border-color .15s, transform .15s; }
.mcard:hover { border-color: var(--accent); }
.mcard img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--elevated); }
.mcard div { padding: 12px 14px 14px; }
.mcard strong { display: block; font: 800 22px/1.05 var(--display); text-transform: uppercase; }
:lang(ja) .mcard strong, :lang(hi) .mcard strong { font: 700 17px/1.3 var(--body); }
.mcard span { font-size: 13px; color: var(--text2); }

.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-decoration: none; font-weight: 600; font-size: 14px; }
.list-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; }
.list-head h3 { font-size: clamp(36px, 5vw, 52px); }
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 16px 0 8px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: 13px; font-weight: 600; letter-spacing: var(--track); text-transform: uppercase; color: var(--text2); cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; }
.row a { display: grid; grid-template-columns: 96px 1fr 20px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.row img { width: 96px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-sm); background: var(--elevated); }
.row strong { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; }
.row span { font-size: 14px; color: var(--text2); }
.row svg { color: var(--text3); }
.row a:hover strong { color: var(--accent-ink); }
.empty { padding: 48px 0; text-align: center; }
.empty h3 { margin: 0 0 8px; font-size: 20px; }
.empty p { margin: 0 auto; max-width: 30em; color: var(--text2); }
.more { display: flex; justify-content: center; margin-top: 24px; }
.more button { min-height: 48px; padding: 0 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-weight: 600; cursor: pointer; }

/* Detalhe */
dialog#detail { width: min(100%, 720px); max-height: 100dvh; margin: auto; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); color: var(--text); overflow: auto; overscroll-behavior: contain; }
dialog#detail::backdrop { background: rgb(0 0 0 / .7); }
dialog[open] { animation: up .22s cubic-bezier(.22, 1, .36, 1); }
.d-photos { position: relative; }
.d-close { position: absolute; top: 12px; left: 12px; z-index: 2; background: color-mix(in srgb, var(--bg) 80%, transparent); }
.d-body { padding: 0 20px 32px; }
.d-body .phase { padding-inline: 0; }
.d-body h2 { font-size: clamp(34px, 6vw, 48px); margin-top: 24px; }
.d-en { margin: 6px 0 16px; color: var(--text2); font-size: 17px; }
.d-section { margin: 32px 0 12px; }
.legend { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.legend li { display: flex; gap: 12px; align-items: baseline; color: var(--text2); }
.legend b { color: var(--text); }
.sw { flex: none; width: 16px; height: 16px; border-radius: 4px; transform: translateY(3px); background: var(--accent); }
.sw.mid { background: var(--accent-mid); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 16px; align-items: start; font-size: 17px; }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-ink); font: 800 18px/1 var(--display); }
.d-body .bodies { margin-bottom: 16px; }
.d-body .body svg { max-height: 280px; }

/* Recursos */
.features { padding-block: 64px; border-top: 1px solid var(--line); }
.feature-grid { display: grid; gap: 12px; margin-top: 32px; }
.feature { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.feature .num { font: 800 28px/1 var(--display); color: var(--accent-ink); }
.feature h3 { margin: 12px 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--text2); }

.foot { border-top: 1px solid var(--line); padding-block: 32px 48px; }
.foot-nav { margin-bottom: 32px; }
.foot-nav ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 16px; }
.foot-nav a { display: inline-block; padding: 6px 0; font-size: 14px; color: var(--text2); text-decoration: none; }
.foot-nav a:hover { color: var(--accent-ink); }
.foot-row { display: grid; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.foot p { margin: 0; font-size: 14px; }
.foot .foot-nav p.eyebrow { margin-bottom: 12px; text-align: left; font-size: 12px; }

/* Trilha (breadcrumb) */
.crumbs { padding-top: 20px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 14px; color: var(--text2); }
.crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--text3); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

/* Página do músculo */
.mpage { padding-block: 24px 64px; }
.mhead { display: grid; gap: 24px; align-items: center; margin-bottom: 16px; }
.bodies.mini { margin: 0; max-width: 320px; }
.bodies.mini .body svg { max-height: 220px; }
.row[hidden] { display: none; }

/* Página do exercício */
.expage { padding-block: 24px 64px; }
.ex-grid { display: grid; gap: 24px; align-items: start; }
.ex-media { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ex-media .phase { padding-bottom: 16px; }
.ex-title { font-size: clamp(36px, 5.6vw, 60px); }
.ex-info .bodies { margin: 0 0 16px; max-width: 420px; }
.ex-info .body svg { max-height: 280px; }
a.chip { text-decoration: none; }
.related { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--line); }
.related .rows { margin: 24px 0; }
.btn-ghost { border: 1px solid var(--line); background: var(--surface); color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 600; }
.btn-ghost:hover { border-color: var(--accent); }
.hero-name { font-size: 32px; text-decoration: none; }
.hero-name:hover { color: var(--accent-ink); }
h2.eyebrow, h3.eyebrow { font-family: var(--body); }

/* 404 */
.nf { padding-block: 64px; }
.nf-links { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nf-links a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-decoration: none; font-weight: 600; }

/* Entrada: uma sequência só (fade-up 18px, passos de 90ms). */
.rise { animation: up .5s cubic-bezier(.22, 1, .36, 1) both; }
.hero-copy .rise:nth-child(2) { animation-delay: 90ms; }
.hero-copy .rise:nth-child(3) { animation-delay: 180ms; }
.hero-copy .rise:nth-child(4) { animation-delay: 270ms; }
.hero-copy .rise:nth-child(5) { animation-delay: 360ms; }
.hero-card.rise { animation-delay: 200ms; }
@keyframes up { from { opacity: 0; transform: translateY(18px); } }

@media (min-width: 768px) {
  :root { --gutter: 24px; }
  .hero { grid-template-columns: 1.15fr 1fr; padding-block: 72px 96px; }
  .rows { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-row { grid-template-columns: auto 1fr; align-items: center; gap: 32px; }
  .foot p { text-align: right; }
}
@media (min-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
  .catalog-home { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 40px; align-items: start; }
  .catalog-home .bodies { margin: 0; position: sticky; top: 88px; }
  .mhead { grid-template-columns: 1fr 320px; }
  .ex-grid { grid-template-columns: 1.05fr 1fr; gap: 48px; }
  .ex-media { position: sticky; top: 88px; }
}
@media (max-width: 767px) {
  dialog#detail { width: 100%; max-width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .lang select { max-width: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
